[
  {
    "path": ".gitignore",
    "content": "# OntoWiki configs\n/config.ini\n/local.ini\n\n# OntoWiki muck\n*.log\napplication/tests/cache\n/cache\n/uploads\n/libraries\n/logs\n\n# Extensions\n/extensions/*.ini\n/extensions/*\n!/extensions/account\n!/extensions/application\n!/extensions/auth\n!/extensions/autologin\n!/extensions/basicimporter\n!/extensions/bookmarklet\n!/extensions/ckan\n!/extensions/community\n!/extensions/cors\n!/extensions/datagathering\n!/extensions/defaultmodel\n!/extensions/exconf\n!/extensions/filter\n!/extensions/googletracking\n!/extensions/hideproperties\n!/extensions/history\n!/extensions/imagelink\n!/extensions/imprint\n!/extensions/jsonrpc\n!/extensions/linkeddataserver\n!/extensions/listmodules\n!/extensions/literaltypes\n!/extensions/mail\n!/extensions/mailtolink\n!/extensions/manchester\n!/extensions/markdown\n!/extensions/modellist\n!/extensions/navigation\n!/extensions/pingback\n!/extensions/queries\n!/extensions/resourcecreationuri\n!/extensions/resourcemodules\n!/extensions/savedqueries\n!/extensions/selectlanguage\n!/extensions/semanticsitemap\n!/extensions/sendmail\n!/extensions/sindice\n!/extensions/sortproperties\n!/extensions/source\n!/extensions/themes\n!/extensions/translations\n!/extensions/weblink\n\n# aksw specific mud\n/BlogPost\n/extensions/dssn/libraries/lib-dssn-php\n\n# ide and editor dirt\n.settings\n.project\n.idea\n.buildpath\n.DS_Store\nnbproject\n*~\n*.swp\ncache.properties\n\n# test stuff\napplication/tests/config.ini\n\n# build stuff\nbuild/\n!build/phpcs.xml\n!build/phpcmd.xml\n\n# composer stuff\n/vendor\ncomposer.phar\n# for now we ignore the composer.lock, but we should commit it some dome day, especially for releases\n\n# devenv stuff\n/devenv\n"
  },
  {
    "path": ".htaccess",
    "content": "# OntoWiki .htaccess file\n\n# WARNING: If you do not use the htaccess at all or your htaccess is\n# ignored, then your config.ini can be loaded over the web !!!\n<Files \"*.ini\">\n    Deny from all\n</Files>\n\n# OntoWiki does not requires Apache's rewrite engine to work. However,\n# if you would like to have nice (Linked Data) URIs you must enable URL\n# rewriting by enabling mod_rewrite in your apache config.\n<IfModule mod_rewrite.c>\n    RewriteEngine On\n\n    # This gives ontowiki an easy hint that rewrite is enabled\n    <IfModule mod_env.c>\n        SetEnv ONTOWIKI_APACHE_MOD_REWRITE_ENABLED 1\n    </IfModule>\n\n    # for deployment purposes, we want to redirect to a maintenance page iff it exists\n    # works only if document root is ontowiki folder\n    #RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f\n    #RewriteCond %{REQUEST_FILENAME} !/maintenance.html\n    #RewriteRule ^.*$ /maintenance.html [R=503,L]\n    #ErrorDocument 503 /maintenance.html\n\n    # favicon files are located under /application\n    RewriteRule ^favicon\\.(.*)$ application/favicon.$1\n\n    # do not rewrite requests on /robots.txt or /maintenance.html\n    RewriteCond %{REQUEST_URI} !/(robots.txt|maintenance.html)$\n    # do not rewrite requests on resource under public in extensions\n    RewriteCond %{REQUEST_URI} !/extensions/.*/public/.*$\n\n    # do not rewrite requests on /favicon.ico and /favicon.png\n    RewriteCond %{REQUEST_URI} !/favicon\\.(ico|png)$\n\n    # do not rewrite requests on files with the whitelisted extensions under extensions (if file exists)\n    RewriteCond %{REQUEST_FILENAME} !-f [OR]\n    RewriteCond %{REQUEST_URI} !/extensions/.*/.*\\.(js|css|gif|ico|png|jpg|svg)$\n\n    # do not rewrite requests on files with the whitelisted extensions under libraries/RDFauthor (if file exists)\n    RewriteCond %{REQUEST_FILENAME} !-f [OR]\n    RewriteCond %{REQUEST_URI} !/libraries/RDFauthor/.*/.*\\.(js|css|gif|ico|png|jpg|svg)$\n\n    RewriteRule ^.*$ index.php\n\n    # Set RewriteBase if your OntoWiki virtual host is managed with VirtualDocumentRoot.\n    #RewriteBase /\n\n    # Set RewriteBase only if your OntoWiki folder is not located in your web server's root dir.\n    #RewriteBase /ontowiki\n</IfModule>\n\n# if you allow short open tags, xml templates will crash\n# please refer https://github.com/AKSW/OntoWiki/wiki/php.ini-recommendations\n# for recommended PHP settings\n# maybe php_flag is not allowed in your environment,\n# but if you allow short open tags, xml templates will crash\n#php_flag short_open_tag 0\n\n\n### Additional Auth with external OntoWiki auth-script\n### (more infos at http://code.google.com/p/mod-auth-external/)\n#AuthType Basic\n#AuthName OntoWiki\n#AuthBasicProvider external\n#AuthExternal ontowiki\n#Require valid-user\n### NOTE: This is needed to be included in /etc/apache2/mods-enabled/authnz_external.load or .conf\n#DefineExternalAuth ontowiki pipe /path/to/ontowiki/application/scripts/mod-auth-external/ontowiki.php\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: php\n\nphp:\n    - 5.4\n    - 5.6.29\n    - 7.0\n    - 7.1\n\nenv:\n    - VIRTUOSO=6.1.7\n    - VIRTUOSO=7.0.0\n    - VIRTUOSO=7.2.0\n\nmatrix:\n    fast_finish: true\n    include:\n        - php: 5.4\n          env: VIRTUOSO=6.1.6\n        - php: 5.4\n          env: VIRTUOSO=7.2.4.2\n    allow_failures:\n        - php: 7.0\n        - php: 7.1\n        - env: VIRTUOSO=7.2.4.2\n\ncache:\n    directories:\n        - $HOME/.composer/cache\n        - virtuoso-opensource\n\nsudo: true\n\nservices:\n    - mysql\n\nbefore_install:\n    - sudo apt-get -qq update\n    - bash ./application/scripts/travis/install-extensions.sh\n    - bash ./application/scripts/travis/install-services.sh\n    - sudo apt-get install -y raptor2-utils\n    - phpenv config-rm xdebug.ini\n    - mysql -e 'CREATE DATABASE ontowiki_TEST;'\n\ninstall:\n    - travis_retry composer install --no-interaction\n\nbefore_script:\n    - cp ./application/tests/config.ini.dist.travis ./application/tests/config.ini\n    - make directories\n\nscript: \n    - vendor/bin/phpunit --testsuite \"OntoWiki Unit Tests\"\n    - EF_STORE_ADAPTER=zenddb vendor/bin/phpunit --testsuite \"OntoWiki ZendDB Integration Tests\"\n    - EF_STORE_ADAPTER=virtuoso vendor/bin/phpunit --testsuite \"OntoWiki Virtuoso Integration Tests\"\n    - vendor/bin/phpunit --testsuite \"OntoWiki Extensions Tests\"\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Change Log\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](http://keepachangelog.com/)\nand this project adheres to [Semantic Versioning](http://semver.org/) as of version 1.0.0.\n\n## [1.0.0] - 2016-10-04\n\n### Added\n- Add a help text for the filter module\n- Add option to (not) display default type column\n- Add first draft (incomplete) to provide french\n- SPARQL: add option to export result to CSV\n- Add hide type when using add instance\n- Add json-support for registrationAction\n- Add prependTitleProperty again, remove unused methods and keep a single instance of erfurt\n- Add showHiddenElements to naviagtion config\n- Add hugarian to language selection\n- Add initial ResourceJsonrpcAdapter\n- Add getTitle method to ModelJsonrpcAdapter\n- Add RDF/JSON (Alternate, Talis) content type\n- Add support for attributes in toolbar buttons\n- Add support for docker based devenv\n- Add controller test for resource export action\n- Add an onRegisterUser Event\n- Add an onRegisterUserFailed Event\n- Add test makefile for new composer download\n\n### Changed\n- Update RDFauthor\n- Use onResolveDomainAliasInput on URL detection\n- TitleHelper improvements: Chunk/Bulk Querying\n- Changing the workflow of the TitleHelper using the ResourcePool\n- Update getValues functionality using the ResourcePool - Scalability Improvement\n- Changing getAllProperties functionality to work with the MemoryModel and ResourcePool\n- Changing debug workflow with blanknodes on gettitles + cleanup\n- Changing debug workflow on addResource\n- Re-enabling inverse show properties in table view but on a scaleable way\n- Change sameTerm Filter into Equals constraint in NavigationController\n- Make new TitleHelper aware of languages\n- Add getResources() call and unify testShownPropertiesAddTitles\n- Set zend version to latest 1.x. Fix #306.\n- Move responsibility for contentType and fileExtension to Erfurt\n- Improve Exception output\n- Update jQuery to 1.9.1 and add jQuery migrate\n- Using composer for dependencies\n- Update jquery-ui to 1.8.22. Fix #337\n- Refactor usage of exit to using return\n- Clean up default.ini/config.ini.dist, disable caches per default\n- Remove trim() to give more meaningfull output\n- Improve FileCommentSniff to also accept older years and to ignore sub repos\n- Increse minimal PHP version to 5.4.0\n- Change sort option to SORT_NUMERIC\n- Modify help menu building process\n- Deactivate ckan, mail and pingback extension\n- Add data route to default config\n- Update Linked Data plugin to use data route\n- Enhance environment for controller unit tests\n- Replace sameterm with equals in navbox\n- Use IN where possible\n- Optimize offset/limit usage & refactor js code a bit\n- Make codesniffer now ignores the FileCommentSniff and make codesniffer_year includes the Sniff\n- Disable front-end cache in config.ini.dist\n- Change the Documentation link from Github to the new Documentation\n\n### Fixed\n- Fix type handling in rdfauthor popover controller\n- Fix #278 Add Property not working properly\n- Complete license and copyright information in doc blocks\n- Additional fixes while firing onRegisterUser and onRegisterUserFailed event\n- added workaround to handle statements with empty object URIs, which are sometimes provided by RDFauthor editor (seems to be related to line 467 in extensions/themes/silverblue/scripts/support.js)\n- Only Uris should be used as links in a List. BugFix\n- Prevent Bugs with wrong initalized class attributes\n- Fix try to get property of non-object, when deleting model\n- Fix pingback takes for ever\n- Fix #286. Also consider colon in OntoWiki_Utils::compactUri method.\n- Fix #258. Forward Erfurt.\n- Fix community tab\n- Fix selectlanguage config for russian\n- Fix comments if creator not set.\n- Fix getting branch name (wasn't language independent)\n- Fix #145. Fix special chars in Linked Data request URIs.\n- Fix testing for extensions\n- Fix handling of protocols forwarded by proxy. Fix #313.\n- Fix typo in Bootstrap comment\n- Fix 319. Expose navigationAddElement in navigation.js\n- Fix setting select clause instead of prologue part and forward Erfurt\n- Fall back if no feed is specified\n- Fix #347. Remove require_once because we are using autoloader now\n- Fix skipped test\n- Fix integration tests to fit new result format\n- #332: Fix \"Shift + Alt\" key capture issue\n- Fix content-type for resource exports\n- Fix support for JSON content types in Linked Data plugin\n- Fix indentation of mappings array\n\n### Removed\n- Removing subjects from inverse relations memory model\n- Remove OntoWiki_Controller_Service. Fix #242.\n- Remove useless add-method from ResourceJsonrpcAdapter\n- Remove Vagrant development environment\n- Remove test target in makefile\n\n## [0.9.11] - 2014-01-31\n\n- Improve model selection in linkeddataserver extension\n- Extend cache clear script by support for query and translation cache\n- Fix #60: Add script to clear cache via shell\n- fix #201 - removed css classes for modal and set z-index of applicationbar to 999\n- Fix 271. Fix Output Format of queries editor\n- fix #201 - fixed z-index for modal-wrapper-propertyselector\n- Merge pull request #268 from hknochi/feature/fix-extension-enabler\n- Merge pull request #269 from hknochi/feature/fix-pagination\n- fix issue #167 - invalidate extensionCache to distribute requested changes\n- fix issue #261 - added limit-parameter to url\n- improve cron job\n- Add list-events target to Makefile\n- remove log in about screen\n- avoid broken feed URLs on version / names with spaces\n- use configure name instead of hardcoded one\n- fixed issue #201 - added css rules for modal-wrapper\n- fixed issue #201 - added css rules for simplemodal-container and -overlay\n- Fix build to ignore worker shell scripts\n- Reorganize shell scripts to avoid build failure\n- Cleanup mail extension job class by removing obsolete members\n- Added console client and an example extension for testing Erfurts worker\n- Add support for Erfurts background jobs\n- add min-height to <span> in resource view\n- Add hidden save and cancle buttons in listmode\n- Reorganize some code in support.js\n- Fix editProperty to work in extended mode (+)\n- Allow configuration of session cookie parameters, such as session lifetime\n- Fix #259. Write alle defined prefixes to RDFa output.\n- Fix warning, when site redirect takes place. Fix #260.\n- fix wrong server class includes (closes #256)\n- initial version of SelectorModule\n- Fix model creation if no title is specified\n- move inner window modules outside of master form\n- Add “View as Resource” entry to model menu. Fix #152\n- fix wrong encoded query parameter\n- add even/odd classes for row and noodds parameter\n- use new querylink feature of table partial\n- remake table partial, add query link enhancement\n- Fix #152. Move menu creation to Menu_Registry.\n- add xdebug link\n- Remove unused action service/entities\n\n## [0.9.10] - 2013-07-11\n\n- new model creation / add data procedure\n- fixes in query editor\n- performance issues in title helper\n- unify CommentModule and LastcommentsModule, increase limit and set ordering\n- +100 other commits\n- depends on Erfurt 1.6\n- depends on RDFauthor 0.9.6\n\n## [0.9.8] - 2013-02-01\n\n- fix cors header\n- add doap:wiki to the weblink list (2 weeks ago by Sebastian Tramp)\n- add head action to return the request header for given uri\n- fix extensions setting page (toggleswitch) #179\n- Fixing Sort functionality of the Navigation Box extension re-enabling the Sort Menue\n- prevent open paranthesis bug while using the limit buttons (100 / all)\n- Fix #172 - rewrite rules in .htaccess\n- use getReadableGraphsUsingResource method on Store\n- cleanup togglebutton changes\n- fix toggle button for new jquery version (#167)\n- depends on Erfurt 1.5\n- depends on RDFauthor 0.9.5\n\n## [0.9.7] - 2012-11-27\n\n- GUI niceups\n- lots of fixes\n- https://github.com/AKSW/OntoWiki/issues?milestone=1&page=1&state=closed\n- RDFauthor is now a separate package\n- Add support for additonal vhosts\n- increment RDFauthor dependency\n- allow usage of virtuosos bd.ini if present\n- add gnome desktop file\n\n## 0.9.6-21 - 2012-03-03\n\n- fix RDFauthor integration\n- forward RDFauthor to b780680\n- forward OntoWiki to 04b33fd\n\n[1.0.0]: https://github.com/AKSW/OntoWiki/compare/v0.9.11...v1.0.0\n[0.9.11]: https://github.com/AKSW/OntoWiki/compare/v0.9.10...v0.9.11\n[0.9.10]: https://github.com/AKSW/OntoWiki/compare/v0.9.8...v0.9.10\n[0.9.8]: https://github.com/AKSW/OntoWiki/compare/v0.9.7...v0.9.8\n[0.9.7]: https://github.com/AKSW/OntoWiki/compare/v0.9.6-21...v0.9.7\n"
  },
  {
    "path": "Makefile",
    "content": "PHPUNIT = ./vendor/bin/phpunit\nPHPCS = ./vendor/bin/phpcs\nPHPCBF = ./vendor/bin/phpcbf\n\n# Get calid composer executable\nCOMPOSER = $(shell which composer)\nifeq ($(findstring composer, $(COMPOSER)), )\n    COMPOSER = $(shell which composer.phar)\n    ifeq ($(findstring composer.phar, $(COMPOSER)), )\n        ifneq ($(wildcard composer.phar), )\n            COMPOSER = php composer.phar\n        else\n            COMPOSER =\n        endif\n    endif\nendif\n\ndefault:\n\t@echo \"Typical targets your could want to reach:\"\n\t@echo \"\"\n\t@echo \"-->   make deploy ............... Install OntoWiki <-- in doubt, use this\"\n\t@echo \"      make install .............. deploy and install are equivalent\"\n\t@echo \"\"\n\t@echo \"      make help ................. Show more (developer related) make targets\"\n\t@echo \"\"\n\t@echo \"      make help-cs .............. Show help for code sniffing targets\"\n\t@echo \"\"\n\t@echo \"      make help-test ............ Show help for test related targets\"\n\nhelp:\n\t@echo \"Please use: (e.g. make deploy)\"\n\t@echo \"     deploy ..................... Runs everything which is needed for a deployment\"\n\t@echo \"     install .................... Equivalent to deploy\"\n\t@echo \"     help ....................... This help screen\"\n\t@echo \"     help-cs .................... Show help for code sniffing targets\"\n\t@echo \"     help-test .................. Show help for test related targets\"\n\t@echo \"     -------------------------------------------------------------------\"\n\t@echo \"     directories ................ Create cache/log dir and chmod environment\"\n\t@echo \"     clean ...................... Deletes all log and cache files\"\n\t@echo \"     odbctest ................... Executes some tests to check the Virtuoso connection\"\n\nhelp-cs:\n\t@echo \"Please use: (e.g. make codesniffer)\"\n\t@echo \"     codesniffer ............................ Run CodeSniffer except for the FileCommentSniff\"\n\t@echo \"\t\t\tcodesniffer_year ....................... Run CodeSniffer including the FileCommentSniff\"\n\t@echo \"     codebeautifier ......................... Run CodeBeautifier\"\n\nhelp-test:\n\t@echo \"  test ......................... Execute unit, integration and extension tests\"\n\t@echo \"  test-unit .................... Run OntoWiki unit tests\"\n\t@echo \"  test-integration-virtuoso .... Run OntoWiki integration tests with virtuoso\"\n\t@echo \"  test-integration-mysql ....... Run OntoWiki integration tests with mysql\"\n\t@echo \"  test-extensions .............. Run tests for extensions\"\n\ngetcomposer:\n\tcurl -o composer.phar \"https://getcomposer.org/composer.phar\"\n\tphp composer.phar self-update\n\ninstall: deploy\n\nifdef COMPOSER\ndeploy: directories clean composer-install\nelse\ndeploy: getcomposer\n\tmake deploy\nendif\n\nclean:\n\trm -rf cache/* logs/* libraries/*\n\ndirectories: clean\n\tmkdir -p logs cache\n\tchmod 777 logs cache extensions\n\nifdef COMPOSER\ncomposer-install: #add difference for user and dev (with phpunit etc and without)\n\t$(COMPOSER) install\nelse\ncomposer-install:\n\t@echo\n\t@echo\n\t@echo \"!!! make $@ failed !!!\"\n\t@echo\n\t@echo \"Sorry, there doesn't seem to be a PHP composer (dependency manager for PHP) on your system!\"\n\t@echo \"Please have a look at http://getcomposer.org/ for further information,\"\n\t@echo \"or just run 'make getcomposer' to download the composer locally\"\n\t@echo \"and run 'make $@' again\"\nendif\n# test stuff\n\ndevenv:\n\tgit clone \"https://github.com/pfrischmuth/ontowiki-devenv.git\" devenv\n\tcp -i devenv/config.ini.dist ./config.ini\n\tcp -i devenv/config-test.ini.dist ./application/tests/config.ini\n\ntest-directories:\n\trm -rf application/tests/cache application/tests/unit/cache application/tests/integration/cache\n\tmkdir -p application/tests/cache application/tests/unit/cache application/tests/integration/cache\n\ntest-unit: test-directories\n\t$(PHPUNIT) --testsuite \"OntoWiki Unit Tests\"\n\ntest-integration-virtuoso: test-directories\n\tEF_STORE_ADAPTER=virtuoso $(PHPUNIT) --testsuite \"OntoWiki Virtuoso Integration Tests\"\n\ntest-integration-mysql: test-directories\n\tEF_STORE_ADAPTER=zenddb $(PHPUNIT) --testsuite \"OntoWiki Virtuoso Integration Tests\"\n\ntest-extensions: #directories\n\t$(PHPUNIT) --testsuite \"OntoWiki Extensions Tests\"\n\ntest:\n\tmake test-unit\n\t@echo \"\"\n\t@echo \"-----------------------------------\"\n\t@echo \"\"\n\tmake test-integration-virtuoso\n\t@echo \"\"\n\t@echo \"-----------------------------------\"\n\t@echo \"\"\n\tmake test-integration-mysql\n\t@echo \"\"\n\t@echo \"-----------------------------------\"\n\t@echo \"\"\n\tmake test-extensions\n\n\nodbctest:\n\t@application/scripts/odbctest.php\n\n# packaging\n\ndebianize:\n\trm extensions/markdown/parser/License.text\n\trm extensions/markdown/parser/PHP_Markdown_Readme.txt\n\trm extensions/markdown/parser/markdown.php\n\trm extensions/queries/resources/codemirror/LICENSE\n\trm extensions/themes/silverblue/scripts/libraries/jquery-1.9.1.js\n\trm libraries/RDFauthor/libraries/jquery.js\n\trm Makefile\n\t@echo \"now do: cp -R application/scripts/debian debian\"\n\n# #### config ####\n\ncodesniffer:\n\t$(PHPCS) -p\n\ncodebeautifier:\n\t$(PHPCBF)\n\n# other stuff\n\nlist-events:\n\t@grep -R \"new Erfurt_Event\" * 2> /dev/null | sed \"s/.*new Erfurt_Event('//;s/');.*//\" | sort -u\n"
  },
  {
    "path": "README.md",
    "content": "# OntoWiki\n\nNote: This project is not under active development anymore. See [this issue](https://github.com/AKSW/OntoWiki/issues/441) for more details.\n\n[![Travis CI Build Status](https://travis-ci.org/AKSW/OntoWiki.svg)](https://travis-ci.org/AKSW/OntoWiki/) [![Latest Stable Version](https://poser.pugx.org/aksw/ontowiki/v/stable)](https://packagist.org/packages/aksw/ontowiki) [![Total Downloads](https://poser.pugx.org/aksw/ontowiki/downloads)](https://packagist.org/packages/aksw/ontowiki) [![License](https://poser.pugx.org/aksw/ontowiki/license)](https://packagist.org/packages/aksw/ontowiki) [![composer.lock](https://poser.pugx.org/aksw/ontowiki/composerlock)](https://packagist.org/packages/aksw/ontowiki)\n\n\n[![OntoWiki User Documentation](https://cdn.rawgit.com/AKSW/OntoWiki/develop/application/logo/user_doc.svg)](https://docs.ontowiki.net) [![OntoWiki API Documentation](https://cdn.rawgit.com/AKSW/OntoWiki/develop/application/logo/api_doc.svg)](http://api.ontowiki.net/)\n\n\n![](https://raw.github.com/wiki/AKSW/OntoWiki/images/owHeader.png)\n\n## Introduction\n\nis a tool providing support for agile, distributed knowledge engineering scenarios.\nOntoWiki facilitates the visual presentation of a knowledge base as an information map, with different views on instance data.\nIt enables intuitive authoring of semantic content.\nIt fosters social collaboration aspects by keeping track of changes, allowing to comment and discuss every single part of a knowledge base.\n\nOther remarkable features are:\n\n* OntoWiki is a Linked Data Server for you data as well as a Linked Data client to fetch additional data from the web\n* OntoWiki is a Semantic Pingback Client in order to receive and send back-linking request as known from the blogosphere.\n* OntoWiki is backend independent, which means you can save your data on a MySQL database as well as on a Virtuoso Triple Store.\n* OntoWiki is easily extendible by you, since it features a sophisticated Extension System.\n\n## Installation/Update\n\nIf you are updating OntoWiki, please don't forget to run `make install`.\nIf `make install` fails, you might also have to run `make getcomposer` once before run `make deploy` again.\n\nFor further installation instructions please have a look at our [wiki](https://docs.ontowiki.net/) (might be outdated in some parts).\n\n## Screenshot / Webinar\nBelow is a screenshot showing OntoWiki in editing mode.\n\nFor a longer visual presentation you can watch our [webinar@youtube](http://www.youtube.com/watch?v=vP1UDKeZsQk)\n(thanks to Phil and the Semantic Web company).\n\n![Screenshot](http://lh4.ggpht.com/-kXpKMqBBCIU/Tpx45SUaItI/AAAAAAAAA9w/aPYaNQjcpvo/s800/ontowiki.png)\n\n## Documentation\n\nThe Documentation is hosted at https://docs.ontowiki.net/ . If you find errors or think we should add something to it\nyou are free to fork https://github.com/AKSW/docs.ontowiki.net and send us a pull requst with your changes.\n\n## License\n\nOntoWiki is licensed under the [GNU General Public License Version 2, June 1991](http://www.gnu.org/licenses/gpl-2.0.txt) (license document is in the application subfolder).\n"
  },
  {
    "path": "application/Bootstrap.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki bootstrap class.\n *\n * Provides on-demand loading of application resources.\n *\n * @category OntoWiki\n * @package OntoWiki_Bootstrap\n * @author Norman Heino <norman.heino@gmail.com>\n */\nclass Bootstrap extends Zend_Application_Bootstrap_Bootstrap\n{\n    /**\n     * Initializes the the extension manager which in turn scans\n     * for components, modules, plugins and wrapper and registers them.\n     *\n     * @since 0.9.5\n     */\n    public function _initExtensionManager()\n    {\n        // require Front controller\n        $this->bootstrap('frontController');\n        $frontController = $this->getResource('frontController');\n\n        // require Config\n        $this->bootstrap('Config');\n        $config = $this->getResource('Config');\n\n        //NOTICE: i swtiched loading of erfurt and session\n        //because serialized erfurt objects in the session need constants defined in erfurt\n        //is this ok?\n\n        Erfurt_Wrapper_Registry::reset();\n\n        // require Erfurt\n        $this->bootstrap('Erfurt');\n\n        // apply session configuration settings\n        if (isset($config->session)) {\n            $this->applySessionConfig($config->session);\n        }\n\n        // require Session\n        $this->bootstrap('Session');\n\n        // require Dispatcher\n        $this->bootstrap('Dispatcher');\n        $dispatcher = $this->getResource('Dispatcher');\n\n        // require OntoWiki\n        $this->bootstrap('OntoWiki');\n        $ontoWiki = $this->getResource('OntoWiki');\n\n        // require Translate\n        $this->bootstrap('Translate');\n        $translate = $this->getResource('Translate');\n\n        // require View\n        $this->bootstrap('View');\n        $view = $this->getResource('View');\n\n        // make sure router is bootstrapped\n        $this->bootstrap('Router');\n\n        // set view\n        $ontoWiki->view = $view;\n\n        $extensionPath = ONTOWIKI_ROOT\n                        . $config->extensions->base;\n\n        $extensionPathBase = $config->staticUrlBase\n                        . $config->extensions->base;\n\n        $extensionManager = new OntoWiki_Extension_Manager($extensionPath);\n        $extensionManager->setTranslate($translate)\n            ->setComponentUrlBase($extensionPathBase);\n\n        // register component controller directories\n        foreach ($extensionManager->getComponents() as $extensionName => $extensionConfig) {\n            $frontController->addControllerDirectory($extensionConfig->path, '_component_' . $extensionName);\n        }\n\n        // make extension manager available to dispatcher\n        $dispatcher = $frontController->getDispatcher();\n        $dispatcher->setExtensionManager($extensionManager);\n\n        // keep extension manager in OntoWiki\n        $ontoWiki->extensionManager = $extensionManager;\n\n        // actionhelper\n        Zend_Controller_Action_HelperBroker::addPrefix('OntoWiki_Controller_ActionHelper_');\n        Zend_Controller_Action_HelperBroker::addHelper(new OntoWiki_Controller_ActionHelper_List());\n\n        return $extensionManager;\n    }\n\n    /**\n     * Loads the application config file\n     *\n     * @since 0.9.5\n     */\n    public function _initConfig()\n    {\n        // load default application configuration file\n        try {\n            $config = new Zend_Config_Ini(APPLICATION_PATH . 'config/default.ini', 'default', true);\n        } catch (Zend_Config_Exception $e) {\n            throw $e;\n        }\n\n        // load user application configuration files\n        $tryDistConfig = false;\n        try {\n            $privateConfig = new Zend_Config_Ini(ONTOWIKI_ROOT . 'config.ini', 'private', true);\n            $config->merge($privateConfig);\n        } catch (Zend_Config_Exception $e) {\n            $tryDistConfig = true;\n        }\n\n        if ($tryDistConfig === true) {\n            try {\n                $privateConfig = new Zend_Config_Ini(ONTOWIKI_ROOT . 'config.ini.dist', 'private', true);\n                $config->merge($privateConfig);\n            } catch (Zend_Config_Exception $e) {\n                $message = '<p>OntoWiki can not find a proper configuration.</p>' . PHP_EOL\n                         . '<p>Maybe you have to copy and modify the distributed '\n                         . '<code>config.ini.dist</code> file?</p>'. PHP_EOL\n                         . '<details><summary>Error Details</summary>'\n                         . $e->getMessage() . '</details>';\n\n                throw new OntoWiki_Exception($message);\n            }\n        }\n\n        // normalize path names\n        $config->themes->path     = rtrim($config->themes->path, '/\\\\') . '/';\n        $config->themes->default  = rtrim($config->themes->default, '/\\\\') . '/';\n        $config->extensions->base = rtrim($config->extensions->base, '/\\\\') . '/';\n\n        if (false === defined('EXTENSION_PATH')) {\n            define('EXTENSION_PATH', $config->extensions->base);\n        }\n\n        $config->extensions->legacy     = EXTENSION_PATH . rtrim($config->extensions->legacy, '/\\\\') . '/';\n        $config->languages->path        = EXTENSION_PATH . rtrim($config->languages->path, '/\\\\') . '/';\n\n        $config->libraries->path = rtrim($config->libraries->path, '/\\\\') . '/';\n        $config->cache->path     = rtrim($config->cache->path, '/\\\\') . '/';\n        $config->log->path       = rtrim($config->log->path, '/\\\\') . '/';\n\n        // support absolute path\n        $matches = array();\n        if (!(preg_match('/^(\\w:[\\/|\\\\\\\\]|\\/)/', $config->cache->path, $matches) === 1)) {\n            $config->cache->path = ONTOWIKI_ROOT . $config->cache->path;\n        }\n\n        // set path variables\n        $rewriteBase = substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], BOOTSTRAP_FILE));\n\n        // set protocol and read headers sent by proxies\n        $protocol = 'http';\n        if (isset($_SERVER['X-Forwarded-Protocol'])) {\n                $protocol = strtolower($_SERVER['X-Forwarded-Protocol']);\n        } else if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {\n                $protocol = strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']);\n        } else if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') {\n                 $protocol = 'https';\n        }\n\n        if (isset($_SERVER['HTTP_HOST'])) {\n            $httpHost = $_SERVER['HTTP_HOST'];\n        } else {\n            $httpHost = 'localhost';\n        }\n\n        $urlBase = sprintf(\n            '%s://%s%s',\n            $protocol,\n            $httpHost,\n            $rewriteBase\n        );\n\n        // construct URL variables\n        $config->host           = parse_url($urlBase, PHP_URL_HOST);\n        $config->urlBase        = rtrim($urlBase . (ONTOWIKI_REWRITE ? '' : BOOTSTRAP_FILE), '/\\\\') . '/';\n        $config->staticUrlBase  = rtrim($urlBase, '/\\\\') . '/';\n        $config->themeUrlBase   = $config->staticUrlBase\n                                . $config->themes->path\n                                . $config->themes->default;\n        $config->libraryUrlBase = $config->staticUrlBase\n                                . $config->libraries->path;\n\n        //check if log.level has a valid integer as value\n        if (!((int)$config->log->level >= 0 && (int)$config->log->level <= 7)) {\n            $config->log->level = 0;\n        }\n        // define constants for development/debugging\n        if (isset($config->debug) && (boolean)$config->debug) {\n            // display errors\n            error_reporting(E_ALL | E_STRICT);\n            ini_set('display_errors', 'On');\n            // enable debugging options\n            if (false === defined('_OWDEBUG')) {\n                define('_OWDEBUG', 1);\n            }\n\n            // log everything\n            $config->log->enabled = true;\n            $config->log->level = 7;\n        }\n\n        return $config;\n    }\n\n    /**\n     * apply session config\n     *\n     * @param Zend_Config $sessionConfig Session configuration settings\n     */\n    protected function applySessionConfig($sessionConfig)\n    {\n        $cookieParams = array(\n            'lifetime' => isset($sessionConfig->lifetime) ? $sessionConfig->lifetime : 0,\n            'path'     => isset($sessionConfig->path) ? $sessionConfig->path : '/',\n            'domain'   => isset($sessionConfig->domain) ? $sessionConfig->domain : '',\n            'secure'   => isset($sessionConfig->secure) ? (bool)$sessionConfig->secure : false,\n            'httpOnly' => isset($sessionConfig->httpOnly) ? (bool)$sessionConfig->httpOnly : false\n        );\n        call_user_func_array('session_set_cookie_params', $cookieParams);\n    }\n\n    /**\n     * Initializes the modified Zend_Conroller_Dispatcher to allow for\n     * pluggable controllers\n     *\n     * @since 0.9.5\n     */\n    public function _initDispatcher()\n    {\n        // require Front controller\n        $this->bootstrap('frontController');\n        $frontController = $this->getResource('frontController');\n\n        // require Config\n        $this->bootstrap('Config');\n        $config = $this->getResource('Config');\n\n        $dispatcher = new OntoWiki_Dispatcher(array('url_base' => $config->urlBase));\n        $dispatcher->setControllerDirectory(APPLICATION_PATH . 'controllers');\n        $frontController->setDispatcher($dispatcher);\n\n        return $dispatcher;\n    }\n\n    /**\n     * Initializes the Erfurt framework\n     *\n     * @since 0.9.5\n     */\n    public function _initErfurt()\n    {\n        $erfurt = null;\n\n        // require Config\n        $this->bootstrap('Config');\n        $config = $this->getResource('Config');\n\n        // require OntoWiki\n        $this->bootstrap('OntoWiki');\n        $ontoWiki = $this->getResource('OntoWiki');\n\n        // require Logger, since Erfurt logger should write into OW logs dir\n        $this->bootstrap('Logger');\n\n        // Reset the Erfurt app for testability... needs to be refactored.\n        Erfurt_App::reset();\n\n        try {\n            $erfurt = Erfurt_App::getInstance(false)->start($config);\n        } catch (Erfurt_Exception $ee) {\n            throw new OntoWiki_Exception('Error loading Erfurt framework: ' . $ee->getMessage());\n        } catch (Exception $e) {\n            throw new OntoWiki_Exception('Unexpected error: ' . $e->getMessage());\n        }\n\n        // make available\n        $ontoWiki->erfurt = $erfurt;\n\n        return $erfurt;\n    }\n\n    /**\n     * Initializes the event dispatcher\n     *\n     * @since 0.9.5\n     */\n    public function _initEventDispatcher()\n    {\n        // load event dispatcher for Erfurt and OntoWiki events\n        $eventDispatcher = Erfurt_Event_Dispatcher::getInstance();\n\n        return $eventDispatcher;\n    }\n\n    /**\n     * Loads logging capability\n     *\n     * @since 0.9.5\n     */\n    public function _initLogger()\n    {\n        // require config\n        $this->bootstrap('Config');\n        $config = $this->getResource('Config');\n\n        // support absolute path\n        if (!(preg_match('/^(\\w:[\\/|\\\\\\\\]|\\/)/', $config->log->path) === 1)) {\n            // prepend OntoWiki root for relative paths\n            $config->log->path = ONTOWIKI_ROOT . $config->log->path;\n        }\n\n        // initialize logger\n        $writer = null;\n        if (is_writable($config->log->path) && ((boolean)$config->log->enabled == true)) {\n            $levelFilter = new Zend_Log_Filter_Priority((int)$config->log->level, '<=');\n\n            $logName = $config->log->path . 'ontowiki';\n\n            // Check whether log can be created with $logName... otherwise append a number.\n            // This needs to be done, since logs may be created by other processes (e.g. with\n            // testing) and thus can't be opened anymore.\n            $writer = null;\n            for ($i = 0; $i < 10; ++$i) {\n                try {\n                    $fullLogName = $logName;\n                    if ($i > 0) {\n                        $fullLogName .= '_' . $i;\n                    }\n                    $fullLogName .= '.log';\n\n                    $writer = new Zend_Log_Writer_Stream($fullLogName);\n                    if (null !== $writer) {\n                        break;\n                    }\n                } catch (Zend_Log_Exception $e) {\n                    // Nothing to do... just continue\n                }\n            }\n\n            if (null !== $writer) {\n                $logger = new Zend_Log($writer);\n                $logger->addFilter($levelFilter);\n\n                return $logger;\n            }\n        }\n\n        // fallback to NULL logger\n        $writer = new Zend_Log_Writer_Null();\n        $logger = new Zend_Log($writer);\n\n        return $logger;\n    }\n\n    /**\n     * Initializes the navigation\n     *\n     * @since 0.9.5\n     */\n    public function _initNavigation()\n    {\n        // require Session\n        $this->bootstrap('Session');\n        $session = $this->getResource('Session');\n\n        $this->bootstrap('Request');\n        $request = $this->getResource('Request');\n\n        $this->bootstrap('Config');\n        $config = $this->getResource('Config');\n\n        // get current action name\n        $currentAction = $request->getActionName();\n\n        // is current action a default action?\n        if ($currentAction == 'properties' || $currentAction == 'instances') {\n            // save it to session\n            $session->lastRoute = $currentAction;\n        }\n\n        // get last route or default\n        $route = isset($session->lastRoute) ? $session->lastRoute : $config->route->default->name;\n\n        // register with navigation\n        if (isset($config->routes->{$route})) {\n            extract($config->routes->{$route}->defaults->toArray());\n\n            // and add last routed component\n            OntoWiki::getInstance()->getNavigation()->register(\n                'index',\n                array(\n                    'route'      => $route,\n                    'controller' => $controller,\n                    'action'     => $action,\n                    'name'       => ucfirst($route),\n                    'priority'   => 0\n                )\n            );\n        }\n    }\n\n    /**\n     * Initializes the OntoWiki main class\n     *\n     * @since 0.9.5\n     */\n    public function _initOntoWiki()\n    {\n        // require Config\n        $this->bootstrap('Config');\n        $config = $this->getResource('Config');\n\n        OntoWiki::reset();\n        $ontoWiki = OntoWiki::getInstance();\n        $ontoWiki->setBootstrap($this);\n        $ontoWiki->language = isset($config->languages->locale) ? $config->languages->locale : null;\n        $ontoWiki->config   = $config;\n\n        return $ontoWiki;\n    }\n\n    public function _initPlugins()\n    {\n        // require front controller\n        $this->bootstrap('frontController');\n        $frontController = $this->getResource('frontController');\n\n        // Needs to be done first!\n        $frontController->registerPlugin(new OntoWiki_Controller_Plugin_HttpAuth(), 1);\n        $frontController->registerPlugin(new OntoWiki_Controller_Plugin_SetupHelper(), 2);\n        //needs to be done after SetupHelper\n        $frontController->registerPlugin(new OntoWiki_Controller_Plugin_ListSetupHelper(), 3);\n    }\n\n    /**\n     * Initializes the request object\n     *\n     * @since 0.9.5\n     */\n    public function _initRequest()\n    {\n        $this->bootstrap('FrontController');\n        $frontController = $this->getResource('FrontController');\n\n        $this->bootstrap('Router');\n        $router = $this->getResource('Router');\n\n        $request = new OntoWiki_Request();\n        $frontController->setRequest($request);\n\n        $router->route($request);\n\n        return $request;\n    }\n\n    /**\n     * Initializes the router\n     *\n     * @since 0.9.5\n     */\n    public function _initRouter()\n    {\n        // require front controller\n        $this->bootstrap('frontController');\n        $frontController = $this->getResource('frontController');\n\n        // require Config\n        $this->bootstrap('Config');\n        $config = $this->getResource('Config');\n\n        $router = $frontController->getRouter();\n        $router->addConfig($config->routes);\n\n        return $router;\n    }\n\n    /**\n     * Initializes the session and loads session variables\n     *\n     * @since 0.9.5\n     */\n    public function _initSession()\n    {\n        // require Config\n        $this->bootstrap('Config');\n        $config = $this->getResource('Config');\n\n        // require Config\n        $this->bootstrap('OntoWiki');\n        $ontoWiki = $this->getResource('OntoWiki');\n\n        // init session\n        $sessionKey = 'ONTOWIKI' . (isset($config->session->identifier) ? $config->session->identifier : '');\n        $session    = new Zend_Session_Namespace($sessionKey);\n\n        // define the session key as a constant for global reference\n\n        if (false === defined('_OWSESSION')) {\n            define('_OWSESSION', $sessionKey);\n        }\n\n        // inject session vars into OntoWiki\n        if (array_key_exists('sessionVars', $this->_options['bootstrap'])) {\n            $ontoWiki->setSessionVars((array)$this->_options['bootstrap']['sessionVars']);\n        }\n\n        // make available\n        $ontoWiki->session = $session;\n\n        return $session;\n    }\n\n    /**\n     * Initializes the toolbar\n     *\n     * @since 0.9.5\n     */\n    public function _initToolbar()\n    {\n        $this->bootstrap('Config');\n        $config = $this->getResource('Config');\n\n        $this->bootstrap('Translate');\n        $translate = $this->getResource('Translate');\n\n        // configure toolbar\n        $toolbar = OntoWiki_Toolbar::getInstance();\n        $toolbar->setThemeUrlBase($config->themeUrlBase)\n            ->setTranslate($translate);\n\n        return $toolbar;\n    }\n\n    /**\n     * Loads the translation\n     *\n     * @since 0.9.5\n     */\n    public function _initTranslate()\n    {\n        $this->bootstrap('Config');\n        $config = $this->getResource('Config');\n\n        // setup translation cache\n        if ((boolean)$config->cache->translation) {\n            // set translation cache\n            Zend_Translate::setCache($this->getResource('Erfurt')->getCache());\n        }\n\n        // set up translations\n        $options = array(\n            // scan locale from directories\n            'scan'           => Zend_Translate::LOCALE_DIRECTORY,\n            // don't emit notices\n            'disableNotices' => true\n        );\n        $translate = new Zend_Translate('csv', ONTOWIKI_ROOT . $config->languages->path, null, $options);\n        try {\n            $translate->setLocale($config->languages->locale);\n        } catch (Zend_Translate_Exception $e) {\n            $config->languages->locale = 'en';\n            $translate->setLocale('en');\n        }\n\n        return $translate;\n    }\n\n    /**\n     * Authenticates the current user or Anonymous with Erfurt\n     *\n     * @since 0.9.5\n     */\n    public function _initUser()\n    {\n        $user = null;\n\n        // require Erfurt\n        $this->bootstrap('Erfurt');\n        $erfurt = $this->getResource('Erfurt');\n\n        // get logged in user\n        $auth = $erfurt->getAuth();\n        if ($auth->hasIdentity()) {\n            $user = $auth->getIdentity();\n        }\n\n        if (null === $user) {\n            // authenticate anonymous user\n            $erfurt->authenticate('Anonymous', '');\n            $user = $auth->getIdentity();\n        }\n\n        return $user;\n    }\n\n    /**\n     * Sets up the view environment\n     *\n     * @since 0.9.5\n     */\n    public function _initView()\n    {\n        // require Config\n        $this->bootstrap('Config');\n        $config = $this->getResource('Config');\n\n        // require Config\n        $this->bootstrap('Translate');\n        $translate = $this->getResource('Translate');\n\n        // standard template path\n        $defaultTemplatePath = ONTOWIKI_ROOT\n                             . 'application/views/templates';\n\n        // path for theme template\n        $themeTemplatePath   = ONTOWIKI_ROOT\n                             . $config->themes->path\n                             . $config->themes->default\n                             . 'templates';\n\n        $viewOptions = array(\n            'use_module_cache' => (bool)$config->cache->modules,\n            'cache_path'        => $config->cache->path,\n            'lang'              => $config->languages->locale\n\n        );\n\n        // init view\n        $view = new OntoWiki_View($viewOptions, $translate);\n        $view->addScriptPath($defaultTemplatePath)  // default templates\n            ->addScriptPath($themeTemplatePath)    // theme templates override default ones\n            ->addScriptPath($config->extensions->base)    // extension templates\n            ->setEncoding($config->encoding)\n            ->setHelperPath(ONTOWIKI_ROOT . 'application/classes/OntoWiki/View/Helper', 'OntoWiki_View_Helper');\n\n        // set Zend_View to emit notices in debug mode\n        $view->strictVars(defined('_OWDEBUG'));\n\n        // init view renderer action helper\n        $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);\n        Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);\n\n        $themeLayoutTemplate = $themeTemplatePath\n                             . DIRECTORY_SEPARATOR\n                             . 'layouts'\n                             . DIRECTORY_SEPARATOR\n                             . 'layout.phtml';\n\n        $layoutPath = $defaultTemplatePath . DIRECTORY_SEPARATOR . 'layouts';\n        if (is_readable($themeLayoutTemplate)) {\n            $layoutPath = $themeTemplatePath . DIRECTORY_SEPARATOR . 'layouts';\n        }\n\n        // initialize layout\n        Zend_Layout::startMvc(\n            array(\n                // for layouts we use the default path\n                'layoutPath' => $layoutPath\n            )\n        );\n\n        return $view;\n    }\n}\n"
  },
  {
    "path": "application/LICENSE.txt",
    "content": "            GNU GENERAL PUBLIC LICENSE\n               Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicense is intended to guarantee your freedom to share and change free\nsoftware--to make sure the software is free for all its users.  This\nGeneral Public License applies to most of the Free Software\nFoundation's software and to any other program whose authors commit to\nusing it.  (Some other Free Software Foundation software is covered by\nthe GNU Lesser General Public License instead.)  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthis service if you wish), that you receive source code or can get it\nif you want it, that you can change the software or use pieces of it\nin new free programs; and that you know you can do these things.\n\n  To protect your rights, we need to make restrictions that forbid\nanyone to deny you these rights or to ask you to surrender the rights.\nThese restrictions translate to certain responsibilities for you if you\ndistribute copies of the software, or if you modify it.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must give the recipients all the rights that\nyou have.  You must make sure that they, too, receive or can get the\nsource code.  And you must show them these terms so they know their\nrights.\n\n  We protect your rights with two steps: (1) copyright the software, and\n(2) offer you this license which gives you legal permission to copy,\ndistribute and/or modify the software.\n\n  Also, for each author's protection and ours, we want to make certain\nthat everyone understands that there is no warranty for this free\nsoftware.  If the software is modified by someone else and passed on, we\nwant its recipients to know that what they have is not the original, so\nthat any problems introduced by others will not reflect on the original\nauthors' reputations.\n\n  Finally, any free program is threatened constantly by software\npatents.  We wish to avoid the danger that redistributors of a free\nprogram will individually obtain patent licenses, in effect making the\nprogram proprietary.  To prevent this, we have made it clear that any\npatent must be licensed for everyone's free use or not licensed at all.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n            GNU GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License applies to any program or other work which contains\na notice placed by the copyright holder saying it may be distributed\nunder the terms of this General Public License.  The \"Program\", below,\nrefers to any such program or work, and a \"work based on the Program\"\nmeans either the Program or any derivative work under copyright law:\nthat is to say, a work containing the Program or a portion of it,\neither verbatim or with modifications and/or translated into another\nlanguage.  (Hereinafter, translation is included without limitation in\nthe term \"modification\".)  Each licensee is addressed as \"you\".\n\nActivities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning the Program is not restricted, and the output from the Program\nis covered only if its contents constitute a work based on the\nProgram (independent of having been made by running the Program).\nWhether that is true depends on what the Program does.\n\n  1. You may copy and distribute verbatim copies of the Program's\nsource code as you receive it, in any medium, provided that you\nconspicuously and appropriately publish on each copy an appropriate\ncopyright notice and disclaimer of warranty; keep intact all the\nnotices that refer to this License and to the absence of any warranty;\nand give any other recipients of the Program a copy of this License\nalong with the Program.\n\nYou may charge a fee for the physical act of transferring a copy, and\nyou may at your option offer warranty protection in exchange for a fee.\n\n  2. You may modify your copy or copies of the Program or any portion\nof it, thus forming a work based on the Program, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) You must cause the modified files to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    b) You must cause any work that you distribute or publish, that in\n    whole or in part contains or is derived from the Program or any\n    part thereof, to be licensed as a whole at no charge to all third\n    parties under the terms of this License.\n\n    c) If the modified program normally reads commands interactively\n    when run, you must cause it, when started running for such\n    interactive use in the most ordinary way, to print or display an\n    announcement including an appropriate copyright notice and a\n    notice that there is no warranty (or else, saying that you provide\n    a warranty) and that users may redistribute the program under\n    these conditions, and telling the user how to view a copy of this\n    License.  (Exception: if the Program itself is interactive but\n    does not normally print such an announcement, your work based on\n    the Program is not required to print an announcement.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Program,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Program, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote it.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Program.\n\nIn addition, mere aggregation of another work not based on the Program\nwith the Program (or with a work based on the Program) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may copy and distribute the Program (or a work based on it,\nunder Section 2) in object code or executable form under the terms of\nSections 1 and 2 above provided that you also do one of the following:\n\n    a) Accompany it with the complete corresponding machine-readable\n    source code, which must be distributed under the terms of Sections\n    1 and 2 above on a medium customarily used for software interchange; or,\n\n    b) Accompany it with a written offer, valid for at least three\n    years, to give any third party, for a charge no more than your\n    cost of physically performing source distribution, a complete\n    machine-readable copy of the corresponding source code, to be\n    distributed under the terms of Sections 1 and 2 above on a medium\n    customarily used for software interchange; or,\n\n    c) Accompany it with the information you received as to the offer\n    to distribute corresponding source code.  (This alternative is\n    allowed only for noncommercial distribution and only if you\n    received the program in object code or executable form with such\n    an offer, in accord with Subsection b above.)\n\nThe source code for a work means the preferred form of the work for\nmaking modifications to it.  For an executable work, complete source\ncode means all the source code for all modules it contains, plus any\nassociated interface definition files, plus the scripts used to\ncontrol compilation and installation of the executable.  However, as a\nspecial exception, the source code distributed need not include\nanything that is normally distributed (in either source or binary\nform) with the major components (compiler, kernel, and so on) of the\noperating system on which the executable runs, unless that component\nitself accompanies the executable.\n\nIf distribution of executable or object code is made by offering\naccess to copy from a designated place, then offering equivalent\naccess to copy the source code from the same place counts as\ndistribution of the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  4. You may not copy, modify, sublicense, or distribute the Program\nexcept as expressly provided under this License.  Any attempt\notherwise to copy, modify, sublicense or distribute the Program is\nvoid, and will automatically terminate your rights under this License.\nHowever, parties who have received copies, or rights, from you under\nthis License will not have their licenses terminated so long as such\nparties remain in full compliance.\n\n  5. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Program or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Program (or any work based on the\nProgram), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Program or works based on it.\n\n  6. Each time you redistribute the Program (or any work based on the\nProgram), the recipient automatically receives a license from the\noriginal licensor to copy, distribute or modify the Program subject to\nthese terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties to\nthis License.\n\n  7. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Program at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Program by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Program.\n\nIf any portion of this section is held invalid or unenforceable under\nany particular circumstance, the balance of the section is intended to\napply and the section as a whole is intended to apply in other\ncircumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system, which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  8. If the distribution and/or use of the Program is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Program under this License\nmay add an explicit geographical distribution limitation excluding\nthose countries, so that distribution is permitted only in or among\ncountries not thus excluded.  In such case, this License incorporates\nthe limitation as if written in the body of this License.\n\n  9. The Free Software Foundation may publish revised and/or new versions\nof the General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Program\nspecifies a version number of this License which applies to it and \"any\nlater version\", you have the option of following the terms and conditions\neither of that version or of any later version published by the Free\nSoftware Foundation.  If the Program does not specify a version number of\nthis License, you may choose any version ever published by the Free Software\nFoundation.\n\n  10. If you wish to incorporate parts of the Program into other free\nprograms whose distribution conditions are different, write to the author\nto ask for permission.  For software which is copyrighted by the Free\nSoftware Foundation, write to the Free Software Foundation; we sometimes\nmake exceptions for this.  Our decision will be guided by the two goals\nof preserving the free status of all derivatives of our free software and\nof promoting the sharing and reuse of software generally.\n\n                NO WARRANTY\n\n  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\nFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\nOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\nPROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\nOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\nTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\nPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\nREPAIR OR CORRECTION.\n\n  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\nREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\nINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\nOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\nTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\nYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\nPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGES.\n\n             END OF TERMS AND CONDITIONS\n\n        How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License along\n    with this program; if not, write to the Free Software Foundation, Inc.,\n    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\nAlso add information on how to contact you by electronic and paper mail.\n\nIf the program is interactive, make it output a short notice like this\nwhen it starts in an interactive mode:\n\n    Gnomovision version 69, Copyright (C) year name of author\n    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, the commands you use may\nbe called something other than `show w' and `show c'; they could even be\nmouse-clicks or menu items--whatever suits your program.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the program, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n  `Gnomovision' (which makes passes at compilers) written by James Hacker.\n\n  <signature of Ty Coon>, 1 April 1989\n  Ty Coon, President of Vice\n\nThis General Public License does not permit incorporating your program into\nproprietary programs.  If your program is a subroutine library, you may\nconsider it more useful to permit linking proprietary applications with the\nlibrary.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License."
  },
  {
    "path": "application/classes/OntoWiki/Component/Exception.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki component exteption class.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Component\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Component_Exception extends OntoWiki_Exception\n{\n}\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Component/Helper.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Component helper base class.\n *\n * Component helpers are small objects that are instantiated when a component\n * is found by the component manager. Component helpers allow for certain tasks\n * to be executed on every request (even those the component doesn't handle).\n * Example usages are registering a menu entry or a navigation tab.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Component\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Component_Helper\n{\n    /**\n     * The component's file system root directory\n     *\n     * @var string\n     */\n    protected $_componentRoot = null;\n\n    /**\n     * The components URL base\n     *\n     * @var string\n     */\n    protected $_componentUrlBase = null;\n\n    /**\n     * OntoWiki Application config\n     *\n     * @var Zend_Config\n     */\n    protected $_config;\n\n    /**\n     * The component private config\n     *\n     * @var Zend_Config\n     */\n    protected $_privateConfig;\n\n    /**\n     * OntoWiki Application\n     *\n     * @var OntoWiki\n     */\n    protected $_owApp;\n\n    /**\n     * Constructor\n     *\n     * @param OntoWiki_Component_Manager $componentManager\n     */\n    public function __construct($config)\n    {\n        $this->_owApp         = OntoWiki::getInstance();\n        $this->_config        = $this->_owApp->getConfig();\n        $this->_privateConfig = isset($config->private) ? $config->private : new Zend_Config(array(), true);\n    }\n\n    /**\n     * Overwritten in subclasses\n     */\n    public function init()\n    {\n    }\n\n    public function getPrivateConfig()\n    {\n        return $this->_privateConfig;\n    }\n\n    public function getComponentRoot()\n    {\n        $componentName = strtolower(str_replace('Helper', '', get_class($this)));\n\n        // set component root dir\n        $this->_componentRoot = $this->_owApp->extensionManager->getComponentPath() . $componentName . '/';\n\n        return $this->_componentRoot;\n    }\n\n    public function getComponentUrlBase()\n    {\n        $componentName = strtolower(str_replace('Helper', '', get_class($this)));\n\n        // set component root url\n        $this->_componentUrlBase\n            = $this->_config->staticUrlBase . $this->_config->extensions->base . $componentName . '/';\n\n        return $this->_componentUrlBase;\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Controller/ActionHelper/List.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Manage the session variable that stores multiple lists (mostly the current instance list)\n *\n * @category OntoWiki\n * @package  OntoWiki_Classes_Controller_ActionHelper\n */\nclass OntoWiki_Controller_ActionHelper_List extends Zend_Controller_Action_Helper_Abstract\n{\n    protected $_owApp;\n\n    public function __construct()\n    {\n        $this->_owApp = OntoWiki::getInstance();\n        if (!isset($this->_owApp->session->managedLists)) {\n            $this->_owApp->session->managedLists = array();\n        }\n    }\n\n    /**\n     *\n     * @return OntoWiki_Model_Instances\n     */\n    public function getLastList()\n    {\n        $name = $this->_owApp->session->lastList;\n        if (isset($this->_owApp->session->managedLists)) {\n            $lists = $this->_owApp->session->managedLists;\n            if (key_exists($name, $lists)) {\n                return $lists[$name];\n            }\n        }\n\n        return null;\n    }\n\n    /**\n     *\n     * @return string\n     */\n    public function getLastListName()\n    {\n        return $this->_owApp->session->lastList;\n    }\n\n    /**\n     *\n     * @return bool\n     */\n    public function listExists($name)\n    {\n        $lists = $this->_owApp->session->managedLists;\n        if (key_exists($name, $lists)) {\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     *\n     * @return OntoWiki_Model_Instances\n     */\n    public function getList($name)\n    {\n        $lists = $this->_owApp->session->managedLists;\n\n        if (key_exists($name, $lists)) {\n            return $lists[$name];\n        }\n\n        throw new InvalidArgumentException('list was not found. check with listExists() first');\n    }\n\n    /**\n     * Render a list, add it to the cache and add it to the current view\n     *\n     * @param $listName string with a listname\n     * @param $list OntoWiki_Model_Instances a list of resources\n     * @param $view the current view to which the list should be added\n     * @param $mainTemplate the template to use for rendering the list\n     * @param $other array of other values available to the template\n     * @param $returnOutput true|false if false, the list is rendered directly to the view else the\n     *        rendered list is returned\n     * @return the rendered list if $returnOutput is true\n     */\n    public function addListPermanently(\n        $listName,\n        OntoWiki_Model_Instances $list,\n        Zend_View_Interface $view,\n        $mainTemplate = 'list_std_main',\n        $other = null,\n        $returnOutput = false\n    ) {\n        $this->updateList($listName, $list, true);\n        return $this->addList($listName, $list, $view, $mainTemplate, $other, $returnOutput);\n    }\n\n    /**\n     * Render a list and add it to the current view\n     *\n     * @param $listName string with a listname\n     * @param $list OntoWiki_Model_Instances a list of resources\n     * @param $view the current view to which the list should be added\n     * @param $mainTemplate the template to use for rendering the list\n     * @param $other array of other values available to the template\n     * @param $returnOutput true|false if false, the list is rendered directly to the view else the\n     *        rendered list is returned\n     * @return the rendered list if $returnOutput is true\n     */\n    public function addList(\n        $listName,\n        OntoWiki_Model_Instances $list,\n        Zend_View_Interface $view,\n        $mainTemplate = 'list_std_main',\n        $other = null,\n        $returnOutput = false\n    ) {\n        if ($other === null) {\n            $other = new stdClass();\n        }\n\n        $renderedList = $view->partial(\n            'partials/list.phtml',\n            array(\n                 'listName'     => $listName,\n                 'instances'    => $list,\n                 'mainTemplate' => $mainTemplate,\n                 'other'        => $other\n            )\n        );\n\n        $this->_owApp->session->lastList = $listName;\n\n        if ($returnOutput) {\n            return $renderedList;\n        } else {\n            $this->getResponse()->append('default', $renderedList);\n        }\n    }\n\n    public function updateList($name, OntoWiki_Model_Instances $list, $setLast = false)\n    {\n        $lists                               = $this->_owApp->session->managedLists;\n        $lists[$name]                        = $list;\n        $this->_owApp->session->managedLists = $lists;\n        if ($setLast) {\n            $this->_owApp->session->lastList = $name;\n        }\n    }\n\n    public function getAllLists()\n    {\n        return $this->_owApp->session->managedLists;\n    }\n\n    public function removeAllLists()\n    {\n        $this->_owApp->session->managedLists = array();\n    }\n\n    public function removeList($name)\n    {\n        $lists = $this->_owApp->session->managedLists;\n\n        if (key_exists($name, $lists)) {\n            unset($lists[$name]);\n        }\n\n        throw new InvalidArgumentException('list was not found. check with listExists() first');\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Controller/Base.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki controller base class.\n *\n * @category OntoWiki\n * @package  OntoWiki_Classes_Controller\n * @author   Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Controller_Base extends Zend_Controller_Action\n{\n    /**\n     * OntoWiki Application\n     *\n     * @var OntoWiki\n     */\n    protected $_owApp = null;\n\n    /**\n     * OntoWiki Application config\n     *\n     * @var Zend_Config\n     */\n    protected $_config = null;\n\n    /**\n     * The session store\n     *\n     * @var Zend_Session\n     */\n    protected $_session = null;\n\n    /**\n     * Erfurt App\n     *\n     * @var Erfurt_App\n     */\n    protected $_erfurt = null;\n\n    /**\n     * The Erfurt event dispatcher\n     *\n     * @var Erfurt_Event_Dispatcher\n     */\n    protected $_eventDispatcher = null;\n\n    /**\n     * Time before the conroller is launched\n     *\n     * @var float\n     */\n    private $_preController;\n\n    /**\n     * Constructor\n     */\n    public function init()\n    {\n        /**\n         * @trigger onBeforeInitController\n         * Triggered before a controller of class OntoWiki_Controller_Base (or derived)\n         * is initialized.\n         */\n        $event       = new Erfurt_Event('onBeforeInitController');\n        $eventResult = $event->trigger();\n\n        // init controller variables\n        $this->_owApp           = OntoWiki::getInstance();\n        $this->_config          = $this->_owApp->config;\n        $this->_session         = $this->_owApp->session;\n        $this->_erfurt          = $this->_owApp->erfurt;\n        $this->_eventDispatcher = Erfurt_Event_Dispatcher::getInstance();\n\n        // set important script variables\n        $this->view->themeUrlBase   = $this->_config->themeUrlBase;\n        $this->view->urlBase        = $this->_config->urlBase;\n        $this->view->staticUrlBase  = $this->_config->staticUrlBase;\n        $this->view->libraryUrlBase = $this->_config->staticUrlBase . 'libraries/';\n\n        $graph = $this->_owApp->selectedModel;\n        if ($graph instanceof Erfurt_Rdf_Model) {\n            if ($graph->isEditable()) {\n                $this->view->placeholder('update')->set(\n                    array(\n                         'defaultGraph'   => $graph->getModelIri(),\n                         'queryEndpoint'  => $this->_config->urlBase . 'sparql/',\n                         'updateEndpoint' => $this->_config->urlBase . 'update/'\n                    )\n                );\n            }\n        }\n\n        // check config for additional styles\n        if ($stylesExtra = $this->_config->themes->styles) {\n            $this->view->themeExtraStyles = $stylesExtra->toArray();\n        } else {\n            $this->view->themeExtraStyles = array();\n        }\n\n        // disable layout for Ajax requests\n        if ($this->_request->isXmlHttpRequest()) {\n            $this->_helper->layout()->disableLayout();\n        }\n\n        // initialize view helpers\n        $this->view->headTitle($this->_config->title->prefix, 'SET');\n        $this->view->headTitle()->setSeparator($this->_config->title->separator);\n        $this->view->headMeta()->setHttpEquiv('Content-Type', 'text/html; charset=' . $this->_config->encoding);\n        $this->view->headMeta()->setName('generator', 'OntoWiki — Collaborative Knowledge Engineering');\n\n        // RDFauthor view configuration\n        $viewMode = isset($this->_config->rdfauthor->viewmode) ? $this->_config->rdfauthor->viewmode : 'inline';\n\n        // inject JSON variables into view\n        $this->view->jsonVars\n            = '\n            var urlBase = \"' . $this->_config->urlBase . '\";\n            var themeUrlBase = \"' . $this->_config->themeUrlBase . '\";\n            var _OWSESSION = \"' . _OWSESSION . '\";\n            var RDFAUTHOR_BASE = \"' . $this->_config->staticUrlBase . 'libraries/RDFauthor/\";\n            var RDFAUTHOR_VIEW_MODE = \"' . $viewMode . '\";' . PHP_EOL;\n\n        if (defined('_OWDEBUG')) {\n            $this->view->jsonVars .= '            var RDFAUTHOR_DEBUG = 1;';\n        }\n\n        if ($this->_owApp->selectedModel) {\n            $this->view->jsonVars\n                .= '\n            var selectedGraph = {\n                URI: \"' . (string)$this->_owApp->selectedModel . '\",\n                title: ' . json_encode((string)$this->_owApp->selectedModel->getTitle()) . ',\n                editable: ' . ($this->_owApp->selectedModel->isEditable() ? 'true' : 'false') . '\n            };\n            var RDFAUTHOR_DEFAULT_GRAPH = \"' . (string)$this->_owApp->selectedModel . '\";' . PHP_EOL;\n        }\n\n        if ($this->_owApp->selectedResource) {\n            $this->view->jsonVars\n                .= '\n            var selectedResource = {\n                URI: \"' . (string)$this->_owApp->selectedResource . '\",\n                title: ' . json_encode((string)$this->_owApp->selectedResource->getTitle()) . ',\n                graphURI: \"' . (string)$this->_owApp->selectedModel . '\"\n            };\n            var RDFAUTHOR_DEFAULT_SUBJECT = \"' . (string)$this->_owApp->selectedResource . '\";' . PHP_EOL;\n        }\n\n        // set ratio between left bar and main window\n        if (isset($this->_session->sectionRation)) {\n            $this->view->headScript()->appendScript(\n                'var sectionRatio = ' . $this->_session->sectionRation . ';'\n            );\n        }\n\n        if (isset($this->_config->meta)) {\n            if (isset($this->_config->meta->Keywords)) {\n                $this->view->metaKeywords = $this->_config->meta->Keywords;\n            }\n            if (isset($this->_config->meta->Description)) {\n                $this->view->metaDescription = $this->_config->meta->Description;\n            }\n        }\n\n        /**\n         * @trigger onAfterInitController\n         * Triggered after a controller from class OntoWiki_Controller_Base (or derived)\n         * has been initialized.\n         */\n        $event           = new Erfurt_Event('onAfterInitController');\n        $event->response = $this->_response;\n        $eventResult     = $event->trigger();\n    }\n\n    /**\n     * Zend pre-dispatch hook.\n     *\n     * Executed before dispatching takes place.\n     */\n    public function preDispatch()\n    {\n        // log time before dispatch\n        $this->_preController = microtime(true);\n\n        // render main modules\n        if (!$this->view->has('main.sidewindows') && !$this->_request->isXmlHttpRequest()) {\n            $this->view->placeholder('main.sidewindows')->append($this->view->modules('main.sidewindows'));\n        }\n    }\n\n    /**\n     * Zend post-dispatch hook.\n     *\n     * Executed after dispatching has taken place.\n     */\n    public function postDispatch()\n    {\n        // log dispatch time\n        $this->_owApp->logger->info(\n            sprintf(\n                'Dispatching %s/%s: %d ms',\n                $this->_request->getControllerName(),\n                $this->_request->getActionName(),\n                (microtime(true) - $this->_preController) * 1000\n            )\n        );\n\n        // catch redirect\n        if ($this->_request->has('redirect-uri')) {\n            $redirectUri = urldecode($this->_request->getParam('redirect-uri'));\n            $front       = Zend_Controller_Front::getInstance();\n            if ('' !== $front->getBaseUrl()) {\n                $prependBase = (false === strpos($redirectUri, $front->getBaseUrl()));\n            } else {\n                $prependBase = true;\n            }\n            $options     = array('prependBase' => $prependBase);\n\n            $this->_redirect($redirectUri, $options);\n        }\n\n        if (strlen($this->view->placeholder('main.window.title')->toString()) > 0) {\n            $this->view->headTitle($this->view->placeholder('main.window.title')->toString());\n        }\n    }\n\n    /**\n     * Returns a parameter from the current request and expands its URI\n     * using the local namespace table. It also strips slashes if\n     * magic_quotes_gpc is turned on in PHP.\n     *\n     * @param string  $name            the name of the parameter\n     * @param boolean $expandNamespace Whether to expand the namespace or not\n     *\n     * @deprecated 0.9.5, use OntoWiki_Request::getParam() instead\n     *\n     * @return mixed the parameter or null if not found\n     */\n    public function getParam($name, $expandNamespace = false)\n    {\n        $value = $this->_request->getParam($name);\n\n        if ($expandNamespace) {\n            $value = OntoWiki_Utils::expandNamespace($value);\n        }\n\n        if (get_magic_quotes_gpc()) {\n            $value = stripslashes($value);\n        }\n\n        return $value;\n    }\n\n    /**\n     * Adds a module context which the controller provides\n     *\n     * @param string $moduleContext The context name\n     */\n    public function addModuleContext($moduleContext)\n    {\n        if (!$this->_request->isXmlHttpRequest()) {\n            $moduleContent = $this->view->modules($moduleContext);\n            $this->view->placeholder('main.window.innerwindows')->append($moduleContent);\n        }\n    }\n\n    /**\n     * Clones the current view object and returns a new view\n     * object with the same configuration but all variables cleared.\n     *\n     * @return OntoWiki_View\n     */\n    public function cloneView()\n    {\n        $view = clone $this->view;\n        $view->clearVars();\n\n        return $view;\n    }\n\n    /**\n     * tests if there is a selected model and appends an error message\n     * (optional) to the message queue\n     *\n     * @param boolean $appendMessage append a error message or not (default: true)\n     * @since 0.9.9\n     * @return boolean\n     */\n    public function isModelSelected($appendMessage = true)\n    {\n        if ($this->_owApp->selectedModel === null) {\n            if ($appendMessage) {\n                $this->_owApp->appendMessage(\n                    new OntoWiki_Message(\n                        $this->view->_('No model selected.'),\n                        OntoWiki_Message::ERROR\n                    )\n                );\n            }\n            return false;\n        } else {\n            return true;\n        }\n    }\n\n    /**\n     * tests if there is an editable selected model and appends an error message\n     * (optional) to the message queue\n     *\n     * @param boolean $appendMessage append a error message or not (default: true)\n     * @since 0.9.9\n     * @return boolean\n     */\n    public function isSelectedModelEditable($appendMessage = true)\n    {\n        if (!$this->isModelSelected($appendMessage)) {\n            return false;\n        } else {\n            if (!$this->_owApp->selectedModel->isEditable()) {\n                if ($appendMessage) {\n                    $this->_owApp->appendMessage(\n                        new OntoWiki_Message(\n                            $this->view->_('No write permissions on this model.'),\n                            OntoWiki_Message::ERROR\n                        )\n                    );\n                }\n                return false;\n            } else {\n                return true;\n            };\n        }\n    }\n\n}\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Controller/Component.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki controller base class for components.\n *\n * Provide component-specific path variables and Zend settings.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Controller\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Controller_Component extends OntoWiki_Controller_Base\n{\n    /**\n     * The component's file system root directory\n     *\n     * @var string\n     */\n    protected $_componentRoot = null;\n\n    /**\n     * The components URL base\n     *\n     * @var string\n     */\n    protected $_componentUrlBase = null;\n\n    /**\n     * The component helper object\n     *\n     * @var OntoWiki_Component_Helper\n     */\n    protected $_componentHelper = null;\n\n    /**\n     * The component private config\n     *\n     * @var array\n     */\n    protected $_privateConfig = null;\n\n    /**\n     * Constructor\n     */\n    public function init()\n    {\n        parent::init();\n\n        $cm   = $this->_owApp->extensionManager;\n        $name = $this->_request->getControllerName();\n\n        // set component specific template path\n        if ($tp = $cm->getComponentTemplatePath($name)) {\n            $this->view->addScriptPath($tp);\n        }\n\n        // set component specific helper path\n        if ($hp = $cm->getComponentHelperPath($name)) {\n            $this->view->addHelperPath($hp, ucfirst($name) . '_View_Helper_');\n        }\n\n        // set private config\n        if ($pc = $cm->getPrivateConfig($name)) {\n            $this->_privateConfig = $pc;\n        }\n\n        // set component root dir\n        $this->_componentRoot = $cm->getExtensionPath()\n            . $name\n            . '/';\n\n        // set component root url\n        $this->_componentUrlBase = $this->_config->staticUrlBase\n            . $this->_config->extensions->base\n            . $name\n            . '/';\n    }\n\n    /**\n     * Returns the helper object associated with the component.\n     *\n     * @throws OntoWiki_Component_Exception if the component has no helper defined.\n     * @return OntoWiki_Component_Helper\n     */\n    public function getComponentHelper()\n    {\n        if (null === $this->_componentHelper) {\n            $name                   = $this->_request->getControllerName();\n            $extensionManager       = $this->_owApp->extensionManager;\n            $this->_componentHelper = $extensionManager->getComponentHelper($name);\n        }\n\n        return $this->_componentHelper;\n    }\n}\n\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Controller/Exception.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki controller exception base class\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Controller\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Controller_Exception extends OntoWiki_Exception\n{\n}\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Controller/Plugin/HttpAuth.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * HTTP Authentication plug-in\n *\n * Provides authentication via HTTP simple method.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Controller_Plugin\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Controller_Plugin_HttpAuth extends Zend_Controller_Plugin_Abstract\n{\n    /**\n     * Retieves user credentials from the current request and tries to\n     * authenticate the user with Erfurt.\n     *\n     * @param Zend_Controller_Request_Abstract $request The current request object\n     */\n    public function routeShutdown(Zend_Controller_Request_Abstract $request)\n    {\n        if ($credentials = $this->_getAuthHeaderCredentials($request)) {\n            switch ($credentials['type']) {\n                case 'basic':\n                    $erfurt = OntoWiki::getInstance()->erfurt;\n                    $logger = OntoWiki::getInstance()->logger;\n                    // authenticate\n                    $authResult = $erfurt->authenticate($credentials['username'], $credentials['password']);\n                    if ($authResult->isValid()) {\n                        $logger = OntoWiki::getInstance()->logger;\n                        $logger->info(\"User '$credentials[username]' authenticated via HTTP.\");\n                    } else {\n                        // if authentication attempt fails, send appropriate headers\n                        $front    = Zend_Controller_Front::getInstance();\n                        $response = $front->getResponse();\n                        $response->setRawHeader('HTTP/1.1 401 Unauthorized');\n                        echo 'HTTP/1.1 401 Unauthorized';\n\n                        return;\n                    }\n                    break;\n                case 'foaf+ssl':\n                    $adapter = new Erfurt_Auth_Adapter_FoafSsl();\n\n                    $authResult = $adapter->authenticateWithCredentials($credentials['creds']);\n                    Erfurt_App::getInstance()->getAuth()->setIdentity($authResult);\n\n                    if ($authResult->isValid()) {\n                        $logger = OntoWiki::getInstance()->logger;\n                        $logger->info('User authenticated with FOAF+SSL via HTTPS.');\n                    }\n                    break;\n            }\n        }\n    }\n\n    /**\n     * Fetches authentication credentials from the current request\n     *\n     * @param Zend_Controller_Request_Abstract $request The current request object\n     *\n     * @return array\n     */\n    private function _getAuthHeaderCredentials(Zend_Controller_Request_Abstract $request)\n    {\n        $authHeader = $request->getHeader('Authorization');\n        if (is_string($authHeader) && strlen($authHeader) > 0) {\n            if (strtolower(substr($authHeader, 0, 8)) === 'foaf+ssl') {\n                $auth  = base64_decode(substr($authHeader, 9));\n                $creds = explode('=', $auth);\n                foreach ($creds as &$c) {\n                    if (substr($c, 0, 1) === '\"') {\n                        $c = substr($c, 1, -1);\n                    }\n                }\n\n                if (count($creds) > 0) {\n                    return array(\n                        'type'  => 'foaf+ssl',\n                        'creds' => $creds\n                    );\n                }\n            } else {\n                if (strtolower(substr($authHeader, 0, 5)) === 'basic') {\n                    $auth  = base64_decode(substr($authHeader, 6));\n                    $creds = array_filter(explode(':', $auth));\n                    if (count($creds) > 0) {\n                        return array(\n                            'type'     => 'basic',\n                            'username' => $creds[0],\n                            'password' => isset($creds[1]) ? $creds[1] : ''\n                        );\n                    }\n                }\n            }\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Controller/Plugin/ListSetupHelper.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * ListSetupHelper handles list.\n * reacts on parameters prior ComponentHelper instantiation\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Controller_Plugin\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Jonas Brekle <jonas.brekle@gmail.com>\n */\nclass OntoWiki_Controller_Plugin_ListSetupHelper extends Zend_Controller_Plugin_Abstract\n{\n    protected $_isSetup = false;\n\n    /**\n     * RouteStartup is triggered before any routing happens.\n     */\n    public function routeStartup(Zend_Controller_Request_Abstract $request)\n    {\n        /**\n         * @trigger onRouteStartup\n         */\n        $event = new Erfurt_Event('onRouteStartup');\n        $event->trigger();\n    }\n\n    /**\n     * RouteShutdown is the earliest event in the dispatch cycle, where a\n     * fully routed request object is available\n     */\n    public function routeShutdown(Zend_Controller_Request_Abstract $request)\n    {\n        if (isset($request->noListRedirect)) {\n            return;\n        }\n\n        $ontoWiki = OntoWiki::getInstance();\n\n        // TODO: Refactor! The list helper is from an extension! Do not access extensions\n        // from core code!\n        if (!Zend_Controller_Action_HelperBroker::hasHelper('List')) {\n            return;\n        }\n\n        $listHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('List');\n        // only once and only when possible\n        if (!$this->_isSetup\n            && $ontoWiki->selectedModel != null\n            && (isset($request->init)\n            || isset($request->instancesconfig)\n            || isset($request->s)\n            || isset($request->class)\n            || isset($request->p)\n            || isset($request->limit))\n        ) {\n            $frontController = Zend_Controller_Front::getInstance();\n            $store           = $ontoWiki->erfurt->getStore();\n            $resource        = $ontoWiki->selectedResource;\n            $session         = $ontoWiki->session;\n\n            // when switching to another class:\n            // reset session vars (regarding the list)\n            if (isset($request->init)) {\n                //echo 'kill list session';\n                // reset the instances object\n                unset($session->instances);\n\n                //reset config from tag explorer\n                unset($session->cloudproperties);\n            }\n\n            //react on m parameter to set the selected model\n            if (isset($request->m)) {\n\n                try {\n                    $model                   = $store->getModel($request->getParam('m', null, false));\n                    $ontoWiki->selectedModel = $model;\n                } catch (Erfurt_Store_Exception $e) {\n                    $model                   = null;\n                    $ontoWiki->selectedModel = null;\n                }\n            }\n\n            $list = $listHelper->getLastList();\n\n            if ((!isset($request->list)\n                && $list == null)\n                || isset($request->init)\n            ) {\n                // instantiate model, that selects all resources\n                $list = new OntoWiki_Model_Instances($store, $ontoWiki->selectedModel, array());\n            } else {\n                // use the object from the session\n                if (isset($request->list) && $request->list != $listHelper->getLastListName()) {\n                    if ($listHelper->listExists($request->list)) {\n                        $list = $listHelper->getList($request->list);\n                        $ontoWiki->appendMessage(new OntoWiki_Message('reuse list'));\n                    } else {\n                        throw new OntoWiki_Exception(\n                            'your trying to configure a list, but there is no list name specified'\n                        );\n                    }\n                }\n\n                $list->setStore($store); // store is not serialized in session! reset it\n            }\n\n            //local function :)\n            function _json_decode($string)\n            {\n                /* PHP 5.3 DEPRECATED ; REMOVE IN PHP 6.0 */\n                if (get_magic_quotes_gpc()) {\n                    // add slashes for unicode chars in json\n                    $string = str_replace('\\\\u', '\\\\\\\\u', $string);\n                    $string = stripslashes($string);\n                }\n\n                /* ---- */\n\n                return json_decode($string, true);\n            }\n\n            //a shortcut for search param\n            if (isset($request->s)) {\n                if (isset($request->instancesconfig)) {\n                    $config = _json_decode($request->instancesconfig);\n                    if (null === $config) {\n                        throw new OntoWiki_Exception(\n                            'Invalid parameter instancesconfig (json_decode failed): ' . $this->_request->setup\n                        );\n                    }\n                } else {\n                    $config = array();\n                }\n                if (!isset($config['filter'])) {\n                    $config['filter'] = array();\n                }\n                $config['filter'][] = array(\n                    'action'     => 'add',\n                    'mode'       => 'search',\n                    'searchText' => $request->s\n                );\n                $request->setParam('instancesconfig', json_encode($config));\n            }\n            //a shortcut for class param\n            if (isset($request->class)) {\n                if (isset($request->instancesconfig)) {\n                    $config = _json_decode($request->instancesconfig);\n                    if (null === $config) {\n                        throw new OntoWiki_Exception(\n                            'Invalid parameter instancesconfig (json_decode failed): ' . $this->_request->setup\n                        );\n                    }\n                } else {\n                    $config = array();\n                }\n                if (!isset($config['filter'])) {\n                    $config['filter'] = array();\n                }\n                $config['filter'][] = array(\n                    'action'    => 'add',\n                    'mode'      => 'rdfsclass',\n                    'rdfsclass' => $request->class\n                );\n                $request->setParam('instancesconfig', json_encode($config));\n            }\n\n            //check for change-requests\n            if (isset($request->instancesconfig)) {\n                $config = _json_decode($request->instancesconfig);\n                if (null === $config) {\n                    throw new OntoWiki_Exception('Invalid parameter instancesconfig (json_decode failed)');\n                }\n// TODO is this a bug? why access sort->asc when it is null?\n                if (isset($config['sort'])) {\n                    if ($config['sort'] == null) {\n                        $list->orderByUri($config['sort']['asc']);\n                    } else {\n                        $list->setOrderProperty($config['sort']['uri'], $config['sort']['asc']);\n                    }\n                }\n\n                if (isset($config['shownProperties'])) {\n                    foreach ($config['shownProperties'] as $prop) {\n                        if ($prop['action'] == 'add') {\n                            $list->addShownProperty($prop['uri'], $prop['label'], $prop['inverse']);\n                        } else {\n                            $list->removeShownProperty($prop['uri'], $prop['inverse']);\n                        }\n                    }\n                }\n\n                if (isset($config['filter'])) {\n                    foreach ($config['filter'] as $filter) {\n                        // set default value for action and mode if they're not assigned\n                        if (!isset($filter['action'])) {\n                            $filter['action'] = 'add';\n                        }\n                        if (!isset($filter['mode'])) {\n                            $filter['mode'] = 'box';\n                        }\n\n                        if ($filter['action'] == 'add') {\n                            if ($filter['mode'] == 'box') {\n                                $list->addFilter(\n                                    $filter['property'],\n                                    isset($filter['isInverse']) ? $filter['isInverse'] : false,\n                                    isset($filter['propertyLabel']) ? $filter['propertyLabel'] : 'defaultLabel',\n                                    $filter['filter'],\n                                    isset($filter['value1']) ? $filter['value1'] : null,\n                                    isset($filter['value2']) ? $filter['value2'] : null,\n                                    isset($filter['valuetype']) ? $filter['valuetype'] : 'literal',\n                                    isset($filter['literaltype']) ? $filter['literaltype'] : null,\n                                    isset($filter['hidden']) ? $filter['hidden'] : false,\n                                    isset($filter['id']) ? $filter['id'] : null,\n                                    isset($filter['negate']) ? $filter['negate'] : false\n                                );\n                            } else {\n                                if ($filter['mode'] == 'search') {\n                                    $list->addSearchFilter(\n                                        $filter['searchText'],\n                                        isset($filter['id']) ? $filter['id'] : null\n                                    );\n                                } else {\n                                    if ($filter['mode'] == 'rdfsclass') {\n                                        $list->addTypeFilter(\n                                            $filter['rdfsclass'],\n                                            isset($filter['id']) ? $filter['id'] : null\n                                        );\n                                    } else {\n                                        if ($filter['mode'] == 'cnav') {\n                                            $list->addTripleFilter(\n                                                NavigationHelper::getInstancesTriples($filter['uri'], $filter['cnav']),\n                                                isset($filter['id']) ? $filter['id'] : null\n                                            );\n                                        } else {\n                                            if ($filter['mode'] == 'query') {\n                                                try {\n                                                    $query = Erfurt_Sparql_Query2::initFromString($filter['query']);\n// TODO what the hell is this?!\n                                                    if (!($query instanceof Exception)) {\n                                                        $list->addTripleFilter(\n                                                            $query->getWhere()->getElements(),\n                                                            isset($filter['id']) ? $filter['id'] : null\n                                                        );\n                                                    }\n                                                } catch (Erfurt_Sparql_ParserException $e) {\n                                                    $ontoWiki->appendMessage('the query could not be parsed');\n                                                }\n                                            }\n                                        }\n                                    }\n                                }\n                            }\n                        } else {\n                            $list->removeFilter($filter['id']);\n                        }\n                    }\n                }\n\n                if (isset($config['order'])) {\n                    foreach ($config['order'] as $prop) {\n                        if ($prop['action'] == 'set') {\n                            if ($prop['mode'] == 'var') {\n                                $list->setOrderVar($prop['var']);\n                            } else {\n                                $list->setOrderUri($prop['uri']);\n                            }\n                        }\n                    }\n                }\n            }\n\n            if (isset($request->limit)) { // how many results per page\n                $list->setLimit($request->limit);\n            } else {\n                $list->setLimit(10);\n            }\n            if (isset($request->p)) { // p is the page number\n                $list->setOffset(\n                    ($request->p * $list->getLimit()) - $list->getLimit()\n                );\n            } else {\n                $list->setOffset(0);\n            }\n\n            //save to session\n            $name = (isset($request->list) ? $request->list : 'instances');\n            $listHelper->updateList($name, $list, true);\n\n            // avoid setting up twice\n            $this->_isSetup = true;\n            // redirect normal requests if config-params are given to a param-free uri\n            // (so a browser reload by user does nothing unwanted)\n            if (!$request->isXmlHttpRequest()) {\n                //strip of url parameters that modify the list\n                $url = new OntoWiki_Url(\n                    array(),\n                    null,\n                    array('init', 'instancesconfig', 's', 'p', 'limit', 'class', 'list')\n                );\n                //redirect\n                $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n                $redirector->gotoUrl($url);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Controller/Plugin/SetupHelper.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki Setup Helper Zend plug-in.\n *\n * Sets up the component and module managers before any request is handled\n * but after the request object exists.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Controller_Plugin\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Controller_Plugin_SetupHelper extends Zend_Controller_Plugin_Abstract\n{\n    /**\n     * Denotes whether the setup has been performed\n     *\n     * @var boolean\n     */\n    protected $_isSetup = false;\n\n    /**\n     * RouteStartup is triggered before any routing happens.\n     */\n    public function routeStartup(Zend_Controller_Request_Abstract $request)\n    {\n        /**\n         * @trigger onRouteStartup\n         */\n        $event = new Erfurt_Event('onRouteStartup');\n        $event->trigger();\n    }\n\n    /**\n     * RouteShutdown is the earliest event in the dispatch cycle, where a\n     * fully routed request object is available\n     */\n    public function routeShutdown(Zend_Controller_Request_Abstract $request)\n    {\n        // only once\n        if (!$this->_isSetup) {\n            $frontController = Zend_Controller_Front::getInstance();\n            $ontoWiki        = OntoWiki::getInstance();\n\n            // instantiate model if parameter passed\n            if (isset($request->m)) {\n                $store = $ontoWiki->erfurt->getStore();\n                try {\n                    $model                   = $store->getModel($request->getParam('m', null, false));\n                    $ontoWiki->selectedModel = $model;\n                } catch (Erfurt_Store_Exception $e) {\n                    // When no user is given (Anoymous) give the requesting party a chance to authenticate.\n                    if (Erfurt_App::getInstance()->getAuth()->getIdentity()->isAnonymousUser()) {\n                        // In this case we allow the requesting party to authorize...\n                        $response = $frontController->getResponse();\n                        $response->setException(new OntoWiki_Http_Exception(401));\n\n                        return;\n                    }\n\n                    // post error message\n                    $ontoWiki->prependMessage(\n                        new OntoWiki_Message(\n                            '<p>Could not instantiate model: ' . $e->getMessage() . '</p>' .\n                            '<a href=\"' . $ontoWiki->config->urlBase . '\">Return to index page</a>',\n                            OntoWiki_Message::ERROR, array('escape' => false)\n                        )\n                    );\n                    // hard redirect since finishing the dispatch cycle will lead to errors\n                    header('Location:' . $ontoWiki->config->urlBase . 'error/error');\n\n                    return;\n                }\n            }\n\n            // instantiate resource if parameter passed\n            if (isset($request->r)) {\n                $store  = $ontoWiki->erfurt->getStore();\n                $rParam = $request->getParam('r', null, true);\n                $graph  = $ontoWiki->selectedModel;\n                if (null === $graph) {\n                    // try to use first readable graph\n                    $possibleGraphs = $store->getGraphsUsingResource((string)$rParam, true);\n                    if (count($possibleGraphs) > 0) {\n                        try {\n                            $graph                   = $store->getModel($possibleGraphs[0]);\n                            $ontoWiki->selectedModel = $graph;\n                        } catch (Erfurt_Store_Exception $e) {\n                            $graph = null;\n                            // fail as before (see below)\n                        }\n                    }\n                }\n\n                if ($graph instanceof Erfurt_Rdf_Model) {\n                    $resource                   = new OntoWiki_Resource($rParam, $graph);\n                    $ontoWiki->selectedResource = $resource;\n                } else {\n                    // post error message\n                    $ontoWiki->prependMessage(\n                        new OntoWiki_Message(\n                            '<p>Could not instantiate resource. No model selected.</p>' .\n                            '<a href=\"' . $ontoWiki->config->urlBase . '\">Return to index page</a>',\n                            OntoWiki_Message::ERROR, array('escape' => false)\n                        )\n                    );\n                    // hard redirect since finishing the dispatch cycle will lead to errors\n                    header('Location:' . $ontoWiki->config->urlBase . 'error/error');\n\n                    return;\n                }\n            }\n\n            /**\n             * @trigger onRouteShutdown\n             */\n            $event          = new Erfurt_Event('onRouteShutdown');\n            $event->request = $request;\n            $event->trigger();\n\n            // avoid setting up twice\n            $this->_isSetup = true;\n        }\n    }\n}\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Dispatcher.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki dispatcher\n *\n * Overwrites Zend_Controller_Dispatcher_Standard in order to allow for\n * multiple (component) controller directories.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Dispatcher extends Zend_Controller_Dispatcher_Standard\n{\n    /**\n     * The extension manager\n     *\n     * @var OntoWiki_Extension_Manager\n     */\n    protected $_extensionManager = null;\n\n    /**\n     * Base for building URLs\n     *\n     * @var string\n     */\n    protected $_urlBase = '';\n\n    public function __construct($params = array())\n    {\n        if (array_key_exists('url_base', $params)) {\n            $urlBase = (string)$params['url_base'];\n            unset($params['url_base']);\n        }\n\n        parent::__construct($params);\n\n        $this->urlBase = $urlBase;\n    }\n\n    /**\n     * Sets the component manager\n     */\n    public function setExtensionManager(OntoWiki_Extension_Manager $extensionManager)\n    {\n        $this->_extensionManager = $extensionManager;\n    }\n\n    /**\n     * Gets the component manager\n     */\n    public function getExtensionManager()\n    {\n        return $this->_extensionManager;\n    }\n\n    /**\n     * Get controller class name\n     *\n     * Try request first; if not found, try pulling from request parameter;\n     * if still not found, fallback to default\n     *\n     * @param Zend_Controller_Request_Abstract $request\n     *\n     * @return string|false Returns class name on success\n     */\n    public function getControllerClass(Zend_Controller_Request_Abstract $request)\n    {\n        $controllerName = $request->getControllerName();\n\n        if (empty($controllerName)) {\n            if (!$this->getParam('useDefaultControllerAlways')) {\n                return false;\n            }\n            $controllerName = $this->getDefaultControllerName();\n            $request->setControllerName($controllerName);\n        }\n\n        // Zend 1.10+ changes\n        $className = $this->formatControllerName($controllerName);\n\n        $controllerDirs = $this->getControllerDirectory();\n        $module         = $request->getModuleName();\n        if ($this->isValidModule($module)) {\n            $this->_curModule    = $module;\n            $this->_curDirectory = $controllerDirs[$module];\n        } elseif ($this->isValidModule($this->_defaultModule)) {\n            $request->setModuleName($this->_defaultModule);\n            $this->_curModule    = $this->_defaultModule;\n            $this->_curDirectory = $controllerDirs[$this->_defaultModule];\n        } else {\n            require_once 'Zend/Controller/Exception.php';\n            throw new Zend_Controller_Exception('No default module defined for this application');\n        }\n\n        // PATCH\n        // if component manager has controller registered\n        // redirect to specific controller dir index\n        if (null !== $this->_extensionManager) {\n            if ($this->_extensionManager->isComponentRegistered($controllerName)) {\n                $dir = $this->_extensionManager->getComponentPrefix() . $controllerName;\n                $this->_curDirectory = $controllerDirs[$dir];\n            }\n        }\n\n        return $className;\n    }\n\n    /**\n     * Returns TRUE if the Zend_Controller_Request_Abstract object can be\n     * dispatched to a controller.\n     *\n     * Use this method wisely. By default, the dispatcher will fall back to the\n     * default controller (either in the module specified or the global default)\n     * if a given controller does not exist. This method returning false does\n     * not necessarily indicate the dispatcher will not still dispatch the call.\n     *\n     * @param Zend_Controller_Request_Abstract $action\n     *\n     * @return boolean\n     */\n    public function isDispatchable(Zend_Controller_Request_Abstract $request)\n    {\n        // Zend 1.10+ changes\n        $className    = $this->getControllerClass($request);\n        $actionMethod = strtolower($request->getActionName()) . 'Action';\n\n        if (class_exists($className, false)) {\n            if (method_exists($className, $actionMethod)) {\n                return true;\n            }\n        }\n\n        $fileSpec    = $this->classToFilename($className);\n        $dispatchDir = $this->getDispatchDirectory();\n        $test        = $dispatchDir . DIRECTORY_SEPARATOR . $fileSpec;\n\n        if (Zend_Loader::isReadable($test)) {\n            require_once $test;\n\n            if (method_exists($className, $actionMethod)) {\n                return true;\n            }\n        }\n\n        /**\n         * @trigger onIsDispatchable\n         * Triggered if no suitable controller has been found. Plug-ins can\n         * attach to this event in order to modify request URLs or provide\n         * mechanisms that do not allow a controller/action mapping from URL\n         * parts.\n         */\n\n        $pathInfo = ltrim($request->getPathInfo(), '/');\n\n        // URI may not contain a whitespace character!\n        $pathInfo = str_replace(' ', '+', $pathInfo);\n        $pathInfo = urldecode($pathInfo);\n\n        if (class_exists($className, false)) {\n            // give a chance to let class handle (e.g. index controller news action default)\n            return true;\n        }\n\n        $event          = new Erfurt_Event('onIsDispatchable');\n        $event->uri     = $this->urlBase . $pathInfo;\n        $event->request = $request;\n\n        $eventResult = (bool)$event->trigger();\n\n        return $eventResult;\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Exception.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki exception base class\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Exception extends Exception\n{\n}\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Extension/Manager.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2010-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * will be used by OntoWiki to scan the extension folder and load the needed extension\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Extension\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Jonas Brekle <jonas.brekle@gmail.com>\n */\nclass OntoWiki_Extension_Manager\n{\n    const EXTENSION_DEFAULT_DOAP_FILE = 'doap.n3';\n\n    const COMPONENT_HELPER_SUFFIX      = 'Helper';\n    const COMPONENT_HELPER_FILE_SUFFIX = 'Helper.php';\n\n    const COMPONENT_CLASS_POSTFIX = 'Controller';\n    const COMPONENT_FILE_POSTFIX  = 'Controller.php';\n\n    const PLUGIN_CLASS_POSTFIX = 'Plugin';\n    const PLUGIN_FILE_POSTFIX  = 'Plugin.php';\n\n    const WRAPPER_CLASS_POSTFIX = 'Wrapper';\n    const WRAPPER_FILE_POSTFIX  = 'Wrapper.php';\n\n    const EVENT_NS = 'http://ns.ontowiki.net/SysOnt/Events/';\n\n    /**\n     * Array (extension name -> config)\n     *\n     * @var array\n     */\n    protected $_extensionRegistry = array();\n\n    /**\n     * The path scanned for components\n     *\n     * @var string\n     */\n    protected $_extensionPath = null;\n\n    /**\n     * The translation object.\n     *\n     * @var Zend_Translate\n     */\n    protected $_translate = null;\n\n    /**\n     * Base URL for hyperlinks.\n     *\n     * @var string\n     */\n    protected $_componentUrlBase = '';\n\n    /**\n     * Component helpers to be initialized\n     *\n     * @var array\n     */\n    protected $_helpers = array();\n\n    /**\n     * stores extensions configs\n     *\n     * @var array\n     */\n    protected $_componentRegistry = array();\n\n    /**\n     *\n     * @var OntoWiki_Module_Registry\n     */\n    protected $_moduleRegistry = null;\n\n    //plugins and wrappers are handled by erfurt\n\n    /**\n     * Denotes whether component helpers have been called.\n     *\n     * @var boolean\n     */\n    protected $_helpersCalled = false;\n\n    /**\n     * Prefix to distinguish component controller directories\n     * from other controller directories.\n     *\n     * @var string\n     */\n    private $_componentPrefix = '_component_';\n\n    /**\n     * Keys in the component configuration file storing path names that\n     * should be normalized.\n     *\n     * @var array\n     */\n    private $_pathKeys\n        = array(\n            'templates',\n            'languages',\n            'helpers'\n        );\n\n    /**\n     * Name of the private section in the component config file\n     *\n     * @var string\n     */\n    private $_privateSection = 'private';\n\n    /**\n     * a reference to the erfurt event dispatcher\n     *\n     * @var Erfurt_Event_Dispatcher\n     */\n    protected $_eventDispatcher = null;\n\n    /**\n     * folders in the extensions directory that are not extensions\n     *\n     * @var array\n     */\n    public $reservedNames = array('themes', 'translations');\n\n    /**\n     * Constructor\n     */\n    public function __construct($extensionPath)\n    {\n        if (!(substr($extensionPath, -1) == DIRECTORY_SEPARATOR)) {\n            $extensionPath .= DIRECTORY_SEPARATOR;\n        }\n        $this->_extensionPath = $extensionPath;\n\n        OntoWiki_Module_Registry::reset();\n        //OntoWiki_Module_Registry::getInstance()->resetInstance();\n        $this->_moduleRegistry = OntoWiki_Module_Registry::getInstance();\n        $this->_moduleRegistry->setExtensionPath($extensionPath);\n\n        //TODO nessesary?\n        Erfurt_Wrapper_Registry::reset();\n\n        $this->_eventDispatcher = Erfurt_Event_Dispatcher::getInstance();\n\n        // scan for extensions\n        $this->_scanExtensionPath();\n\n        // scan for translations\n        $this->_scanTranslations();\n\n        // register for event\n        $dispatcher = Erfurt_Event_Dispatcher::getInstance();\n        $dispatcher->register('onRouteShutdown', $this);\n    }\n\n    // ------------------------------------------------------------------------\n    // --- Public Methods -----------------------------------------------------\n    // ------------------------------------------------------------------------\n\n    /**\n     * Returns component.\n     *\n     * @return array\n     */\n    public function getExtensionConfig($name)\n    {\n        if (isset($this->_extensionRegistry[$name])) {\n            return $this->_extensionRegistry[$name];\n        }\n    }\n\n    /**\n     * Returns registered extensions.\n     *\n     * @return array\n     */\n    public function getExtensions()\n    {\n        return $this->_extensionRegistry;\n    }\n\n    /**\n     * Returns registered components.\n     *\n     * @return array\n     */\n    public function getComponents()\n    {\n        return $this->_componentRegistry;\n    }\n\n\n    /**\n     * Returns the helper associated with the component specified.\n     *\n     * @throws OntoWiki_Component_Exception if no component with the specified name has been registered or\n     *         OntoWiki_Component_Exception if the specified component has no helper defined.\n     * @return OntoWiki_Component_Helper\n     */\n    public function getComponentHelper($componentName)\n    {\n        if (!$this->isExtensionRegistered($componentName)) {\n            throw new OntoWiki_Component_Exception('Component with key \"' . $componentName . '\" not registered');\n        }\n\n        if (!isset($this->_helpers[$componentName]['instance'])) {\n            throw new OntoWiki_Component_Exception('no helper loaded for component \"' . $componentName . '\"');\n        }\n\n        return $this->_helpers[$componentName]['instance'];\n    }\n\n    /**\n     * Returns the path the component manager used to search for components\n     * because there is one component per extension, this path is equal to the extension path.\n     *\n     * @return string\n     */\n    public function getComponentPath()\n    {\n        return $this->getExtensionPath();\n    }\n\n\n    /**\n     * Returns the path the extension manager used to search for extensions.\n     *\n     * @return string\n     */\n    public function getExtensionPath($name = null)\n    {\n        if ($name == null) {\n            return $this->_extensionPath;\n        } else {\n            return $this->_extensionPath . $name;\n        }\n    }\n\n    /**\n     * Returns the specified component's URL.\n     *\n     * @throws OntoWiki_Component_Exception if no component with the specified name has been registered\n     * @return string\n     */\n    public function getComponentUrl($componentName)\n    {\n        if (!$this->isExtensionRegistered($componentName)) {\n            throw new OntoWiki_Component_Exception(\"Component with key '$componentName' not registered\");\n        }\n\n        return $this->_componentUrlBase . $componentName . '/';\n    }\n\n    /**\n     * Checks whether a specific extension is registered.\n     *\n     *\n     * @param  string $componentName\n     *\n     * @return boolean\n     */\n    public function isExtensionRegistered($exName)\n    {\n        return isset($this->_extensionRegistry[$exName]);\n    }\n\n    /**\n     * Checks whether a specific component is registered.\n     *\n     * @deprecated\n     *\n     * @param  string $componentName\n     *\n     * @return boolean\n     */\n    public function isComponentRegistered($componentName)\n    {\n        return array_key_exists($componentName, $this->_componentRegistry);\n    }\n\n    /**\n     * Checks whether a specific component is activated\n     * in its configuration file.\n     *\n     * @param  string $componentName\n     *\n     * @return boolean\n     */\n    public function isExtensionActive($componentName)\n    {\n        return array_key_exists($componentName, $this->_extensionRegistry)\n            && $this->_extensionRegistry[$componentName]->enabled;\n    }\n\n    /**\n     * Returns a prefix that can be used to distinguish components from\n     * other extensions, i.e. modules or plugins.\n     *\n     * @deprecated\n     *\n     * @return string\n     */\n    public function getComponentPrefix()\n    {\n        return $this->_componentPrefix;\n    }\n\n    /**\n     * Returns the helper path for a given component.\n     *\n     * @param  string $componentName\n     *\n     * @return string\n     */\n    public function getComponentHelperPath($componentName)\n    {\n        if (!$this->isExtensionRegistered($componentName)) {\n            throw new OntoWiki_Component_Exception(\"Component with key '$componentName' not registered\");\n        }\n\n        if (isset($this->_extensionRegistry[$componentName]->helpers)) {\n            $path = $this->_extensionPath\n                . $componentName\n                . DIRECTORY_SEPARATOR\n                . $this->_extensionRegistry[$componentName]->helpers;\n\n            return $path;\n        }\n    }\n\n    /**\n     * Returns the template path for a given component.\n     *\n     * @param  string $componentName\n     *\n     * @return string\n     */\n    public function getComponentTemplatePath($componentName)\n    {\n        if (!$this->isExtensionRegistered($componentName)) {\n            throw new OntoWiki_Component_Exception(\"Component with key '$componentName' not registered\");\n        }\n\n        if (isset($this->_extensionRegistry[$componentName]->templates)) {\n            $path = $this->_extensionPath\n                . $componentName\n                . DIRECTORY_SEPARATOR\n                . $this->_extensionRegistry[$componentName]->templates;\n\n            return $path;\n        }\n\n        return $this->_extensionPath\n            . $componentName\n            . DIRECTORY_SEPARATOR;\n    }\n\n    /**\n     * Returns the component's private configuration section\n     *\n     * @param  string $extensionName\n     *\n     * @return array|null\n     */\n    public function getPrivateConfig($extensionName)\n    {\n        if (!$this->isExtensionRegistered($extensionName)) {\n            throw new OntoWiki_Component_Exception(\"Component with key '$extensionName' not registered\");\n        }\n\n        return $this->_extensionRegistry[$extensionName]->{$this->_privateSection};\n    }\n\n    /**\n     * Sets the base URL for hyperlinks.\n     *\n     * @param string $urlBase\n     */\n    public function setComponentUrlBase($componentUrlBase)\n    {\n        $componentUrlBase = (string)$componentUrlBase;\n\n        $this->_componentUrlBase = trim($componentUrlBase, '/\\\\') . '/';\n\n        return $this;\n    }\n\n    /**\n     * Sets the translation object to be used for string translation.\n     *\n     * @param Zend_Translate $translate\n     */\n    public function setTranslate(Zend_Translate $translate)\n    {\n        $this->_translate = $translate;\n\n        // (re)scan for translations\n        $this->_scanTranslations();\n\n        return $this;\n    }\n\n    /**\n     * Event Handler, called by event dispatcher after controller and action is determined\n     * initializes the component helpers, so they can react\n     *\n     * @param Erfurt_Event $event\n     */\n    public function onRouteShutdown(Erfurt_Event $event)\n    {\n        // init component helpers\n        if (!$this->_helpersCalled) {\n            foreach ($this->_helpers as $componentName => &$helper) {\n                // only if helper has not been previously loaded\n                if (!isset($helper['instance'])) {\n                    $helperInstance = $this->_loadHelper($componentName, $this->getExtensionConfig($componentName));\n                } else {\n                    $helperInstance = $this->_helpers[$componentName]['instance'];\n                }\n\n                $helperInstance->init();\n            }\n\n            $this->_helpersCalled = true;\n        }\n    }\n\n    /**\n     * load helpers for a component\n     *\n     * @param $componentName\n     * @param $config\n     *\n     * @return mixed\n     * @throws OntoWiki_Component_Exception\n     */\n    protected function _loadHelper($componentName, $config)\n    {\n        if (!isset($this->_helpers[$componentName])) {\n            throw new OntoWiki_Component_Exception(\"No helper defined for component '$componentName'.\");\n        }\n\n        $helperSpec = $this->_helpers[$componentName];\n\n        // load helper class\n        require_once $helperSpec['path'];\n        if (class_exists($helperSpec['class'])) {\n            // instantiate helper object\n            $helperInstance = new $helperSpec['class']($config);\n        } else {\n            throw new OntoWiki_Component_Exception(\n                \"required helper class '\" . $helperSpec['class'] .\n                \"' could not be found for component '$componentName'.\"\n            );\n        }\n\n        // register helper events\n        if (isset($helperSpec['events'])) {\n            $dispatcher = Erfurt_Event_Dispatcher::getInstance();\n            foreach ($helperSpec['events'] as $currentEvent) {\n                if (substr($currentEvent, 0, strlen(self::EVENT_NS)) == self::EVENT_NS) {\n                    //currently we only accept events from the ontowiki event namespace\n                    $currentEvent = substr($currentEvent, strlen(self::EVENT_NS));\n                }\n                $dispatcher->register($currentEvent, $helperInstance);\n            }\n        }\n\n        $this->_helpers[$componentName]['instance'] = $helperInstance;\n\n        return $helperInstance;\n    }\n\n    /**\n     * scan the extension folder for configs modified after $time\n     * the default doap file could have been touched OR the local ini\n     * return an array(string->int) where the key is the extension name and the value is\n     * 0 - local ini modified after $time\n     * 1 - default doap file modified after $time\n     * 2 - both modified after $time\n     *\n     * @param $time int unix timestamp\n     *\n     * @return array\n     */\n    private function _getModifiedConfigsSince($time)\n    {\n        $dir = new DirectoryIterator($this->_extensionPath);\n        $mod = array();\n        foreach ($dir as $file) {\n            if (!$file->isDot() && $file->isDir() && !in_array($file->getFileName(), $this->reservedNames)) {\n                //for all folders in <ow>/extensions/\n                $extensionName       = $file->getFileName();\n                $modifiedLocalConfig = @filemtime($this->_extensionPath . $extensionName . '.ini');\n                if ($modifiedLocalConfig && $modifiedLocalConfig > $time) { //check for modification on the local config\n                    $mod[$extensionName] = 0;\n                }\n                $modifiedDefaultConfig = @filemtime(\n                    $file->getRealPath() . DIRECTORY_SEPARATOR . self::EXTENSION_DEFAULT_DOAP_FILE\n                );\n                if ($modifiedDefaultConfig && $modifiedDefaultConfig > $time) { //and the default config\n                    if (isset($mod[$extensionName])) {\n                        $mod[$extensionName] = 2;\n                    } else {\n                        $mod[$extensionName] = 1;\n                    }\n                }\n            }\n        }\n        return $mod;\n    }\n\n    /**\n     * get the location of the cache\n     *\n     * @return string\n     * @deprecated  use Ontowiki::getCache to access cache\n     * @todo        to be deleted in next version\n     */\n    public function getCachePath()\n    {\n        throw new BadMethodCallException(\n            'Method OntoWiki_Extension_Manager::getCachePath is deprecated. Please use Ontowiki cache'\n        );\n    }\n\n    /**\n     * invalidate the cache\n     */\n    public function clearCache()\n    {\n        $cache = OntoWiki::getInstance()->getCache();\n        $cache->clean(Zend_Cache::CLEANING_MODE_ALL);\n    }\n\n    /**\n     * Scans the component path for conforming components and\n     * announces their paths to appropriate components.\n     */\n    private function _scanExtensionPath()\n    {\n        $cache  = OntoWiki::getInstance()->getCache();\n        if (!($config = $cache->load('ow_extensionConfig'))) {\n            $config = array();\n            $dir    = new DirectoryIterator($this->_extensionPath);\n            foreach ($dir as $file) {\n                if (!$file->isDot() && $file->isDir()) {\n                    if (!in_array($file->getFileName(), $this->reservedNames)) {\n                        $extensionName          = $file->getFileName();\n                        $currentExtensionPath   = $file->getPathname() . DIRECTORY_SEPARATOR;\n                        // parse all extensions on the filesystem\n                        if (is_readable($currentExtensionPath . self::EXTENSION_DEFAULT_DOAP_FILE)) {\n                            $config[$extensionName] = $this->_loadConfigs($extensionName);\n                        }\n                    }\n                }\n            }\n            $cache->save(array_reverse($config));\n        }\n\n        $view = OntoWiki::getInstance()->view;\n        //register the discovered extensions within ontowiki\n        foreach ($config as $extensionName => $extensionConfig) {\n            $currentExtensionPath = $this->_extensionPath . $extensionName . DIRECTORY_SEPARATOR;\n\n            if (!$extensionConfig->enabled) {\n                continue;\n            }\n\n            //templates can be in the main extension folder\n            $view->addScriptPath($currentExtensionPath);\n            if (isset($extensionConfig->templates)) {\n                //or in a folder specified in  config\n                $view->addScriptPath($currentExtensionPath . $extensionConfig->templates);\n            }\n\n            //check for other helpers\n            if (isset($extensionConfig->helpers)) {\n                $view->addHelperPath(\n                    $currentExtensionPath . $extensionConfig->helpers,\n                    ucfirst($extensionName) . '_View_Helper_'\n                );\n            }\n\n            //check for component class (only one per extension for now)\n            if (file_exists($currentExtensionPath . ucfirst($extensionName) . self::COMPONENT_FILE_POSTFIX)) {\n                $this->_addComponent($extensionName, $currentExtensionPath, $extensionConfig);\n            }\n\n            //check for modules and plugins (multiple possible)\n            //TODO declare them in the config?\n            if (is_dir($currentExtensionPath)) {\n                $extensionDir = new DirectoryIterator($currentExtensionPath);\n                foreach ($extensionDir as $extensionDirFile) {\n                    $filename = $extensionDirFile->getFilename();\n\n                    $subStr = substr($filename, -strlen(OntoWiki_Module_Registry::MODULE_FILE_POSTFIX));\n                    if ($subStr === OntoWiki_Module_Registry::MODULE_FILE_POSTFIX) {\n                        $this->_addModule($extensionName, $filename, $currentExtensionPath, $extensionConfig);\n                    } else {\n                        $subStrB = substr($filename, -strlen(self::PLUGIN_FILE_POSTFIX));\n                        if ($subStrB === self::PLUGIN_FILE_POSTFIX) {\n                            $this->_addPlugin($filename, $currentExtensionPath, $extensionConfig);\n                        } else {\n                            $subStrC = substr($filename, -strlen(self::WRAPPER_FILE_POSTFIX));\n                            if ($subStrC === self::WRAPPER_FILE_POSTFIX) {\n                                $this->_addWrapper($filename, $currentExtensionPath, $extensionConfig);\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n        //save to instance\n        $this->_extensionRegistry = $config;\n    }\n\n    /**\n     * adds a component to the internal registry.\n     *\n     * @param string $componentName the component's (folder) name\n     * @param string $componentPath the path to the component folder\n     * @param array  $config        the config of the components extension\n     */\n    private function _addComponent($componentName, $componentPath, $config)\n    {\n        // load helper\n        $helperClassName = ucfirst($componentName) . self::COMPONENT_HELPER_SUFFIX;\n        $helperPathName  = $componentPath . ucfirst($componentName) . self::COMPONENT_HELPER_FILE_SUFFIX;\n        if (is_readable($helperPathName)) {\n            $helperSpec = array(\n                'path'  => $helperPathName,\n                'class' => $helperClassName\n            );\n\n            // store events\n            $events = array();\n            if (isset($config->helperEvents)) {\n                $events = $config->helperEvents;\n            } else {\n                if (isset($config->helperEvent)) {\n                    $events = $config->helperEvent;\n                }\n            }\n            if ($events instanceof Zend_Config) {\n                $events = $events->toArray();\n            } else {\n                if (!is_array($events)) {\n                    $events = array($events);\n                }\n            }\n            $helperSpec['events'] = $events;\n\n            if ($config->enabled) {\n                $this->_helpers[$componentName] = $helperSpec;\n\n                // event helpers need to be called early\n                if (!empty($helperSpec['events'])) {\n                    $this->_loadHelper($componentName, $config);\n                }\n\n                //helpers without events will be instantiated onRouteShutdown\n            }\n        }\n\n        $action = isset($config->action) ? $config->action : null;\n\n        $position = isset($config->position) ? $config->position : null;\n\n        if (isset($config->navigation) && (boolean)$config->navigation && $config->enabled) {\n            // register with navigation\n            OntoWiki::getInstance()->getNavigation()->register(\n                $componentName,\n                array(\n                     'controller' => $componentName,\n                     'action'     => $action,\n                     'name'       => $config->name,\n                     'priority'   => $position,\n                     'active'     => false\n                )\n            );\n        }\n\n        $this->_componentRegistry[$componentName] = $config;\n    }\n\n    /**\n     *\n     * @param      $extensionName\n     * @param      $moduleFilename\n     * @param      $modulePath\n     * @param null $config\n     */\n    protected function _addModule($extensionName, $moduleFilename, $modulePath, $config = null)\n    {\n        //one extension can contain many modules - so they share a config file\n        //but each module needs different settings\n        //so we got this trickery to enables per-module-config\n        //everything within the config key \"config->module->$modulename\" will be made toplevel config\n        if (isset($config->modules)) {\n            $moduleName = strtolower(\n                substr(\n                    $moduleFilename,\n                    0,\n                    strlen($moduleFilename) - strlen(OntoWiki_Module_Registry::MODULE_FILE_POSTFIX)\n                )\n            );\n            if (isset($config->modules->{$moduleName})) {\n                //dont touch the original config (seen also by components etc)\n                $config = unserialize(serialize($config));\n                $config->merge($config->modules->{$moduleName}); //pull this config up!\n            }\n        }\n\n        //read context(s)\n        if (isset($config->context) && is_string($config->context)) {\n            $contexts = array($config->context);\n        } else {\n            if (isset($config->context) && is_object($config->context)) {\n                $contexts = $config->context->toArray();\n            } else {\n                if (isset($config->contexts) && is_object($config->contexts)) {\n                    $contexts = $config->contexts->toArray();\n                } else {\n                    $contexts = array(OntoWiki_Module_Registry::DEFAULT_CONTEXT);\n                }\n            }\n        }\n\n        // register for context(s)\n        foreach ($contexts as $context) {\n            $this->_moduleRegistry->register($extensionName, $moduleFilename, $context, $config);\n        }\n    }\n\n\n    /**\n     * adds a wrapper\n     *\n     * @param string $filename\n     * @param string $wrapperPath\n     */\n    protected function _addWrapper($filename, $wrapperPath, $config)\n    {\n        $owApp = OntoWiki::getInstance();\n\n        $wrapperManager = new Erfurt_Wrapper_Manager();\n        $wrapperManager->addWrapperExternally(\n            strtolower(substr($filename, 0, strlen($filename) - strlen(self::WRAPPER_FILE_POSTFIX))),\n            $wrapperPath,\n            isset($config->private) ? $config->private : new Zend_Config(array(), true)\n        );\n    }\n\n\n    /**\n     * Adds a plugin and registers it with the dispatcher.\n     *\n     * @param string $filename\n     * @param string $pluginPath\n     */\n    private function _addPlugin($filename, $pluginPath, $config)\n    {\n        $owApp         = OntoWiki::getInstance();\n        $pluginManager = $owApp->erfurt->getPluginManager(false);\n        $pluginManager->addPluginExternally(\n            strtolower(\n                substr(\n                    $filename,\n                    0,\n                    strlen($filename) - strlen(self::PLUGIN_FILE_POSTFIX)\n                )\n            ),\n            $filename,\n            $pluginPath,\n            $config\n        );\n    }\n\n    private static $_owconfigNS = 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/';\n\n    /**\n     * interpret a doap triple-set to a config array\n     *\n     * @static\n     *\n     * @param $triples\n     * @param $name string name of the extension\n     * @param $base string base URI from parsing\n     * @param $path string path of the original file (just for error reporting)\n     *\n     * @return array\n     * @throws Exception\n     */\n    public static function triples2configArray($triples, $name, $base, $path)\n    {\n        $memModel = new Erfurt_Rdf_MemoryModel($triples);\n\n        $owconfigNS = self::$_owconfigNS;\n        $doapNS     = 'http://usefulinc.com/ns/doap#';\n        $mapping    = array(\n            $owconfigNS . 'enabled'       => 'enabled',\n            $owconfigNS . 'helperEvent'   => 'helperEvents',\n            $owconfigNS . 'templates'     => 'templates',\n            $owconfigNS . 'helpers'       => 'helpers',\n            $owconfigNS . 'languages'     => 'languages',\n            $owconfigNS . 'defaultAction' => 'action',\n            $owconfigNS . 'class'         => 'classes',\n            $doapNS . 'name'              => 'name',\n            $doapNS . 'description'       => 'description',\n            $doapNS . 'maintainer'        => 'authorUrl',\n            $owconfigNS . 'authorLabel'   => 'author',\n            EF_RDFS_LABEL                 => 'title'\n        );\n\n        $scp = $owconfigNS . 'config'; //sub config property\n        $mp  = $owconfigNS . 'hasModule'; //module property\n\n        $extensionUri = $memModel->getValue($base, 'http://xmlns.com/foaf/0.1/primaryTopic');\n\n        if ($extensionUri == null) {\n            throw new Exception(\n                'DOAP config for extension ' . $name .\n                ': missing triple (@base, foaf:primaryTopic, <extensionUri>). ' .\n                'Base was: \"' . $base . '\". In doap file: \"' . $path . '\".'\n            );\n        }\n\n        $privateNS = $memModel->getValue($extensionUri, $owconfigNS . 'privateNamespace');\n\n        $modules    = array();\n        $config     = array('default' => array(), 'private' => array(), 'events' => array(), 'modules' => array());\n        $subconfigs = array();\n        foreach ($memModel->getPO($extensionUri) as $key => $values) {\n            //handle subconfigs\n            if ($key == $scp) {\n                foreach ($values as $val) {\n                    $subconfigs[] = $val['value'];\n                }\n                continue;\n            } else {\n                if ($key == $mp) {\n                    //handle modules\n                    foreach ($values as $val) {\n                        $modules[] = $val['value'];\n                    }\n                    continue;\n                } else {\n                    if ($key == $owconfigNS . 'pluginEvent') {\n                        //handle events that belong to plugins\n                        foreach ($values as $value) {\n                            $config['events'][] = $value['value'];\n                        }\n                        continue;\n                    } else {\n                        if (isset($mapping[$key])) {\n                            $mappedKey = $mapping[$key];\n                            $section   = 'default';\n                        } else {\n                            $mappedKey = self::getPrivateKey($key, $privateNS);\n                            if ($mappedKey == null) {\n                                continue; //skip irregular keys\n                            }\n                            $section = 'private';\n                        }\n                    }\n                }\n            }\n\n            foreach ($values as $value) {\n                $value = self::getValue($value, $memModel);\n                self::addValue($mappedKey, $value, $config[$section]);\n            }\n        }\n\n        foreach ($subconfigs as $bnUri) {\n            $config['private'] = array_merge(\n                $config['private'],\n                self::getSubConfig($memModel, $bnUri, $privateNS, $mapping)\n            );\n        }\n\n        foreach ($modules as $moduleUri) {\n            $name                     = strtolower(self::getPrivateKey($moduleUri, $privateNS));\n            $config['modules'][$name] = array();\n            foreach ($memModel->getPO($moduleUri) as $key => $values) {\n                $mappedKey = self::getPrivateKey($key, $owconfigNS);\n                if ($mappedKey == null) {\n                    continue; //modules can only have specific properties\n                }\n\n                foreach ($values as $value) {\n                    $value = self::getValue($value, $memModel);\n                    self::addValue($mappedKey, $value, $config['modules'][$name]);\n                }\n            }\n        }\n\n        if (empty($config['events'])) {\n            unset($config['events']);\n        }\n\n        //pull up the default module\n        if (isset($config['modules']['default'])) {\n            $config = array_merge($config, $config['modules']['default']);\n            unset($config['modules']['default']);\n        }\n\n        //pull up the default section\n        $config = array_merge($config, $config['default']);\n        unset($config['default']);\n\n        return $config;\n    }\n\n    /**\n     * load the doap.n3 file of a extension and transform it into a config array\n     *\n     * @param string $path\n     * @param string $name\n     *\n     * @return array config array\n     */\n    public static function loadDoapN3($path, $name)\n    {\n        $parser  = Erfurt_Syntax_RdfParser::rdfParserWithFormat('n3');\n        $triples = $parser->parse($path, Erfurt_Syntax_RdfParser::LOCATOR_FILE);\n        $base    = $parser->getBaseUri();\n        $a       = self::triples2configArray($triples, $name, $base, $path);\n\n        return $a;\n    }\n\n    /**\n     * convert a php-rdf value to a php value\n     * respects booleans especially (literals and URIs are trivial)\n     *\n     * @static\n     *\n     * @param $value\n     *\n     * @return bool\n     */\n    private static function getValue($value, Erfurt_Rdf_MemoryModel $memModel = null)\n    {\n        if ($value['type'] == 'literal'\n            && isset($value['datatype'])\n            && $value['datatype'] == 'http://www.w3.org/2001/XMLSchema#boolean'\n        ) {\n            $value = $value['value'] == 'true';\n        } else {\n            if ($memModel !== null && ($value['type'] == 'uri' || $value['type'] == 'bnode')) {\n                // Handle collections and containers (rdf:Bag, rdf:Seq) not rdf:Alt because of a bug\n                $type = $memModel->getValue($value['value'], EF_RDF_NS . 'type');\n                if ($type == EF_RDF_NS . 'Bag' || $type == EF_RDF_NS . 'Seq') {\n                    // This is a container, convert it to an array\n                    $properties = $memModel->getPO($value['value']);\n                    $value      = array();\n                    foreach ($properties as $property => $entry) {\n                        if (strstr($property, EF_RDF_NS . '_')) {\n                            $value[] = $entry[0]['value'];\n                        }\n                    }\n                } else {\n                    if ($type == EF_RDF_NS . 'nil') {\n                        $value = array();\n                    } else {\n                        $first = $memModel->getValue($value['value'], EF_RDF_NS . 'first');\n                        $rest  = $memModel->getValue($value['value'], EF_RDF_NS . 'rest');\n                        if (count($first) > 0 && count($rest) > 0) {\n                            // This is a collection, convert it to an array\n                            $value = array($first);\n                            while ($rest != EF_RDF_NS . 'nil') {\n                                $value[] = $memModel->getValue($rest, EF_RDF_NS . 'first');\n                                $rest    = $memModel->getValue($rest, EF_RDF_NS . 'rest');\n                            }\n                        } else {\n                            // unknown Resource\n                            $value = $value['value'];\n                        }\n                    }\n                }\n            } else {\n                $value = $value['value'];\n            }\n        }\n\n        return $value;\n    }\n\n    /**\n     * add an value to an array using a key\n     * if the key is already used, cast it to array and add to that array\n     *\n     * @static\n     *\n     * @param $key   string\n     * @param $value mixed\n     * @param $to    array\n     */\n    private static function addValue($key, $value, &$to)\n    {\n        if (!isset($to[$key])) { //first entry for that key\n            $to[$key] = $value;\n        } else {\n            if (is_array($to[$key])) { //there are already multiple values for that key\n                if (is_array($value)) {\n                    $to[$key] = array_merge($value, $to[$key]);\n                } else {\n                    $to[$key][] = $value;\n                }\n            } else { //it the second entry for that key, turn to array\n                if (is_array($value)) {\n                    $to[$key] = array_merge(array($to[$key]), $value);\n                } else {\n                    $to[$key] = array($to[$key], $value);\n                }\n            }\n        }\n    }\n\n    /**\n     * clean a config property URI to obtain a config array key\n     *\n     * @static\n     *\n     * @param       $key       string\n     * @param       $privateNS string\n     * @param array $mapping\n     *\n     * @return mixed\n     */\n    private static function getPrivateKey($key, $privateNS, $mapping = array())\n    {\n        if (isset($mapping[$key])) {\n            return $mapping[$key];\n        }\n        if (strpos($key, $privateNS) === 0) {\n            //strip private NS, only keep last part\n            $newKey = substr($key, strlen($privateNS));\n        } else {\n            //return only local part\n            //take the right most / or #\n            $slashPos = strrpos($key, '/');\n            $hashPos  = strrpos($key, '#');\n            if ($slashPos < $hashPos) {\n                $l = $hashPos;\n            } else {\n                $l = $slashPos;\n            }\n\n            if ($l == false) {\n                $newKey = $key; //no / or #\n            } else {\n                $newKey = substr($key, $l + 1);\n            }\n        }\n\n        return preg_replace('[^A-Za-z0-9-_]', '', $newKey); //strip bad chars\n    }\n\n    /**\n     * read a private config part from a doap Erfurt_Rdf_MemoryModel (recursive)\n     *\n     * @static\n     *\n     * @param $memModel\n     * @param $bnUri\n     * @param $privateNS\n     * @param $mapping\n     *\n     * @return array\n     */\n    private static function getSubConfig(Erfurt_Rdf_MemoryModel $memModel, $bnUri, $privateNS, $mapping)\n    {\n        $kv   = array();\n        $name = $memModel->getValue($bnUri, self::$_owconfigNS . 'id');\n        if ($name == null) {\n            return array();\n        }\n\n        foreach ($memModel->getPO($bnUri) as $key => $values) {\n            if ($key == EF_RDF_TYPE || $key == self::$_owconfigNS . 'id') {\n                continue;\n            }\n            if ($key == self::$_owconfigNS . 'config') {\n                foreach ($values as $value) {\n                    $kv = array_merge($kv, self::getSubConfig($memModel, $value['value'], $privateNS, $mapping));\n                }\n            } else {\n                $mappedKey = self::getPrivateKey($key, $privateNS, $mapping);\n                foreach ($values as $value) {\n                    $value = self::getValue($value, $memModel);\n                    self::addValue($mappedKey, $value, $kv);\n                }\n            }\n        }\n        $r = array($name => $kv);\n\n        return $r;\n    }\n\n    /**\n     * load configs for an extension\n     * - respect local ini's\n     * - fix missing or dirty values\n     *\n     * @param $name string containing the name of an extension\n     *\n     * @return Zend_Config\n     */\n    private function _loadConfigs($name)\n    {\n        $path   = $this->_extensionPath . $name . DIRECTORY_SEPARATOR;\n        $config = new Zend_Config(self::loadDoapN3($path . self::EXTENSION_DEFAULT_DOAP_FILE, $name), true);\n\n        // overwrites default config with local config\n        $localConfigPath = $this->_extensionPath . $name . '.ini';\n        if (is_readable($localConfigPath)) {\n            //the local config is still in ini syntax\n            $localConfig = new Zend_Config_Ini($localConfigPath, null, true);\n            $config->merge($localConfig);\n        }\n\n        //fix missing names\n        if (!isset($config->name)) {\n            $config->name = $name;\n        }\n\n        //fix deprecated/invalid values for \"enabled\"\n        if (is_string($config->enabled)) {\n            switch ($config->enabled) {\n                case '1':\n                case 'enabled':\n                case 'true':\n                case 'on':\n                case 'yes':\n                    $config->enabled = true;\n                    break;\n                default:\n                    $config->enabled = false;\n            }\n        }\n\n        // normalize paths\n        foreach ($this->_pathKeys as $pathKey) {\n            if (isset($config->{$pathKey})) {\n                $config->{$pathKey} = rtrim($config->{$pathKey}, '/\\\\') . '/';\n            }\n        }\n\n        // save component's path\n        $config->path = $path;\n\n        return $config;\n    }\n\n    /**\n     * Reads all available component translations and adds them to the translation object\n     */\n    private function _scanTranslations()\n    {\n        // check for valid translation object\n        if (is_object($this->_translate)) {\n            foreach ($this->_extensionRegistry as $component => $settings) {\n                // check if component owns translation\n                if (isset($settings->languages)\n                    && is_readable($settings->path . $settings->languages)\n                ) {\n                    // keep current locale\n                    $locale = $this->_translate->getAdapter()->getLocale();\n\n                    $this->_translate->addTranslation(\n                        $settings->path . $settings->languages,\n                        null,\n                        array('scan' => Zend_Translate::LOCALE_FILENAME)\n                    );\n\n                    // reset current locale\n                    $this->_translate->setLocale($locale);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Http/Exception.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki exception base class\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Http\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Http_Exception extends OntoWiki_Exception\n{\n    const ERROR_CODE_BASE = 3000;\n\n    protected $_responseCode = 0;\n\n    public function __construct($responseCode, $message = null)\n    {\n        parent::__construct(\n            ((null !== $message) ? $message : Zend_Http_Response::responseCodeAsText($responseCode)),\n            self::ERROR_CODE_BASE + (int)$responseCode\n        );\n\n        $this->_responseCode = $responseCode;\n    }\n\n    public function getResponseMessage()\n    {\n        return $this->getMessage();\n    }\n\n    public function getResponseCode()\n    {\n        return $this->_responseCode;\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Jobs/Cron.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2013-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki Cron Job\n *\n * This is a poormans implementation of a cron job. It is based on a chain of\n * recursivly restarting jobs which trigger onEveryMinute, onEveryHour and\n * onEveryDay events. The starting time of a job chain is saved to avoid more\n * than on job chain.\n *\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Jobs\n * @author    Sebastian Tramp <mail@sebastian.tramp.name>\n */\nclass OntoWiki_Jobs_Cron extends Erfurt_Worker_Job_Abstract\n{\n\n    /**\n     * on which integer the delay countdown starts\n     */\n    const DELAY_COUNTDOWN    = 10;\n\n    /**\n     * the maximum time in seconds where a cached chain startTime is not taken\n     * as too old and a new chain is fired\n     */\n    const DELAY_MERCYSECONDS = 10;\n\n\n    /**\n     * gives an DateInterval in seconds (for better comparison)\n     * taken from http://www.php.net/manual/en/dateinterval.format.php#102271\n     *\n     * @param DateInterval $interval object to recalculate\n     *\n     * @return integer\n     */\n    private function _toSeconds(DateInterval $interval)\n    {\n        $y = $interval->y * 365 * 24 * 60 * 60;\n        $m = $interval->m * 30 * 24 * 60 * 60;\n        $d = $interval->d * 24 * 60 * 60;\n        $h = $interval->h * 60 * 60;\n        $i = $interval->i * 60;\n        $s = $interval->s;\n\n        return $y + $m + $d + $h + $i + $s;\n    }\n\n    /**\n     * sleeps an amount of time and calls the next job\n     *\n     * @param mixed $load       the load of the next job\n     * @param int   $inXSeconds time in seconds when the next job is called\n     *\n     * @return void\n     */\n    private function _next($load = null, $inXSeconds = 2)\n    {\n        if ((int)$inXSeconds > 0) {\n            sleep((int)$inXSeconds);\n        }\n\n        if ($load == null) {\n            OntoWiki::getInstance()->callJob('cron');\n        } else {\n            OntoWiki::getInstance()->callJob('cron', $load);\n        }\n    }\n\n    /**\n     * initializes a new load\n     *\n     * @return void\n     */\n    private function _getNewLoad()\n    {\n        $this->setValue($this->timeStart, 'timeStart');\n        $this->setValue($this->timeStart, 'timeLast');\n        $this->load = array(\n            'lastMinutly' => $this->nowString,\n            'lastHourly' => $this->nowString,\n            'lastDaily' => $this->nowString,\n            'timeStart' => $this->timeStart,\n        );\n    }\n\n    /**\n     * trigger events, based on nowstring and load\n     *\n     * @return void\n     */\n    private function _triggerEvents()\n    {\n        $now             = new DateTime($this->nowString);\n\n        $lastMinutly     = new DateTime($this->load->lastMinutly);\n        $lastMinutlyDiff = $this->_toSeconds($now->diff($lastMinutly));\n        if ($lastMinutlyDiff >= 60) {\n            $this->load->lastMinutly = $this->nowString;\n            /**\n             * @trigger onEveryMinute\n             */\n            $event = new Erfurt_Event('onEveryMinute');\n            $event->trigger();\n            if ($event->handled) {\n                $this->logSuccess('triggered onEveryMinute (handled)');\n            } else {\n                $this->logSuccess('triggered onEveryMinute (but not handled)');\n            }\n        };\n\n        $lastHourly     = new DateTime($this->load->lastHourly);\n        $lastHourlyDiff = $this->_toSeconds($now->diff($lastHourly));\n        if ($lastHourlyDiff >= 60 * 60) {\n            $this->load->lastHourly = $this->nowString;\n            /**\n             * @trigger onEveryHour\n             */\n            $event = new Erfurt_Event('onEveryHour');\n            $event->trigger();\n            if ($event->handled) {\n                $this->logSuccess('triggered onEveryHour (handled)');\n            } else {\n                $this->logSuccess('triggered onEveryHour (but not handled)');\n            }\n        };\n\n        $lastDaily     = new DateTime($this->load->lastDaily);\n        $lastDailyDiff = $this->_toSeconds($now->diff($lastDaily));\n        if ($lastDailyDiff >= 60 * 60 * 24) {\n            $this->load->lastDaily = $this->nowString;\n            /**\n             * @trigger onEveryDay\n             */\n            $event = new Erfurt_Event('onEveryDay');\n            $event->trigger();\n            if ($event->handled) {\n                $this->logSuccess('triggered onEveryDay (handled)');\n            } else {\n                $this->logSuccess('triggered onEveryDay (but not handled)');\n            }\n        };\n    }\n\n    /**\n     * run the job\n     *\n     * @param mixed $load payload object\n     *\n     * @return null\n     */\n    public function run($load)\n    {\n        // the micro-timestamp to identify the start of the cron chain\n        $this->timeStart = microtime(true);\n        // the timestring to calculate the events\n        $this->nowString = date(\"Y-m-d H:i:s\");\n        // the timestamp when a continous chain of cron jobs was started\n        $timeStartValue = $this->getValue('timeStart');\n        // the timestamp when the last link in the chain was started\n        $timeLastValue  = $this->getValue('timeLast');\n\n        if (empty($load)) {\n            // situation 1: no previous timestamps cached -> init\n            if ($timeStartValue === false || $timeLastValue === false) {\n                // first start without payload and cached values,\n                // so we create a fresh chain\n                $this->_getNewLoad();\n                $this->_next($this->load);\n            } else {\n                // situation 2: previous timestamps cached -> handle\n                $timeLastDiff = $this->timeStart - $timeLastValue;\n                if ($timeLastDiff > self::DELAY_MERCYSECONDS) {\n                    // first start without payload but WITH invalid old cache,\n                    // we can create a fresh chain\n                    $this->logSuccess(\n                        'started without payload,'.\n                        ' and OLD cached timestamps exists -- '. $timeLastDiff .\n                        ' (init on ' . (string)$this->timeStart . ')'\n                    );\n                    $this->_getNewLoad();\n                    $this->_next($this->load);\n                } else {\n                    // first start without payload but WITH opposing cache,\n                    // we need to look forward\n                    $this->logFailure(\n                        'started without payload, but cached timestamps exists ' .\n                        ' (do nothing for now and try again '.self::DELAY_COUNTDOWN.' times).'\n                    );\n                    $this->_next(array('delayed' => self::DELAY_COUNTDOWN), 1);\n                }\n            }\n        } else { // load exists\n            if (!empty($load->delayed) && (int)$load->delayed > 0) {\n                $this->logFailure(\n                    'started delayed: ' . $load->delayed\n                );\n                $timeLastDiff = $this->timeStart - $timeLastValue;\n                if ($timeLastDiff > self::DELAY_MERCYSECONDS) {\n                    // this is a fresh restart since we know, that the chain can\n                    // be created now\n                    $this->_next(null, 0);\n                } else {\n                    // this is a delayed job which is agains started to re-run the tests\n                    $this->_next(array('delayed' => $load->delayed - 1), 1);\n                }\n            } else if (empty($load->timeStart) || (string)$load->timeStart !== (string)$timeStartValue) {\n                // this is a start with load but it does not belong to the\n                // cron chain of the cached timeStart\n                $this->logFailure(\n                    'started with payload, but cached timestamp differs' .\n                    ' (do nothing, chain dies).'\n                );\n            } else {\n                // finally, this is a \"normal\" job which can trigger events and\n                // which setup a new timeLast\n                $this->load = $load;\n                $this->_triggerEvents();\n                $this->setValue($this->timeStart, 'timeLast');\n                $this->_next($this->load);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Menu/Registry.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki menu registry class.\n *\n * Serves as a central registry for menus and provides methods for setting\n * and retrieving menu instances.\n *\n * @category OntoWiki\n * @package  OntoWiki_Classes_Menu\n * @author   Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Menu_Registry\n{\n    /**\n     * Menu registry; an array of menu instances\n     *\n     * @var array\n     */\n    private $_menus = array();\n\n    /**\n     * Singleton instance\n     *\n     * @var OntoWiki_Menu_Registry\n     */\n    private static $_instance = null;\n\n    /**\n     * Singleton instance\n     *\n     * @return OntoWiki_Menu_Registry\n     */\n    public static function getInstance()\n    {\n        if (null === self::$_instance) {\n            self::$_instance = new self();\n        }\n\n        return self::$_instance;\n    }\n\n    /**\n     * Returns the menu denoted by $menuKey.\n     *\n     * @param string $menuKey\n     *\n     * @return OntoWiki_Menu\n     */\n    public function getMenu($menuKey, $context = null)\n    {\n        if (!is_string($menuKey)) {\n            throw new OntoWiki_Exception('Menu key must be string.');\n        }\n\n        if (!isset($this->_menus[$context])) {\n            $this->_menus[$context] = array();\n        }\n\n        if (!array_key_exists($menuKey, $this->_menus[$context])) {\n            $getMethod = '_get' . ucfirst($menuKey) . 'Menu';\n            if (method_exists($this, $getMethod)) {\n                $this->setMenu($menuKey, $context, $this->$getMethod($context));\n            } else {\n                $this->setMenu($menuKey, $context, new OntoWiki_Menu());\n            }\n        }\n\n        return $this->_menus[$context][$menuKey];\n    }\n\n    /**\n     * Stores the menu $menu with key $menuKey in the registry.\n     *\n     * @param string        $menuKey\n     * @param OntoWiki_Menu $menu\n     * @param boolean       $replace\n     *\n     * @return OntoWiki_Menu_Registry\n     */\n    public function setMenu($menuKey, $context, OntoWiki_Menu $menu, $replace = true)\n    {\n        if (!is_string($menuKey)) {\n            throw new OntoWiki_Exception('Menu key must be string.');\n        }\n\n        if (!isset($this->_menus[$context])) {\n            $this->_menus[$context] = array();\n        }\n\n        if (!$replace && array_key_exists($menuKey, $this->_menus[$context])) {\n            throw new OntoWiki_Exception(\"Menu with key '$menuKey' already registered.\");\n        }\n\n        $this->_menus[$context][$menuKey] = $menu;\n\n        return $this;\n    }\n\n    private function __construct()\n    {\n        $owApp = OntoWiki::getInstance();\n        $this->setMenu('application', null, $this->_getApplicationMenu());\n\n        // check if a resource is selected\n        if (isset($owApp->selectedResource) && $owApp->selectedResource) {\n            $resource = (string)$owApp->selectedResource;\n            $this->setMenu('resource', $resource, $this->_getResourceMenu($resource));\n        }\n    }\n\n    /**\n     * Create the application menu and fill it with its default entries\n     */\n    private function _getApplicationMenu($context = null)\n    {\n        $owApp = OntoWiki::getInstance();\n\n        // user sub menu\n        if ($owApp->erfurt->isActionAllowed('RegisterNewUser')\n            && !(isset($owApp->config->ac)\n            && ((boolean)$owApp->config->ac->deactivateRegistration === true))\n        ) {\n\n            if (!($owApp->erfurt->getAc() instanceof Erfurt_Ac_None)) {\n                $userMenu = new OntoWiki_Menu();\n                $userMenu->setEntry('Register New User', $owApp->config->urlBase . 'application/register');\n            }\n        }\n        if ($owApp->user && !$owApp->user->isAnonymousUser()) {\n            if (!isset($userMenu)) {\n                $userMenu = new OntoWiki_Menu();\n            }\n\n            if (!$owApp->user->isDbUser()) {\n                $userMenu->setEntry('Preferences', $owApp->config->urlBase . 'application/preferences');\n            }\n\n            $userMenu->setEntry('Logout', $owApp->config->urlBase . 'application/logout');\n        }\n\n        // view sub menu\n        $viewMenu = new OntoWiki_Menu();\n\n        // extras sub menu\n        $extrasMenu = new OntoWiki_Menu();\n\n        $extrasMenu->setEntry('News', $owApp->config->urlBase . 'index/news');\n\n        // help sub menue\n        $helpMenu = new OntoWiki_Menu();\n\n        if (isset($owApp->config->help->documentation) && (trim($owApp->config->help->documentation) !== '')) {\n            $helpMenu->setEntry('Documentation', trim($owApp->config->help->documentation));\n        }\n        if (isset($owApp->config->help->issues) && (trim($owApp->config->help->issues) !== '')) {\n            $helpMenu->setEntry('Bug Report', trim($owApp->config->help->issues));\n        }\n        if (isset($owApp->config->help->versioninfo) && (trim($owApp->config->help->versioninfo) !== '')) {\n            $helpMenu->setEntry('Version Info', trim($owApp->config->help->versioninfo));\n        }\n        $helpMenu->setEntry('About', $owApp->config->urlBase . 'application/about');\n\n        // build menu out of sub menus\n        $applicationMenu = new OntoWiki_Menu();\n        if (isset($userMenu)) {\n            $applicationMenu->setEntry('User', $userMenu);\n        }\n        $applicationMenu->setEntry('Extras', $extrasMenu)\n            ->setEntry('Help', $helpMenu);\n\n        // add cache entry only if use is allowed to use debug action\n        if ($owApp->erfurt->isActionAllowed('Debug')) {\n            $debugMenu = new OntoWiki_Menu();\n            $debugMenu->setEntry('Clear Module Cache', $owApp->config->urlBase . 'debug/clearmodulecache')\n                ->setEntry('Clear Translation Cache', $owApp->config->urlBase . 'debug/cleartranslationcache')\n                ->setEntry('Clear Object & Query Cache', $owApp->config->urlBase . 'debug/clearquerycache')\n                ->setEntry('Start xdebug Session', $owApp->config->urlBase . '?XDEBUG_SESSION_START=xdebug')\n                ->setEntry('Reset Session', $owApp->config->urlBase . 'debug/destroysession');\n\n            $applicationMenu->setEntry('Debug', $debugMenu);\n        }\n\n        return $applicationMenu;\n    }\n\n    /**\n     * Create the context menu for models/knowledge bases and fill it with its default entries\n     */\n    private function _getModelMenu($model = null)\n    {\n        $owApp = OntoWiki::getInstance();\n        if ($model === null) {\n            $model = $owApp->selectedModel;\n        }\n        $config = $owApp->config;\n\n        $modelMenu = new OntoWiki_Menu();\n\n        // Select Knowledge Base\n        $url = new OntoWiki_Url(\n            array('controller' => 'model', 'action' => 'select'),\n            array()\n        );\n        $url->setParam('m', $model, false);\n        $modelMenu->appendEntry(\n            'Select Knowledge Base',\n            (string)$url\n        );\n\n        // View resource\n        $url = new OntoWiki_Url(\n            array('action' => 'view'),\n            array()\n        );\n        $url->setParam('m', $model, false);\n        $url->setParam('r', $model, true);\n\n        $modelMenu->appendEntry(\n            'View as Resource',\n            (string)$url\n        );\n\n        // check if model could be edited (prefixes and data)\n        if ($owApp->erfurt->getAc()->isModelAllowed('edit', $model)) {\n            // Configure Knowledge Base\n            $url = new OntoWiki_Url(\n                array('controller' => 'model', 'action' => 'config'),\n                array()\n            );\n            $url->setParam('m', $model, false);\n            $modelMenu->appendEntry(\n                'Configure Knowledge Base',\n                (string)$url\n            );\n\n            // Add Data to Knowledge Base\n            $url = new OntoWiki_Url(\n                array('controller' => 'model', 'action' => 'add'),\n                array()\n            );\n            $url->setParam('m', $model, false);\n            $modelMenu->appendEntry(\n                'Add Data to Knowledge Base',\n                (string)$url\n            );\n        }\n\n        // Model export\n        if ($owApp->erfurt->getAc()->isActionAllowed(Erfurt_Ac_Default::ACTION_MODEL_EXPORT)) {\n            // add entries for supported export formats\n            foreach (Erfurt_Syntax_RdfSerializer::getSupportedFormats() as $key => $format) {\n\n                $url = new OntoWiki_Url(\n                    array('controller' => 'model', 'action' => 'export'),\n                    array()\n                );\n                $url->setParam('m', $model, false);\n                $url->setParam('f', $key);\n\n                $modelMenu->appendEntry(\n                    'Export Knowledge Base as ' . $format,\n                    (string)$url\n                );\n            }\n        }\n\n        // can user delete models?\n        if ($owApp->erfurt->getAc()->isModelAllowed('edit', $model)\n            && $owApp->erfurt->getAc()->isActionAllowed('ModelManagement')\n        ) {\n\n            $url = new OntoWiki_Url(\n                array('controller' => 'model', 'action' => 'delete'),\n                array()\n            );\n            $url->setParam('model', $model, false);\n\n            $modelMenu->appendEntry(\n                'Delete Knowledge Base',\n                (string)$url\n            );\n        }\n\n        // add a seperator\n        $modelMenu->appendEntry(OntoWiki_Menu::SEPARATOR);\n\n        return $modelMenu;\n    }\n\n    /**\n     * Create the (context) menu for resource and fill it with its default entries\n     */\n    private function _getResourceMenu($resource = null)\n    {\n        $owApp = OntoWiki::getInstance();\n        if ($resource === null) {\n            $resource = $owApp->selectedResource;\n        }\n        $config = $owApp->config;\n\n        $resourceMenu = new OntoWiki_Menu();\n\n        // Add the class Menu if the current resource is a class\n        $classMenu = $this->_getClassMenu($resource)->toArray();\n        foreach ($classMenu as $key => $value) {\n            $resourceMenu->appendEntry($key, $value);\n        }\n        if (count($classMenu) > 0) {\n            $resourceMenu->appendEntry(OntoWiki_Menu::SEPARATOR);\n        }\n\n        // View resource\n        $url = new OntoWiki_Url(\n            array('action' => 'view'),\n            array()\n        );\n        $url->setParam('r', $resource, true);\n\n        $resourceMenu->appendEntry(\n            'View Resource',\n            (string)$url\n        );\n\n        // Edit entries\n        if ($owApp->erfurt->getAc()->isModelAllowed('edit', $owApp->selectedModel)) {\n            // edit resource option\n            $resourceMenu->appendEntry(\n                'Edit Resource',\n                'javascript:editResourceFromURI(\\'' . (string)$resource . '\\')'\n            );\n\n            // Delete resource option\n            $url = new OntoWiki_Url(\n                array('controller' => 'resource', 'action' => 'delete'),\n                array('r')\n            );\n            $url->setParam('r', (string)$resource, false);\n            $resourceMenu->appendEntry('Delete Resource', (string)$url);\n        }\n\n        $resourceMenu->appendEntry(\n            'Go to Resource (external)',\n            (string)$resource\n        );\n\n        $resourceMenu->appendEntry(OntoWiki_Menu::SEPARATOR);\n\n        foreach (Erfurt_Syntax_RdfSerializer::getSupportedFormats() as $key => $format) {\n            $resourceMenu->appendEntry(\n                'Export Resource as ' . $format,\n                $config->urlBase . 'resource/export/f/' . $key . '?r=' . urlencode($resource)\n            );\n        }\n\n        return $resourceMenu;\n    }\n\n    /**\n     * Create the (context) menu for classes and fill it with its default entries\n     */\n    private function _getClassMenu($resource = null)\n    {\n        $owApp = OntoWiki::getInstance();\n        $classMenu = new OntoWiki_Menu();\n\n        $query     = Erfurt_Sparql_SimpleQuery::initWithString(\n            'SELECT *\n             FROM <' . (string)$owApp->selectedModel . '>\n             WHERE {\n                <' . $resource . '> a ?type  .\n             }'\n        );\n        $results[] = $owApp->erfurt->getStore()->sparqlQuery($query);\n\n        $query = Erfurt_Sparql_SimpleQuery::initWithString(\n            'SELECT *\n             FROM <' . (string)$owApp->selectedModel . '>\n             WHERE {\n                ?inst a <' . $resource . '> .\n             } LIMIT 2'\n        );\n\n        if (count($owApp->erfurt->getStore()->sparqlQuery($query)) > 0) {\n            $hasInstances = true;\n        } else {\n            $hasInstances = false;\n        }\n\n        $typeArray = array();\n        foreach ($results[0] as $row) {\n            $typeArray[] = $row['type'];\n        }\n\n        if (in_array(EF_RDFS_CLASS, $typeArray)\n            || in_array(EF_OWL_CLASS, $typeArray)\n            || $hasInstances\n        ) {\n            $url = new OntoWiki_Url(\n                array('action' => 'list'),\n                array()\n            );\n            $url->setParam('class', $resource, false);\n            $url->setParam('init', \"true\", true);\n\n            $classMenu->appendEntry(\n                'List Instances',\n                (string)$url\n            );\n\n            // add class menu entries\n            if ($owApp->erfurt->getAc()->isModelAllowed('edit', $owApp->selectedModel)) {\n                $classMenu->appendEntry(\n                    'Create Instance',\n                    \"javascript:createInstanceFromClassURI('$resource');\"\n                );\n            }\n        }\n\n        return $classMenu;\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Menu.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki menu class.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Menu\n{\n    /**\n     * Menu entry separator\n     */\n    const SEPARATOR = '_---_';\n\n    /**\n     * Array of menu entries\n     *\n     * @var array\n     */\n    private $_entries = array();\n\n    /**\n     * Constructor\n     */\n    public function __construct()\n    {\n    }\n\n    public function appendEntry($entryKey, $entryContent = null)\n    {\n        if (!is_string($entryKey)) {\n            throw new OntoWiki_Exception('Entry key must be string.');\n        }\n\n        if (($entryKey != self::SEPARATOR)\n            && !is_string($entryContent) && !is_array($entryContent)\n            && !($entryContent instanceof OntoWiki_Menu)\n        ) {\n            throw new OntoWiki_Exception(\n                'Menu content must be an instance of ' . __CLASS__ . ' or string, ' . gettype($entryContent) . ' given.'\n            );\n        }\n\n        if (array_key_exists($entryKey, $this->_entries)) {\n            throw new OntoWiki_Exception(\"An entry with key '$entryKey' already exists.\");\n        }\n\n        if ($entryKey == self::SEPARATOR) {\n            $key                  = self::SEPARATOR . uniqid();\n            $this->_entries[$key] = self::SEPARATOR;\n        } else {\n            $this->_entries[$entryKey] = $entryContent;\n        }\n\n        return $this;\n    }\n\n    public function prependEntry($entryKey, $entryContent = null)\n    {\n        if (!is_string($entryKey)) {\n            throw new OntoWiki_Exception('Entry key must be string.');\n        }\n\n        if (($entryKey != self::SEPARATOR)\n            && !is_string($entryContent)\n            && !is_array($entryContent)\n            && !($entryContent instanceof OntoWiki_Menu)\n        ) {\n            throw new OntoWiki_Exception(\n                'Menu content must be an instance of ' . __CLASS__ . ' or string, ' . gettype($entryContent) . ' given.'\n            );\n        }\n\n        if (array_key_exists($entryKey, $this->_entries)) {\n            throw new OntoWiki_Exception(\"An entry with key '$entryKey' already exists.\");\n        }\n\n        if ($entryKey == self::SEPARATOR) {\n            $key = self::SEPARATOR . uniqid();\n\n            $this->_entries = array_merge(array($key => self::SEPARATOR), $this->_entries);\n        } else {\n            $this->_entries = array_merge(array($entryKey => $entryContent), $this->_entries);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Sets a menu entry. Throws an exception if a menu key with\n     * the same name already exists and\n     *\n     * @param string                     $entryKey\n     * @param string|array|OntoWiki_Menu $entryContent\n     * If a string is provided, it is used as the target URL for the menu entry.\n     * If an array is given, it must have a key 'url', whereas 'class' and 'id'\n     * are optional and can be used for CSS classes and CSS ids respectively.\n     * An instance of OntoWiki_Menu means, this entry is a submenu.\n     * @param                            boolean replace\n     */\n    public function setEntry($entryKey, $entryContent = null, $replace = true)\n    {\n        if (!is_string($entryKey)) {\n            throw new OntoWiki_Exception('Entry key must be string.');\n        }\n\n        if (($entryKey != self::SEPARATOR)\n            && !is_string($entryContent)\n            && !is_array($entryContent)\n            && !($entryContent instanceof OntoWiki_Menu)\n        ) {\n            throw new OntoWiki_Exception(\n                'Menu content must be an instance of ' . __CLASS__ . ' or string, ' . gettype($entryContent) . ' given.'\n            );\n        }\n\n        if (!$replace && array_key_exists($entryKey, $this->_entries)) {\n            throw new OntoWiki_Exception(\"An entry with key '$entryKey' already exists.\");\n        }\n\n        if ($entryKey == self::SEPARATOR) {\n            $key                  = self::SEPARATOR . uniqid();\n            $this->_entries[$key] = self::SEPARATOR;\n        } else {\n            $this->_entries[$entryKey] = $entryContent;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns a sub menu entry. If the sub menu does not\n     * exist an empty instance of OntoWiki_Menu is returned\n     * that represents a new submenu.\n     *\n     * @param string $subMenuKey\n     *\n     * @return OntoWiki_Menu|null\n     */\n    public function getSubMenu($subMenuKey)\n    {\n        if (!array_key_exists($subMenuKey, $this->_entries)) {\n            $subMenu = new OntoWiki_Menu();\n            $this->setEntry($subMenuKey, $subMenu);\n        }\n\n        if (!$this->_entries[$subMenuKey] instanceof OntoWiki_Menu) {\n            throw new OntoWiki_Exception(\"Entry '$subMenuKey' is not a menu.\");\n        }\n\n        return $this->_entries[$subMenuKey];\n    }\n\n    /**\n     * Removes the entry with key $entryKey from the menu.\n     *\n     * @param string $entryKey\n     */\n    public function removeEntry($entryKey)\n    {\n        if (array_key_exists($entryKey, $this->_entries)) {\n            unset($this->_entries[$entryKey]);\n        }\n    }\n\n    /**\n     * Returns the menu instance as an array\n     *\n     * @param boolean $translate Whether to translate keys\n     * @param boolean $recursive Whether to recursively array-ize this instance\n     *\n     * @return array\n     */\n    public function toArray($translate = false, $recursive = true)\n    {\n        if ($translate) {\n            $translation = OntoWiki::getInstance()->translate;\n        }\n\n        $return = array();\n\n        foreach ($this->_entries as $key => $content) {\n            if ($translate) {\n                $key = $translation->translate($key);\n            }\n\n            if ($content instanceof self) {\n                if ($recursive) {\n                    $return[$key] = $content->toArray($translate, $recursive);\n                } else {\n                    $return[$key] = $content;\n                }\n            } else {\n                $return[$key] = $content;\n            }\n        }\n\n        return $return;\n    }\n\n    /**\n     * Returns the menu instance as an HTML list\n     *\n     * @return array\n     */\n    public function toHtmlList()\n    {\n        // TODO:\n    }\n\n    /**\n     * Returns the menu instance as a JSON array\n     *\n     * @return array\n     */\n    public function toJson($translate = true)\n    {\n        return json_encode($this->toArray($translate, true));\n    }\n}\n\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Message.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki message class.\n *\n * Encapsulates a message that needs to be saved for the user.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Message\n{\n    /**\n     * Message of type succes.\n     * The last operation was executed successfully.\n     */\n    const SUCCESS = 'success';\n\n    /**\n     * Message of type info.\n     * A notice to help the user interpret the application state.\n     */\n    const INFO = 'info';\n\n    /**\n     * Message of type warning.\n     * A notice to inform the user the he might not get the results desired\n     * due to a non-critical application error or false input.\n     */\n    const WARNING = 'warning';\n\n    /**\n     * Message of type error.\n     * A notice to inform the user of a critical application error that does\n     * not allow the application to perform under normal circumstances.\n     */\n    const ERROR = 'error';\n\n    /**\n     * Options array\n     *\n     * @var array\n     */\n    protected $_options = null;\n\n    /**\n     * The message's type\n     *\n     * @var string\n     */\n    protected $_type = null;\n\n    /**\n     * The message text\n     *\n     * @var string\n     */\n    protected $_text = null;\n\n    /**\n     * Constructor\n     *\n     * @param string $text\n     * @param string $type\n     */\n    public function __construct($text, $type = self::INFO, $options = array())\n    {\n        $this->_options = array_merge(\n            array(\n                 'escape'    => true,\n                 'translate' => true),\n            $options\n        );\n\n        $this->_type = $type;\n        $this->_text = $text;\n    }\n\n    /**\n     * Returns the type of the message\n     *\n     * @return string\n     */\n    public function getType()\n    {\n        return $this->_type;\n    }\n\n    /**\n     * Returns the message's text\n     *\n     * @return string\n     */\n    public function getText()\n    {\n        $text = $this->_translate($this->_text);\n        if (strlen($text) > 1000) {\n            $text = substr($text, 0, 1000) . '...';\n        }\n        $text = $this->_options['escape'] ? $this->getView()->escape($text) : $text;\n\n        return $text;\n    }\n\n    /**\n     * Returns the view object.\n     *\n     * @return OntoWiki_View\n     */\n    protected function getView()\n    {\n        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');\n        if (null === $viewRenderer->view) {\n            $viewRenderer->initView();\n        }\n        $view = clone $viewRenderer->view;\n        $view->clearVars();\n        return $view;\n    }\n\n    /**\n     * Returns the translator.\n     *\n     * @return Zend_Translate\n     */\n    protected function getTranslator()\n    {\n        return OntoWiki::getInstance()->translate;\n    }\n\n    private function _translate($text)\n    {\n        if (($this->_options['translate'] === true) && ($translator = $this->getTranslator()) !== null) {\n            return $translator->translate($text);\n        }\n        return $text;\n    }\n\n}\n\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Model/Exception.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki model exception\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Model\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Model_Exception extends OntoWiki_Exception\n{\n}\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Model/Hierarchy.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki resource hierarchy model class.\n *\n * Represents a hierarchy of resources, e.g. a class tree.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Model\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Model_Hierarchy extends OntoWiki_Model\n{\n    /**\n     * Direction of the hierarchy relation is downwards.\n     */\n    const DIRECTION_DOWN = 1;\n\n    /**\n     * Direction of the hierarchy relation is upwards.\n     */\n    const DIRECTION_UP = 2;\n\n    /**\n     * Default hierarchy options\n     *\n     * @var array\n     */\n    private $_options\n        = array(\n            'object_types'   => array(EF_RDFS_CLASS, EF_OWL_CLASS),\n            'ignore_ns'      => array(EF_RDF_NS, EF_RDFS_NS, EF_OWL_NS), // EF_OWL_THING\n            'sub_relation'   => EF_RDFS_SUBCLASSOF,\n            'sub_direction'  => self::DIRECTION_DOWN,\n            'inst_relation'  => EF_RDF_TYPE,\n            'inst_direction' => self::DIRECTION_DOWN,\n            'entry'          => null\n        );\n\n    /**\n     * Result array\n     *\n     * @var array\n     */\n    private $_hierarchyResults = null;\n\n    /**\n     * Root of the hierarchy\n     *\n     * @var Erfurt_Rdf_Resource\n     */\n    private $_current = null;\n\n    /**\n     * URL object used to built URLs\n     *\n     * @var OntoWiki_Url\n     */\n    private $_url = null;\n\n    /**\n     * Current session instance\n     *\n     * @var Zend_Session\n     */\n    private $_session = null;\n\n    protected $_titleHelper = null;\n\n    /**\n     * Constructor\n     *\n     * @see OntoWiki_Model_Abstract\n     */\n    public function __construct(Erfurt_Store $store, $graph, array $options = array())\n    {\n        parent::__construct($store, $graph);\n        $this->_options = array_merge($this->_options, $options);\n        $this->_current = (string)OntoWiki::getInstance()->selectedResource;\n        $this->_session = OntoWiki::getInstance()->session;\n\n        // HACK: if the graph itself is one that is normally ignored in other\n        // models, don't ignore it\n        if (in_array($this->_graph, $this->_options['ignore_ns'])) {\n            // TODO: remove only graph and imported namespaces\n            $this->_options['ignore_ns'] = array();\n        }\n    }\n\n    /**\n     * Returns whether the model contains data.\n     *\n     * @return boolean\n     */\n    public function hasData()\n    {\n        if (!$this->_hierarchyResults) {\n            $this->getHierarchy();\n        }\n\n        return !empty($this->_hierarchyResults);\n    }\n\n    /**\n     * Returns the resource hierarchy.\n     *\n     * @return array\n     */\n    public function getHierarchy()\n    {\n        if (!$this->_hierarchyResults) {\n            $query = $this->_buildQuery();\n\n            $this->_url = new OntoWiki_Url(array('route' => 'instances'), array('r', 'init'));\n\n            if ($result = $this->_model->sparqlQuery($query)) {\n                $this->_hierarchyResults = array();\n\n                // set titles\n                foreach ((array)$result as $row) {\n                    $this->_titleHelper->addResource($row['classUri']);\n                    if (!empty($row['sub'])) {\n                        $this->_titleHelper->addResource($row['sub']);\n                    }\n                }\n\n                foreach ((array)$result as $row) {\n                    $classUri = $row['classUri'];\n\n                    if (!array_key_exists($classUri, $this->_hierarchyResults)) {\n                        $this->_hierarchyResults[$classUri] = $this->_getEntry($classUri, !empty($row['sub']));\n                        $this->_titleHelper->addResource($classUri);\n                    }\n\n                    // do subclasses exists?\n                    if (!empty($row['sub'])) {\n                        $subClassUri = $row['sub'];\n\n                        $this->_hierarchyResults[$classUri]['children'][$subClassUri]\n                            = $this->_getEntry($subClassUri, !empty($row['subsub']));\n                    }\n                }\n            }\n        }\n\n        return $this->_hierarchyResults;\n    }\n\n    protected function _getEntry($resultUri, $hasChildren = false)\n    {\n        $classes = '';\n        if ($resultUri == $this->_current) {\n            $classes .= ' selected';\n        }\n\n        if ($hasChildren) {\n            $classes .= ' has-children';\n        }\n\n        $this->_url->setParam('r', $resultUri, true);\n\n        $hierarchyOpen = is_array($this->_session->hierarchyOpen) &&\n                         in_array($resultUri, $this->_session->hierarchyOpen);\n\n        $entry = array(\n            'uri'          => $resultUri,\n            'url'          => (string)$this->_url,\n            'classes'      => trim($classes),\n            'title'        => $this->_titleHelper->getTitle($resultUri, $this->_config->languages->locale),\n            'children'     => array(),\n            'has_children' => $hasChildren,\n            'open'         => $hierarchyOpen\n        );\n\n        return $entry;\n    }\n\n    protected function _buildQuery()\n    {\n        $query    = new Erfurt_Sparql_SimpleQuery();\n        $query->setSelectClause('SELECT DISTINCT ?classUri ?sub ?subsub ?subsubsub');\n\n        $whereSpecs = array();\n        $whereSpec  = '';\n        foreach ($this->_options['object_types'] as $type) {\n            $whereSpecs[] = '{?classUri a <' . $type . '>}';\n        }\n\n        // optional inference\n        if (!$this->_options['entry'] && $this->_inference) {\n            // instance retrieval is only applicable for classes\n            if ($this->_options['sub_relation'] == EF_RDFS_SUBCLASSOF) {\n                $whereSpecs[] = '{?instance a ?classUri.}';\n            }\n            // entities with a subtype must be a type\n            $whereSpecs[] = '{?subtype <' . $this->_options['sub_relation'] . '> ?classUri.}';\n        }\n\n        $whereSpec = implode(' UNION ', $whereSpecs);\n        $whereSpec .= ' FILTER (isURI(?classUri))';\n\n        // dont't show rdfs/owl entities and subtypes in the first level\n        if (!$this->_options['entry']) {\n            $whereSpec .= ' FILTER (regex(str(?super), \"^' . EF_OWL_NS . '\") || !bound(?super))';\n        }\n        $whereSpec .= ' OPTIONAL {?sub <' . $this->_options['sub_relation'] . '> ?classUri.\n                            OPTIONAL {?subsub <' . $this->_options['sub_relation'] . '> ?sub.\n                                  OPTIONAL {?subsubsub <' . $this->_options['sub_relation'] . '> ?subsub}\n                            }\n                        }';\n        $whereSpec .= ' OPTIONAL {?classUri <' . $this->_options['sub_relation'] . '> ?super. FILTER(isUri(?super))}';\n\n        // namespaces to be ignored, rdfs/owl-defined objects\n        foreach ($this->_options['ignore_ns'] as $ignore) {\n            $whereSpec .= ' FILTER (!regex(str(?classUri), \"^' . $ignore . '\"))';\n        }\n\n        // entry point into the class tree\n        if ($this->_options['entry']) {\n            $whereSpec .= ' FILTER (str(?super) = str(<' . $this->_options['entry'] . '>))';\n        }\n\n        $query->setWherePart('WHERE {' . $whereSpec . '}');\n\n        return $query;\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Model/Instances.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki resource list model class.\n *\n * Represents a list of resources (specified by filters) and their properties.\n *\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Model\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n * @author    Jonas Brekle <jonas.brekle@gmail.com>\n */\nclass OntoWiki_Model_Instances extends OntoWiki_Model\n{\n    /**\n     * all triple (?s ?p ?o). is added and removed to the resorceQuery on demand, but always stored here\n     *\n     * @var Erfurt_Sparql_Query2_IF_TriplesSameSubject\n     */\n    protected $_allTriple;\n\n    /**\n     * OntoWiki Application config\n     *\n     * @var Zend_Config\n     */\n    protected $_config = null;\n\n    /**\n     * OntoWiki Application object\n     *\n     * @var OntoWiki\n     */\n    protected $_owApp = null;\n\n    /**\n     * Properties whose values are to be fetched for each resource.\n     *\n     * @var array\n     */\n    protected $_shownProperties = array();\n\n    /**\n     * @var array\n     */\n    protected $_shownPropertiesConverted = array();\n\n    /**\n     * @var bool\n     */\n    protected $_shownPropertiesConvertedUptodate = false;\n\n    /**\n     * @var array\n     */\n    protected $_ignoredShownProperties\n        = array(//EF_RDF_TYPE\n        );\n\n    /**\n     * values of the set properties for all resources\n     */\n    protected $_values;\n\n    /**\n     * @var bool\n     */\n    protected $_valuesUptodate = false;\n\n    protected $_valueQueryUptodate = false;\n\n    /**\n     * all resources\n     */\n    protected $_resources = array();\n\n    /**\n     * @var bool\n     */\n    protected $_resourcesUptodate = false;\n\n    /**\n     *\n     * @var array transformed\n     */\n    protected $_resourcesConverted;\n\n    /**\n     * @var bool\n     */\n    protected $_resourcesConvertedUptodate = false;\n\n    /**\n     *\n     * @var Erfurt_Sparql_Query2_Var the var that is used in the resourcequery to bind all uri of list elements\n     */\n    protected $_resourceVar = null;\n\n    /**\n     * @var array stores all configured filters\n     */\n    protected $_filter = array();\n\n    /**\n     * Result array - what comes back when evaluating the query.\n     *\n     * @var array\n     */\n    protected $_results = null;\n\n    /**\n     * @var bool\n     */\n    protected $_resultsUptodate = false;\n\n    /**\n     * @var Erfurt_Sparql_Query2 the manged query that selects the resources in the list\n     */\n    protected $_resourceQuery = null;\n\n    /**\n     * @var Erfurt_Sparql_Query2_IF_TriplesSameSubject\n     */\n    protected $_sortTriple = null;\n\n    /**\n     * @var Erfurt_Sparql_Query2\n     */\n    protected $_valueQuery = null;\n\n    /**\n     * @var Erfurt_Sparql_Query2_Filter\n     */\n    protected $_valueQueryResourceFilter = null;\n\n    /**\n     * @var bool\n     */\n    protected $_useCache = true;\n\n    /**\n     * @var OntoWiki_Model_TitleHelper\n     */\n    protected $_titleHelper = null;\n\n    /**\n     * Constructor\n     */\n    public function __construct(Erfurt_Store $store, Erfurt_Rdf_Model $model, $options = array())\n    {\n        parent::__construct($store, $model);\n\n        if (isset($options[Erfurt_Store::USE_CACHE])) {\n            $this->_useCache = $options[Erfurt_Store::USE_CACHE];\n        }\n\n        $this->_resourceQuery = new Erfurt_Sparql_Query2();\n        $this->_resourceVar   = new Erfurt_Sparql_Query2_Var('resourceUri');\n\n        $this->_owApp   = OntoWiki::getInstance();\n        $this->_config  = $this->_owApp->config;\n\n        $this->_allTriple = new Erfurt_Sparql_Query2_Triple(\n            $this->_resourceVar,\n            new Erfurt_Sparql_Query2_Var('p'),\n            new Erfurt_Sparql_Query2_Var('o')\n        );\n        $this->addAllTriple();\n\n        //show resource uri\n        $this->_resourceQuery->addProjectionVar($this->_resourceVar);\n        $this->_resourceQuery\n            ->setLimit(10) //per default query only for 10 resources\n            ->setDistinct(true);\n\n        // when resourceVar is the object - prevent literals\n        $this->_resourceQuery->addFilter(\n            new Erfurt_Sparql_Query2_ConditionalAndExpression(\n                array(\n                    new Erfurt_Sparql_Query2_UnaryExpressionNot(\n                        new Erfurt_Sparql_Query2_isBlank($this->_resourceVar)\n                     )\n                )\n            )\n        );\n\n        //build value query\n        $this->_valueQuery = new Erfurt_Sparql_Query2();\n\n        $this->_valueQuery\n            ->addProjectionVar($this->_resourceVar)\n            ->setDistinct(true);\n\n        if (!isset($this->_config->lists) || $this->_config->lists->showTypeColumnByDefault === 'true') {\n           $this->addShownProperty(EF_RDF_TYPE, '__TYPE');\n        }\n\n        //set froms to the requested graph\n        $this->_valueQuery->addFrom((string)$model);\n        $this->_resourceQuery->addFrom((string)$model);\n\n        $this->invalidate();\n    }\n\n    /**\n     * dont keep the references to the query objects in $this->resourceQuery (the must be cloned too)\n     */\n    public function __clone()\n    {\n        foreach ($this as $key => $val) {\n            if (is_object($val) || (is_array($val))) {\n                $this->{$key} = unserialize(serialize($val));\n            }\n        }\n    }\n\n    /**\n     * redirect calls that cant be handled - both to the resource and value query.\n     * currently only methods regarding the FROM are allowed\n     *\n     * @param string $name\n     * @param array  $arguments\n     */\n    public function __call($name, $arguments)\n    {\n        $allowedMethods = array(\n            'addFrom', 'addFroms', 'removeFrom', 'removeFroms',\n            'hasFrom', 'getFrom', 'getFroms', 'setFrom', 'setFroms'\n        );\n        if (in_array($name, $allowedMethods)\n            && (method_exists($this->_valueQuery, $name) && method_exists($this->_resourceQuery, $name))\n        ) {\n            call_user_func_array(array($this->_valueQuery, $name), $arguments);\n            $ret = call_user_func_array(array($this->_resourceQuery, $name), $arguments);\n            if (strpos($name, 'get') === 0 || strpos($name, 'has') === 0) {\n                return $ret;\n            } else {\n                return $this;\n            }\n        } else {\n            throw new RuntimeException(\"OntoWiki_Model_Instances: method $name does not exists\");\n        }\n    }\n\n    public function __sleep()\n    {\n        //dont save reference to the store\n        return array_diff(array_keys(get_object_vars($this)), array('_store', '_titleHelper', '_config', '_owApp'));\n    }\n\n    public function __wakeup()\n    {\n        //after serialisation, the store state may has been changed\n        $this->invalidate();\n    }\n\n    /**\n     *\n     * Method for setting the store explicitely\n     * (necessary after unserialization from session for unavailable _dbconn\n     * resource handles etc.)\n     *\n     * @param Erfurt_Store $store\n     *\n     * @throws Exception for parameter type being incorrect (no Erfurt_Store Object)\n     * @return null\n     */\n    public function setStore(Erfurt_Store $store)\n    {\n        $this->_store = $store;\n        $this->restoreTitleHelper();\n    }\n\n    /**\n     *\n     * @throws OntoWiki_Exception\n     */\n    protected function restoreTitleHelper()\n    {\n        $this->_titleHelper = new OntoWiki_Model_TitleHelper($this->_model, $this->_store);\n    }\n\n    /**\n     * set title helper (for unittests)\n     *\n     * @param OntoWiki_Model_TitleHelper $t\n     */\n    public function setTitleHelper(OntoWiki_Model_TitleHelper $t)\n    {\n        $this->_titleHelper = $t;\n    }\n\n    /**\n     * get title helper (for unittests)\n     *\n     * @return OntoWiki_Model_TitleHelper\n     */\n    public function getTitleHelper()\n    {\n        return $this->_titleHelper;\n    }\n\n    /**\n     * add ?resourceUri ?p ?o to the resource query\n     * TODO: support objects as resources? optionally?\n     */\n    public function addAllTriple()\n    {\n        $this->_resourceQuery->addElement($this->_allTriple);\n    }\n\n    /**\n     * remove ?resourceUri ?p ?o from the resource query\n     */\n    public function removeAllTriple()\n    {\n        $this->_allTriple->remove($this->_resourceQuery);\n    }\n\n    /**\n     * get the object that represents the \"?resourceUri ?p ?o\" from the resource query.\n     * object exists, even if not part of the query\n     */\n    public function getAllTriple()\n    {\n        return $this->_allTriple;\n    }\n\n    /**\n     * Adds a property to the properties fetched for every resource.\n     *\n     * @param $propertyUri  The URI of the property\n     * @param $propertyName Name to be used for the variable\n     *\n     * @return OntoWiki_Model_Instances\n     */\n    public function addShownProperty(\n        $propertyUri,\n        $propertyName = null,\n        $inverse = false,\n        $datatype = null,\n        $hidden = false\n    ) {\n        if (in_array($propertyUri, $this->_ignoredShownProperties)) {\n            return $this; //no action\n        }\n\n        if (!$propertyName) {\n            $propertyName = preg_replace('/^.*[#\\/]/', '', $propertyUri);\n            $propertyName = str_replace('-', '', $propertyName);\n        }\n\n        $used = false;\n        foreach ($this->_shownProperties as $shownProp) {\n            if ($shownProp['name'] == $propertyName) {\n                $used = true;\n            }\n        }\n        //solve duplicate name problem by adding counter\n        if ($used) {\n            $counter = 2;\n            while ($used) {\n                $name = $propertyName . $counter;\n                ++$counter;\n                $used = false;\n                foreach ($this->_shownProperties as $shownProp) {\n                    if ($shownProp['name'] == $name) {\n                        $used = true;\n                    }\n                }\n            }\n\n            $propertyName = $name;\n        }\n\n        $ret = Erfurt_Sparql_Query2_Abstraction_ClassNode::addShownPropertyHelper(\n            $this->_valueQuery,\n            $this->_resourceVar,\n            $propertyUri,\n            $propertyName,\n            $inverse\n        );\n\n        $this->_shownProperties[$propertyUri . '-' . ($inverse ? 'inverse' : 'direct')] = array(\n            'uri'          => $propertyUri,\n            'name'         => $propertyName,\n            'inverse'      => $inverse,\n            'datatype'     => $datatype,\n            'varName'      => $ret['var']->getName(),\n            'var'          => $ret['var'],\n            'optionalpart' => $ret['optional'],\n            'filter'       => $ret['filter'],\n            'hidden'       => $hidden\n        );\n\n        $this->_valuesUptodate  = false; // getValues will not use the cache next time\n        $this->_resultsUptodate = false;\n\n        return $this;\n    }\n\n    /**\n     * add a shown property, that is more complex.\n     * provide own triples, they will wrapped in an optional and a projection var will be added.\n     *\n     * @param array                    $triples\n     * @param Erfurt_Sparql_Query2_Var $var\n     * @param boolean                  $hidden\n     *\n     * @return OntoWiki_Model_Instances\n     */\n    public function addShownPropertyCustom($triples, $var, $hidden = false)\n    {\n        //add\n        $optional = new Erfurt_Sparql_Query2_OptionalGraphPattern();\n        $optional->addElements($triples);\n        $this->_valueQuery->getWhere()->addElement($optional);\n        $this->_valueQuery->addProjectionVar($var);\n\n        //save\n        $this->_shownProperties['custom' . count($this->_shownProperties)] = array(\n            'uri'          => null,\n            'name'         => 'custom' . count($this->_shownProperties),\n            'inverse'      => false,\n            'datatype'     => null,\n            'varName'      => $var->getName(),\n            'var'          => $var,\n            'optionalpart' => $triples,\n            'filter'       => array(),\n            'hidden'       => $hidden\n        );\n        $this->_valuesUptodate  = false; // getValues will not use the cache next time\n        $this->_resultsUptodate = false;\n\n        return $this;\n    }\n\n    /**\n     * remove a property that has been added before\n     *\n     * @param string $key the uri\n     */\n    public function removeShownProperty($property, $inverse)\n    {\n        $key = $property . '-' . ($inverse ? 'inverse' : 'direct');\n        if (isset($this->_shownProperties[$key])) {\n            $prop = $this->_shownProperties[$key];\n            $this->_valueQuery->removeProjectionVar($prop['var']);\n            $prop['optionalpart']->remove($this->_valueQuery);\n            unset($this->_shownProperties[$key]);\n\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * queries for values (unconverted)\n     *\n     * @return array\n     */\n    public function getResults()\n    {\n        $this->updateValueQuery();\n\n        if (!$this->_resultsUptodate) {\n            $this->_results         = $this->_store->sparqlQuery(\n                $this->_valueQuery,\n                array(\n                     Erfurt_Store::RESULTFORMAT => Erfurt_Store::RESULTFORMAT_EXTENDED,\n                     Erfurt_Store::USE_CACHE    => $this->_useCache\n                )\n            );\n            $this->_resultsUptodate = true;\n        }\n\n        return $this->_results;\n    }\n\n    /**\n     * add a filter from the filter box - these filters match some predefined schemes\n     * (like \"equals\", \"contains\")\n     *\n     * @param string  $property\n     * @param boolean $isInverse     whether the property is a indirect property of the resources\n     * @param string  $propertyLabel label affects the created variable\n     * @param string  $filter        the type of filter (\"equals\", \"bound\", \"larger\", \"smaller\", \"between\", \"contains\")\n     * @param string  $value\n     * @param string  $valueSecondary\n     * @param string  $valuetype     (\"uri\" or \"literal\" or \"typed-literal\")\n     * @param string  $literaltype   (if valuetype is set to \"typed-literal\", you can pass a URI here)\n     * @param boolean $hidden        whether to hide this filter in the filter box GUI\n     * @param string  $id            optional predined ID, will be generated normally\n     * @param boolean $negate        whether to invert the condition\n     * @param boolean $optional\n     *\n     * @return string id\n     * @throws RuntimeException\n     */\n    public function addFilter(\n        $property,\n        $isInverse,\n        $propertyLabel,\n        $filter,\n        $value = null,\n        $valueSecondary = null,\n        $valuetype = 'literal',\n        $literaltype = null,\n        $hidden = false,\n        $id = null,\n        $negate = false,\n        $optional = false\n    ) {\n        if ($id == null) {\n            $id = 'box' . count($this->_filter);\n        } else {\n            if (isset($this->_filter[$id])) {\n                $this->removeFilter($id);\n            }\n        }\n        $prop = new Erfurt_Sparql_Query2_IriRef($property);\n        if (!empty($value)) {\n            switch ($valuetype) {\n                case 'uri':\n                    $valueObj = new Erfurt_Sparql_Query2_IriRef($value);\n\n                    if (!empty($valueSecondary)) {\n                        $valueSecondaryObj = new Erfurt_Sparql_Query2_IriRef($valueSecondary);\n                    }\n                    break;\n                case 'literal':\n                    if (!empty($literaltype)) {\n                        //with language tags\n                        $valueObj = new Erfurt_Sparql_Query2_RDFLiteral(\n                            $value,\n                            $literaltype\n                        );\n                        if (!empty($valueSecondary)) {\n                            $valueSecondaryObj = new Erfurt_Sparql_Query2_RDFLiteral(\n                                $valueSecondary,\n                                $literaltype\n                            );\n                        }\n                    } else {\n                        //no language tags\n                        if (is_array($value)) {\n                            $value = current($value);\n                        }\n                        $meta = '';\n                        if (is_scalar($value) && !is_string($value) && !is_array($value)) {\n                            $meta = gettype($value);\n                        }\n                        $valueObj = new Erfurt_Sparql_Query2_RDFLiteral($value, $meta);\n                        if (!empty($valueSecondary)) {\n                            $valueSecondaryObj = new Erfurt_Sparql_Query2_RDFLiteral($valueSecondary, $meta);\n                        }\n                    }\n                    break;\n                case 'typed-literal':\n                    if (in_array($literaltype, Erfurt_Sparql_Query2_RDFLiteral::$knownShortcuts)) {\n                        //is something like \"bool\" or \"int\" - will be converted from \"1\"^^xsd:int to 1\n                        $valueObj = new Erfurt_Sparql_Query2_RDFLiteral($value, $literaltype);\n                        if (!empty($valueSecondary)) {\n                            $valueSecondaryObj = new Erfurt_Sparql_Query2_RDFLiteral($valueSecondary, $literaltype);\n                        }\n                    } else {\n                        // is a uri\n                        $valueObj = new Erfurt_Sparql_Query2_RDFLiteral(\n                            $value,\n                            new Erfurt_Sparql_Query2_IriRef($literaltype)\n                        );\n                        if (!empty($valueSecondary)) {\n                            $valueSecondaryObj = new Erfurt_Sparql_Query2_RDFLiteral(\n                                $valueSecondary,\n                                new Erfurt_Sparql_Query2_IriRef($literaltype)\n                            );\n                        }\n                    }\n                    break;\n                default:\n                    throw new RuntimeException(\n                        'called Ontowiki_Model_Instances::addFilter with ' .\n                        'unknown param-value: valuetype = \"' . $valuetype . '\"'\n                    );\n            }\n        }\n\n        switch ($filter) {\n            case 'contains':\n                $var = new Erfurt_Sparql_Query2_Var($propertyLabel);\n                if (!$isInverse) {\n                    $triple = $this->_resourceQuery->addTriple(\n                        $this->_resourceVar,\n                        $prop,\n                        $var\n                    );\n                } else {\n                    $triple = $this->_resourceQuery->addTriple(\n                        $var,\n                        $prop,\n                        $this->_resourceVar\n                    );\n                }\n                $valueObj->setValue(str_replace(\"\\\\\", \"\\\\\\\\\", preg_quote($valueObj->getValue())));\n\n                $addFilter = null;\n                if (!$negate) {\n                    $addFilter = new Erfurt_Sparql_Query2_Regex(\n                        new Erfurt_Sparql_Query2_Str($var),\n                        $valueObj\n                    );\n                } else {\n                    $addFilter = new Erfurt_Sparql_Query2_UnaryExpressionNot(\n                        new Erfurt_Sparql_Query2_Regex(\n                            new Erfurt_Sparql_Query2_Str($var),\n                            $valueObj\n                        )\n                    );\n                }\n\n                $filterObj = $this->_resourceQuery->addFilter($addFilter);\n                break;\n            case 'equals':\n                if ($valuetype == 'literal') {\n                    $valueVar = new Erfurt_Sparql_Query2_Var($propertyLabel);\n                    if (!$isInverse) {\n                        $triple = new Erfurt_Sparql_Query2_Triple(\n                            $this->_resourceVar,\n                            $prop,\n                            $valueVar\n                        );\n                    } else {\n                        throw new RuntimeException(\n                            'literal as value for an inverse property ' .\n                            'is a literal subject which is not allowed'\n                        );\n                    }\n\n                    if ($negate) {\n                        $optionalGP = new Erfurt_Sparql_Query2_OptionalGraphPattern();\n                        $optionalGP->addElement($triple);\n\n                        if ($optional) {\n                            $orExpression = new Erfurt_Sparql_Query2_ConditionalOrExpression();\n                            $orExpression->addElement(\n                                new Erfurt_Sparql_Query2_UnaryExpressionNot(\n                                    new Erfurt_Sparql_Query2_bound($valueVar)\n                                )\n                            );\n                            $orExpression->addElement(new Erfurt_Sparql_Query2_NotEquals($valueVar, $valueObj));\n\n                            $filterObj = $optionalGP->addFilter($orExpression);\n                        } else {\n                            $filterObj = $optionalGP->addFilter(\n                                new Erfurt_Sparql_Query2_NotEquals($valueVar, $valueObj)\n                            );\n                        }\n\n                        $this->_resourceQuery->addElement($optionalGP);\n                        $triple = $optionalGP;\n                    } else {\n                        $this->_resourceQuery->addElement($triple);\n                        $filterObj = $this->_resourceQuery->addFilter(\n                            new Erfurt_Sparql_Query2_Regex(\n                                new Erfurt_Sparql_Query2_Str($valueVar),\n                                new Erfurt_Sparql_Query2_RDFLiteral(\n                                    '^' . str_replace(\"\\\\\", \"\\\\\\\\\", preg_quote($value)) . '$'\n                                )\n                            )\n                        );\n                    }\n                } else {\n                    if (!$isInverse) {\n                        $triple = $this->_resourceQuery->addTriple(\n                            $this->_resourceVar,\n                            $prop,\n                            $valueObj\n                        );\n                    } else {\n                        $triple = $this->_resourceQuery->addTriple(\n                            $valueObj,\n                            $prop,\n                            $this->_resourceVar\n                        );\n                    }\n                }\n                break;\n            case 'larger':\n                $var = new Erfurt_Sparql_Query2_Var($propertyLabel);\n                if (!$isInverse) {\n                    $triple = $this->_resourceQuery->addTriple(\n                        $this->_resourceVar,\n                        $prop,\n                        $var\n                    );\n                } else {\n                    $triple = $this->_resourceQuery->addTriple(\n                        $var,\n                        $prop,\n                        $this->_resourceVar\n                    );\n                }\n\n                $filterObj = $this->_resourceQuery->addFilter(\n                    new Erfurt_Sparql_Query2_Larger($var, $valueObj)\n                );\n                break;\n            case 'smaller':\n                $var = new Erfurt_Sparql_Query2_Var($propertyLabel);\n                if (!$isInverse) {\n                    $triple = $this->_resourceQuery->addTriple(\n                        $this->_resourceVar,\n                        $prop,\n                        $var\n                    );\n                } else {\n                    $triple = $this->_resourceQuery->addTriple(\n                        $var,\n                        $prop,\n                        $this->_resourceVar\n                    );\n                }\n\n                $filterObj = $this->_resourceQuery->addFilter(\n                    new Erfurt_Sparql_Query2_Smaller($var, $valueObj)\n                );\n                break;\n            case 'between':\n                $var = new Erfurt_Sparql_Query2_Var($propertyLabel);\n                if (!$isInverse) {\n                    $triple = $this->_resourceQuery->addTriple(\n                        $this->_resourceVar,\n                        $prop,\n                        $var\n                    );\n                } else {\n                    $triple = $this->_resourceQuery->addTriple(\n                        $var,\n                        $prop,\n                        $this->_resourceVar\n                    );\n                }\n\n                $filterObj = $this->_resourceQuery->addFilter(\n                    new Erfurt_Sparql_Query2_ConditionalAndExpression(\n                        array(\n                             new Erfurt_Sparql_Query2_Larger($var, $valueObj),\n                             new Erfurt_Sparql_Query2_Smaller($var, $valueSecondaryObj)\n                        )\n                    )\n                );\n                break;\n            case 'bound':\n                $var = new Erfurt_Sparql_Query2_Var($propertyLabel);\n\n                if (!$isInverse) {\n                    $triple = new Erfurt_Sparql_Query2_Triple(\n                        $this->_resourceVar,\n                        $prop,\n                        $var\n                    );\n                } else {\n                    $triple = new Erfurt_Sparql_Query2_Triple(\n                        $var,\n                        $prop,\n                        $this->_resourceVar\n                    );\n                }\n                if ($negate) {\n                    $optionalGP = new Erfurt_Sparql_Query2_OptionalGraphPattern();\n                    $optionalGP->addElement($triple);\n                    $this->_resourceQuery->addElement($optionalGP);\n                    $triple = $optionalGP; // to save this obj (see underneath 20 lines)\n                } else {\n                    $this->_resourceQuery->addElement($triple);\n                }\n\n                if ($negate) {\n                    $filterObj = $this->_resourceQuery->addFilter(\n                        new Erfurt_Sparql_Query2_UnaryExpressionNot(\n                            new Erfurt_Sparql_Query2_bound($var)\n                        )\n                    );\n                }\n                break;\n            default:\n                throw new RuntimeException(\n                    'called Ontowiki_Model_Instances::addFilter with ' .\n                    'unknown param-value: filtertype=' . $filter\n                );\n        }\n\n        //these filters bring their own triple\n        $this->removeAllTriple();\n\n        //save\n        $this->_filter[$id] = array(\n            'id'            => $id,\n            'mode'          => 'box',\n            'property'      => $property,\n            'isInverse'     => $isInverse,\n            'propertyLabel' => $propertyLabel,\n            'filter'        => $filter,\n            'value1'        => $value,\n            'value2'        => $valueSecondary,\n            'valuetype'     => $valuetype,\n            'literaltype'   => $literaltype,\n            'hidden'        => $hidden,\n            'negate'        => $negate,\n            'objects'       => array($triple, isset($filterObj) ? $filterObj : null)\n        );\n\n        $this->invalidate();\n\n        return $id;\n    }\n\n    /**\n     * remove a filter by id\n     *\n     * @param string $id\n     *\n     * @return OntoWiki_Model_Instances $this\n     */\n    public function removeFilter($id)\n    {\n        if (isset($this->_filter[$id])) {\n            foreach ($this->_filter[$id]['objects'] as $obj) {\n                if ($obj instanceof Erfurt_Sparql_Query2_ElementHelper) {\n                    $obj->remove($this->_resourceQuery);\n                }\n            }\n\n            unset($this->_filter[$id]);\n\n            //when all deleted\n            //empty == 1 left because this last element is the \"isUri and !isBlank\"-filter\n            if (count($this->_resourceQuery->getWhere()->getElements()) == 1) {\n                $this->addAllTriple();\n            }\n\n            $this->invalidate();\n\n            return $this;\n        }\n    }\n\n    /**\n     * get the internal array that holds the filters\n     *\n     * @return array\n     */\n    public function getFilter()\n    {\n        return $this->_filter;\n    }\n\n    /**\n     *\n     * @param string $type the uri of the class\n     * @param string $id\n     * @param array  $options\n     *\n     * @return int id\n     */\n    public function addTypeFilter($type, $id = null, $option = array())\n    {\n        if ($id == null) {\n            $id = 'type' . count($this->_filter);\n        } else {\n            if (isset($this->_filter[$id])) {\n                $this->removeFilter($id);\n            }\n        }\n\n        //shortcut navigation - only a rdfs class given\n        $options['mode']            = 'instances';\n        $options['type']            = $type;\n        $options['memberPredicate'] = EF_RDF_TYPE;\n        $options['withChilds']      = isset($option['withChilds']) ? $option['withChilds'] : true;\n\n        $options['hierarchyUp']        = EF_RDFS_SUBCLASSOF;\n        $options['hierarchyIsInverse'] = true;\n        $options['direction'] = 1; // down the tree\n\n        $memberPredicate = $options['memberPredicate'];\n        if (is_string($memberPredicate)) {\n            $memberPredicate = new Erfurt_Sparql_Query2_IriRef($memberPredicate);\n        }\n\n        if (!($memberPredicate instanceof Erfurt_Sparql_Query2_Verb)) {\n            throw new RuntimeException(\n                'Option \"member_predicate\" passed to Ontowiki_Model_Instances ' .\n                'must be an instance of Erfurt_Sparql_Query2_IriRef ' .\n                'or string instance of ' . typeHelper($memberPredicate) . ' given'\n            );\n        }\n\n        $type       = new Erfurt_Sparql_Query2_IriRef($options['type']);\n        $subClasses = array();\n        if ($options['withChilds']) {\n            $subClasses = array_keys(\n                // get subclasses:\n                $this->_store->getTransitiveClosure(\n                    $this->_graph,\n                    $options['hierarchyUp'],\n                    array($type->getIri()),\n                    $options['hierarchyIsInverse']\n                )\n            );\n        } else {\n            if (isset($options['subtypes'])) { //dont query, take the given. maybe the new navigation can use this\n                $subClasses = $options['subtypes'];\n            } else {\n                $subClasses = array();\n            }\n        }\n\n        if (count($subClasses) > 1) {\n            // there are subclasses. \"1\" because the class itself is somehow included in the subclasses...\n            $typeVar = new Erfurt_Sparql_Query2_Var($type);\n            $triple  = $this->_resourceQuery->addTriple(\n                $this->_resourceVar,\n                $memberPredicate,\n                $typeVar\n            );\n\n            $or = new Erfurt_Sparql_Query2_ConditionalOrExpression();\n            foreach ($subClasses as $subclass) {\n                $or->addElement(\n                    new Erfurt_Sparql_Query2_Equals(\n                        $typeVar,\n                        new Erfurt_Sparql_Query2_IriRef($subclass)\n                    )\n                );\n            }\n\n            $filterObj = $this->_resourceQuery->addFilter($or);\n        } else {\n            // no subclasses\n            $triple = $this->_resourceQuery->addTriple(\n                $this->_resourceVar,\n                $memberPredicate,\n                new Erfurt_Sparql_Query2_IriRef($type->getIri())\n            );\n        }\n\n        //save\n        $this->_filter[$id] = array(\n            'id'         => $id,\n            'mode'       => 'rdfsclass',\n            'rdfsclass'  => $options['type'],\n            'withChilds' => $options['withChilds'],\n            'objects'    => array($triple, isset($filterObj) ? $filterObj : null)\n        );\n\n        //these filters bring there own triple\n        $this->removeAllTriple();\n\n        $this->invalidate();\n\n        return $id;\n    }\n\n    public function addDisjunctiveTypeFilters(array $types, $id = null, array $options = array())\n    {\n        if (!$id) {\n            $id = 'type' . count($this->_filter);\n        } else {\n            if (isset($this->_filter[$id])) {\n                $this->removeFilter($id);\n            }\n        }\n\n        // Create UNION of all types\n        $union = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n        foreach ($types as $type) {\n            $union->addElement(\n                new Erfurt_Sparql_Query2_GroupGraphPattern(\n                    new Erfurt_Sparql_Query2_Triple(\n                        $this->_resourceVar,\n                        new Erfurt_Sparql_Query2_IriRef(EF_RDF_TYPE),\n                        new Erfurt_Sparql_Query2_IriRef($type)\n                    )\n                )\n            );\n        }\n\n        // Add UNION element\n        $this->_resourceQuery->addElement($union);\n\n        // Remove default ?s ?p ?o pattern\n        $this->_allTriple->remove($this->_resourceQuery);\n    }\n\n    /**\n     *\n     * @param string $str\n     * @param string $id optional\n     *\n     * @return string the id used\n     */\n    public function addSearchFilter($str, $id = null)\n    {\n        if ($id == null) {\n            $id = 'search' . count($this->_filter);\n        } else {\n            if (isset($this->_filter[$id])) {\n                $this->removeFilter($id);\n            }\n        }\n        $pattern = $this->_store->getSearchPattern(\n            $str,\n            $this->_graph\n        );\n\n        $vars = array();\n\n        foreach ($pattern as $element) {\n            if (method_exists($element, 'getVars')) {\n                $vars = array_merge($vars, $element->getVars());\n            }\n        }\n        $count = count($this->_filter);\n        foreach ($vars as $var) {\n            if ($var->getName() == 'o' || $var->getName() == 'p') {\n                $var->setName($var->getName() . $count);\n            }\n        }\n        $this->_resourceQuery->addElements($pattern);\n\n        //save\n        $this->_filter[$id] = array(\n            'id'         => $id,\n            'mode'       => 'search',\n            'searchText' => $str,\n            'objects'    => $pattern\n        );\n\n        //these filters bring there own triple\n        $this->removeAllTriple();\n\n        $this->invalidate();\n\n        return $id;\n    }\n\n    /**\n     * add arbitrary triples to the query to filter (used by the navigation)\n     *\n     * @param array  $triples\n     * @param string $id\n     *\n     * @return string the id used\n     */\n    public function addTripleFilter($triples, $id = null)\n    {\n        if ($id == null) {\n            $id = 'triple' . count($this->_filter);\n        } else {\n            if (isset($this->_filter[$id])) {\n                $this->removeFilter($id);\n            }\n        }\n        $this->_resourceQuery->addElements($triples);\n\n        //save\n        $this->_filter[$id] = array(\n            'id'      => $id,\n            'mode'    => 'triples',\n            'objects' => $triples\n        );\n\n        //these filters bring there own triple\n        $this->removeAllTriple();\n\n        $this->invalidate();\n\n        return $id;\n    }\n\n    /**\n     * get the query used to get the values (shownproperties)\n     *\n     * @deprecated\n     * @see getValueQuery\n     * @return Erfurt_Sparql_Query2\n     */\n    public function getQuery()\n    {\n        return $this->getValueQuery();\n    }\n\n    /**\n     * get the query used to get the values (shownproperties)\n     *\n     * @return Erfurt_Sparql_Query2\n     */\n    public function getValueQuery()\n    {\n        $this->updateValueQuery();\n\n        return $this->_valueQuery;\n    }\n\n    /**\n     * get the query used for getting the resources. incl. filter\n     *\n     * @return Erfurt_Sparql_Query2\n     */\n    public function getResourceQuery()\n    {\n        return $this->_resourceQuery;\n    }\n\n    /**\n     * build a link that recreates the current state on a different system\n     *\n     * @return string\n     */\n    public function getPermalink($listname)\n    {\n        $url       = new OntoWiki_Url();\n        $url->init = true;\n\n        if ($this->getOffset() != 0 && $this->getLimit() != 0) {\n            $url->p = (($this->getOffset() / $this->getLimit()) + 1);\n        }\n        if ($this->getLimit() != 10) {\n            $url->limit = $this->getLimit();\n        }\n        $url->list = $listname;\n\n        $conf = array();\n\n        if (is_array($this->_shownProperties) && count($this->_shownProperties) > 0) {\n            $conf['shownProperties'] = array();\n\n            foreach ($this->_shownProperties as $shownProperty) {\n                $conf['shownProperties'][] = array(\n                    'uri'     => $shownProperty['uri'],\n                    'label'   => $shownProperty['name'],\n                    'inverse' => $shownProperty['inverse'],\n                    'action'  => 'add'\n                );\n            }\n        }\n        if (is_array($this->_filter) && count($this->_filter) > 0) {\n            $conf['filter'] = array();\n\n            foreach ($this->_filter as $filter) {\n                switch ($filter['mode']) {\n                    case 'box':\n                        $arr              = array(\n                            'action' => 'add',\n                            'mode'   => 'box'\n                        );\n                        $arr              = array_merge($arr, $filter);\n                        $conf['filter'][] = $arr;\n                        break;\n                    case 'search':\n                        $conf['filter'][] = array(\n                            'action'     => 'add',\n                            'mode'       => 'search',\n                            'searchText' => $filter['searchText']\n                        );\n                        break;\n                    case 'rdfsclass':\n                        $conf['filter'][] = array(\n                            'action'    => 'add',\n                            'mode'      => 'rdfsclass',\n                            'rdfsclass' => $filter['rdfsclass']\n                        );\n                        break;\n                    case 'triples':\n                        //problem: php objects can not be json encoded ...\n                        break;\n                }\n            }\n            $url->m = (string)$this->_model;\n            if (!empty($conf)) {\n                $url->instancesconfig = json_encode($conf);\n            }\n        }\n\n        return $url;\n    }\n\n    /**\n     * @return Erfurt_sparql_Query2_Var the var that is used as subject in the query\n     */\n    public function getResourceVar()\n    {\n        return $this->_resourceVar;\n    }\n\n    /**\n     * Returns the property values for all resources at once.\n     * This method receives its values from Resources from the ResourcePool.\n     * @return array\n     */\n    public function getValues()\n    {\n        if (empty($this->_resources)) {\n            return array();\n        }\n\n        //first we have to create the list of resources that have to be shown.\n        $pool = Erfurt_App::getInstance()->getResourcePool();\n        $resources = array();\n        $valueResults = array();\n        foreach ($this->_resources as $item) {\n            $resourceUri = $item['value'];\n            $resource = $pool->getResource($resourceUri, (string)$this->_model);\n\n            //secondly we have to walk throw the list of interesting properties to bw shown\n            $valueResults[$resourceUri] = array();\n            foreach ($this->_shownProperties as $key => $property) {\n                $propertyUri = $property['uri'];\n                $variable = $property['var']->getName();\n                $propertyResource = $pool->getResource($propertyUri, (string)$this->_model);\n\n                //now we have to extract the values according the current property from the resource\n                $values = $resource->getMemoryModel()->getValues($resourceUri, $propertyUri);\n                foreach ($values as $value) {\n\n                    //initialising the value with the original content\n                    $revisedValue = $value['value'];\n                    $link = null;\n\n                    //but we have to do something specific if the value is a resource\n                    if ($value['type'] == 'uri') {\n                        // skip blanknode values here due to backend problems with filters\n                        if (substr($value['value'], 0, 2) == '_:') {\n                            continue;\n                        }\n\n                        $url = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n                        $link = (string)$url->setParam('r', $value['value'], true);\n                        $event = new Erfurt_Event('onDisplayObjectPropertyValue');\n                        $event->property = $propertyUri;\n                        $event->value = $value['value'];\n                        $revisedValue = $event->trigger();\n\n                        // set default if event has not been handled\n                        if (!$event->handled()) {\n                            $revisedValue = $this->_titleHelper->getTitle($value['value']);\n                        }\n\n                    } else { // the value is not a resource but a literal value\n                        $event           = new Erfurt_Event('onDisplayLiteralPropertyValue');\n                        $event->property = $propertyUri;\n                        $event->value    = $value['value'];\n                        $event->setDefault($value['value']);\n                        $revisedValue = $event->trigger();\n                    }\n                    //now we have to assign the facts to the result array\n                    $valueResults[$resourceUri][$variable][] = array(\n                        'value'     => $revisedValue,\n                        'origvalue' => $value['value'],\n                        'type'      => $value['type'],\n                        'url'       => $link,\n                        'uri'       => $value['value'] //TODO: rename (can be literal)\n                    );\n                }\n            }\n        }\n\n        //some assignments\n        $this->_values         = $valueResults;\n        $this->_valuesUptodate = true;\n\n        //returning the result\n        return $valueResults;\n    }\n\n    /**\n     * Returns the property values for all resources at once.\n     * This method generate one SPARQL query to receive all values .\n     * Original Name was getValues()\n     * @return array\n     */\n    public function getValuesBySingleQuery()\n    {\n        if ($this->_valuesUptodate) {\n            return $this->_values;\n        } else {\n            $this->updateValueQuery();\n        }\n\n        if (empty($this->_resources)) {\n            return array();\n        }\n\n        $this->getResults();\n\n        $result = array();\n        if (isset($this->_results['results']['bindings'])) {\n            $result = $this->_results['results']['bindings'];\n        }\n\n        //fill titlehelper\n        foreach ($result as $row) {\n            foreach ($this->_shownProperties as $property) {\n                if (isset($row[$property['varName']])\n                    && $row[$property['varName']]['type'] == 'uri'\n                    && substr($row[$property['varName']]['value'], 0, 2) != '_:'\n                ) {\n                    $this->_titleHelper->addResource($row[$property['varName']]['value']);\n                }\n            }\n            if (isset($row['__TYPE']) && $row['__TYPE']['type'] == 'uri' //sould both be true\n            ) {\n                $this->_titleHelper->addResource($row['__TYPE']['value']);\n            }\n            $this->_titleHelper->addResource($row[$this->_resourceVar->getName()]['value']);\n        }\n\n        $valueResults = array();\n\n        foreach ($result as $row) {\n            $resourceUri = $row[$this->_resourceVar->getName()]['value'];\n\n            if (!array_key_exists($resourceUri, $valueResults)) {\n                $valueResults[$resourceUri] = array();\n            }\n\n            $url = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n\n            $value = null;\n            $link  = null;\n\n            foreach ($row as $varName => $data) {\n                if (!isset($valueResults[$resourceUri][$varName])) {\n                    $valueResults[$resourceUri][$varName] = array();\n                }\n\n                if ($data['type'] == 'uri') {\n                    if (substr($data['value'], 0, 2) == '_:') {\n                        continue; // skip blanknode values here due to backend problems with filters\n                    }\n\n                    // object type is uri --> handle object property\n                    $objectUri = $data['value'];\n                    $url->setParam('r', $objectUri, true);\n                    $link = (string)$url;\n\n                    // set up event\n                    $event = new Erfurt_Event('onDisplayObjectPropertyValue');\n\n                    //find uri\n                    foreach ($this->_shownProperties as $property) {\n                        if ($varName == $property['varName']) {\n                            $event->property = $property['uri'];\n                        }\n                    }\n\n                    $event->value = $objectUri;\n\n                    // trigger\n                    $value = $event->trigger();\n\n                    // set default if event has not been handled\n                    if (!$event->handled()) {\n                        $value = $this->_titleHelper->getTitle($objectUri);\n                    }\n                } else {\n                    // object is a literal\n                    $object = $data['value'];\n\n                    $propertyUri = null;\n                    foreach ($this->_shownProperties as $property) {\n                        if ($varName == $property['varName']) {\n                            $propertyUri = $property['uri'];\n                        }\n                    }\n\n                    if ($object !== null) {\n                        // set up event\n                        $event           = new Erfurt_Event('onDisplayLiteralPropertyValue');\n                        $event->property = $propertyUri;\n                        $event->value    = $object;\n                        $event->setDefault($object);\n\n                        // trigger\n                        $value = $event->trigger();\n                    }\n                }\n\n                //check for dulplicate values\n                if (isset($valueResults[$resourceUri][$varName])) {\n                    foreach ($valueResults[$resourceUri][$varName] as $old) {\n                        if ($old['origvalue'] == $data['value'] && $old['type'] == $data['type']) {\n                            $link = null;\n                            continue 2; // dont add this value\n                        }\n                    }\n                }\n\n                //add value\n                $valueResults[$resourceUri][$varName][] = array(\n                    'value'     => $value,\n                    'origvalue' => $data['value'],\n                    'type'      => $data['type'],\n                    'url'       => $link,\n                    'uri'       => $data['value'] //TODO: rename (can be literal) -> use origvalue + type to output uri\n                );\n\n                $value = null;\n                $link  = null;\n            }\n        }\n\n        foreach ($this->getShownResources() as $resource) {\n            if (!isset($valueResults[$resource['value']])) {\n                //there are no statements about this resource\n                $valueResults[$resource['value']] = array();\n            }\n        }\n\n        $this->_values         = $valueResults;\n        $this->_valuesUptodate = true;\n        return $valueResults;\n    }\n\n    public function getAllPropertiesQuery($inverse = false)\n    {\n        $query = clone $this->_resourceQuery;\n        $query\n            ->removeAllProjectionVars()\n            ->setDistinct(true)\n            ->setLimit(0)\n            ->setOffset(0);\n        $vars        = $query->getWhere()->getVars();\n        $resourceVar = $this->getResourceVar();\n        foreach ($vars as $var) {\n            if ($var->getName() == $resourceVar->getName()) {\n                $var->setName('listresource');\n            }\n        }\n        $listResource = new Erfurt_Sparql_Query2_Var('listresource');\n        $predVar      = new Erfurt_Sparql_Query2_Var('resourceUri');\n        if (!$inverse) {\n            $query->addTriple(\n                $listResource,\n                $predVar,\n                new Erfurt_Sparql_Query2_Var('showPropsObj')\n            );\n        } else {\n            $query->addTriple(\n                new Erfurt_Sparql_Query2_Var('showPropsSubj'),\n                $predVar,\n                $listResource\n            );\n        }\n\n        $query\n            ->addProjectionVar($predVar)\n            ->getOrder()\n            ->clear();\n\n        return $query;\n    }\n\n    /**\n     * Returns a list of properties used by the current list of resources.\n     * Original Name was getValues()\n     * @return array\n     */\n    public function getAllProperties($inverse = false)\n    {\n        if ((empty($this->_resources) && $this->_resourcesUptodate)) {\n            return array();\n        }\n\n        $pool = Erfurt_App::getInstance()->getResourcePool();\n        $propertyUris = array();\n\n        $memoryModel = new Erfurt_Rdf_MemoryModel();\n\n        foreach ($this->_resources as $item) {\n            $resourceUri = $item['value'];\n            $resource = $pool->getResource($resourceUri, (string)$this->_model);\n\n            if ($inverse == false) {\n                $resourceDescription = $resource->getDescription();\n                $memoryModel->addStatements($resourceDescription);\n            } else {\n                $resourceDescription = $resource->getDescription(array('fetchInverse' => true));\n                $memoryModel->addStatements($resourceDescription);\n                //remove s from memory model to extract only inverse relations\n                $memoryModel->removeS($resourceUri);\n            }\n        }\n        $predicates = $memoryModel->getPredicates();\n\n        foreach ($predicates as $uri) {\n            $propertyUris[] = array('uri' => $uri);\n        }\n        return $this->convertProperties($propertyUris);\n    }\n\n    /**\n     * Returns the list of properties used by all resources at once.\n     * This method generate one SPARQL query .\n     * Original Name was getAllProperties()\n     * @return array\n     */\n    public function getAllPropertiesBySingleQuery($inverse = false)\n    {\n        if (empty($this->_resources) && $this->_resourcesUptodate) {\n            return array();\n        }\n\n        $query = $this->getAllPropertiesQuery($inverse);\n\n        $results = $this->_store->sparqlQuery(\n            $query,\n            array(\n                 Erfurt_Store::RESULTFORMAT => Erfurt_Store::RESULTFORMAT_EXTENDED,\n                 Erfurt_Store::USE_CACHE    => $this->_useCache\n            )\n        );\n\n        $properties = array();\n        foreach ($results['results']['bindings'] as $row) {\n            $properties[] = array('uri' => $row['resourceUri']['value']);\n        }\n\n        return $this->convertProperties($properties);\n    }\n\n\n    /**\n     * get the bound values for a predicate\n     *\n     * @param Erfurt_Sparql_Query2_IriRef|string $property\n     * @param boolean                            $distinct\n     * @param boolean                            $inverse\n     *\n     * @return array\n     */\n    public function getPossibleValues($property, $distinct = true, $inverse = false)\n    {\n        if (is_string($property)) {\n            $property = new Erfurt_Sparql_Query2_IriRef($property);\n        }\n        if (!($property instanceof Erfurt_Sparql_Query2_IriRef)) {\n            throw new RuntimeException(\n                'Argument 1 passed to OntoWiki_Model_Instances::getObjects ' .\n                'must be instance of string or Erfurt_Sparql_Query2_IriRef, ' .\n                typeHelper($property) . ' given'\n            );\n        }\n\n        $query = clone $this->_resourceQuery;\n        $query\n            ->removeAllProjectionVars()\n            ->setDistinct($distinct)\n            ->setLimit(0)\n            ->setOffset(0);\n\n        $valueVar = new Erfurt_Sparql_Query2_Var('obj');\n        if ($inverse) {\n            $query->addTriple($valueVar, $property, $this->_resourceVar);\n        } else {\n            $query->addTriple($this->_resourceVar, $property, $valueVar);\n        }\n        $query->addFilter(\n            new Erfurt_Sparql_Query2_ConditionalAndExpression(\n                array(\n                     // when resourceVar is the object - prevent literals\n                     new Erfurt_Sparql_Query2_UnaryExpressionNot(\n                         new Erfurt_Sparql_Query2_isBlank($valueVar)\n                     )\n                )\n            )\n        );\n        $query->addProjectionVar($valueVar);\n        $results = $this->_store->sparqlQuery(\n            $query,\n            array(\n                 Erfurt_Store::RESULTFORMAT => Erfurt_Store::RESULTFORMAT_EXTENDED,\n                 Erfurt_Store::USE_CACHE    => $this->_useCache\n            )\n        );\n\n        $values = array();\n        foreach ($results['results']['bindings'] as $row) {\n            $values[] = $row['obj'];\n        }\n\n        return $values;\n    }\n\n    /**\n     * get link-url, curi, title for an array of properties\n     *\n     * @param array $properties\n     *\n     * @return array\n     */\n    protected function convertProperties($properties)\n    {\n        $uris = array();\n        foreach ($properties as $property) {\n            $uris[] = $property['uri'];\n        }\n\n        if (!empty($properties)) {\n            $this->_titleHelper->addResources($uris);\n\n            $url = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n        }\n\n        $propertyResults = array();\n        foreach ($properties as $key => $property) {\n            if (in_array($property['uri'], $this->_ignoredShownProperties)) {\n                continue;\n            }\n\n            // set URL\n            $url->setParam('r', $property['uri'], true);\n\n            $property['url'] = (string)$url;\n\n            $property['curi'] = OntoWiki_Utils::contractNamespace($property['uri']);\n\n            $property['title'] = $this->_titleHelper->getTitle($property['uri']);\n\n            $propertyResults[$key] = $property;\n        }\n\n        return $propertyResults;\n    }\n\n    /**\n     * Returns information about the properties fetched (title etc.)\n     *\n     * @return array\n     */\n    public function getShownProperties()\n    {\n        if ($this->_shownPropertiesConvertedUptodate) {\n// TODO is this required here?\n            echo 'reuse';\n\n            return $this->_shownPropertiesConverted;\n        }\n\n        //$this->getResults();\n\n        $converted                               = $this->convertProperties($this->_shownProperties);\n        $this->_shownPropertiesConverted         = $converted;\n        $this->_shownPropertiesConvertedUptodate = true;\n\n        return $converted;\n    }\n\n    /**\n     * array of shownproperties (each is a array:\n     * array (\n     *      'uri'\n    'name'\n    'inverse'\n    'datatype'\n    'varName'\n    'var' // var objectused as object\n    'optionalpart' //the hole optional {?resourceUri <prop> ?var} pattern object\n    'filter' // the FILTER(!isBlank(?var)) object\n     * )\n     *\n     * @return array\n     */\n    public function getShownPropertiesPlain()\n    {\n        return $this->_shownProperties;\n    }\n\n    /**\n     * get titles and build link-urls (for a sparql result of the resource query)\n     *\n     * @param array $resources an array of resource uris\n     *\n     * @return array\n     */\n    public function convertResources($resources)\n    {\n        // add titles first, seperatly\n        $uris = array();\n        foreach ($resources as $resource) {\n            $uris[] = $resource['value'];\n        }\n        $this->_titleHelper->addResources($uris);\n\n        $resourceResults = array();\n        foreach ($resources as $resource) {\n            $thisResource        = $resource;\n            $thisResource['uri'] = $resource['value'];\n            // the URL to view this resource in detail\n            $url    = new OntoWiki_Url(array('controller' => 'resource', 'action' => 'properties'), array());\n            $url->r = $resource['value'];\n\n            $thisResource['url'] = (string)$url;\n            // title\n            $thisResource['title'] = $this->_titleHelper->getTitle($resource['value']);\n\n            $resourceResults[] = $thisResource;\n        }\n\n        return $resourceResults;\n    }\n\n    protected function getShownResources()\n    {\n        if (!$this->_resourcesUptodate) {\n            $result           = $this->_store->sparqlQuery(\n                $this->_resourceQuery,\n                array(\n                     Erfurt_Store::RESULTFORMAT => Erfurt_Store::RESULTFORMAT_EXTENDED,\n                     Erfurt_Store::USE_CACHE    => $this->_useCache\n                )\n            );\n            $this->_resources = array();\n            foreach ($result['results']['bindings'] as $row) {\n                if (isset($row[$this->_resourceVar->getName()])) {\n                    $this->_resources[] = $row[$this->_resourceVar->getName()];\n                } else {\n                    throw new Erfurt_Exception(\n                        'The given query is not a valid resource query because no variable with' .\n                        'name: \"' . $this->_resourceVar->getName() . '\" is specified.'\n                    );\n                }\n            }\n            $this->_resourcesUptodate = true;\n        }\n\n        return $this->_resources;\n    }\n\n    /**\n     * Returns information about the resources queried\n     *\n     * @return array\n     */\n    public function getResources()\n    {\n        if ($this->_resourcesConvertedUptodate) {\n            return $this->_resourcesConverted;\n        }\n\n        $this->_resourcesConverted = $this->convertResources($this->getShownResources());\n\n        $this->_resourcesConvertedUptodate = true;\n\n        return $this->_resourcesConverted;\n    }\n\n    /**\n     * Returns whether the model has data.\n     *\n     * @return boolean\n     */\n    public function hasData()\n    {\n        $this->getShownResources();\n\n        return !empty($this->_resources);\n    }\n\n    /**\n     * Sets the maximum number of resources to fetch for one page.\n     *\n     * @param int $limit\n     *\n     * @return OntoWiki_Model_Instances\n     */\n    public function setLimit($limit)\n    {\n        if ($this->_resourceQuery->getLimit() == $limit) {\n            return $this;\n        }\n\n        if ($limit < 0) {\n            $limit *= -1;\n        }\n\n        $this->_resourceQuery->setLimit($limit);\n        $this->invalidate();\n\n        return $this;\n    }\n\n    /**\n     * Sets the number of resources to be skipped for the current page.\n     *\n     * @param int $offset\n     *\n     * @return OntoWiki_Model_Instances\n     */\n    public function setOffset($offset)\n    {\n        if ($this->_resourceQuery->getOffset() == $offset) {\n            return $this;\n        }\n\n        if ($offset < 0) {\n            $offset *= -1;\n        }\n\n        $this->_resourceQuery->setOffset($offset);\n        $this->invalidate();\n\n        return $this;\n    }\n\n    /** Gets the maximum number of resources to fetch for one page.\n     *\n     * @return int\n     */\n    public function getLimit()\n    {\n        return $this->_resourceQuery->getLimit();\n    }\n\n    /**\n     * Gets the number of resources to be skipped for the current page.\n     *\n     * @return int\n     */\n    public function getOffset()\n    {\n        return $this->_resourceQuery->getOffset();\n    }\n\n    /*\n     * set all \"uptodate\" flags to false\n     * @return OntoWiki_Model_Instances\n     */\n    public function invalidate()\n    {\n        $this->_resourcesConvertedUptodate       = false;\n        $this->_resourcesUptodate                = false;\n        $this->_shownPropertiesConvertedUptodate = false;\n        $this->_resultsUptodate                  = false;\n        $this->_valuesUptodate                   = false;\n        $this->_valueQueryUptodate               = false;\n\n        return $this;\n    }\n\n    /**\n     * if the selected resources changed (due to filters or limit or offset)\n     * we have to change the value query as well (because the resources are mentioned as subjects)\n     *\n     * @return OntoWiki_Model_Instances $this\n     */\n    protected function updateValueQuery()\n    {\n        if ($this->_valueQueryUptodate) {\n            return $this;\n        }\n\n        $resources = $this->getShownResources();\n\n        foreach ($resources as $key => $resource) {\n            $resources[$key] = new Erfurt_Sparql_Query2_SameTerm(\n                $this->_resourceVar,\n                new Erfurt_Sparql_Query2_IriRef($resource['value'])\n            );\n        }\n\n        if ($this->_valueQueryResourceFilter == null) {\n            $this->_valueQueryResourceFilter = new Erfurt_Sparql_Query2_Filter(\n                new Erfurt_Sparql_Query2_BooleanLiteral(false)\n            );\n            $this->_valueQuery->addElement($this->_valueQueryResourceFilter);\n        }\n\n        if (!empty($resources)) {\n            $constraint = new Erfurt_Sparql_Query2_ConditionalOrExpression($resources);\n        } else {\n            $constraint = new Erfurt_Sparql_Query2_BooleanLiteral(false);\n        }\n        $this->_valueQueryResourceFilter->setConstraint($constraint);\n\n        //fix for a strange issue where a query with only optionals fails\n        //(but there is a magic/unkown condition, that makes it work for some queries!?)\n        $hasTriple = false;\n        foreach ($this->_valueQuery->getWhere()->getElements() as $element) {\n            if ($element instanceof Erfurt_Sparql_Query2_IF_TriplesSameSubject) {\n                $hasTriple = true;\n                break;\n            }\n        }\n        if (!$hasTriple) {\n            $this->_valueQuery->getWhere()->addElement(\n                new Erfurt_Sparql_Query2_Triple(\n                    $this->_resourceVar,\n                    new Erfurt_Sparql_Query2_Var('p'),\n                    new Erfurt_Sparql_Query2_Var('o')\n                )\n            );\n        }\n        //remove duplicate triples...\n        $this->_valueQuery->optimize();\n\n        $this->_valueQueryUptodate = true;\n\n        return $this;\n    }\n\n    /**\n     * order by a property (must be set as shown property before)\n     *\n     * @param type    $uri the property to order by\n     * @param boolean $asc true if ascending, false if descending\n     */\n    public function setOrderProperty($uri, $asc = true)\n    {\n        $this->setOffset(0);\n        if ($this->_sortTriple == null) {\n            $orderVar          = new Erfurt_Sparql_Query2_Var('order');\n            $this->_sortTriple = new Erfurt_Sparql_Query2_OptionalGraphPattern(\n                array(\n                     new Erfurt_Sparql_Query2_Triple(\n                         $this->getResourceVar(),\n                         new Erfurt_Sparql_Query2_IriRef($uri),\n                         $orderVar\n                     )\n                )\n            );\n            $this->_resourceQuery->getWhere()->addElement($this->_sortTriple);\n            $this->_resourceQuery->getOrder()->add(\n                $orderVar,\n                $asc ? Erfurt_Sparql_Query2_OrderClause::ASC : Erfurt_Sparql_Query2_OrderClause::DESC\n            );\n        } else {\n            $this->_sortTriple->getElement(0)->setP(new Erfurt_Sparql_Query2_IriRef($uri));\n            if ($asc) {\n                $this->_resourceQuery->getOrder()->setAsc(0);\n            } else {\n                $this->_resourceQuery->getOrder()->setDesc(0);\n            }\n        }\n        $this->invalidate();\n    }\n\n    /**\n     * order by a var, that is used in the resource query\n     *\n     * @param Erfurt_Sparql_Query2_Var $var the var to order by\n     * @param boolean                  $asc true if ascending, false if descending, optional, default is true=>asc\n     */\n    public function setOrderVar($var, $asc = true)\n    {\n        $this->setOffset(0);\n        if (!is_bool($asc)) {\n            $asc = true;\n        }\n        if ($var instanceof Erfurt_Sparql_Query2_Var) {\n            $this->_resourceQuery->getOrder()->setExpression(\n                array(\n                     'exp' => $var,\n                     'dir' => $asc ? Erfurt_Sparql_Query2_OrderClause::ASC : Erfurt_Sparql_Query2_OrderClause::DESC\n                )\n            );\n        } else {\n            if (is_string($var)) {\n                if ($var == $this->getResourceVar()->getName()) {\n                    $this->setOrderVar($this->getResourceVar(), $asc);\n                }\n            }\n        }\n        $this->invalidate();\n    }\n\n    /**\n     * order the resources by their URI\n     *\n     * @param type $asc true if ascending, false if descending, optional, default is true=>asc\n     */\n    public function orderByUri($asc = true)\n    {\n        $this->setOrderVar($this->getResourceVar(), $asc);\n    }\n\n    /**\n     * a legacy Method to determine the class, whose instances are shown in this list\n     * unfortunatley , it is not as easy as this anymore - we support other list too - then -1 is returned\n     *\n     * @deprecated since version 0.9.5\n     * @return string|int\n     */\n    public static function getSelectedClass()\n    {\n        $listHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('List');\n        $listName   = 'instances';\n        if ($listHelper->listExists($listName)) {\n            $list   = $listHelper->getList($listName);\n            $filter = $list->getFilter();\n\n            return isset($filter['type0']['rdfsclass']) ? $filter['type0']['rdfsclass'] : -1;\n        }\n\n        return -1;\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Model/Resource.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki resource model class.\n *\n * Represents a resources and its properties.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Model\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Model_Resource extends OntoWiki_Model\n{\n    /**\n     * The resource URI\n     *\n     * @var string\n     */\n    protected $_uri = null;\n\n    /**\n     * Array with predicate data\n     *\n     * @var array\n     */\n    protected $_predicateResults = null;\n\n    /**\n     * Array with value data\n     *\n     * @var array\n     */\n    protected $_valueResults = null;\n\n    /**\n     * Whether data has been fetched\n     *\n     * @var boolean\n     */\n    protected $_queryResults = null;\n\n    /**\n     * Array of predicates to be ignored\n     *\n     * @var array\n     */\n    protected $_ignoredPredicates = array();\n\n    /**\n     * Array of predicates to be ignored\n     *\n     * @var array\n     */\n    protected $_limit = OW_SHOW_MAX;\n\n    /**\n     * Constructor\n     */\n    public function __construct(Erfurt_Store $store, $graph, $uri, $limit = false)\n    {\n        parent::__construct($store, $graph);\n        $this->_uri = (string)$uri;\n\n        $this->_titleHelper = new OntoWiki_Model_TitleHelper($this->_model);\n        if ($limit !== false) {\n            $this->_limit = $limit;\n        }\n\n        //TODO fix query\n        $queryHidden = 'PREFIX sysont: <http://ns.ontowiki.net/SysOnt/> SELECT ?p WHERE {?p sysont:hidden ?o }';\n        $res         = $store->sparqlQuery($queryHidden, array(\"result_format\" => Erfurt_Store::RESULTFORMAT_EXTENDED));\n        if (isset($res['bindings'])) {\n            $bindings = $res['bindings'];\n        } else {\n            if (isset($res['results']['bindings'])) {\n                $bindings = $res['results']['bindings'];\n            } else {\n                require_once 'OntoWiki/Model/Exception.php';\n                throw new OntoWiki_Model_Exception('invalid query result.');\n            }\n        }\n        foreach ($bindings as $b) {\n            $this->_ignoredPredicates[] = $b['p']['value'];\n        }\n    }\n\n    /**\n     * Returns an array of predicates and predicate infos for the current resource.\n     *\n     * @return array\n     */\n    public function getPredicates()\n    {\n        if (null === $this->_predicateResults) {\n            $this->_predicateResults = array();\n\n            // get results\n            $results = $this->getQueryResults();\n\n            // url object to build URLs\n            $url = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n\n            foreach ($results as $graph => $resultsForGraph) {\n                // set up title helper\n                $this->_titleHelper->addResources($resultsForGraph, 'predicate');\n                $this->_titleHelper->addResources($resultsForGraph, 'object');\n            }\n\n            foreach ($results as $graph => $resultsForGraph) {\n                $this->_predicateResults[$graph] = array();\n\n                foreach ($resultsForGraph as $row) {\n                    $predicateUri = $row['predicate']['value'];\n\n                    if (!array_key_exists($predicateUri, $this->_predicateResults)) {\n                        // title\n                        $predicateTitle = $this->_titleHelper->getTitle($predicateUri);\n                        // url\n                        $url->setParam('r', $predicateUri, true);\n\n                        $this->_predicateResults[$graph][$predicateUri] = array(\n                            'uri'      => $predicateUri,\n                            'curi'     => OntoWiki_Utils::compactUri($predicateUri),\n                            'url'      => (string)$url,\n                            'title'    => $predicateTitle,\n                            'has_more' => false\n                        );\n                    }\n                }\n            }\n        }\n\n        return $this->_predicateResults;\n    }\n\n    public function getQueryResults()\n    {\n        // query if necessary\n        if (null === $this->_queryResults) {\n            $this->_queryResults = array();\n\n            foreach ($this->_buildQueries() as $graph => $query) {\n                $options = array(\n                    'result_format'          => 'extended',\n                    'use_owl_imports'        => false,\n                    'use_additional_imports' => false\n                );\n\n                $currentResults = $this->_store->sparqlQuery($query, $options);\n\n                if (isset($currentResults['results']['bindings'])) {\n                    $this->_queryResults[$graph] = $currentResults['results']['bindings'];\n                } else {\n                    $this->_queryResults[$graph] = array();\n                }\n            }\n\n            // remove empty results\n            $this->_queryResults = array_filter($this->_queryResults);\n        }\n\n        return $this->_queryResults;\n    }\n\n    /**\n     * Returns an array of predicate values for the current resource.\n     * The array is indexed with the predicate's URIs.\n     *\n     * @return array\n     */\n    public function getValues()\n    {\n        if (null === $this->_valueResults) {\n            $this->_valueResults = array();\n\n            // get results\n            $results = $this->getQueryResults();\n\n            // load predicates first\n            $this->getPredicates();\n\n            // URL object to build URLs\n            $url = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n\n            // keep track of URI objects already used\n            $objects = array();\n\n            foreach ($results as $graph => $resultsForGraph) {\n                $this->_valueResults[$graph] = array();\n\n                foreach ($resultsForGraph as $row) {\n                    $predicateUri = $row['predicate']['value'];\n\n                    if (!array_key_exists($predicateUri, $objects)) {\n                        $objects[$predicateUri] = array();\n                    }\n\n                    // create space for value information if not exists\n                    if (!array_key_exists($predicateUri, $this->_valueResults[$graph])) {\n                        $this->_valueResults[$graph][$predicateUri] = array();\n                    }\n\n                    // default values\n                    $value = array(\n                        'content'     => null,\n                        'object'      => null,\n                        'object_hash' => null,\n                        'datatype'    => null,\n                        'lang'        => null,\n                        'url'         => null,\n                        'uri'         => null,\n                        'curi'        => null\n                    );\n\n                    switch ($row['object']['type']) {\n                        case 'uri':\n                            // every URI objects is only used once for each statement\n                            if (in_array($row['object']['value'], $objects[$predicateUri])) {\n                                continue;\n                            }\n\n                            // URL\n                            $url->setParam('r', $row['object']['value'], true);\n                            $value['url'] = (string)$url;\n\n                            // URI\n                            $value['uri'] = $row['object']['value'];\n\n                            // title\n                            $title = $this->_titleHelper->getTitle($row['object']['value']);\n\n                            /**\n                             * @trigger onDisplayObjectPropertyValue Triggered if an object value of some\n                             * property is returned. Plugins can attach to this trigger in order to modify\n                             * the value that gets displayed.\n                             * Event payload: value, property, title and link\n                             */\n                            // set up event\n                            $event           = new Erfurt_Event('onDisplayObjectPropertyValue');\n                            $event->value    = $row['object']['value'];\n                            $event->property = $predicateUri;\n                            $event->title    = $title;\n                            $event->link     = (string)$url;\n\n                            // trigger\n                            $value['object'] = $event->trigger();\n\n                            if (!$event->handled()) {\n                                // object (modified by plug-ins)\n                                $value['object'] = $title;\n                            }\n\n                            array_push($objects[$predicateUri], $row['object']['value']);\n\n                            break;\n\n                        case 'typed-literal':\n                            $event                = new Erfurt_Event('onDisplayLiteralPropertyValue');\n                            $value['datatype']    = OntoWiki_Utils::compactUri($row['object']['datatype']);\n                            $literalString        = Erfurt_Utils::buildLiteralString(\n                                $row['object']['value'],\n                                $row['object']['datatype']\n                            );\n                            $value['object_hash'] = md5($literalString);\n\n                            $event->value    = $row['object']['value'];\n                            $event->datatype = $row['object']['datatype'];\n                            $event->property = $predicateUri;\n                            $value['object'] = $event->trigger();\n                            // keep unmodified value in content\n                            $value['content'] = $row['object']['value'];\n\n                            if (!$event->handled()) {\n                                // object (modified by plug-ins)\n                                $value['object'] = $row['object']['value'];\n                            }\n\n                            break;\n                        case 'literal':\n                            // original (unmodified) for RDFa\n                            $value['content']     = $row['object']['value'];\n                            $literalString        = Erfurt_Utils::buildLiteralString(\n                                $row['object']['value'],\n                                null,\n                                isset($row['object']['xml:lang']) ? $row['object']['xml:lang'] : null\n                            );\n                            $value['object_hash'] = md5($literalString);\n\n                            /**\n                             * @trigger onDisplayLiteralPropertyValue Triggered if a literal value of some\n                             * property is returned. Plugins can attach to this trigger in order to modify\n                             * the value that gets displayed.\n                             */\n                            $event           = new Erfurt_Event('onDisplayLiteralPropertyValue');\n                            $event->value    = $row['object']['value'];\n                            $event->property = $predicateUri;\n\n                            // set literal language\n                            if (isset($row['object']['xml:lang'])) {\n                                $value['lang']   = $row['object']['xml:lang'];\n                                $event->language = $row['object']['xml:lang'];\n                            }\n                            // trigger\n                            $value['object'] = $event->trigger();\n                            // keep unmodified value in content\n                            $value['content'] = $row['object']['value'];\n\n                            // set default if event has not been handled\n                            if (!$event->handled()) {\n                                $value['object'] = $row['object']['value'];\n                            }\n\n                            break;\n                    }\n\n                    // push it only if it doesn't exceed number of items to display\n                    if (count($this->_valueResults[$graph][$predicateUri]) < $this->_limit) {\n                        array_push($this->_valueResults[$graph][$predicateUri], $value);\n                    } else {\n                        $this->_predicateResults[$graph][$predicateUri]['has_more'] = true;\n                    }\n                    if (count($this->_valueResults[$graph][$predicateUri]) > 1) {\n                        // create the \"has more link\" (used for area context menu as well)\n                        // do it only once per predicate\n                        if (!isset($this->_predicateResults[$graph][$predicateUri]['has_more_link'])) {\n                            //when all values are literal, we dont use a link to the list,but to the query editor\n                            $allValuesAreLiterals = true;\n                            foreach ($this->_valueResults[$graph][$predicateUri] as $value) {\n                                if (isset($value['uri'])) {\n                                    $allValuesAreLiterals = false;\n                                }\n                            }\n                            if (!$allValuesAreLiterals) {\n                                $hasMoreUrl = new OntoWiki_Url(\n                                    array('route' => 'instances', 'action' => 'list'),\n                                    array()\n                                );\n                                $filterExp  = json_encode(\n                                    array(\n                                         'filter' => array(\n                                             array(\n                                                 'action'        => 'add',\n                                                 'mode'          => 'box',\n                                                 'id'            => 'allvalues',\n                                                 'property'      => $predicateUri,\n                                                 'isInverse'     => true,\n                                                 'propertyLabel' => \"value\",\n                                                 'filter'        => 'equals',\n                                                 'value1'        => $this->_uri,\n                                                 'value2'        => null,\n                                                 'valuetype'     => 'uri',\n                                                 'literaltype'   => null,\n                                                 'hidden'        => false\n                                             )\n                                         )\n                                    )\n                                );\n\n                                $hasMoreUrl->setParam(\n                                    'instancesconfig',\n                                    $filterExp\n                                )->setParam(\n                                    'init',\n                                    true\n                                );\n                            } else {\n                                $hasMoreUrl = new OntoWiki_Url(\n                                    array('controller' => 'queries', 'action' => 'editor'),\n                                    array()\n                                );\n                                $hasMoreUrl->setParam(\n                                    'query',\n                                    'SELECT ?value WHERE {<' . $this->_uri . '> <' . $predicateUri . '> ?value}'\n                                )->setParam(\n                                    'immediate',\n                                    true\n                                );\n                            }\n\n                            $this->_predicateResults[$graph][$predicateUri]['has_more_link'] = (string)$hasMoreUrl;\n                        }\n                    }\n                }\n            }\n\n            return $this->_valueResults;\n        }\n    }\n\n    /**\n     * Builds the SPARQL query\n     */\n    private function _buildQueries()\n    {\n        $query = new Erfurt_Sparql_Query2();\n\n        $uri     = new Erfurt_Sparql_Query2_IriRef($this->_uri);\n        $predVar = new Erfurt_Sparql_Query2_Var('predicate');\n        $objVar  = new Erfurt_Sparql_Query2_Var('object');\n\n        $query\n            ->addTriple($uri, $predVar, $objVar);\n        $query->addFilter(\n            new Erfurt_Sparql_Query2_UnaryExpressionNot(\n                new Erfurt_Sparql_Query2_isBlank(\n                    $objVar\n                )\n            )\n        );\n\n        if (!empty($this->_ignoredPredicates)) {\n            $or     = new Erfurt_Sparql_Query2_ConditionalAndExpression();\n            $filter = new Erfurt_Sparql_Query2_Filter($or);\n            foreach ($this->_ignoredPredicates as $ignored) {\n                $or->addElement(\n                    new Erfurt_Sparql_Query2_UnaryExpressionNot(\n                        new Erfurt_Sparql_Query2_sameTerm(\n                            $predVar,\n                            new Erfurt_Sparql_Query2_IriRef($ignored)\n                        )\n                    )\n                );\n            }\n            $query->getWhere()->addElement($filter);\n        }\n\n        $query\n            ->setDistinct(true)\n            ->addProjectionVar($predVar)\n            ->addProjectionVar($objVar)\n            ->getOrder()\n            ->add($predVar);\n\n        $queries     = array();\n        $closure     = Erfurt_App::getInstance()->getStore()->getImportsClosure(\n            $this->_model->getModelUri(),\n            true\n        );\n        $queryGraphs = array_merge(array($this->_graph), $closure);\n\n        foreach ($queryGraphs as $currentGraph) {\n            $query->setFroms(array($currentGraph));\n            $queries[$currentGraph] = clone $query;\n        }\n\n        return $queries;\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Model/TitleHelper.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Fetches title properties for a set of resources at once.\n * The resources can be defined explicitly or via a SPARQL graph pattern.\n *\n * @category OntoWiki\n * @package  OntoWiki_Classes_Model\n */\nclass OntoWiki_Model_TitleHelper\n{\n    /**\n     * Whether to always search all configured title properties\n     * in order to find the best language match or stop at the\n     * first matching title property.\n     *\n     * @var boolean\n     */\n    protected $_alwaysSearchAllProperties = false;\n\n    /**\n     * Whether to fallback to local names instead of full\n     * URIs for unknown resources\n     *\n     * @var boolean\n     */\n    protected $_alwaysUseLocalNames = false;\n\n    /**\n     * The singleton instance\n     *\n     * @var OntoWiki_Model_TitleHelper\n     */\n    private static $_instance = null;\n\n    /**\n     * The languages to consider for title properties.\n     *\n     * @var array\n     */\n    protected $_languages = array('en','','localname');\n\n    /**\n     * The model object to operate on\n     *\n     * @var Erfurt_Rdf_Model\n     */\n    protected $_model = null;\n\n    /**\n     * The resources for whitch to fetch title properties\n     *\n     * @var array\n     */\n    protected $_resources = array();\n\n    /**\n     * Resource query object\n     *\n     * @var Erfurt_Sparql_SimpleQuery\n     */\n    protected $_resourceQuery = null;\n\n    /**\n     * Erfurt store object\n     *\n     * @var Erfurt_Store\n     */\n    protected $_store = null;\n\n    /**\n     * Erfurt store object\n     *\n     * @var Erfurt_App\n     */\n    protected $_erfurtApp = null;\n\n    /**\n     * titleProperties from configuration\n     *\n     * @var array\n     */\n    protected $_titleProperties = null;\n\n\n\n    // ------------------------------------------------------------------------\n    // --- Magic methods ------------------------------------------------------\n    // ------------------------------------------------------------------------\n\n    /**\n     * Constructs a new title helper instance.\n     *\n     * @param Erfurt_Rdf_Model $model The model instance to operate on\n     */\n    public function __construct(Erfurt_Rdf_Model $model = null, Erfurt_Store $store = null, $config = null)\n    {\n        if (null !== $model) {\n            $this->_model = $model;\n        }\n\n        $this->_erfurtApp = Erfurt_App::getInstance();\n\n        if (null !== $store) {\n            $this->_store = $store;\n        } else {\n            $this->_store = $this->_erfurtApp->getStore();\n        }\n\n        if (null == $config) {\n            $config = OntoWiki::getInstance()->config;\n        }\n        if (is_array($config)) {\n            if (isset($config['titleHelper']['properties'])) { // naming properties for resources\n                $this->_titleProperties = array_values($config['titleHelper']['properties']);\n            } else {\n                $this->_titleProperties = array();\n            }\n\n            // fetch mode\n            if (isset($config['titleHelper']['searchMode'])) {\n                $this->_alwaysSearchAllProperties = (strtolower($config['titleHelper']['searchMode']) === 'language');\n            }\n        } else {\n            if ($config instanceof Zend_Config) {\n                //its possible to define myProperties in config.ini\n                if (isset($config->titleHelper->myProperties)) {\n                    $this->_titleProperties = array_values($config->titleHelper->myProperties->toArray());\n                } else if (isset($config->titleHelper->properties)) { // naming properties for resources\n                    $this->_titleProperties = array_values($config->titleHelper->properties->toArray());\n                } else {\n                    $this->_titleProperties = array();\n                }\n\n                // fetch mode\n                if (isset($config->titleHelper->searchMode)) {\n                    $this->_alwaysSearchAllProperties = (strtolower($config->titleHelper->searchMode) == 'language');\n                }\n            } else {\n                $this->_titleProperties = array();\n            }\n        }\n        // always use local name for unknown resources?\n        if (isset($config->titleHelper->useLocalNames)) {\n            $this->_alwaysUseLocalNames = (bool)$config->titleHelper->useLocalNames;\n        }\n        // add localname to titleproperties\n        $this->_titleProperties[] = 'localname';\n\n        if (null === $this->_languages) {\n            $this->_languages = array();\n        }\n        if (isset($config->languages->locale)) {\n            array_unshift($this->_languages, (string)$config->languages->locale);\n            $this->_languages = array_unique($this->_languages);\n        }\n    }\n\n    // ------------------------------------------------------------------------\n    // --- Public methods -----------------------------------------------------\n    // ------------------------------------------------------------------------\n    /**\n     * Singleton instance\n     *\n     * @return OntoWiki_Model_Instance\n     */\n    public static function getInstance()\n    {\n        if (null === self::$_instance) {\n            self::$_instance = new self();\n        }\n\n        return self::$_instance;\n    }\n\n    /**\n     * Adds a resource to list of resources for which to query title properties.\n     *\n     * @param Erfurt_Rdf_Resource|string $resource Resource instance or URI\n     *\n     * @return OntoWiki_Model_TitleHelper\n     */\n    public function addResource($resource)\n    {\n        $resourceUri = (string)$resource;\n        if (Erfurt_Uri::check($resourceUri)) {\n            if (empty($this->_resources[$resourceUri])) {\n                $this->_resources[$resourceUri] = null;\n            }\n        } else {\n            // throw exeption in debug mode only\n            if (defined('_OWDEBUG')) {\n                $logger = OntoWiki::getInstance()->logger;\n                $logger->info('Supplied resource ' . htmlentities('<' . $resource . '>') . ' is not a valid URI.');\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Adds a bunch of resources for which to query title properties.\n     * @param array  $resources\n     * @return OntoWiki_Model_TitleHelper\n     */\n    public function addResources($resources = array(), $variable = null)\n    {\n        if (null === $variable) {\n            foreach ($resources as $resourceUri) {\n                $this->addResource($resourceUri);\n            }\n        } else {\n            foreach ($resources as $row) {\n                foreach ((array)$variable as $key) {\n                    if (!empty($row[$key])) {\n                        $object = $row[$key];\n                        $toBeAdded = null;\n                        if (is_array($object)) {\n                            // probably support extended format\n                            if (isset($object['type']) && ($object['type'] == 'uri')) {\n                                $toBeAdded = $object['value'];\n                            }\n                        } else {\n                            // plain object\n                            $toBeAdded = $object;\n                        }\n                        if ($toBeAdded != null) {\n                            $this->addResource($toBeAdded);\n                        }\n                    }\n                }\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Returns the title property for the resource URI in the requested language.\n     * If no title property is found for that language the local part\n     * of the resource URI  will be returned.\n     *\n     * @param string $resourceUri\n     * @param string $language The preferred language for the title\n     *\n     * @return string\n     */\n    public function getTitle($resourceUri, $language = null)\n    {\n        if (!Erfurt_Uri::check($resourceUri)) {\n            return $resourceUri;\n        }\n        // * means any language\n        if (trim($language) == '*') {\n            $language = null;\n        }\n\n        //Have a look if we have an entry for the given resourceUri\n        if (!array_key_exists($resourceUri, $this->_resources) ) {\n\n            if (defined('_OWDEBUG')) {\n                $logger = OntoWiki::getInstance()->logger;\n                $logger->info('TitleHelper: getTitle called for unknown resource. Adding resource before fetch.');\n            }\n            //If we dont have an entry create one\n            $this->addResource($resourceUri);\n        }\n\n        // prepend the language that is asked for to the array\n        // of languages we will look for\n        $languages = $this->_languages;\n        if (null !== $language) {\n            array_unshift($languages, (string)$language);\n        }\n        $languages = array_values(array_unique($languages));\n\n        //Have a look if we have already a title for the given resourceUri\n        if ($this->_resources[$resourceUri] === null ) {\n            $this->_receiveTitles();\n        }\n        //Select the best found title according received titles and order of configured titleproperties\n        $title = $resourceUri;\n\n        $titles = $this->_resources[$resourceUri];\n        foreach ($languages as $language) {\n            foreach ($this->_titleProperties as $titleProperty) {\n                if (isset($titles[$titleProperty][$language]) && !empty($titles[$titleProperty][$language])) {\n                    $title = $titles[$titleProperty][$language];\n                    break(2);\n                }\n            }\n        }\n        return $title;\n    }\n\n    /**\n     * Add a new title property on top of the list (most important) of title properties\n     *\n     * @param $propertyUri a string with the URI of the property to add\n     */\n    public function prependTitleProperty($propertyUri)\n    {\n        // check if we have a valid URI\n        if (Erfurt_Uri::check($propertyUri)) {\n            // remove the property from the list if it already exist\n            foreach ($this->_titleProperties as $key => $value) {\n                if ($value == $propertyUri) {\n                    unset($this->_titleProperties[$key]);\n                }\n            }\n\n            // rewrite the array\n            $this->_titleProperties = array_values($this->_titleProperties);\n\n            // prepend the new URI\n            array_unshift($this->_titleProperties, $propertyUri);\n\n            // reset the TitleHelper to fetch resources with new title properties\n            $this->reset();\n        }\n    }\n\n     /**\n     * Resets the title helper, emptying all resources, results and queries stored\n     */\n    public function reset()\n    {\n        $this->_resources = array();\n    }\n\n    /**\n     * operate on _resources array and call the method to fetch the titles\n     * if no titles found for the respective resource the localname will be extracted\n     *\n     * @return void\n     */\n    private function _receiveTitles()\n    {\n        //first we check if there are resourceUris without a title representation\n        $toBeReceived = array();\n        foreach ($this->_resources as $resourceUri => $resource) {\n            if ($resource == null) {\n                $toBeReceived[] = $resourceUri;\n            }\n        }\n        //now we try to receive the Titles from ResourcePool\n        $this->_fetchTitlesFromResourcePool($toBeReceived);\n\n        //If we dont find titles then we extract them from LocalName\n        foreach ($this->_resources as $resourceUri => $resource) {\n            if ($resource == null) {\n                $this->_resources[$resourceUri]['localname']['localname']\n                    = $this->_extractTitleFromLocalName($resourceUri);\n            }\n        }\n    }\n\n    /**\n     * fetches all titles according the given array if Uris\n     *\n     * @param array resourceUris\n     */\n    private function _fetchTitlesFromResourcePool($resourceUris)\n    {\n        $resourcePool = $this->_erfurtApp->getResourcePool();\n        $resources = array();\n        if (!empty($this->_model)) {\n            $modelUri = $this->_model->getModelIri();\n            $resources = $resourcePool->getResources($resourceUris, $modelUri);\n        } else {\n            $resources = $resourcePool->getResources($resourceUris);\n        }\n\n        $memoryModel = new Erfurt_Rdf_MemoryModel();\n        foreach ($resources as $resourceUri => $resource) {\n            $resourceDescription = $resource->getDescription();\n            $memoryModel->addStatements($resourceDescription);\n            $found = false;\n            foreach ($this->_titleProperties as $titleProperty) {\n                $values = $memoryModel->getValues($resourceUri, $titleProperty);\n                foreach ($values as $value) {\n                    if (!empty($value['lang'])) {\n                        $language = $value['lang'];\n                    } else {\n                        $language = '';\n                    }\n                    $this->_resources[$resourceUri][$titleProperty][$language] = $value['value'];\n                }\n            }\n        }\n    }\n\n    /**\n     * extract the localname from given resourceUri\n     *\n     * @param string resourceUri\n     * @return string title\n     */\n    private function _extractTitleFromLocalName($resourceUri)\n    {\n        $title = OntoWiki_Utils::contractNamespace($resourceUri);\n        // not even namespace found?\n        if ($title == $resourceUri && $this->_alwaysUseLocalNames) {\n            $title = OntoWiki_Utils::getUriLocalPart($resourceUri);\n        }\n        return $title;\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Model.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki model base class.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n * @property Zend_Log $_logger\n * @property Erfurt_Event_Dispatcher $_eventDispatcher\n * @property Zend_Config $_config The application configuration.\n */\nclass OntoWiki_Model\n{\n    /**\n     * The Erfurt store\n     *\n     * @var Erfurt_Store\n     */\n    protected $_store = null;\n\n    /**\n     * Whether inference features are turned on\n     *\n     * @var boolean\n     */\n    protected $_inference = true;\n\n    /**\n     * Model instance\n     *\n     * @var Erfurt_Rdf_Model\n     */\n    protected $_model = null;\n\n    /**\n     * The current named graph URI\n     *\n     * @var string\n     */\n    protected $_graph = null;\n\n    /**\n     * Constructor\n     */\n    public function __construct(Erfurt_Store $store, Erfurt_Rdf_Model $graph)\n    {\n        // system variables\n        $this->_store           = $store;\n\n        if (isset($this->_config->system->inference) && !(bool)$this->_config->system->inference) {\n            $this->_inference = false;\n        }\n\n        // data variables\n        $this->_graph = $graph->getModelIri();\n        $this->_model = $graph;\n\n        $this->_titleHelper = new OntoWiki_Model_TitleHelper($this->_model, $store);\n\n        $this->_titleProperties = array_flip($graph->getTitleProperties());\n    }\n\n    /**\n     * get the store that hosts this model\n     *\n     * @return Erfurt_Store\n     */\n    public function getStore()\n    {\n        return $this->_store;\n    }\n\n    /**\n     * get the raw model/graph\n     *\n     * @return Erfurt_Rdf_Model\n     */\n    public function getGraph()\n    {\n        return $this->_model;\n    }\n\n    /**\n     * Simulates properties that reference global objects.\n     *\n     * The globals are *not* stored as properties of this objects, otherwise\n     * these globals (and the whole object graph that is connected to them)\n     * are serialized when this object is stored in the session.\n     *\n     * @param string $name\n     * @return Erfurt_Event_Dispatcher|Zend_Log|Zend_Config|null\n     */\n    public function __get($name)\n    {\n        switch ($name) {\n            case '_logger':\n                return OntoWiki::getInstance()->logger;\n            case '_eventDispatcher':\n                return Erfurt_Event_Dispatcher::getInstance();\n            case '_config':\n                return OntoWiki::getInstance()->config;\n        }\n        return null;\n    }\n\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Module/Exception.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module exteption class.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Module\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Module_Exception extends OntoWiki_Exception\n{\n}\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Module/Registry.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module registry class.\n *\n * Serves as a central registry for modules.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Module\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Module_Registry\n{\n    /**\n     * Default module context\n     */\n    const DEFAULT_CONTEXT = 'Default';\n\n    const MODULE_CLASS_POSTFIX = 'Module';\n    const MODULE_FILE_POSTFIX  = 'Module.php';\n\n\n    /**\n     * Module is open\n     */\n    const MODULE_STATE_OPEN = 1;\n\n    /**\n     * Module is minimized\n     */\n    const MODULE_STATE_MINIMIZED = 2;\n\n    /**\n     * Module is hidden\n     */\n    const MODULE_STATE_HIDDEN = 3;\n\n    /**\n     * Array of modules\n     *\n     * @var array\n     */\n    protected $_modules = array();\n\n    /**\n     * Module path\n     *\n     * @var string\n     */\n    protected $_extensionDir = '';\n\n    /**\n     * Array of module states\n     *\n     * @var array\n     */\n    protected $_moduleStates = array();\n\n    /**\n     * Array of module contexts (keys) and modules therein\n     *\n     * @var array\n     */\n    protected $_moduleOrder = array();\n\n    /**\n     * Singleton instance\n     *\n     * @var OntoWiki_Module_Registry\n     */\n    private static $_instance = null;\n\n    /**\n     * private Constructor\n     */\n    private function __construct()\n    {\n        $this->_moduleStates = new Zend_Session_Namespace('Module_Registry');\n\n        // TODO: module order per namespace?\n        if (isset($this->_moduleStates->moduleOrder)) {\n            $this->_moduleOrder = $this->_moduleStates->moduleOrder;\n        }\n    }\n\n    /**\n     * Singleton instance\n     *\n     * @return OntoWiki_Module_Registry\n     */\n    public static function getInstance()\n    {\n        if (null === self::$_instance) {\n            self::$_instance = new self();\n        }\n\n        return self::$_instance;\n    }\n\n    /**\n     * Resets the instance to its initial state. Mainly used for\n     * testing purposes.\n     */\n    public function resetInstance()\n    {\n        $this->_modules      = array();\n        $this->_moduleStates = array();\n        $this->_moduleOrder  = array();\n    }\n\n    public static function reset()\n    {\n        if (null !== self::$_instance) {\n            self::$_instance->resetInstance();\n        }\n        self::$_instance = null;\n    }\n\n    /**\n     * Sets the path where modules are to be found\n     *\n     * @since 0.9.5\n     * @return OntoWiki_Module_Registry\n     */\n    public function setExtensionPath($extensionDir)\n    {\n        $extensionDir = (string)$extensionDir;\n\n        if (is_readable($extensionDir)) {\n            $this->_extensionDir = $extensionDir;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Registers modulewith name $moduleName in namespace $namspace.\n     *\n     * @param string $extensionName the name of the extension that brings this module\n     * @param string $moduleName    the name of the module\n     * @param string $context       in which context the module should be shown\n     * @param array  $options       config object of the module\n     *\n     * @return OntoWiki_Module_Registry\n     */\n    public function register($extensionName, $moduleFileName, $context = self::DEFAULT_CONTEXT, $options = null)\n    {\n        $moduleName = strtolower(\n            substr($moduleFileName, 0, strlen($moduleFileName) - strlen(self::MODULE_FILE_POSTFIX))\n        );\n\n        if (!array_key_exists($context, $this->_moduleOrder)) {\n            $this->_moduleOrder[$context] = array();\n        }\n\n        if ($options == null) {\n            $options = new Zend_Config(array(), true);\n        } else {\n            if (is_array($options)) {\n                $options = new Zend_Config($options, true);\n            }\n        }\n\n        //if not already registered\n        if (!array_key_exists($moduleName, $this->_modules)) {\n            // merge defaults\n            $default = new Zend_Config(\n                array(\n                     'id'            => strtolower($moduleName),\n                     'classes'       => '',\n                     'name'          => ucwords($moduleName),\n                     'enabled'       => true,\n                     'extensionName' => $extensionName,\n                     'private'       => array()\n                ),\n                true\n            );\n            $options = $default->merge($options);\n\n            // set css classes according to module state\n            if (true == property_exists($options, 'id')) {\n                switch ($this->_moduleStates->{$options->id}) {\n                    case self::MODULE_STATE_OPEN:\n                        break;\n                    case self::MODULE_STATE_MINIMIZED:\n                        $options->classes .= ' is-minimized';\n                        break;\n                    case self::MODULE_STATE_HIDDEN:\n                        $options->classes .= ' is-disabled';\n                        break;\n                }\n            }\n\n            // register module\n            $this->_modules[$moduleName] = $options;\n        } else {\n            if (in_array($moduleName, $this->_moduleOrder[$context])) {\n                throw new Exception(\"Module '$moduleName' is already registered for context '$context'.\");\n            }\n        }\n\n        // set module order and context\n        if (isset($options->priority)) {\n            $position                                = $this->_getModulePosition($context, $options->priority);\n            $this->_moduleOrder[$context][$position] = $moduleName;\n        } else {\n            $this->_moduleOrder[$context][] = $moduleName;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns whether the module with $moduleName has been registered\n     * under namespace $namespace.\n     *\n     * @param string $moduleName\n     * @param string $namespace\n     *\n     * @return boolean\n     */\n    public function isModuleEnabled($moduleName)\n    {\n        return array_key_exists($moduleName, $this->_modules) && $this->_modules[$moduleName]->enabled == true;\n    }\n\n    /**\n     * Sets the module's state to disabled. If the module doesn't exists, it is\n     * registered as disabled.\n     *\n     * @param string $moduleName\n     * @param string $namespace\n     *\n     * @return OntoWiki_Module_Registry\n     */\n    public function disableModule($moduleName, $context = self::DEFAULT_CONTEXT)\n    {\n        if ($this->isModuleEnabled($moduleName)) {\n            $this->_modules[$moduleName]->enabled = false;\n        } else {\n            $this->register($moduleName, $moduleName, $context, new Zend_Config(array('enabled' => false), true));\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns an instance of the module denoted by $moduleName, if registered.\n     *\n     * @param string $moduleName\n     *\n     * @return OntoWiki_Module\n     * @throws OntoWiki_Module_Exception if a module with the has not been registered.\n     */\n    public function getModule($moduleName, $context = null)\n    {\n        if (!$this->isModuleEnabled($moduleName)) {\n            return null;\n        }\n        $moduleFile = $this->_extensionDir\n            . $this->_modules[$moduleName]->extensionName\n            . DIRECTORY_SEPARATOR\n            . ucfirst($moduleName)\n            . self::MODULE_FILE_POSTFIX;\n\n        if (!is_readable($moduleFile)) {\n            throw new OntoWiki_Module_Exception(\"Module '$moduleName' could not be loaded from path '$moduleFile'.\");\n        }\n\n        // instantiate module\n        require_once $moduleFile;\n        $moduleClass = ucfirst($moduleName)\n            . self::MODULE_CLASS_POSTFIX;\n        $module      = null;\n        if (class_exists($moduleClass)) {\n            $module = new $moduleClass($moduleName, $context, $this->_modules[$moduleName]);\n        }\n\n        return $module;\n    }\n\n    public function getModules()\n    {\n        return $this->_modules;\n    }\n\n    /**\n     * Returns the config for the module denoted by $moduleName.\n     *\n     * @param string $moduleName The module's name\n     *\n     * @return array\n     */\n    public function getModuleConfig($moduleName)\n    {\n        $moduleName = (string)$moduleName;\n\n        if (array_key_exists($moduleName, $this->_modules)) {\n            return $this->_modules[$moduleName];\n        }\n    }\n\n    /**\n     * Returns all module names that are registered and enabled under\n     * namespace $namespace.\n     *\n     * @param string $namespace\n     *\n     * @return array|null\n     */\n    public function getModulesForContext($context = self::DEFAULT_CONTEXT)\n    {\n        $modules = array();\n        if (array_key_exists($context, $this->_moduleOrder)) {\n            ksort($this->_moduleOrder[$context]);\n\n            foreach ($this->_moduleOrder[$context] as $moduleName) {\n                if (array_key_exists($moduleName, $this->_modules)) {\n                    if ((boolean)$this->_modules[$moduleName]->enabled === true) {\n                        $modules[$moduleName] = $this->_modules[$moduleName];\n                    }\n                }\n            }\n        }\n\n        return $modules;\n    }\n\n    /**\n     * Returns the first empty position greater than $priority\n     * in the internal module array.\n     *\n     * @param string $context  The module context\n     * @param int    $priority The module's priority request\n     */\n    protected function _getModulePosition($context, $priority)\n    {\n        while (array_key_exists($priority, $this->_moduleOrder[$context])) {\n            $priority++;\n        }\n\n        return $priority;\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Module.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module base class.\n *\n * Serves as a base class for all OntoWiki modules.\n *\n * @category OntoWiki\n * @package  OntoWiki_Classes\n * @author   Norman Heino <norman.heino@gmail.com>\n */\nabstract class OntoWiki_Module\n{\n    /**\n     * Default value for caching enabled\n     *\n     * @var boolean\n     */\n    const MODULE_CACHING_DEFAULT = true;\n\n    /**\n     * OntoWiki Application config\n     *\n     * @var Zend_Config\n     */\n    protected $_config = null;\n\n    /**\n     * The current module context thats loaded this module\n     */\n    protected $_context = null;\n\n    /**\n     * Erfurt framework entry\n     *\n     * @var Erfurt_App\n     */\n    protected $_erfurt = null;\n\n    /**\n     * Currently selected language\n     *\n     * @var string\n     */\n    protected $_lang = null;\n\n    /**\n     * The module name\n     *\n     * @var string\n     */\n    protected $_name = null;\n\n    /**\n     * OntoWiki Application object\n     *\n     * @var OntoWiki\n     */\n    protected $_owApp = null;\n\n    /**\n     * The module private config ([private] section from module.ini file)\n     *\n     * @var Zend_Config\n     */\n    protected $_privateConfig = null;\n\n    /**\n     * The module runtime options from the view's module method's second\n     * parameter (merged with default module options)\n     * injected with setOptions from the view\n     *\n     * @var Zend_Config\n     */\n    protected $_options = null;\n\n    /**\n     * The current request object\n     *\n     * @var Zend_Controller_Request_Abstract\n     */\n    protected $_request = null;\n\n    /**\n     * Erfurt store tab\n     *\n     * @var Erfurt_Store\n     */\n    protected $_store = null;\n\n    /**\n     * File extension for template files\n     *\n     * @var string\n     */\n    protected $_templateSuffix = 'phtml';\n\n    /**\n     * The module view\n     *\n     * @var Zend_View_Interface\n     */\n    public $view = null;\n\n    /**\n     * Constructor\n     */\n    public function __construct($name, $context, $config)\n    {\n        // init view\n        if (null === $this->view) {\n            $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');\n            if (null === $viewRenderer->view) {\n                $viewRenderer->initView();\n            }\n            $this->view = clone $viewRenderer->view;\n            $this->view->clearVars();\n        }\n\n        $this->_templateSuffix = '.' . ltrim($this->_templateSuffix, '.');\n\n        $this->_owApp   = OntoWiki::getInstance();\n        $this->_erfurt  = $this->_owApp->erfurt;\n        $this->_store   = $this->_erfurt->getStore();\n        $this->_config  = $this->_owApp->config;\n        $this->_lang    = $this->_config->languages->locale;\n        $this->_request = Zend_Controller_Front::getInstance()->getRequest();\n\n        $this->_name = $name;\n\n        // set important script variables\n        $this->view->themeUrlBase = $this->_config->themeUrlBase;\n        $this->view->urlBase      = $this->_config->urlBase;\n        $this->view->moduleUrl    = $this->_config->staticUrlBase\n            . $this->_config->extensions->base\n            . $config->extensionName . '/';\n\n        // set the config\n        $this->_privateConfig = $config->private;\n\n        // set the context\n        $this->setContext($context);\n\n        // allow custom module initialization\n        $this->init();\n    }\n\n    /**\n     * Returns the current context or the default context if none has been set.\n     *\n     * @return string\n     */\n    public function getContext()\n    {\n        if (null != $this->_context) {\n            return $this->_context;\n        }\n\n        return OntoWiki_Module_Registry::DEFAULT_CONTEXT;\n    }\n\n    /**\n     * Renders the module content with the module template.\n     *\n     * @return string\n     */\n    public function render($template, $vars = array(), $spec = null)\n    {\n        $template = $template\n            . $this->_templateSuffix;\n\n        if (null === $spec) {\n            $this->view->assign($vars);\n        } else {\n            $this->view->assign($spec, $vars);\n        }\n\n        return $this->view->render($template);\n    }\n\n    /**\n     * Sets the current context so the module can perform different actions\n     * depending on the context.\n     *\n     * @param string $context\n     */\n    public function setContext($context)\n    {\n        $this->_context = $context ? (string)$context : OntoWiki_Module_Registry::DEFAULT_CONTEXT;\n    }\n\n    /**\n     * Returns the rendered module.\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->getContents();\n    }\n\n    /**\n     * Returns whether the module wants its content to be cached.\n     *\n     * The base clase implementation returns the value set in the module.ini\n     * config file or the default value if not set.\n     *\n     * @return boolean\n     */\n    public function allowCaching()\n    {\n        if (isset($this->caching)) {\n            return (boolean)$this->caching;\n        }\n\n        // return default\n        return self::MODULE_CACHING_DEFAULT;\n    }\n\n    /**\n     * Returns wheter the module should be displayd in the current\n     * application state.\n     *\n     * @return boolean\n     */\n    public function shouldShow()\n    {\n        return true;\n    }\n\n    /**\n     * Returns a string is unique to the module's state and can be used for\n     * cache identification.\n     *\n     * @return string\n     */\n    public function getCacheId()\n    {\n        $id = $this->_config->host\n            . $this->_name\n            . $this->getStateId();\n\n        return $id;\n    }\n\n    /**\n     * Returns the number of seconds after which this module's content\n     * cache should be renewed\n     *\n     * @return int\n     */\n    public function getCacheLivetime()\n    {\n        return 600;\n    }\n\n    /**\n     * Returns an OntoWiki_Message object that should be displayed on top of all\n     * module content.\n     *\n     * @return OntoWiki_Message|null\n     */\n    public function getMessage()\n    {\n        return null;\n    }\n\n    /**\n     * Returns a string that contains the string representation\n     * of all variable this module's state (content) depends on.\n     *\n     * @return string\n     */\n    public function getStateId()\n    {\n    }\n\n\n    /**\n     * Allows for custom module initialization\n     */\n    public function init()\n    {\n    }\n\n    /**\n     * Returns the contents this module provides.\n     *\n     * Only provide the real content. About surrounding markup\n     * is taken care by OntoWiki in order to provide consistent\n     * look & feel.\n     *\n     * If you want to provide tabs in your module window, return\n     * an array whose keys are translatable names of the tabs and\n     * will be used as anchor ids in HTML code.\n     *\n     * @return string|array\n     */\n    public function getContents()\n    {\n    }\n\n    /**\n     * Returns the title of the module\n     *\n     * If no title is provided, the title is used from the module config.\n     *\n     * @return string\n     */\n    public function getTitle()\n    {\n        if (isset($this->title)) {\n            return $this->title;\n        }\n    }\n\n    /*\n     * setter method for options\n     */\n    public function setOptions(Zend_Config $options = null)\n    {\n        if ($options) {\n            $this->_options = $options;\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Navigation.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki navigation registry.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Navigation\n{\n    /**\n     * Array with navigation elements\n     *\n     * @var array\n     */\n    protected $_navigation = array();\n\n    /**\n     * Array for the default navigation element group\n     *\n     * @var array\n     */\n    protected $_defaultGroups = array();\n\n    /**\n     * Array of navigation elements with configured position\n     *\n     * @var array\n     */\n    protected $_ordered = array();\n\n    /**\n     * Array of navigation elements without a configured position\n     *\n     * @var array\n     */\n    protected $_unordered = array();\n\n    /**\n     * Key of the currently active navigation element\n     *\n     * @var string\n     */\n    protected $_activeKey = null;\n\n    /**\n     * Array of parameters that should be kept when switching navigation elements.\n     *\n     * @var array\n     */\n    protected $_keepParams\n        = array(\n            'r'\n        );\n\n    /** @var boolean */\n    protected $_isDisabled = false;\n\n    /**\n     * Constructor\n     */\n    public function __construct()\n    {\n\n    }\n\n    /**\n     * Disables the navigation for the current view.\n     */\n    public function disableNavigation()\n    {\n        $this->_isDisabled = true;\n    }\n\n    /**\n     * Returns the currently active navigation component.\n     *\n     * @return array\n     */\n    public function getActive()\n    {\n        if (!$this->_activeKey) {\n            return null;\n        }\n\n        return $this->_navigation[$this->_activeKey];\n    }\n\n    /**\n     * Returns whether the navigation is disabled for the current view\n     *\n     * @return boolean\n     */\n    public function isDisabled()\n    {\n        return $this->_isDisabled;\n    }\n\n    /**\n     * Registers a component with the navigation\n     *\n     * @param string  $key     the identifier for the component\n     * @param array   $options An options array for the navigation entry.\n     *                         The following keys are recognized:\n     *                         name –       The name displayed on the tab\n     *                         route –      A Zend route name (internal OntoWiki route;\n     *                         mapped automatically to a controller and action name\n     *                         by Zend). Controller and action keys are ignored if a\n     *                         route is given.\n     *                         controller – Controller name for the URL\n     *                         action –     Action name for the URL\n     *                         priority –   Priority of the tab\n     * @param boolean $replace Whether to replace previously registered tabs\n     *                         with the same name\n     *\n     * @todo  Implement functionality to maintain a preferred order\n     */\n    public function register($key, array $options, $replace = false)\n    {\n        if (true == array_key_exists($key, $this->_navigation) && !$replace) {\n            throw new OntoWiki_Exception(\"Navigation component with key '$key' already registered.\");\n        }\n\n        if (!is_string($key)) {\n            throw new OntoWiki_Exception(\"Key needs to be a string.\");\n        }\n\n        if (0 == strlen((string)$key)) {\n            throw new OntoWiki_Exception(\"No key was set.\");\n        }\n\n        if (false == array_key_exists('name', $options)) {\n            $options['name'] = $key;\n        }\n\n        // merge defaults\n        $options = array_merge(\n            array(\n                 'route'      => null,\n                 'controller' => null,\n                 'action'     => null,\n                 'name'       => null\n            ), $options\n        );\n\n        // add registrant\n        $this->_navigation[$key] = $options;\n\n        // store order request\n        if (false == $replace) {\n            if (true == array_key_exists('priority', $options) && true == is_numeric($options['priority'])) {\n                $position = (int)$options['priority'];\n                while (array_key_exists((string)$position, $this->_ordered)) {\n                    $position++;\n                }\n                $this->_ordered[$position] = $key;\n            } else {\n                $this->_unordered[] = $key;\n            }\n        }\n\n        // if this is the first element, set it active\n        if (1 == count($this->_navigation)) {\n            $this->setActive($key);\n        }\n    }\n\n    /**\n     * Sets the currently active navigation component.\n     *\n     * @param string $key the identifier for the component\n     */\n    public function setActive($key)\n    {\n        if (false == array_key_exists($key, $this->_navigation)) {\n            throw new OntoWiki_Exception('Navigation component with key \\'' . $key . '\\' not registered.');\n        }\n\n        // set the current active to unactive\n        if ($this->_activeKey != null) {\n            unset($this->_navigation[$this->_activeKey]['active']);\n        }\n\n        // set new active\n        $this->_navigation[$key]['active'] = 'active';\n\n        // remember new\n        $this->_activeKey = $key;\n    }\n\n    /**\n     * Checks if a navigation components with the given key has been.\n     *\n     * @return boolean\n     */\n    public function isRegistered($key)\n    {\n        if (array_key_exists($key, $this->_navigation)) {\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Returns an array of registered navigation components\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        if (false == $this->_isDisabled) {\n            $return = array();\n\n            $session = new Zend_Session_Namespace('ONTOWIKI_NAVIGATION');\n            if (isset($session->tabOrder)) {\n                $over = array_diff($this->_ordered, $session->tabOrder);\n                ksort($over);\n                $this->_ordered = array_merge($session->tabOrder, $over);\n            }\n\n            $request           = Zend_Controller_Front::getInstance()->getRequest();\n            $currentController = $request->getControllerName();\n            $currentAction     = $request->getActionName();\n\n            ksort($this->_ordered);\n            // first the order requests\n            foreach ($this->_ordered as $orderKey => $elementKey) {\n\n                if (array_key_exists($elementKey, $this->_navigation)) {\n                    $this->_navigation[$elementKey]['url'] = $this->_getUrl(\n                        $elementKey, $currentController, $currentAction\n                    );\n\n                    // set active if current\n                    if ($currentController == $this->_navigation[$elementKey]['controller']\n                        && $currentAction == $this->_navigation[$elementKey]['action']\n                    ) {\n                        $this->setActive($elementKey);\n                    }\n\n                    $return[$elementKey] = true;\n                }\n            }\n\n            // finally the unordered\n            foreach ($this->_unordered as $name => $elementKey) {\n                $this->_navigation[$elementKey]['url'] = $this->_getUrl(\n                    $elementKey, $currentController, $currentAction\n                );\n\n                // set active if current\n                if ($currentController == $this->_navigation[$elementKey]['controller']\n                    && $currentAction == $this->_navigation[$elementKey]['action']\n                ) {\n                    $this->setActive($elementKey);\n                }\n\n                $return[$elementKey] = $this->_navigation[$elementKey];\n            }\n\n            // now use the most recent version from $this->_navigation, since it contains the real active state\n            $newReturn = array();\n            foreach ($return as $key => $true) {\n                $newReturn[$key] = $this->_navigation[$key];\n            }\n            $return = $newReturn;\n\n            return $return;\n        }\n    }\n\n    /**\n     * Returns the URL of the given navigation element\n     *\n     * @return OntoWiki_Url\n     */\n    protected function _getUrl($elementKey, $currentController, $currentAction)\n    {\n        $request = Zend_Controller_Front::getInstance()->getRequest();\n        $router  = Zend_Controller_Front::getInstance()->getRouter();\n\n        $current  = $this->_navigation[$elementKey];\n        $hasRoute = false;\n\n        if (isset($current['route'])) {\n            if ($router->hasRoute($current['route'])) {\n                $route    = $router->getRoute($current['route']);\n                $defaults = $route->getDefaults();\n\n                if ($defaults['controller'] == $current['controller'] && $defaults['action'] == $current['action']) {\n                    $hasRoute = true;\n                }\n            }\n        }\n\n        if ($hasRoute) {\n            $url = new OntoWiki_Url(array('route' => $current['route']), $this->_keepParams);\n        } else {\n            $controller = $current['controller'];\n            $action     = $current['action'] ? $current['action'] : null;\n\n            $url = new OntoWiki_Url(array('controller' => $controller, 'action' => $action), $this->_keepParams);\n        }\n        $keyBlacklist   = array('route', 'controller', 'action', 'priority', 'name', 'active');\n        foreach ($current as $key => $value) {\n            if (!in_array($key, $keyBlacklist)) {\n                $url->setParam($key, $value);\n            }\n        }\n        return $url;\n    }\n\n    /**\n     *\n     */\n    public function getNavigation()\n    {\n        return $this->_navigation;\n    }\n\n    /**\n     *\n     */\n    public function reset()\n    {\n        $this->_navigation    = array();\n        $this->_activeKey     = null;\n        $this->_isDisabled    = false;\n        $this->_defaultGroups = array();\n        $this->_ordered       = array();\n        $this->_unordered     = array();\n        $this->_keepParams    = array('r');\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Pager.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki pager class.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Pager\n{\n    /** @var string */\n    public static $firstHtml = '&laquo;&nbsp;';\n\n    /** @var string */\n    public static $prevHtml = '&lsaquo;&nbsp;';\n\n    /** @var string */\n    public static $nextHtml = '&nbsp;&rsaquo;';\n\n    /** @var string */\n    public static $lastHtml = '&nbsp;&raquo;';\n\n    /** @var array */\n    protected static $_options\n        = array(\n            'default_limit'   => 10,\n            'show_first_last' => true,\n            'max_page_links'  => 5,\n            'page_param'      => 'p'\n        );\n\n    /** @var OntoWiki_Url */\n    protected static $_url = null;\n\n    /**\n     * Sets pager options statically.\n     *\n     * @param array $options\n     */\n    public static function setOptions(array $options)\n    {\n        self::$_options = array_merge(self::$_options, $options);\n    }\n\n    /**\n     * Returns pagination links for the current URL with $count and $limit items.\n     *\n     * @param $count the total number of items\n     * @param $limit the number of items per page\n     */\n    public static function get(\n        $count, $limit = null, $itemsOnPage = null, $page = null, $listName = null, $otherParams = array()\n    ) {\n        if (null != $limit) {\n            self::$_options['default_limit'] = $limit;\n        }\n\n        if (Erfurt_Store::COUNT_NOT_SUPPORTED == $count) {\n            self::$_options['show_first_last'] = false;\n            //self::$_options['max_page_links']  = 0;\n        }\n\n        // get URL with params p (page number) and limit (not used atm)\n        $paramsToKeep = array_merge($otherParams, array('p', 'limit', 'r', 'm'));\n        self::$_url   = new OntoWiki_Url(array(), $paramsToKeep);\n        self::$_url->setParam(\"list\", $listName);\n\n        $limit = isset(self::$_url->limit) ? self::$_url->limit : self::$_options['default_limit'];\n\n        if ($limit == 0) {\n            // means no limit\n            // no pager needed\n            return \"\";\n        }\n\n        if (isset(self::$_url->{self::$_options['page_param']})) {\n            $page = self::$_url->{self::$_options['page_param']};\n        } else {\n            $page = ($page != null ? $page : 1);\n        }\n\n        $pagerLinks = array();\n\n        // translation helper\n        $translate = OntoWiki::getInstance()->translate;\n\n        // pagination necessary\n        if (($count > $limit) || ($count == Erfurt_Store::COUNT_NOT_SUPPORTED)) {\n            // previous page exists\n            if ($page > 1) {\n                if (self::$_options['show_first_last']) {\n                    self::$_url->{self::$_options['page_param']} = 1;\n                    self::$_url->limit = $limit;\n                    $pagerLinks[]                                = sprintf(\n                        '<a class=\"minibutton\" href=\"%s\">%s</a>', self::$_url, self::$firstHtml . $translate->_('First')\n                    );\n                }\n\n                self::$_url->{self::$_options['page_param']} = $page - 1;\n                self::$_url->limit = $limit;\n                $pagerLinks[]                                = sprintf(\n                    '<a class=\"minibutton\" href=\"%s\">%s</a>', self::$_url, self::$prevHtml . $translate->_('Previous')\n                );\n            } else {\n                if (self::$_options['show_first_last']) {\n                    $pagerLinks[] = sprintf(\n                        '<a class=\"disabled minibutton\">%s</a>', self::$firstHtml . $translate->_('First')\n                    );\n                }\n                $pagerLinks[] = sprintf(\n                    '<a class=\"disabled minibutton\">%s</a>', self::$prevHtml . $translate->_('Previous')\n                );\n            }\n\n            // individual page links\n            if ($count != null) {\n                if (self::$_options['show_first_last']) {\n                    $maxLinksAsym = floor(self::$_options['max_page_links'] / 2);\n                    $offset       = 0;\n                } else {\n                    // first and last links are disabled, so always show first and last individual page\n                    $maxLinksAsym                                = floor((self::$_options['max_page_links'] - 2) / 2);\n                    self::$_url->{self::$_options['page_param']} = 1;\n                    self::$_url->limit = $limit;\n                    if ($page == 1) {\n                        $pagerLinks[] = '<a class=\"selected minibutton\">1</a>';\n                    } else {\n                        $pagerLinks[] = '<a class=\"minibutton\" href=\"' . self::$_url . '\">1</a>';\n                    }\n                    $offset = 1;\n\n                    // if there is a gap, show dots\n                    if (($page - $maxLinksAsym) > 2) {\n                        $pagerLinks[] = '&hellip;';\n                    }\n                }\n\n                if ($count === Erfurt_Store::COUNT_NOT_SUPPORTED) {\n                    for ($i = max(1 + $offset, $page - $maxLinksAsym); $i <= $page; ++$i) {\n                        self::$_url->{self::$_options['page_param']} = $i;\n                        self::$_url->limit = $limit;\n                        if ($page == $i) {\n                            $pagerLinks[] = '<a class=\"selected minibutton\">' . $i . '</a>';\n                        } else {\n                            $pagerLinks[] = '<a class=\"minibutton\" href=\"' . self::$_url . '\">' . $i . '</a>';\n                        }\n                    }\n                } else {\n                    $forLoopTest = min(ceil($count / $limit) - $offset, $page + $maxLinksAsym);\n                    for (\n                        $i = max(1 + $offset, $page - $maxLinksAsym); $i <= $forLoopTest; ++$i) {\n                        self::$_url->{self::$_options['page_param']} = $i;\n                        self::$_url->limit = $limit;\n\n                        if ($page == $i) {\n                            $pagerLinks[] = '<a class=\"selected minibutton\">' . $i . '</a>';\n                        } else {\n                            $pagerLinks[] = '<a class=\"minibutton\" href=\"' . self::$_url . '\">' . $i . '</a>';\n                        }\n                    }\n                }\n\n                if (!self::$_options['show_first_last'] && ($count !== Erfurt_Store::COUNT_NOT_SUPPORTED)) {\n                    self::$_url->{self::$_options['page_param']} = (int)ceil($count / $limit);\n                    self::$_url->limit = $limit;\n                    if ((self::$_url->{self::$_options['page_param']} - $page) > 2) {\n                        $pagerLinks[] = '&hellip;';\n                    }\n                    if ($page == self::$_url->{self::$_options['page_param']}) {\n                        $pagerLinks[]\n                            = '<a class=\"selected minibutton\">' . self::$_url->{self::$_options['page_param']} . '</a>';\n                    } else {\n                        $pagerLinks[] = '<a class=\"minibutton\" href=\"' . self::$_url . '\">'\n                            . self::$_url->{self::$_options['page_param']} . '</a>';\n                    }\n                }\n            }\n\n            // next page exists\n            if (($count > $page * $limit) || ($count == Erfurt_Store::COUNT_NOT_SUPPORTED && $itemsOnPage === $limit)) {\n                self::$_url->{self::$_options['page_param']} = $page + 1;\n                self::$_url->limit = $limit;\n                $pagerLinks[]                                = sprintf(\n                    '<a class=\"minibutton\" href=\"%s\">%s</a>', self::$_url, $translate->_('Next') . self::$nextHtml\n                );\n\n                if (self::$_options['show_first_last']) {\n                    self::$_url->{self::$_options['page_param']} = (int)ceil($count / $limit);\n                    self::$_url->limit = $limit;\n                    $pagerLinks[]                                = sprintf(\n                        '<a class=\"minibutton\" href=\"%s\">%s</a>', self::$_url, $translate->_('Last') . self::$lastHtml\n                    );\n                }\n            } else {\n                $pagerLinks[] = sprintf(\n                    '<a class=\"disabled minibutton\">%s</a>', $translate->_('Next') . self::$nextHtml\n                );\n                if (self::$_options['show_first_last']) {\n                    $pagerLinks[] = sprintf(\n                        '<a class=\"disabled minibutton\">%s</a>', $translate->_('Last') . self::$lastHtml\n                    );\n                }\n            }\n\n            $ret = '<ul>';\n            foreach ($pagerLinks as $link) {\n                $ret .= '<li>' . $link . '</li>';\n            }\n            $ret .= '</ul>';\n\n            return $ret;\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Plugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki plugin base class.\n *\n * Serves as a base class for all OntoWiki plug-ins. An OntoWiki plug-in is a\n * class or object that meets the following requirements:\n * - it consists of a folder residing under OntoWiki's plug-in dir\n * - that folder contains a .php file with the same name\n * - that php file defines a class that is named like the file with the\n *   first letter in upper case and the suffix 'Plugin'\n * - the folder as well contains a 'plugin.ini' config file\n *\n * @category OntoWiki\n * @package  OntoWiki_Classes\n * @author   Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Plugin extends Erfurt_Plugin\n{\n    /**\n     * The plug-in's view for rendering templates\n     *\n     * @var OntoWiki_View\n     */\n    public $view = null;\n\n    /**\n     * The plug-in URL base\n     *\n     * @var string\n     */\n    protected $_pluginUrlBase = null;\n\n    /**\n     * Constructor\n     */\n    public function __construct($root, $config = null)\n    {\n        // init view\n        if (null === $this->view) {\n            $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');\n            if (null === $viewRenderer->view) {\n                $viewRenderer->initView();\n            }\n            $this->view = clone $viewRenderer->view;\n            $this->view->clearVars();\n        }\n\n        $this->_pluginUrlBase = OntoWiki::getInstance()->getStaticUrlBase()\n            . str_replace(ONTOWIKI_ROOT, '', $root);\n\n        parent::__construct($root, $config);\n    }\n}\n\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Request.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki Request class\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Request extends Zend_Controller_Request_Http\n{\n    /**\n     * Returns a parameter from the current request and expands its URI\n     * using the local namespace table. It also strips slashes if\n     * magic_quotes_gpc is turned on in PHP.\n     *\n     * @param string  $name            the name of the parameter\n     * @param boolean $expandNamespace Whether to expand the namespace or not\n     *\n     * @return mixed the parameter or null if not found\n     */\n    public function getParam($key, $default = null, $expandNamespace = false)\n    {\n        // get parameter value from Zend_Request\n        $value = parent::getParam($key, $default);\n\n        if ($expandNamespace) {\n            // expandable parameters cannot be arrays\n            if (is_array($value)) {\n                $value = current($value);\n            }\n\n            // expand namespace\n            $value = OntoWiki_Utils::expandNamespace($value);\n        }\n\n        // strip slash quotes if necessary\n        if (get_magic_quotes_gpc() && is_string($value)) {\n            $value = stripslashes($value);\n        }\n\n        return $value;\n    }\n}\n\n\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Resource.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki resource class\n *\n * Extends Erfurt_Rdf_Resource with a getTitle method OntoWiki uses\n *\n * @category  OntoWiki\n * @category  OntoWiki_Classes\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Resource extends Erfurt_Rdfs_Resource\n{\n    /**\n     * Human-readable representation of this resource.\n     */\n    protected $_title = null;\n\n    /**\n     * Title helper for CBD resources.\n     *\n     * @var OntoWiki_Model_TitleHelper\n     */\n    protected $_descriptionHelper = null;\n\n    /**\n     * Returns a human-readable representation of this resource or false\n     * if no suitable value has been found.\n     *\n     * @return string|null\n     */\n    public function getTitle($lang = null)\n    {\n        if (null === $this->_title) {\n            require_once 'OntoWiki/Model/TitleHelper.php';\n            $titleHelper = new OntoWiki_Model_TitleHelper($this->_model);\n            $titleHelper->addResource($this->getUri());\n            $this->_title = $titleHelper->getTitle($this->getUri(), $lang);\n        }\n\n        return $this->_title;\n    }\n\n    public function getDescriptionHelper()\n    {\n        $this->_descriptionResource($this->getUri());\n\n        return $this->_descriptionHelper;\n    }\n\n    protected function _descriptionResource($uri)\n    {\n        if (null === $this->_descriptionHelper) {\n            $this->_descriptionHelper = new OntoWiki_Model_TitleHelper($this->_model);\n        }\n\n        $this->_descriptionHelper->addResource($uri);\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Test/ControllerTestCase.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nclass OntoWiki_Test_ControllerTestCase extends Zend_Test_PHPUnit_ControllerTestCase\n{\n    /** @var Erfurt_Ac_Test|Erfurt_Ac_Default */\n    protected $_ac = null;\n\n    /** @var Erfurt_Store_Adapter_Interface */\n    protected $_storeAdapter = null;\n\n    /** @var string|null */\n    protected $_extensionName = null;\n\n    public function setUpIntegrationTest()\n    {\n        $this->bootstrap = new Zend_Application(\n            'integration_testing',\n            ONTOWIKI_ROOT . 'application/config/application.ini'\n        );\n\n        try {\n            parent::setUp();\n        } catch (Exception $e) {\n            // if we can't connect to the database, we skip the test\n            $this->markTestSkipped($e->getMessage());\n        }\n\n        // additional checks for database....\n        $this->_markTestNeedsDatabase();\n    }\n\n    public function setUpUnitTest()\n    {\n        $this->bootstrap = new Zend_Application(\n            'unit_testing',\n            ONTOWIKI_ROOT . 'application/config/application.ini'\n        );\n\n        parent::setUp();\n\n        $this->_storeAdapter = Erfurt_App::getInstance(false)->getStore()->getBackendAdapter();\n    }\n\n    public function setUpExtensionUnitTest()\n    {\n        $this->bootstrap = new Zend_Application(\n            'extension_unit_testing',\n            ONTOWIKI_ROOT . 'application/config/application.ini'\n        );\n        parent::setUp();\n\n        if (null !== $this->_extensionName) {\n            $extensionManager = OntoWiki::getInstance()->extensionManager;\n\n            if (!$extensionManager->isExtensionActive($this->_extensionName)) {\n                Erfurt_Event_Dispatcher::reset();\n                $this->markTestSkipped('extension is not active');\n            }\n        }\n\n        $this->_ac           = Erfurt_App::getInstance(false)->getAc();\n        $this->_storeAdapter = Erfurt_App::getInstance(false)->getStore()->getBackendAdapter();\n    }\n\n    public function setUpExtensionIntegrationTest()\n    {\n        $this->setUpIntegrationTest();\n\n        if (null !== $this->_extensionName) {\n            $extensionManager = OntoWiki::getInstance()->extensionManager;\n\n            if (!$extensionManager->isExtensionActive($this->_extensionName)) {\n                Erfurt_Event_Dispatcher::reset();\n                $this->markTestSkipped('extension is not active');\n            }\n        }\n    }\n\n    public function frontEndLogin() {\n        $store = OntoWiki::getInstance()->erfurt->getStore();\n        $this->request->setMethod('POST')->setPost(\n            array(\n                 'u' => $store->getDbUser(),\n                 'p' => $store->getDbPassword()\n            )\n        );\n    }\n\n    private function _markTestNeedsDatabase()\n    {\n        $config = Erfurt_App::getInstance(false)->getConfig();\n\n        $dbName = null;\n        if ($config->store->backend === 'virtuoso') {\n            if (isset($config->store->virtuoso->dsn)) {\n                $dbName = $config->store->virtuoso->dsn;\n            }\n        } else {\n            if ($config->store->backend === 'zenddb') {\n                if (isset($config->store->zenddb->dbname)) {\n                    $dbName = $config->store->zenddb->dbname;\n                }\n            }\n        }\n\n        if ((null === $dbName) || (substr($dbName, -5) !== '_TEST')) {\n            $this->markTestSkipped('Invalid test database for tests: ' . $dbName); // make sure a test db was selected!\n        }\n\n        try {\n            $store = Erfurt_App::getInstance(false)->getStore();\n            $store->checkSetup();\n            $this->_dbWasUsed = true;\n        } catch (Erfurt_Store_Exception $e) {\n            if ($e->getCode() === 20) {\n                // Setup successful\n                $this->_dbWasUsed = true;\n            } else {\n                $this->markTestSkipped();\n            }\n        } catch (Erfurt_Exception $ee) {\n            $this->markTestSkipped();\n        }\n\n        $this->assertTrue(Erfurt_App::getInstance()->getStore()->isModelAvailable($config->sysont->modelUri, false));\n        $this->assertTrue(Erfurt_App::getInstance()->getStore()->isModelAvailable($config->sysont->schemaUri, false));\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Test/ExtensionIntegrationTestBootstrap.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once realpath(dirname(dirname(dirname(dirname(__FILE__))))) . DIRECTORY_SEPARATOR . 'Bootstrap.php';\n\n/**\n * OntoWiki bootstrap class.\n *\n * Provides on-demand loading of application resources.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Bootstrap\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass OntoWiki_Test_ExtensionIntegrationTestBootstrap extends Bootstrap\n{\n\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Test/ExtensionUnitTestBootstrap.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once realpath(dirname(dirname(dirname(dirname(__FILE__))))) . DIRECTORY_SEPARATOR . 'Bootstrap.php';\n\n/**\n * OntoWiki bootstrap class.\n *\n * Provides on-demand loading of application resources.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Bootstrap\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass OntoWiki_Test_ExtensionUnitTestBootstrap extends Bootstrap\n{\n    public function _initErfurt()\n    {\n        $erfurt = null;\n\n        // require Config\n        $this->bootstrap('Config');\n        $config = $this->getResource('Config');\n\n        // require OntoWiki\n        $this->bootstrap('OntoWiki');\n        $ontoWiki = $this->getResource('OntoWiki');\n\n        // require Logger, since Erfurt logger should write into OW logs dir\n        $this->bootstrap('Logger');\n\n        // Reset the Erfurt app for testability... needs to be refactored.\n        Erfurt_App::reset();\n\n        try {\n            $erfurt = Erfurt_App::getInstance(false)->start($config);\n        } catch (Erfurt_Exception $ee) {\n            throw new OntoWiki_Exception('Error loading Erfurt framework: ' . $ee->getMessage());\n        } catch (Exception $e) {\n            throw new OntoWiki_Exception('Unexpected error: ' . $e->getMessage());\n        }\n\n        $testAdapter = new Erfurt_Store_Adapter_Test();\n        $store       = new Erfurt_Store(\n            array(\n                 'adapterInstance' => $testAdapter\n            ),\n            'Test'\n        );\n        $erfurt->setStore($store);\n\n        $testAc = new Erfurt_Ac_Test();\n        Erfurt_App::getInstance()->setAc($testAc);\n\n        // make available\n        $ontoWiki->erfurt = $erfurt;\n\n        return $erfurt;\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Test/IntegrationTestBootstrap.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once realpath(dirname(dirname(dirname(dirname(__FILE__))))) . DIRECTORY_SEPARATOR . 'Bootstrap.php';\n\n/**\n * OntoWiki bootstrap class.\n *\n * Provides on-demand loading of application resources.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Bootstrap\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass OntoWiki_Test_IntegrationTestBootstrap extends Bootstrap\n{\n    /**\n     * Overwrite the config bootstrap method, such that the store backend can be set via an environment variable.\n     *\n     * @return void|Zend_Config_Ini\n     */\n    public function _initConfig()\n    {\n        $config = parent::_initConfig();\n\n        // Overwrite database settings from test config\n        // load user application configuration files\n        $tryDistConfig = false;\n        try {\n            $privateConfig = new Zend_Config_Ini(ONTOWIKI_ROOT . 'application/tests/config.ini', 'private', true);\n            $config->merge($privateConfig);\n        } catch (Zend_Config_Exception $e) {\n            $tryDistConfig = true;\n        }\n\n        if ($tryDistConfig === true) {\n            try {\n                $privateConfig = new Zend_Config_Ini(\n                    ONTOWIKI_ROOT . 'application/tests/config.ini.dist', 'private', true\n                );\n                $config->merge($privateConfig);\n            } catch (Zend_Config_Exception $e) {\n                $message = 'Failed to find test config';\n                throw new OntoWiki_Exception($message);\n            }\n        }\n\n        // overwrite store adapter to use with environment variable if set\n        // this is useful, when we want to test with different stores without manually\n        // editing the config\n        if ($config instanceof Zend_Config) {\n            $storeAdapter = getenv('EF_STORE_ADAPTER');\n            if (($storeAdapter === 'virtuoso') || ($storeAdapter === 'zenddb')) {\n                $config->store->backend = $storeAdapter;\n            } else {\n                if ($storeAdapter !== false) {\n                    throw new Exception('Invalid value of $EF_STORE_ADAPTER: ' . $storeAdapter);\n                }\n            }\n        }\n\n        return $config;\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Test/UnitTestBootstrap.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once realpath(dirname(dirname(dirname(dirname(__FILE__))))) . DIRECTORY_SEPARATOR . 'Bootstrap.php';\n\n/**\n * OntoWiki bootstrap class.\n *\n * Provides on-demand loading of application resources.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Bootstrap\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass OntoWiki_Test_UnitTestBootstrap extends Bootstrap\n{\n    public function _initExtensionManager()\n    {\n        // We do not want extensions loaded while unit testing!\n        return null;\n    }\n\n    public function _initErfurt()\n    {\n        $erfurt = null;\n\n        // require Config\n        $this->bootstrap('Config');\n        $config = $this->getResource('Config');\n\n        // require OntoWiki\n        $this->bootstrap('OntoWiki');\n        $ontoWiki = $this->getResource('OntoWiki');\n\n        // require Logger, since Erfurt logger should write into OW logs dir\n        $this->bootstrap('Logger');\n\n        // Reset the Erfurt app for testability... needs to be refactored.\n        Erfurt_App::reset();\n\n        try {\n            $erfurt = Erfurt_App::getInstance(false)->start($config);\n        } catch (Erfurt_Exception $ee) {\n            throw new OntoWiki_Exception('Error loading Erfurt framework: ' . $ee->getMessage());\n        } catch (Exception $e) {\n            throw new OntoWiki_Exception('Unexpected error: ' . $e->getMessage());\n        }\n\n        $store = new Erfurt_Store(\n            array(\n                 'adapterInstance' => new Erfurt_Store_Adapter_Test()\n            ),\n            'Test'\n        );\n        $erfurt->setStore($store);\n\n        $erfurt->setAc(new Erfurt_Ac_None());\n\n        // make available\n        $ontoWiki->erfurt = $erfurt;\n\n        return $erfurt;\n    }\n\n    public function _initPlugins()\n    {\n        // require front controller\n        $this->bootstrap('frontController');\n        $frontController = $this->getResource('frontController');\n\n        // We do not register any plugins for unit tests.\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/Toolbar.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki Toolbar class.\n *\n * Facilitates the programmatical construction of toolbars.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Toolbar\n{\n    /**\n     * Constants for default buttons\n     */\n    const CANCEL    = 0;\n    const SAVE      = 1;\n    const EDIT      = 2;\n    const ADD       = 3;\n    const EDITADD   = 4;\n    const DELETE    = 5;\n    const EXPORT    = 6;\n    const SUBMIT    = 10;\n    const RESET     = 11;\n    const SEPARATOR = 100;\n\n    /**\n     * Default button configurations\n     *\n     * @var array\n     */\n    protected $_defaultButtons\n        = array(\n            self::CANCEL  => array('name' => 'Cancel', 'image' => 'cancel', 'class' => 'edit cancel'),\n            self::SAVE    => array('name' => 'Save Changes', 'image' => 'save2', 'class' => 'edit save'),\n            self::EDIT    => array('name' => 'Edit', 'image' => 'edit', 'class' => 'edit-enable'),\n            self::ADD     => array('name' => 'Add', 'image' => 'add'),\n            self::EDITADD => array('name' => 'Add', 'image' => 'editadd'),\n            self::DELETE  => array('name' => 'Delete', 'image' => 'delete', 'class' => 'delete'),\n            self::SUBMIT  => array('name' => 'Submit', 'class' => 'submit', 'image' => 'go2'),\n            self::RESET   => array('name' => 'Reset', 'class' => 'reset', 'image' => 'reset'),\n            self::EXPORT  => array('name' => 'Export', 'class' => 'export', 'image' => 'save')\n        );\n\n    /**\n     * Array of toolbar buttons\n     *\n     * @var array\n     */\n    protected $_buttons = array();\n\n    /**\n     * Singleton instance\n     *\n     * @var OntoWiki_Toolbar\n     */\n    private static $_instance = null;\n\n    /**\n     * Translation object\n     *\n     * @var Zend_Translate\n     */\n    protected $_translate = null;\n\n    /**\n     * Constructor\n     */\n    private function __construct()\n    {\n    }\n\n    /**\n     * Disallow cloning\n     */\n    private function __clone()\n    {\n    }\n\n    /**\n     * Adds a button to the global toolbar.\n     *\n     * @param  mixed $type    either a button constant defined by OntoWiki_Toolbar or\n     *                        a name string that identifies a custom button.\n     * @param  array $options If $type is a custom type, providing $options is mandatory.\n     *                        For default buttons $options is optional but you can overwrite the behaviour\n     *                        of default buttons by providing $options. The following keys are regognized:\n     *         - name:      the button's name\n     *         - class:     the button's css class(es)\n     *         - id:        the button's css id\n     *         - url:       the URL to be fetched when the button has been clicked.\n     *         - title:     value for the HTML title attribute (displayed as a tooltip in most browsers).\n     *         - image:     the button's theme image name (w/o icon- and .png, eg. 'edit' for 'icon-edit.png')\n     *         - image_url: the complete URL of the button's image. Use this to define custom images that are\n     *                        stored anywhere on the web.\n     *\n     * @return OntoWiki_Toolbar\n     */\n    public function appendButton($type, array $options = array())\n    {\n        if ($button = $this->_getButton($type, $options)) {\n            array_push($this->_buttons, $button);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns an instance of OntoWiki_Toolbar\n     *\n     * @return OntoWiki_Toolbar\n     */\n    public static function getInstance()\n    {\n        if (null === self::$_instance) {\n            self::$_instance = new self();\n        }\n\n        return self::$_instance;\n    }\n\n    /**\n     * Adds a button to the front of the global toolbar.\n     *\n     * @param  mixed $type    either a button constant defined by OntoWiki_Toolbar or\n     *                        a name string that identifies a custom button.\n     * @param  array $options If $type is a custom type, providing $options is mandatory.\n     *                        For default buttons $options is optional but you can overwrite the behaviour\n     *                        of default buttons by providing $options. The following keys are regognized:\n     *         - name:      the button's name\n     *         - class:     the button's css class(es)\n     *         - id:        the button's css id\n     *         - url:       the URL to be fetched when the button has been clicked.\n     *         - title:     value for the HTML title attribute (displayed as a tooltip in most browsers).\n     *         - image:     the button's theme image name (w/o icon- and .png, eg. 'edit' for 'icon-edit.png')\n     *         - image_url: the complete URL of the button's image. Use this to define custom images that are\n     *                        stored anywhere on the web.\n     *\n     * @return OntoWiki_Toolbar\n     */\n    public function prependButton($type, array $options = array())\n    {\n        if ($button = $this->_getButton($type, $options)) {\n            array_unshift($this->_buttons, $button);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Sets the URL base for the current theme\n     *\n     * @since 0.9.5\n     *\n     * @param string $themeUrlBase The URL base into the theme dir\n     *\n     * @return OntoWiki_Toolbar\n     */\n    public function setThemeUrlBase($themeUrlBase)\n    {\n        $this->_themeUrlBase = (string)$themeUrlBase;\n\n        return $this;\n    }\n\n    /**\n     * Sets the translation object for the current UI language\n     *\n     * @since 0.9.5\n     *\n     * @param Zend_Translate $translate The translation object\n     *\n     * @return OntoWiki_Toolbar\n     */\n    public function setTranslate(Zend_Translate $translate)\n    {\n        $this->_translate = $translate;\n\n        return $this;\n    }\n\n    /**\n     * Renders the toolbar as an HTML string.\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return '<div class=\"toolbar\">' . implode('', $this->_buttons) . '</div>';\n    }\n\n    /**\n     * Returns HTML for the specified button type.\n     *\n     * @param int   $type    the button type\n     * @param array $options button options\n     *\n     * @return string\n     */\n    private function _getButton($type, $options = array())\n    {\n        if ($type == self::SEPARATOR) {\n            return '<a class=\"button separator\"></a>';\n        } else {\n            if (array_key_exists($type, $this->_defaultButtons)) {\n                $options = array_merge($this->_defaultButtons[$type], $options);\n            } else {\n                if (empty($options)) {\n                    throw new OntoWiki_Exception(\"Missing options for button '$type'.\");\n                }\n\n                if (!array_key_exists('name', $options)) {\n                    $options['name'] = $type;\n                }\n            }\n        }\n\n        // translate name\n        if (array_key_exists('name', $options)) {\n            if ($this->_translate instanceof Zend_Translate) {\n                $label = $this->_translate->translate($options['name']);\n            } else {\n                $label = $options['name'];\n            }\n        } else {\n            $label = null;\n        }\n\n        // set class\n        if (array_key_exists('+class', $options)) {\n            $addedClasses = $options['+class'];\n        }\n\n        // set class\n        if (array_key_exists('class', $options)) {\n            $class = $options['class'];\n\n            if (isset($addedClasses)) {\n                $class = $class\n                    . ' '\n                    . $addedClasses;\n            }\n        } else {\n            if (isset($addedClasses)) {\n                $class = $addedClasses;\n            } else {\n                $class = null;\n            }\n        }\n\n        // set id\n        if (array_key_exists('id', $options)) {\n            $id = 'id=\"' . $options['id'] . '\"';\n        } else {\n            $id = null;\n        }\n\n        if (array_key_exists('url', $options)) {\n            $href = 'href=\"' . $options['url'] . '\"';\n        } else {\n            $href = null;\n        }\n\n        if (array_key_exists('title', $options)) {\n            $title = 'title=\"' . $options['title'] . '\"';\n        } else {\n            $title = null;\n        }\n\n        if (array_key_exists('attributes', $options) && is_array($options['attributes'])) {\n            $attributes = array();\n            foreach ($options['attributes'] as $key => $value) {\n                $attributes[] = $key . '=\"' . $value . '\"';\n            }\n            $attributes = implode(' ', $attributes);\n        } else {\n            $attributes = null;\n        }\n\n        // set image\n        if (array_key_exists('image_url', $options)) {\n            $image = $options['image_url'];\n        } else {\n            if (array_key_exists('image', $options)) {\n                $image = $this->_themeUrlBase . 'images/icon-' . $options['image'] . '.png';\n            } else {\n                $image = null;\n            }\n        }\n\n        // construct button link\n        $button = sprintf(\n            '<a class=\"button %s\" %s %s %s %s><img src=\"%s\"/><span>&nbsp;%s</span></a>',\n            $class,\n            $id,\n            $href,\n            $title,\n            $attributes,\n            $image,\n            $label\n        );\n\n        return $button;\n    }\n}\n\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Url.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki URL class.\n *\n * Represents an internal OntoWiki URL and provides methods for\n * adding, removing and replacing parameters.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Url\n{\n    /**\n     * The current request object\n     *\n     * @var Zend_Controller_Request_Abstract\n     */\n    protected $_request = null;\n\n    /**\n     * Array of URL parameters\n     *\n     * @var array\n     */\n    protected $_params = null;\n\n    /**\n     * Controller name for the URL\n     *\n     * @var string\n     */\n    protected $_controller = null;\n\n    /**\n     * Action name for the URL\n     *\n     * @var string\n     */\n    protected $_action = null;\n\n    /**\n     * Router used for the current request\n     *\n     * @var Zend_Controller_Router_Route\n     */\n    protected $_route = null;\n\n    /**\n     * Whether to use nice search-engine friendly URLs\n     *\n     * @var boolean\n     */\n    protected $_useSefUrls = true;\n\n    /**\n     *\n     */\n    protected $_base = null;\n\n    /**\n     * Constructor\n     */\n    public function __construct(array $options = array(), $paramsToKeep = null, $paramsToExclude = null, $base = null)\n    {\n        $this->_request    = Zend_Controller_Front::getInstance()->getRequest();\n        $defaultAction     = Zend_Controller_Front::getInstance()->getDefaultAction();\n        $defaultController = Zend_Controller_Front::getInstance()->getDefaultControllerName();\n        $router            = Zend_Controller_Front::getInstance()->getRouter();\n\n        // use defaults - current page\n        if (!isset($options['route']) && !isset($options['controller']) && !isset($options['action'])) {\n            $options['controller'] = $this->_request->getControllerName();\n            $options['action']     = $this->_request->getActionName();\n        }\n\n        if ($base != null && is_string($base)) {\n            $this->_base = $base;\n        } else {\n            if (isset(OntoWiki::getInstance()->config->urlBase)) {\n                $this->_base = OntoWiki::getInstance()->config->urlBase;\n            } else {\n                $this->_base = \"http://ns.aksw.org/undefined/\";\n            }\n        }\n\n        // keep parameters\n        if (!$this->_request) {\n            $this->_params = array();\n        } else {\n            if (is_array($paramsToKeep)) {\n                $this->_params = array_intersect_key($this->_request->getParams(), array_flip($paramsToKeep));\n            } else {\n                $this->_params = $this->_request->getParams();\n            }\n        }\n\n        if (is_array($paramsToExclude)) {\n            foreach ($paramsToExclude as $param) {\n                if (isset($this->_params[$param])) {\n                    unset($this->_params[$param]);\n                }\n            }\n        }\n\n        // set route\n        $flag = false;\n        if (array_key_exists('route', $options) && $router->hasRoute($options['route'])) {\n            $flag         = true;\n            $this->_route = $router->getRoute($options['route']);\n        } else {\n            // set controller\n            if (array_key_exists('controller', $options) && $options['controller']) {\n                $flag              = true;\n                $this->_controller = rtrim($options['controller'], '/');\n            } else {\n                if (array_key_exists('controller', $this->_params) && $this->_params['controller']) {\n                    $this->_controller = $this->_params['controller'];\n                }\n            }\n\n            // set action\n            if (array_key_exists('action', $options) && $options['action']) {\n                $flag          = true;\n                $this->_action = rtrim($options['action'], '/');\n            } else {\n                if (array_key_exists('action', $this->_params) && $this->_params['action']) {\n                    $this->_action = $this->_params['action'];\n                }\n            }\n        }\n\n        if (!$flag) {\n            try {\n                $routeName = $router->getCurrentRouteName();\n            } catch (Exception $e) {\n                $routeName = 'default';\n            }\n\n            if ($router->hasRoute($routeName)) {\n                $this->_route = $router->getRoute($routeName);\n            }\n        }\n\n        // check default controller/action and leave those empty\n        if (rtrim($this->_action, '/') == $defaultAction) {\n            $this->_action = '';\n\n            if (rtrim($this->_controller, '/') == $defaultController) {\n                $this->_controller = '';\n            }\n        }\n\n        // don't need these anymore\n        unset($this->_params['module']);\n        unset($this->_params['controller']);\n        unset($this->_params['action']);\n    }\n\n    /**\n     * set base url (for unittests)\n     *\n     * @param string $base\n     */\n    public function setBase($base)\n    {\n        $this->_base = $base;\n    }\n\n    /**\n     * Returns a URL string representing the object\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        try {\n            return $this->_buildQuery();\n        } catch (Exception $e) {\n            echo $e;\n\n            return '';\n        }\n    }\n\n    /**\n     * Returns the URL parameters\n     *\n     * @return array\n     */\n    public function getParams()\n    {\n        return $this->_params;\n    }\n\n    /**\n     * Sets a URL parameter. Paramters with the same name already\n     * set will be overwritten.\n     *\n     * @param string  $name              parameter name\n     * @param string  $value             parameter value\n     * @param boolean $contractNamespace denotes whether to contract namespaces in URIs\n     *\n     * @return OntoWiki_Url\n     */\n    public function setParam($name, $value, $contractNamespace = false)\n    {\n        switch ($name) {\n            case 'controller':\n            case 'action':\n                $this->{'_' . $name} = $value;\n                break;\n            default:\n                if (null !== $value) {\n                    if ($contractNamespace) {\n                        $value = OntoWiki_Utils::contractNamespace($value);\n                    }\n                    $this->_params[$name] = $value;\n                } else {\n                    unset($this->_params[$name]);\n                }\n        }\n\n        // allow chaining\n        return $this;\n    }\n\n    /**\n     * Sets a URL parameter. Paramters with the same name already\n     * set will be overwritten.\n     *\n     * @param string $name  parameter name\n     * @param string $value parameter value\n     *\n     * @return OntoWiki_Url\n     */\n    public function __set($name, $value)\n    {\n        return $this->setParam($name, $value);\n    }\n\n    /**\n     * Returns the value of parameter $name\n     *\n     * @param string $name parameter name\n     *\n     * @return string the value of parameter $name\n     */\n    public function __get($name)\n    {\n        if (isset($this->_params[$name])) {\n            return $this->_params[$name];\n        }\n    }\n\n    /**\n     * Returns whether parameter $name is set\n     *\n     * @param string $name parameter name\n     *\n     * @return boolean\n     */\n    public function __isset($name)\n    {\n        return isset($this->_params[$name]);\n    }\n\n    /**\n     * Unsets the parameter $name\n     *\n     * @param string $name parameter name\n     *\n     * @return OntoWiki_Url\n     */\n    public function __unset($name)\n    {\n        if (isset($this->$this->_params[$name])) {\n            unset($this->$this->_params[$name]);\n        }\n\n        // allow chaining\n        return $this;\n    }\n\n    /**\n     * Builds the query part of the URL\n     */\n    protected function _buildQuery()\n    {\n        $event             = new Erfurt_Event('onBuildUrl');\n        $event->base       = $this->_base;\n        $event->route      = $this->_route;\n        $event->controller = $this->_controller;\n        $event->action     = $this->_action;\n        $event->params     = $this->_params;\n        $urlCreated        = $event->trigger();\n\n        if ($event->handled()) {\n            if ($urlCreated && isset($event->url)) {\n                return $event->url;\n            } else {\n                $this->_params     = $event->params;\n                $this->_controller = $event->controller;\n                $this->_action     = $event->action;\n                $this->_route      = $event->route;\n            }\n        }\n\n        // check params\n        foreach ($this->_params as $name => $value) {\n            if (is_string($value) && preg_match('/\\//', $value)) {\n                $this->_useSefUrls = false;\n            }\n        }\n\n        $url = '';\n        if ($this->_route) {\n            // checking if reset of route-defaults necessary\n            // fixes pager usage fails on versioning pages\n            if (count($this->_route->getDefaults()) == 0) {\n                $resetRoute = false;\n            } else {\n                $resetRoute = true;\n            }\n\n            if ($this->_useSefUrls) {\n                // let the route assemble the whole URL\n                $url = $this->_route->assemble($this->_params, $resetRoute, true);\n            } else {\n                // we will assign parameters ourselves\n                $url = $this->_route->assemble(array(), $resetRoute);\n                $url = sprintf('%s/%s', $url, '?' . http_build_query($this->_params, '&amp;'));\n            }\n        } else {\n            if ($this->_useSefUrls) {\n                $query   = '';\n                $lastKey = '';\n                foreach ($this->_params as $key => $value) {\n                    if (is_scalar($value)) {\n                        $value = urlencode($value);\n                        $query .= \"$key/$value/\";\n                        $lastKey = $key;\n                    }\n                }\n                // remove trailing slash\n                $query = rtrim($query, '/');\n            } else {\n                $query = '?' . http_build_query($this->_params, '&amp;');\n            }\n            $parts = array_filter(array($this->_controller, $this->_action, $query));\n            $url   = implode('/', $parts);\n        }\n        // HACK:\n        $this->_useSefUrls = true;\n\n        return $this->_base . ltrim($url, '/');\n    }\n}\n\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Utils/Exception.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module exteption class.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_Utils\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Utils_Exception extends OntoWiki_Exception\n{\n}\n\n"
  },
  {
    "path": "application/classes/OntoWiki/Utils.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki utility class.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_Utils\n{\n    /**\n     * Pseudo-prefix for the current graph\n     */\n    const DEFAULT_BASE = '__default';\n\n    /**\n     * Separator between namespace prefix and local part\n     */\n    const PREFIX_SEPARATOR = ':';\n\n    /**\n     * An array of namespace prefixes and IRIs.\n     *\n     * @var array\n     */\n    private static $_namespaces = null;\n\n    /**\n     * Returns a compact URI (cURI) as required by RDFa syntax specification\n     * {@link http://www.w3.org/MarkUp/2008/ED-rdfa-syntax-20080125/#s_curieprocessing}.\n     * Adds an ad-hoc namespace prefix if it cannot find one for the URI, resulting\n     * in a value that is guaranteed to be a cURI.\n     *\n     * @param string $uri the URI to be converted\n     *\n     * @return string|null cURI or null if no cURI could be created\n     */\n    public static function compactUri($uri, $saveMode = false)\n    {\n        $namespaces    = self::_getNamespaces();\n        $selectedModel = OntoWiki::getInstance()->selectedModel;\n        $compactUri    = null;\n        $prefix        = null;\n\n        // split URI in namespace and local part at \"/\", \"#\" or \":\"\n        $matches = array();\n        preg_match('/^(.+[#\\/\\:])(.+[^#\\/\\:])$/', $uri, $matches);\n\n        if (count($matches) == 3) {\n            $namespace = $matches[1];\n            $localPart = $matches[2];\n\n            if (!empty($localPart) && $selectedModel) {\n                try {\n                    $prefix = $selectedModel->getNamespacePrefix($namespace);\n                } catch (Erfurt_Exception $e) {\n                    // just to be save\n                    $prefix = null;\n                }\n            }\n        }\n\n        // usable prefix found?\n        if (null !== $prefix) {\n            $compactUri = $prefix\n                . self::PREFIX_SEPARATOR\n                . $localPart;\n        } else {\n            if ($saveMode) {\n                throw new OntoWiki_Utils_Exception(\"Unable to compact URI <$uri>.\");\n            } else {\n                // return URI unmodified\n                $compactUri = $uri;\n            }\n        }\n\n        return $compactUri;\n    }\n\n    /**\n     * Replaces a namespace URI with its prefix if found in the local\n     * prefix table.\n     *\n     * @deprecated Use compactUri instead\n     *\n     * @param string  $uri         The URI\n     * @param boolean $prependBase Whether to prepend the graph base URI\n     *\n     * @return string\n     */\n    public static function contractNamespace($uri, $prependBase = false)\n    {\n        $namespaces = self::_getNamespaces();\n\n        $matches = array();\n        preg_match('/^(.+[#\\/])(.+[^#\\/])$/', $uri, $matches);\n\n        $matchesCount = count($matches);\n        if ($matchesCount >= 3) {\n            $selectedModel = OntoWiki::getInstance()->selectedModel;\n            if ($selectedModel && $matches[1] == $selectedModel->getBaseIri()) {\n                if ($prependBase) {\n                    return self::DEFAULT_BASE . ':' . $matches[2];\n                }\n\n                return $matches[2];\n            } else {\n                if (array_key_exists($matches[1], $namespaces)) {\n                    return $namespaces[$matches[1]] . ':' . $matches[2];\n                }\n            }\n        }\n\n        return $uri;\n    }\n\n    /**\n     * Calculates the Difference between two timestamps\n     *\n     * @param         string/int $startTimestamp\n     * @param integer $endTimestamp\n     * @param integer $unit (default 0)\n     *\n     * @return string\n     */\n    public static function dateDifference($startTimestamp, $endTimestamp = false, $unit = 0)\n    {\n        $translate = OntoWiki::getInstance()->translate;\n\n        $starDaySeconds = (23 * 56 * 60) + 4.091; // Star Day\n        $sunDaySeconds  = 24 * 60 * 60; // Sun Day\n        if ($unit == 0) {\n            $dayInSeconds = $sunDaySeconds;\n        } else {\n            $dayInSeconds = $starDaySeconds;\n        }\n\n        if (is_int($startTimestamp)) {\n            if ($endTimestamp) {\n                $differenceInSeconds = $endTimestamp - $startTimestamp;\n            } else {\n                $endTimestamp        = time();\n                $differenceInSeconds = $endTimestamp - $startTimestamp;\n            }\n        } else {\n            if (is_string($startTimestamp)) {\n                if ($endTimestamp) {\n                    if ($t = strtotime($startTimestamp)) {\n                        $differenceInSeconds = $endTimestamp - $t;\n                    } else {\n                        throw new Exception('unexpected format of timestamp.');\n                    }\n                } else {\n                    $endTimestamp = time();\n                    if ($t = strtotime($startTimestamp)) {\n                        $differenceInSeconds = $endTimestamp - $t;\n                    } else {\n                        throw new Exception('unexpected format of timestamp.');\n                    }\n                }\n            } else {\n                throw new Exception(\n                    'unexpected type of timestamp. ' .\n                    'expected string (date) or int (timestamp), got ' .\n                    gettype($startTimestamp) . ' instead'\n                );\n            }\n        }\n\n        //if start is in the past, we use negative differences\n        $differenceInSeconds *= -1;\n\n        // show e.g. 'moments ago' if time is less than one minute\n        if (abs($differenceInSeconds) < 60) {\n            if ($differenceInSeconds < 0) {\n                return $translate->_('moments ago');\n            } else {\n                return $translate->_('in moments');\n            }\n\n        } else {\n            $differenceInMinutes = round(($differenceInSeconds / 60));\n\n            // show e.g. 'approx. x minutes ago' if time is less than one hour\n            if (abs($differenceInMinutes) == 1) {\n                if ($differenceInSeconds < 0) {\n                    return $translate->_('approx. 1 minute ago');\n                } else {\n                    return $translate->_('in approx. 1 minute');\n                }\n            } else {\n                if (abs($differenceInMinutes) < 60) {\n                    if ($differenceInMinutes < 0) {\n                        return sprintf($translate->_('approx. %d minutes ago'), abs($differenceInMinutes));\n                    } else {\n                        return sprintf($translate->_('in approx. %d minutes'), abs($differenceInMinutes));\n                    }\n                } else {\n                    $differenceInHours = round(($differenceInSeconds / 3600));\n\n                    // show e.g. 'approx. x hours\n                    if (abs($differenceInHours) == 1) {\n                        if ($differenceInHours < 0) {\n                            return $translate->_('approx. 1 hour ago');\n                        } else {\n                            return $translate->_('in approx. 1 hour');\n                        }\n                    } else {\n                        if (abs($differenceInHours) <= 48) {\n                            if ($differenceInHours < 0) {\n                                return sprintf($translate->_('approx. %d hours ago'), abs($differenceInHours));\n                            } else {\n                                return sprintf($translate->_('in approx. %d hours'), abs($differenceInHours));\n                            }\n                        } else {\n                            $differenceInDays = round(($differenceInSeconds / $dayInSeconds));\n\n                            // else return e.g. 'approx. x days ago'\n                            if ($differenceInDays < 0) {\n                                return sprintf($translate->_('approx. %d days ago'), abs($differenceInDays));\n                            } else {\n                                return sprintf($translate->_('in approx. %d days'), abs($differenceInDays));\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    /**\n     * Expands a namespace prefix in a quialified name to a full URI if found\n     * in the local namespace table.\n     *\n     * @param string $qName The qualified name, e.g. 'foaf:Person'\n     *\n     * @return string\n     */\n    public static function expandNamespace($qName)\n    {\n        $namespaces = self::_getNamespaces();\n\n        if (trim($qName) != '') {\n            $parts      = explode(':', $qName);\n            $namespaces = array_flip($namespaces);\n\n            $prefix    = isset($parts[0]) ? $parts[0] : '';\n            $localPart = isset($parts[1]) ? $parts[1] : '';\n\n            if (array_key_exists($prefix, $namespaces) && !empty($localPart)) {\n                $qName = $namespaces[$prefix];\n                array_shift($parts);\n                $qName .= implode('', $parts);\n            } else {\n                // TODO: check store, better URI check, use model base URI\n                $owApp = OntoWiki::getInstance();\n\n                $erfurtConfig = Erfurt_App::getInstance()->getConfig();\n                $uriSchemas   = array_flip($erfurtConfig->uri->schemata->toArray());\n\n                if (array_key_exists($prefix, (array)$uriSchemas)) {\n                    // prefix is an allowed URI schema\n                    return $qName;\n                } else {\n                    if ($owApp->selectedModel instanceof Erfurt_Rdf_Model) {\n                        $qName = $owApp->selectedModel->getBaseIri() . $qName;\n                    }\n                }\n            }\n\n            return $qName;\n        }\n    }\n\n    /**\n     * Returns the local part of a URI.\n     *\n     * @param string $uri\n     *\n     * @return string\n     */\n    public static function getUriLocalPart($uri)\n    {\n        $namespaces = self::_getNamespaces();\n        $localPart  = $uri;\n\n        $matches = array();\n        preg_match('/^(.+[#\\/])(.+[^#\\/])$/', $uri, $matches);\n\n        if (count($matches) == 3) {\n            if (trim($matches[2]) != '') {\n                $localPart = $matches[2];\n            }\n        }\n\n        return $localPart;\n    }\n\n    /**\n     * Matches an array of mime types against the Accept header in a request.\n     *\n     * @param Zend_Controller_Request_Abstract $request            the request\n     * @param array                            $supportedMimetypes The mime types to match against\n     *\n     * @return string\n     */\n    public static function matchMimetypeFromRequest(\n        Zend_Controller_Request_Http $request,\n        array $supportedMimetypes\n    ) {\n        // get accept header\n        $acceptHeader = strtolower($request->getHeader('Accept'));\n\n        try {\n            $match = \\Bitworking\\Mimeparse::bestMatch($supportedMimetypes, $acceptHeader);\n        } catch (Exception $e) {\n            $match = '';\n        }\n\n        return $match;\n    }\n\n    /**\n     * Shortens a string by splitting it in the middle and concatenating\n     * both parts with an ellipse (…)\n     *\n     * @param string $string    The string to be split\n     * @param int    $maxLength The maximum length of the resulting string\n     *\n     * @return string\n     */\n    public static function shorten($string, $maxLength = 20)\n    {\n        if (($maxLength == 0) || (strlen($string) < $maxLength)) {\n            return $string;\n        }\n\n        $offset = floor($maxLength / 2);\n        $short  = rtrim(substr($string, 0, $offset), '.')\n            . '&hellip;'\n            . ltrim(substr($string, -$offset, $offset), '.');\n\n        return $short;\n    }\n\n    /**\n     * Loads the namespaces from the currently selected model\n     */\n    private static function _reloadNamespaces()\n    {\n        $model = OntoWiki::getInstance()->selectedModel;\n        if ($model instanceof Erfurt_Rdfs_Model) {\n            self::$_namespaces = $model->getNamespaces();\n        } else {\n            self::$_namespaces = array();\n        }\n    }\n\n    /**\n     * Loads the local namespace table from the currently active graph.\n     *\n     * @return array\n     */\n    private static function _getNamespaces()\n    {\n        if (null === self::$_namespaces) {\n            self::_reloadNamespaces();\n        }\n\n        return self::$_namespaces;\n    }\n\n    static public function array_to_object(array $array)\n    {\n        // Iterate through our array looking for array values.\n        // If found recurvisely call itself.\n        foreach ($array as $key => $value) {\n            if (is_array($value)) {\n                $array[$key] = self::array_to_object($value);\n            }\n        }\n\n        // Typecast to (object) will automatically convert array -> stdClass\n        return (object)$array;\n    }\n\n    static public function object_to_array(object $array)\n    {\n        // Iterate through our array looking for array values.\n        // If found recurvisely call itself.\n        foreach ($array as $key => $value) {\n            if (is_array($value)) {\n                $array[$key] = self::object_to_array($value);\n            }\n        }\n\n        // Typecast to (object) will automatically convert array -> stdClass\n        return (array)$array;\n    }\n\n    static public function object_merge_recursive($a, $b)\n    {\n        return self::array_to_object(\n            array_merge_recursive(\n                self::object_to_array($a),\n                self::object_to_array($b)\n            )\n        );\n    }\n\n    /**\n     * cast an object to the most general class.\n     * also makes implicit (__get-magic) properties explicit\n     *\n     * @param type $o\n     */\n    static public function to_stdclass_recursive($o)\n    {\n        $ret = new stdClass();\n        foreach ($o as $k => $v) {\n            if (is_object($v) && get_class($v) != 'stdClass') {\n                $v = self::to_stdclass_recursive($v);\n            }\n            $ret->{$k} = $v;\n        }\n\n        return $ret;\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/View/Helper/Curie.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki CURIE view helper\n *\n * Builds a CURIE conforming to {@link http://www.w3.org/TR/curie/}\n * out of a given full URI.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes_View_Helper\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_View_Helper_Curie extends Zend_View_Helper_Abstract\n{\n    public function curie($uri)\n    {\n        $curi = OntoWiki_Utils::compactUri($uri);\n\n        return $curi;\n    }\n}\n"
  },
  {
    "path": "application/classes/OntoWiki/View.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki view class\n *\n * Subclasses Zend_View in order to cache modules and\n * provide a faster interface to important helpers.\n *\n * @category OntoWiki\n * @package  OntoWiki_Classes\n * @author   Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki_View extends Zend_View\n{\n    /**\n     * OntoWiki application config\n     *\n     * @var Zend_Config\n     */\n    protected $_config = null;\n\n    /**\n     * The user interface language currently set\n     *\n     * @var string\n     */\n    protected $_lang = null;\n\n\n    /**\n     * Module cache\n     *\n     * @var Zend_Cache\n     */\n    protected $_moduleCache = null;\n\n    /**\n     * Translation object\n     *\n     * @var Zend_Translate\n     */\n    protected $_translate = null;\n\n    /**\n     * Zend View Placeholder registry\n     *\n     * @var Zend_View_Helper_Placeholder_Registry\n     */\n    protected $_placeholderRegistry = null;\n\n    /**\n     * Subview for rendering modules\n     *\n     * @var OntoWiki_View\n     */\n    protected $_moduleView = null;\n\n    /**\n     * Constructor\n     */\n    public function __construct($config = array(), $translate = null)\n    {\n        parent::__construct($config);\n        $this->_config              = OntoWiki::getInstance()->config;\n        $this->_translate           = $translate;\n        $this->_placeholderRegistry = Zend_View_Helper_Placeholder_Registry::getRegistry();\n\n        if (array_key_exists('use_module_cache', $config) && (boolean)$config['use_module_cache']) {\n            $this->_moduleCache = OntoWiki::getInstance()->getCache();\n        }\n    }\n\n    /**\n     * Provides a shortcut to Zend_Translate from within templates.\n     *\n     * Also tries to cast to string.\n     *\n     * @param string $key the key for the translation table\n     */\n    public function _($key)\n    {\n        return $this->_translate->translate((string)$key);\n    }\n\n    /**\n     * Checks whether a placeholder contains data or view variable exists\n     *\n     * @param string $name the name of the placeholder or view variable\n     */\n    public function has($name)\n    {\n        // check view variables\n        if (isset($this->$name) && !empty($this->$name) && $this->$name != '') {\n            return true;\n        }\n\n        // check placeholders\n        if ($this->_placeholderRegistry->containerExists($name)) {\n            $value = $this->_placeholderRegistry->getContainer($name)->getValue();\n\n            if (is_array($value)) {\n                foreach ($value as $v) {\n                    if (!empty($v) && ($v != '')) {\n                        return true;\n                    }\n                }\n            } else {\n                if (!empty($value) && ($value != '')) {\n                    return true;\n                }\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Clears the cache entry for a specific module or all modules.\n     *\n     * @param string|null $moduleName If null, all cache for all modules is cleared.\n     *\n     * @return bool\n     */\n    public function clearModuleCache($moduleName = null)\n    {\n        if ($this->_moduleCache) {\n            if (null !== $moduleName) {\n                return $this->_moduleCache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array('module', $moduleName));\n            }\n\n            return $this->_moduleCache->clean(Zend_Cache::CLEANING_MODE_ALL);\n        }\n    }\n\n    /**\n     * Renders all modules registered for a certain module context.\n     *\n     * @param string $context The module context whose modules should be rendered\n     *\n     * @return string\n     */\n    public function modules($context, $renderOptions = null)\n    {\n        $modules = '';\n        foreach (OntoWiki_Module_Registry::getInstance()->getModulesForContext($context) as $moduleSpec) {\n            $modules .= $this->module($moduleSpec->id, $renderOptions, $context);\n        }\n\n        return $modules;\n    }\n\n    /**\n     * Module view helper.\n     *\n     * Returns an OntoWiki module either rendered or from cache.\n     *\n     * Fetches the module from the module registry and renders it into the\n     * window template. If a rendering exists in the local module cache it\n     * is used instead.\n     *\n     * @param string $moduleName\n     * @param array  $moduleOptions An associative array or and instance of\n     *                              Zend_config with module options.\n     *                              The following keys can be used:\n     *                              enabled  – whether the module is enabled or disabled\n     *                              title    – the module window's title\n     *                              caching  – whether the module should be cached\n     *                              priority – priority of the module in the module contexts\n     *                              lower number means higher priority\n     *                              classes  – string of css classes for the module window\n     *                              id       – a css id for the module window\n     *\n     * @return string\n     */\n    public function module($moduleName, $renderOptions = null, $context = OntoWiki_Module_Registry::DEFAULT_CONTEXT)\n    {\n        $moduleRegistry = OntoWiki_Module_Registry::getInstance();\n\n        // allow old-style array config\n        if (is_array($renderOptions)) {\n            $renderOptions = new Zend_Config($renderOptions);\n        }\n\n        // get default options from the registry\n        $defaultModuleOptions = $moduleRegistry->getModuleConfig($moduleName);\n\n        if ($defaultModuleOptions == null) {\n            $moduleOptions = $renderOptions;\n        } else {\n            if ($renderOptions != null) {\n                $moduleOptions = $defaultModuleOptions->merge($renderOptions);\n            } else {\n                $moduleOptions = $defaultModuleOptions;\n            }\n        }\n\n        $cssClasses = isset($moduleOptions->classes) ? $moduleOptions->classes : '';\n        $cssId      = isset($moduleOptions->id) ? $moduleOptions->id : '';\n\n        $module = $moduleRegistry->getModule($moduleName, $context);\n\n        // no module found\n        if (null == $module) {\n            return '';\n        }\n\n        $module->setOptions($moduleOptions);\n\n        if ($module->shouldShow()) {\n            // init module view\n            if (null == $this->_moduleView) {\n                $this->_moduleView = clone $this;\n            }\n            $this->_moduleView->clearVars();\n\n            // query module's title\n            $this->_moduleView->title = $module->getTitle();\n\n            // does the module have a message\n            // TODO: allow multiple messages\n            if (method_exists($module, 'getMessage')) {\n                if ($message = $module->getMessage()) {\n                    $this->_moduleView->messages = array($message);\n                }\n            }\n\n            // does the module have a menu?\n            if (method_exists($module, 'getMenu')) {\n                $menu                    = $module->getMenu();\n                $this->_moduleView->menu = $menu->toArray(false, false);\n            }\n\n            // does the module have a context menu?\n            if (method_exists($module, 'getContextMenu')) {\n                $contextMenu = $module->getContextMenu();\n                if ($contextMenu instanceof OntoWiki_Menu) {\n                    $contextMenu = $contextMenu->toArray();\n                }\n                $this->_moduleView->contextmenu = $contextMenu;\n            }\n\n            // is caching enabled\n            if ($this->_moduleCache && $module->allowCaching()) {\n                // get cache id\n                $cacheId = md5($module->getCacheId() . $cssClasses . $this->_config->languages->locale);\n\n                // cache hit?\n                if (!$moduleContent = $this->_moduleCache->load($cacheId)) {\n\n                    // render (expensive) contents\n                    $pre           = microtime(true);\n                    $moduleContent = $module->getContents();\n                    $post          = ((microtime(true) - $pre) * 1000);\n                    // save to cache\n                    $this->_moduleCache->save(\n                        $moduleContent, $cacheId, array('module', $moduleName), $module->getCacheLivetime()\n                    );\n                }\n            } else {\n                // caching disabled\n                $pre           = microtime(true);\n                $moduleContent = $module->getContents();\n                $post          = ((microtime(true) - $pre) * 1000);\n            }\n\n            // implement tabs\n            if (is_array($moduleContent)) {\n                // TODO: tabs\n                $navigation = array();\n                $content    = array();\n\n                $i = 0;\n                foreach ($moduleContent as $key => $content) {\n                    $navigation[$key] = array(\n                        'active' => $i++ == 0 ? 'active' : '',\n                        'url'    => '#' . $key,\n                        'name'   => $this->_($key)\n                    );\n                }\n\n                $this->_moduleView->navigation = $navigation;\n                $this->_moduleView->content    = $moduleContent;\n            } else {\n                if (is_string($moduleContent)) {\n                    $this->_moduleView->content = $moduleContent;\n                }\n            }\n\n            // set variables\n            $this->_moduleView->cssClasses = $cssClasses;\n            $this->_moduleView->cssId      = $cssId;\n\n            if (isset($moduleOptions->noChrome) && (boolean)$moduleOptions->noChrome) {\n                // render without window chrome\n                $moduleWindow = $this->_moduleView->render('partials/module.phtml');\n            } else {\n                // render with window chrome\n                $moduleWindow = $this->_moduleView->render('partials/window.phtml');\n            }\n\n            return $moduleWindow;\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "application/classes/OntoWiki.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki main class.\n *\n * Serves as a central registry for storing objects needed througout the application.\n * Prior to 0.9.5, this class was called OntoWiki_Application and was also partly\n * responsible for application bootstrapping. As of 0.9.5, bootstrapping is handled\n * by the Bootstrap class.\n *\n * @category  OntoWiki\n * @package   OntoWiki_Classes\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    Norman Heino <norman.heino@gmail.com>\n */\nclass OntoWiki\n{\n    const DEFAULT_LOG_IDENTIFIER = 'ontowiki';\n\n    // ------------------------------------------------------------------------\n    // --- Properties\n    // ------------------------------------------------------------------------\n\n    /**\n     * The bootstrap object used during bootstrap.\n     *\n     * @var Zend_Application_Bootstrap_Bootstrap\n     */\n    protected $_bootstrap = null;\n\n    /**\n     * A dictionary for custom logger objects.\n     * The key is the identifier for the logger.\n     */\n    protected $_customLogs = array();\n\n    /**\n     * Array of properties\n     *\n     * @var array\n     */\n    protected $_properties = array();\n\n    /**\n     * Variables to be autoloaded from the session\n     *\n     * @var array\n     */\n    protected $_sessionVars = array();\n\n    /**\n     * Singleton instance\n     *\n     * @var OntoWiki\n     */\n    protected static $_instance = null;\n\n    /**\n     * OntoWiki_Navigation instance\n     */\n    protected $_navigation = null;\n\n    // ------------------------------------------------------------------------\n    // --- Magic Methods\n    // ------------------------------------------------------------------------\n\n    /**\n     * Constructor\n     */\n    private function __construct()\n    {\n    }\n\n    /**\n     * Disallow cloning\n     */\n    private function __clone()\n    {\n    }\n\n    /**\n     * Returns a property value\n     *\n     * @param string $propertyName\n     *\n     * @return mixed\n     * @since 0.9.5\n     */\n    public function __get($propertyName)\n    {\n        // retrieve from session\n        if (in_array($propertyName, $this->_sessionVars)) {\n            if (isset($this->session->$propertyName)) {\n                $this->_properties[$propertyName] = $this->session->$propertyName;\n            }\n        }\n\n        // retrieve bootstrap resource\n        $bootstrap = $this->getBootstrap();\n        if ($bootstrap && $bootstrap->hasResource($propertyName)) {\n            return $bootstrap->getResource($propertyName);\n        }\n\n        // retrieve locally\n        if (isset($this->$propertyName)) {\n            return $this->_properties[$propertyName];\n        }\n    }\n\n    /**\n     * Sets a property\n     *\n     * @param string $propertyName\n     * @param mixed  $propertyValue\n     *\n     * @since 0.9.5\n     */\n    public function __set($propertyName, $propertyValue)\n    {\n        // set in session\n        if (in_array($propertyName, $this->_sessionVars)) {\n            $this->session->$propertyName = $propertyValue;\n        }\n\n        // set locally\n        $this->_properties[$propertyName] = $propertyValue;\n    }\n\n    /**\n     * Returns whether a property is set\n     *\n     * @param string $propertyName\n     *\n     * @return boolean\n     * @since 0.9.5\n     */\n    public function __isset($propertyName)\n    {\n        return array_key_exists($propertyName, $this->_properties);\n    }\n\n    /**\n     * Unsets a property\n     *\n     * @param string $propertyName\n     *\n     * @since 0.9.5\n     */\n    public function __unset($propertyName)\n    {\n        // unset from session\n        if (in_array($propertyName, $this->_sessionVars)) {\n            unset($this->session->$propertyName);\n        }\n\n        // unset locally\n        unset($this->_properties[$propertyName]);\n    }\n\n    // ------------------------------------------------------------------------\n    // --- Public Methods\n    // ------------------------------------------------------------------------\n\n    /**\n     * Appends a (translated) message to the message stack\n     * TODO: add a boolean $translate=true flag in order to allow disabling\n     * translation\n     *\n     * @param OntoWiki_Message $message The message to be added.\n     *\n     * @return OntoWiki\n     */\n    public function appendMessage(OntoWiki_Message $message)\n    {\n        $session = $this->getBootstrap()->getResource('Session');\n\n        $messageStack = (array)$session->messageStack;\n        array_push($messageStack, $message);\n\n        $session->messageStack = $messageStack;\n\n        return $this;\n    }\n\n    /**\n     * Appends an info message to the message stack, a convenient shortcut to\n     * appendMessage with included translate\n     *\n     * @param string $message The message to be added.\n     * @since 0.9.9\n     * @return OntoWiki\n     */\n    public function appendInfoMessage($message)\n    {\n        $this->appendMessage(\n            new OntoWiki_Message((string)$message, OntoWiki_Message::INFO)\n        );\n        return $this;\n    }\n\n    /**\n     * Appends a success message to the message stack, a convenient shortcut to\n     * appendMessage with included translate\n     *\n     * @param string $message The message to be added.\n     * @since 0.9.9\n     * @return OntoWiki\n     */\n    public function appendSuccessMessage($message)\n    {\n        $this->appendMessage(\n            new OntoWiki_Message((string)$message, OntoWiki_Message::SUCCESS)\n        );\n        return $this;\n    }\n\n    /**\n     * Appends a warning message to the message stack, a convenient shortcut to\n     * appendMessage with included translate\n     *\n     * @param string $message The message to be added.\n     * @since 0.9.9\n     * @return OntoWiki\n     */\n    public function appendWarningMessage($message)\n    {\n        $this->appendMessage(\n            new OntoWiki_Message((string)$message, OntoWiki_Message::WARNING)\n        );\n        return $this;\n    }\n\n    /**\n     * Appends an error message to the message stack, a convenient shortcut to\n     * appendMessage with included translate\n     *\n     * @param string $message The message to be added.\n     * @since 0.9.9\n     * @return OntoWiki\n     */\n    public function appendErrorMessage($message)\n    {\n        $this->appendMessage(\n            new OntoWiki_Message((string)$message, OntoWiki_Message::ERROR)\n        );\n        return $this;\n    }\n\n\n    /**\n     * Returns the current message stack and empties it.\n     *\n     * @since 0.9.5\n     * @return array\n     */\n    public function drawMessages()\n    {\n        return $this->getMessages(true);\n    }\n\n    /**\n     * Returns the application bootstrap object\n     *\n     * @since 0.9.5\n     */\n    public function getBootstrap()\n    {\n        if (null === $this->_bootstrap) {\n            $frontController  = Zend_Controller_Front::getInstance();\n            $this->_bootstrap = $frontController->getParam('bootstrap');\n        }\n\n        return $this->_bootstrap;\n    }\n\n    /**\n     *\n     */\n    public function setBootstrap($bootstrap)\n    {\n        $this->_bootstrap = $bootstrap;\n    }\n\n    /**\n     * Returns the system config object\n     *\n     * @since 0.9.5\n     * @return Zend_Config\n     */\n    public function getConfig()\n    {\n        $bootstrap = $this->getBootstrap();\n        if ($bootstrap && $bootstrap->hasResource('Config')) {\n            return $this->getBootstrap()->getResource('Config');\n        }\n    }\n\n    /**\n     * Returns the system cache object\n     *\n     * @since 0.9.9\n     * @return Zend_Cache_Core\n     */\n    public function getCache()\n    {\n        $bootstrap = $this->getBootstrap();\n        if ($bootstrap && $bootstrap->hasResource('Erfurt')) {\n            return $this->getBootstrap()->getResource('Erfurt')->getCache();\n        }\n    }\n\n    /**\n     * Returns the system worker frontend object\n     *\n     * todo: indicate a missing backend somehow\n     * todo: be robust against missing pecl stuff\n     *\n     * @since 0.9.11\n     * @return Erfurt_Worker_Frontend\n     */\n    public function getWorkerFrontend()\n    {\n        if (null === $this->_workerFrontend) {\n            $bootstrap = $this->getBootstrap();\n            $workerFrontend = Erfurt_Worker_Frontend::getInstance();\n            $workerFrontend->setBackend('gearman');\n            $workerFrontend->setServers($bootstrap->config->worker->servers);\n            $this->_workerFrontend = $workerFrontend;\n        }\n        return $this->_workerFrontend;\n    }\n\n    /**\n     * uses the system worker backend to call an async job\n     *\n     * todo: log a warning message if worker backend is not available\n     *\n     * @param string $jobId    The jobs identifier string\n     * @param mixed  $workload The jobs workload (array, object)\n     *\n     * @since 0.9.11\n     * @return null\n     */\n    public function callJob($jobId, $workload = array())\n    {\n        $client = $this->getWorkerFrontend();\n        $client->call($jobId, $workload);\n    }\n\n    /**\n     * Singleton instance\n     *\n     * @return OntoWiki\n     */\n    public static function getInstance()\n    {\n        if (null === self::$_instance) {\n            self::$_instance = new self();\n        }\n\n        return self::$_instance;\n    }\n\n    /**\n     * Returns a custom logger object.\n     * If the $identifier parameter is missing or is equal to the default log\n     * identifier, the default logger object is returned.\n     *\n     * @param string $identifier (optional)\n     *\n     * @return Zend_Log\n     */\n    public function getCustomLogger($identifier = self::DEFAULT_LOG_IDENTIFIER)\n    {\n        if ($identifier === self::DEFAULT_LOG_IDENTIFIER) {\n            return $this->logger;\n        }\n\n        if (isset($this->_customLogs[$identifier])) {\n            return $this->_customLogs[$identifier];\n        }\n\n        $config = $this->getConfig();\n\n        // support absolute path\n        if (!(preg_match('/^(\\w:[\\/|\\\\\\\\]|\\/)/', $config->log->path) === 1)) {\n            // prepend OntoWiki root for relative paths\n            $config->log->path = ONTOWIKI_ROOT . $config->log->path;\n        }\n\n        // initialize logger\n        if (is_writable($config->log->path) && ((boolean)$config->log->enabled == true)) {\n            $levelFilter = new Zend_Log_Filter_Priority((int)$config->log->level, '<=');\n\n            $writer = new Zend_Log_Writer_Stream($config->log->path . $identifier . '.log');\n            $logger = new Zend_Log($writer);\n            $logger->addFilter($levelFilter);\n\n            $this->_customLogs[$identifier] = $logger;\n\n            return $logger;\n        }\n\n        // fallback to NULL logger\n        $writer = new Zend_Log_Writer_Null();\n        $logger = new Zend_Log($writer);\n\n        return $logger;\n    }\n\n    /**\n     * Returns the current message stack and empties it.\n     *\n     * @param boolean $clearMessages Clears the message stack after retrieval\n     *\n     * @return array\n     */\n    public function getMessages($clearMessages = false)\n    {\n        $session = $this->getBootstrap()->getResource('Session');\n\n        // store temporarily\n        $messageStack = (array)$this->session->messageStack;\n\n        if ($clearMessages) {\n            // empty message stack\n            unset($session->messageStack);\n        }\n\n        // return temp\n        return $messageStack;\n    }\n\n    /**\n     * Returns the base URL for static files.\n     * In case mod_rewrite is enabled, getUrlBase and getStaticUrlBase\n     * return identical results.\n     *\n     * @since 0.9.5\n     * @return string\n     */\n    public function getStaticUrlBase()\n    {\n        if ($config = $this->getConfig()) {\n            return $config->staticUrlBase;\n        }\n    }\n\n    /**\n     * Returns the base URL for dynamic requests.\n     * In case mod_rewrite is enabled, getUrlBase and getStaticUrlBase\n     * return identical results.\n     *\n     * @since 0.9.5\n     * @return string\n     */\n    public function getUrlBase()\n    {\n        if ($config = $this->getConfig()) {\n            return $config->urlBase;\n        }\n    }\n\n    /**\n     * Returns the currently logged-in user.\n     *\n     * @return Erfurt_Auth_Identity\n     */\n    public function getUser()\n    {\n        return $this->user;\n    }\n\n    /**\n     * Returns whether OntoWiki currently has messages for the user.\n     *\n     * @return boolean\n     */\n    public function hasMessages()\n    {\n        $messages = $this->getMessages();\n\n        return (!empty($messages));\n    }\n\n    /**\n     * Sets an array of variables that are to be synchronized\n     * with the session.\n     *\n     * @since 0.9.5\n     *\n     * @param array $sessionVars\n     */\n    public function setSessionVars(array $sessionVars)\n    {\n        // add to session vars\n        $this->_sessionVars = $sessionVars;\n    }\n\n    /**\n     * Prepends a message to the message stack\n     *\n     * @param OntoWiki_Message $message The message to be added.\n     *\n     * @return OntoWiki\n     */\n    public function prependMessage(OntoWiki_Message $message)\n    {\n        $session = $this->getBootstrap()->getResource('Session');\n\n        $messageStack = (array)$session->messageStack;\n        array_unshift($messageStack, $message);\n\n        $session->messageStack = $messageStack;\n\n        return $this;\n    }\n\n    /**\n     *\n     */\n    public static function reset()\n    {\n        self::$_instance = null;\n    }\n\n    /**\n     *\n     */\n    public function getNavigation()\n    {\n        if (null == $this->_navigation) {\n            $this->_navigation = new OntoWiki_Navigation();\n        }\n\n        return $this->_navigation;\n    }\n}\n"
  },
  {
    "path": "application/config/SysBase/dc",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE rdf:RDF [\n    <!ENTITY rdfns 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>\n    <!ENTITY rdfsns 'http://www.w3.org/2000/01/rdf-schema#'>\n    <!ENTITY dcns 'http://purl.org/dc/elements/1.1/'>\n    <!ENTITY dctermsns 'http://purl.org/dc/terms/'>\n    <!ENTITY dctypens 'http://purl.org/dc/dcmitype/'>\n    <!ENTITY dcamns 'http://purl.org/dc/dcam/'>\n    <!ENTITY skosns 'http://www.w3.org/2004/02/skos/core#'>\n]>\n<rdf:RDF xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\" xmlns:dcam=\"http://purl.org/dc/dcam/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n<rdf:Description rdf:about=\"http://purl.org/dc/elements/1.1/\">\n<dcterms:title xml:lang=\"en-US\">DCMI Namespace for the Dublin Core Metadata Element Set, Version 1.1</dcterms:title>\n<rdfs:comment>To comment on this schema, please contact dcmifb@dublincore.org.</rdfs:comment>\n<dcterms:publisher xml:lang=\"en-US\">The Dublin Core Metadata Initiative</dcterms:publisher>\n<dcterms:modified>2008-01-14</dcterms:modified>\n</rdf:Description>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/title\">\n<rdfs:label xml:lang=\"en-US\">Title</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A name given to the resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#title-006\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/creator\">\n<rdfs:label xml:lang=\"en-US\">Creator</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An entity primarily responsible for making the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples of a Creator include a person, an organization, or a service. Typically, the name of a Creator should be used to indicate the entity.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#creator-006\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/subject\">\n<rdfs:label xml:lang=\"en-US\">Subject</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The topic of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Typically, the subject will be represented using keywords, key phrases, or classification codes. Recommended best practice is to use a controlled vocabulary. To describe the spatial or temporal topic of the resource, use the Coverage element.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#subject-006\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/description\">\n<rdfs:label xml:lang=\"en-US\">Description</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An account of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Description may include but is not limited to: an abstract, a table of contents, a graphical representation, or a free-text account of the resource.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#description-006\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/publisher\">\n<rdfs:label xml:lang=\"en-US\">Publisher</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An entity responsible for making the resource available.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples of a Publisher include a person, an organization, or a service. Typically, the name of a Publisher should be used to indicate the entity.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#publisher-006\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/contributor\">\n<rdfs:label xml:lang=\"en-US\">Contributor</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An entity responsible for making contributions to the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples of a Contributor include a person, an organization, or a service. Typically, the name of a Contributor should be used to indicate the entity.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#contributor-006\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/date\">\n<rdfs:label xml:lang=\"en-US\">Date</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A point or period of time associated with an event in the lifecycle of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Date may be used to express temporal information at any level of granularity.  Recommended best practice is to use an encoding scheme, such as the W3CDTF profile of ISO 8601 [W3CDTF].</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#date-006\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/type\">\n<rdfs:label xml:lang=\"en-US\">Type</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The nature or genre of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Recommended best practice is to use a controlled vocabulary such as the DCMI Type Vocabulary [DCMITYPE]. To describe the file format, physical medium, or dimensions of the resource, use the Format element.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#type-006\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/format\">\n<rdfs:label xml:lang=\"en-US\">Format</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The file format, physical medium, or dimensions of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples of dimensions include size and duration. Recommended best practice is to use a controlled vocabulary such as the list of Internet Media Types [MIME].</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#format-007\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/identifier\">\n<rdfs:label xml:lang=\"en-US\">Identifier</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An unambiguous reference to the resource within a given context.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Recommended best practice is to identify the resource by means of a string conforming to a formal identification system. </dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#identifier-006\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/source\">\n<rdfs:label xml:lang=\"en-US\">Source</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource from which the described resource is derived.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">The described resource may be derived from the related resource in whole or in part. Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#source-006\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/language\">\n<rdfs:label xml:lang=\"en-US\">Language</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A language of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Recommended best practice is to use a controlled vocabulary such as RFC 4646 [RFC4646].</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#language-007\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.ietf.org/rfc/rfc4646.txt\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/relation\">\n<rdfs:label xml:lang=\"en-US\">Relation</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system. </dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#relation-006\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/coverage\">\n<rdfs:label xml:lang=\"en-US\">Coverage</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Spatial topic and spatial applicability may be a named place or a location specified by its geographic coordinates. Temporal topic may be a named period, date, or date range. A jurisdiction may be a named administrative entity or a geographic place to which the resource applies. Recommended best practice is to use a controlled vocabulary such as the Thesaurus of Geographic Names [TGN]. Where appropriate, named places or time periods can be used in preference to numeric identifiers such as sets of coordinates or date ranges.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#coverage-006\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n<rdf:Property rdf:about=\"http://purl.org/dc/elements/1.1/rights\">\n<rdfs:label xml:lang=\"en-US\">Rights</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">Information about rights held in and over the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/elements/1.1/\"/>\n<dcterms:issued>1999-07-02</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#rights-006\"/>\n<skos:note xml:lang=\"en-US\">A second property with the same name as this property has been declared in the dcterms: namespace (http://purl.org/dc/terms/).  See the Introduction to the document \"DCMI Metadata Terms\" (http://dublincore.org/documents/dcmi-terms/) for an explanation.</skos:note>\n</rdf:Property>\n</rdf:RDF>\n"
  },
  {
    "path": "application/config/SysBase/dcterms",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE rdf:RDF [\n    <!ENTITY rdfns 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>\n    <!ENTITY rdfsns 'http://www.w3.org/2000/01/rdf-schema#'>\n    <!ENTITY dcns 'http://purl.org/dc/elements/1.1/'>\n    <!ENTITY dctermsns 'http://purl.org/dc/terms/'>\n    <!ENTITY dctypens 'http://purl.org/dc/dcmitype/'>\n    <!ENTITY dcamns 'http://purl.org/dc/dcam/'>\n    <!ENTITY skosns 'http://www.w3.org/2004/02/skos/core#'>\n]>\n<rdf:RDF xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\" xmlns:dcam=\"http://purl.org/dc/dcam/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/\">\n<dcterms:title xml:lang=\"en-US\">DCMI Namespace for metadata terms in the http://purl.org/dc/terms/ namespace</dcterms:title>\n<rdfs:comment>To comment on this schema, please contact dcmifb@dublincore.org.</rdfs:comment>\n<dcterms:publisher xml:lang=\"en-US\">The Dublin Core Metadata Initiative</dcterms:publisher>\n<dcterms:modified>2008-01-14</dcterms:modified>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/title\">\n<rdfs:label xml:lang=\"en-US\">Title</rdfs:label>\n<dcterms:description xml:lang=\"en-US\">A name given to the resource.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#titleT-001\"/>\n<skos:note xml:lang=\"en-US\">In current practice, this term is used primarily with literal values; however, there are important uses with non-literal values as well.  As of December 2007, the DCMI Usage Board is leaving this range unspecified pending an investigation of options.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/title\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/creator\">\n<rdfs:label xml:lang=\"en-US\">Creator</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An entity primarily responsible for making the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples of a Creator include a person, an organization, or a service. Typically, the name of a Creator should be used to indicate the entity.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#creatorT-001\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/Agent\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/creator\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/contributor\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/subject\">\n<rdfs:label xml:lang=\"en-US\">Subject</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The topic of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Typically, the subject will be represented using keywords, key phrases, or classification codes. Recommended best practice is to use a controlled vocabulary. To describe the spatial or temporal topic of the resource, use the Coverage element.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#subjectT-001\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/subject\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/description\">\n<rdfs:label xml:lang=\"en-US\">Description</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An account of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Description may include but is not limited to: an abstract, a table of contents, a graphical representation, or a free-text account of the resource.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#descriptionT-001\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/description\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/publisher\">\n<rdfs:label xml:lang=\"en-US\">Publisher</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An entity responsible for making the resource available.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples of a Publisher include a person, an organization, or a service. Typically, the name of a Publisher should be used to indicate the entity.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#publisherT-001\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/Agent\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/publisher\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/contributor\">\n<rdfs:label xml:lang=\"en-US\">Contributor</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An entity responsible for making contributions to the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples of a Contributor include a person, an organization, or a service. Typically, the name of a Contributor should be used to indicate the entity.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#contributorT-001\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/Agent\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/contributor\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/date\">\n<rdfs:label xml:lang=\"en-US\">Date</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A point or period of time associated with an event in the lifecycle of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Date may be used to express temporal information at any level of granularity.  Recommended best practice is to use an encoding scheme, such as the W3CDTF profile of ISO 8601 [W3CDTF].</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#dateT-001\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/type\">\n<rdfs:label xml:lang=\"en-US\">Type</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The nature or genre of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Recommended best practice is to use a controlled vocabulary such as the DCMI Type Vocabulary [DCMITYPE]. To describe the file format, physical medium, or dimensions of the resource, use the Format element.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#typeT-001\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/type\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/format\">\n<rdfs:label xml:lang=\"en-US\">Format</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The file format, physical medium, or dimensions of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples of dimensions include size and duration. Recommended best practice is to use a controlled vocabulary such as the list of Internet Media Types [MIME].</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#formatT-001\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/MediaTypeOrExtent\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/format\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/identifier\">\n<rdfs:label xml:lang=\"en-US\">Identifier</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An unambiguous reference to the resource within a given context.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Recommended best practice is to identify the resource by means of a string conforming to a formal identification system. </dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#identifierT-001\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/identifier\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/source\">\n<rdfs:label xml:lang=\"en-US\">Source</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource from which the described resource is derived.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">The described resource may be derived from the related resource in whole or in part. Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#sourceT-001\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/source\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/language\">\n<rdfs:label xml:lang=\"en-US\">Language</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A language of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Recommended best practice is to use a controlled vocabulary such as RFC 4646 [RFC4646].</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#languageT-001\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/LinguisticSystem\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/language\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/relation\">\n<rdfs:label xml:lang=\"en-US\">Relation</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system. </dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#relationT-001\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/coverage\">\n<rdfs:label xml:lang=\"en-US\">Coverage</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Spatial topic and spatial applicability may be a named place or a location specified by its geographic coordinates. Temporal topic may be a named period, date, or date range. A jurisdiction may be a named administrative entity or a geographic place to which the resource applies. Recommended best practice is to use a controlled vocabulary such as the Thesaurus of Geographic Names [TGN]. Where appropriate, named places or time periods can be used in preference to numeric identifiers such as sets of coordinates or date ranges.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#coverageT-001\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/LocationPeriodOrJurisdiction\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/coverage\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/rights\">\n<rdfs:label xml:lang=\"en-US\">Rights</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">Information about rights held in and over the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#rightsT-001\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/RightsStatement\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/rights\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/audience\">\n<rdfs:label xml:lang=\"en-US\">Audience</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A class of entity for whom the resource is intended or useful.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2001-05-21</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#audience-003\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/AgentClass\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/alternative\">\n<rdfs:label xml:lang=\"en-US\">Alternative Title</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An alternative name for the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">The distinction between titles and alternative titles is application-specific.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#alternative-003\"/>\n<skos:note xml:lang=\"en-US\">In current practice, this term is used primarily with literal values; however, there are important uses with non-literal values as well.  As of December 2007, the DCMI Usage Board is leaving this range unspecified pending an investigation of options.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/title\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/title\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/tableOfContents\">\n<rdfs:label xml:lang=\"en-US\">Table Of Contents</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A list of subunits of the resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#tableOfContents-003\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/description\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/description\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/abstract\">\n<rdfs:label xml:lang=\"en-US\">Abstract</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A summary of the resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#abstract-003\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/description\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/description\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/created\">\n<rdfs:label xml:lang=\"en-US\">Date Created</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">Date of creation of the resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#created-003\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/date\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/valid\">\n<rdfs:label xml:lang=\"en-US\">Date Valid</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">Date (often a range) of validity of a resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#valid-003\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/date\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/available\">\n<rdfs:label xml:lang=\"en-US\">Date Available</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">Date (often a range) that the resource became or will become available.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#available-003\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/date\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/issued\">\n<rdfs:label xml:lang=\"en-US\">Date Issued</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">Date of formal issuance (e.g., publication) of the resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#issued-003\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/date\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/modified\">\n<rdfs:label xml:lang=\"en-US\">Date Modified</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">Date on which the resource was changed.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#modified-003\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/date\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/extent\">\n<rdfs:label xml:lang=\"en-US\">Extent</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The size or duration of the resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#extent-003\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/SizeOrDuration\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/format\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/format\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/medium\">\n<rdfs:label xml:lang=\"en-US\">Medium</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The material or physical carrier of the resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#medium-003\"/>\n<rdfs:domain rdf:resource=\"http://purl.org/dc/terms/PhysicalResource\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/PhysicalMedium\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/format\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/format\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/isVersionOf\">\n<rdfs:label xml:lang=\"en-US\">Is Version Of</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource of which the described resource is a version, edition, or adaptation.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Changes in version imply substantive changes in content rather than differences in format.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#isVersionOf-003\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/hasVersion\">\n<rdfs:label xml:lang=\"en-US\">Has Version</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource that is a version, edition, or adaptation of the described resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#hasVersion-003\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/isReplacedBy\">\n<rdfs:label xml:lang=\"en-US\">Is Replaced By</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource that supplants, displaces, or supersedes the described resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#isReplacedBy-003\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/replaces\">\n<rdfs:label xml:lang=\"en-US\">Replaces</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource that is supplanted, displaced, or superseded by the described resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#replaces-003\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/isRequiredBy\">\n<rdfs:label xml:lang=\"en-US\">Is Required By</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource that requires the described resource to support its function, delivery, or coherence.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#isRequiredBy-003\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/requires\">\n<rdfs:label xml:lang=\"en-US\">Requires</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource that is required by the described resource to support its function, delivery, or coherence.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#requires-003\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/isPartOf\">\n<rdfs:label xml:lang=\"en-US\">Is Part Of</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource in which the described resource is physically or logically included.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#isPartOf-003\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/hasPart\">\n<rdfs:label xml:lang=\"en-US\">Has Part</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource that is included either physically or logically in the described resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#hasPart-003\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/isReferencedBy\">\n<rdfs:label xml:lang=\"en-US\">Is Referenced By</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource that references, cites, or otherwise points to the described resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#isReferencedBy-003\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/references\">\n<rdfs:label xml:lang=\"en-US\">References</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource that is referenced, cited, or otherwise pointed to by the described resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#references-003\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/isFormatOf\">\n<rdfs:label xml:lang=\"en-US\">Is Format Of</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource that is substantially the same as the described resource, but in another format.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#isFormatOf-003\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/hasFormat\">\n<rdfs:label xml:lang=\"en-US\">Has Format</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A related resource that is substantially the same as the pre-existing described resource, but in another format.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#hasFormat-003\"/>\n<skos:note xml:lang=\"en-US\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/conformsTo\">\n<rdfs:label xml:lang=\"en-US\">Conforms To</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An established standard to which the described resource conforms.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2001-05-21</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#conformsTo-003\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/Standard\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/relation\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/spatial\">\n<rdfs:label xml:lang=\"en-US\">Spatial Coverage</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">Spatial characteristics of the resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#spatial-003\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/Location\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/coverage\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/coverage\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/temporal\">\n<rdfs:label xml:lang=\"en-US\">Temporal Coverage</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">Temporal characteristics of the resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#temporal-003\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/PeriodOfTime\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/coverage\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/coverage\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/mediator\">\n<rdfs:label xml:lang=\"en-US\">Mediator</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An entity that mediates access to the resource and for whom the resource is intended or useful.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">In an educational context, a mediator might be a parent, teacher, teaching assistant, or care-giver.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2001-05-21</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#mediator-003\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/AgentClass\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/audience\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/dateAccepted\">\n<rdfs:label xml:lang=\"en-US\">Date Accepted</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">Date of acceptance of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples of resources to which a Date Accepted may be relevant are a thesis (accepted by a university department) or an article (accepted by a journal).</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2002-07-13</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#dateAccepted-002\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/date\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/dateCopyrighted\">\n<rdfs:label xml:lang=\"en-US\">Date Copyrighted</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">Date of copyright.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2002-07-13</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#dateCopyrighted-002\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/date\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/dateSubmitted\">\n<rdfs:label xml:lang=\"en-US\">Date Submitted</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">Date of submission of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples of resources to which a Date Submitted may be relevant are a thesis (submitted to a university department) or an article (submitted to a journal).</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2002-07-13</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#dateSubmitted-002\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/date\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/educationLevel\">\n<rdfs:label xml:lang=\"en-US\">Audience Education Level</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2002-07-13</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#educationLevel-002\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/AgentClass\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/audience\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/accessRights\">\n<rdfs:label xml:lang=\"en-US\">Access Rights</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">Information about who can access the resource or an indication of its security status.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Access Rights may include information regarding access or restrictions based on privacy, security, or other policies.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2003-02-15</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#accessRights-002\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/RightsStatement\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/rights\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/rights\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/bibliographicCitation\">\n<rdfs:label xml:lang=\"en-US\">Bibliographic Citation</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A bibliographic reference for the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Recommended practice is to include sufficient bibliographic detail to identify the resource as unambiguously as possible.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2003-02-15</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#bibliographicCitation-002\"/>\n<rdfs:domain rdf:resource=\"http://purl.org/dc/terms/BibliographicResource\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/identifier\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/identifier\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/license\">\n<rdfs:label xml:lang=\"en-US\">License</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A legal document giving official permission to do something with the resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2004-06-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#license-002\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/LicenseDocument\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/rights\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/rights\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/rightsHolder\">\n<rdfs:label xml:lang=\"en-US\">Rights Holder</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A person or organization owning or managing rights over the resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2004-06-14</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#rightsHolder-002\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/Agent\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/provenance\">\n<rdfs:label xml:lang=\"en-US\">Provenance</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">The statement may include a description of any changes successive custodians made to the resource.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2004-09-20</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#provenance-002\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/ProvenanceStatement\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/instructionalMethod\">\n<rdfs:label xml:lang=\"en-US\">Instructional Method</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Instructional Method will typically include ways of presenting instructional materials or conducting instructional activities, patterns of learner-to-learner and learner-to-instructor interactions, and mechanisms by which group and individual levels of learning are measured.  Instructional methods include all aspects of the instruction and learning processes from planning and implementation through evaluation and feedback.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2005-06-13</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#instructionalMethod-002\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/MethodOfInstruction\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/accrualMethod\">\n<rdfs:label xml:lang=\"en-US\">Accrual Method</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The method by which items are added to a collection.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2005-06-13</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#accrualMethod-002\"/>\n<rdfs:domain rdf:resource=\"http://purl.org/dc/terms/Collection\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/MethodOfAccrual\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/accrualPeriodicity\">\n<rdfs:label xml:lang=\"en-US\">Accrual Periodicity</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The frequency with which items are added to a collection.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2005-06-13</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#accrualPeriodicity-002\"/>\n<rdfs:domain rdf:resource=\"http://purl.org/dc/terms/Collection\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/Frequency\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/accrualPolicy\">\n<rdfs:label xml:lang=\"en-US\">Accrual Policy</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The policy governing the addition of items to a collection.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2005-06-13</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#accrualPolicy-002\"/>\n<rdfs:domain rdf:resource=\"http://purl.org/dc/terms/Collection\"/>\n<rdfs:range rdf:resource=\"http://purl.org/dc/terms/Policy\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/Agent\">\n<rdfs:label xml:lang=\"en-US\">Agent</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A resource that acts or has the power to act.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples of Agent include person, organization, and software agent.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<rdf:type rdf:resource=\"http://purl.org/dc/terms/AgentClass\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Agent-001\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/AgentClass\">\n<rdfs:label xml:lang=\"en-US\">Agent Class</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A group of agents.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples of Agent Class include groups seen as classes, such as students, women, charities, lecturers.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#AgentClass-001\"/>\n<rdfs:subClassOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/BibliographicResource\">\n<rdfs:label xml:lang=\"en-US\">Bibliographic Resource</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A book, article, or other documentary resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#BibliographicResource-001\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/FileFormat\">\n<rdfs:label xml:lang=\"en-US\">File Format</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A digital resource format.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples include the formats defined by the list of Internet Media Types.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#FileFormat-001\"/>\n<rdfs:subClassOf rdf:resource=\"http://purl.org/dc/terms/MediaType\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/Frequency\">\n<rdfs:label xml:lang=\"en-US\">Frequency</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A rate at which something recurs.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Frequency-001\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/Jurisdiction\">\n<rdfs:label xml:lang=\"en-US\">Jurisdiction</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The extent or range of judicial, law enforcement, or other authority.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Jurisdiction-001\"/>\n<rdfs:subClassOf rdf:resource=\"http://purl.org/dc/terms/LocationPeriodOrJurisdiction\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/LicenseDocument\">\n<rdfs:label xml:lang=\"en-US\">License Document</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A legal document giving official permission to do something with a Resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#LicenseDocument-001\"/>\n<rdfs:subClassOf rdf:resource=\"http://purl.org/dc/terms/RightsStatement\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/LinguisticSystem\">\n<rdfs:label xml:lang=\"en-US\">Linguistic System</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A system of signs, symbols, sounds, gestures, or rules used in communication.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples include written, spoken, sign, and computer languages.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#LinguisticSystem-001\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/Location\">\n<rdfs:label xml:lang=\"en-US\">Location</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A spatial region or named place.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Location-001\"/>\n<rdfs:subClassOf rdf:resource=\"http://purl.org/dc/terms/LocationPeriodOrJurisdiction\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/LocationPeriodOrJurisdiction\">\n<rdfs:label xml:lang=\"en-US\">Location, Period, or Jurisdiction</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A location, period of time, or jurisdiction.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#LocationPeriodOrJurisdiction-001\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/MediaType\">\n<rdfs:label xml:lang=\"en-US\">Media Type</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A file format or physical medium.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#MediaType-001\"/>\n<rdfs:subClassOf rdf:resource=\"http://purl.org/dc/terms/MediaTypeOrExtent\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/MediaTypeOrExtent\">\n<rdfs:label xml:lang=\"en-US\">Media Type or Extent</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A media type or extent.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#MediaTypeOrExtent-001\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/MethodOfInstruction\">\n<rdfs:label xml:lang=\"en-US\">Method of Instruction</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A process that is used to engender knowledge, attitudes, and skills.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#MethodOfInstruction-001\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/MethodOfAccrual\">\n<rdfs:label xml:lang=\"en-US\">Method of Accrual</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A method by which resources are added to a collection.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#MethodOfAccrual-001\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/PeriodOfTime\">\n<rdfs:label xml:lang=\"en-US\">Period of Time</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">An interval of time that is named or defined by its start and end dates.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#PeriodOfTime-001\"/>\n<rdfs:subClassOf rdf:resource=\"http://purl.org/dc/terms/LocationPeriodOrJurisdiction\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/PhysicalMedium\">\n<rdfs:label xml:lang=\"en-US\">Physical Medium</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A physical material or carrier.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples include paper, canvas, or DVD.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#PhysicalMedium-001\"/>\n<rdfs:subClassOf rdf:resource=\"http://purl.org/dc/terms/MediaType\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/PhysicalResource\">\n<rdfs:label xml:lang=\"en-US\">Physical Resource</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A material thing.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#PhysicalResource-001\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/Policy\">\n<rdfs:label xml:lang=\"en-US\">Policy</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A plan or course of action by an authority, intended to influence and determine decisions, actions, and other matters.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Policy-001\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/ProvenanceStatement\">\n<rdfs:label xml:lang=\"en-US\">Provenance Statement</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A statement of any changes in ownership and custody of a resource since its creation that are significant for its authenticity, integrity, and interpretation.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#ProvenanceStatement-001\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/RightsStatement\">\n<rdfs:label xml:lang=\"en-US\">Rights Statement</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A statement about the intellectual property rights (IPR) held in or over a Resource, a legal document giving official permission to do something with a resource, or a statement about access rights.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#RightsStatement-001\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/SizeOrDuration\">\n<rdfs:label xml:lang=\"en-US\">Size or Duration</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A dimension or extent, or a time taken to play or execute.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">Examples include a number of pages, a specification of length, width, and breadth, or a period in hours, minutes, and seconds.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#SizeOrDuration-001\"/>\n<rdfs:subClassOf rdf:resource=\"http://purl.org/dc/terms/MediaTypeOrExtent\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/Standard\">\n<rdfs:label xml:lang=\"en-US\">Standard</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">A basis for comparison; a reference point against which other things can be evaluated.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Standard-001\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/ISO639-2\">\n<rdfs:label xml:lang=\"en-US\">ISO 639-2</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The three-letter alphabetic codes listed in ISO639-2 for the representation of names of languages.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#ISO639-2-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://lcweb.loc.gov/standards/iso639-2/langhome.html\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/RFC1766\">\n<rdfs:label xml:lang=\"en-US\">RFC 1766</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of tags, constructed according to RFC 1766, for the identification of languages.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#RFC1766-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.ietf.org/rfc/rfc1766.txt\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/URI\">\n<rdfs:label xml:lang=\"en-US\">URI</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of identifiers constructed according to the generic syntax for Uniform Resource Identifiers as specified by the Internet Engineering Task Force.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#URI-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.ietf.org/rfc/rfc3986.txt\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/Point\">\n<rdfs:label xml:lang=\"en-US\">DCMI Point</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of points in space defined by their geographic coordinates according to the DCMI Point Encoding Scheme.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Point-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://dublincore.org/documents/dcmi-point/\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/ISO3166\">\n<rdfs:label xml:lang=\"en-US\">ISO 3166</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of codes listed in ISO 3166-1 for the representation of names of countries.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#ISO3166-004\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/Box\">\n<rdfs:label xml:lang=\"en-US\">DCMI Box</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of regions in space defined by their geographic coordinates according to the DCMI Box Encoding Scheme.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Box-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://dublincore.org/documents/dcmi-box/\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/Period\">\n<rdfs:label xml:lang=\"en-US\">DCMI Period</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of time intervals defined by their limits according to the DCMI Period Encoding Scheme.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Period-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://dublincore.org/documents/dcmi-period/\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/W3CDTF\">\n<rdfs:label xml:lang=\"en-US\">W3C-DTF</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of dates and times constructed according to the W3C Date and Time Formats Specification.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#W3CDTF-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.w3.org/TR/NOTE-datetime\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/RFC3066\">\n<rdfs:label xml:lang=\"en-US\">RFC 3066</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of tags constructed according to RFC 3066 for the identification of languages.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">RFC 3066 has been obsoleted by RFC 4646.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2002-07-13</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#RFC3066-002\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.ietf.org/rfc/rfc3066.txt\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/RFC4646\">\n<rdfs:label xml:lang=\"en-US\">RFC 4646</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of tags constructed according to RFC 4646 for the identification of languages.</rdfs:comment>\n<dcterms:description xml:lang=\"en-US\">RFC 4646 obsoletes RFC 3066.</dcterms:description>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#RFC4646-001\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.ietf.org/rfc/rfc4646.txt\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/ISO639-3\">\n<rdfs:label xml:lang=\"en-US\">ISO 639-3</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of three-letter codes listed in ISO 639-3 for the representation of names of languages.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2008-01-14</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#ISO639-3-001\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.sil.org/iso639-3/\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/LCSH\">\n<rdfs:label xml:lang=\"en-US\">LCSH</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of labeled concepts specified by the Library of Congress Subject Headings.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#LCSH-003\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/MESH\">\n<rdfs:label xml:lang=\"en-US\">MeSH</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of labeled concepts specified by the Medical Subject Headings.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#MESH-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.nlm.nih.gov/mesh/meshhome.html\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/DDC\">\n<rdfs:label xml:lang=\"en-US\">DDC</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of conceptual resources specified by the Dewey Decimal Classification.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#DDC-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.oclc.org/dewey/\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/LCC\">\n<rdfs:label xml:lang=\"en-US\">LCC</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of conceptual resources specified by the Library of Congress Classification.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#LCC-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://lcweb.loc.gov/catdir/cpso/lcco/lcco.html\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/UDC\">\n<rdfs:label xml:lang=\"en-US\">UDC</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of conceptual resources specified by the Universal Decimal Classification.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#UDC-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.udcc.org/\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/DCMIType\">\n<rdfs:label xml:lang=\"en-US\">DCMI Type Vocabulary</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of classes specified by the DCMI Type Vocabulary, used to categorize the nature or genre of the resource.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#DCMIType-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://dublincore.org/documents/dcmi-type-vocabulary/\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/IMT\">\n<rdfs:label xml:lang=\"en-US\">IMT</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of media types specified by the Internet Assigned Numbers Authority.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#IMT-004\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.iana.org/assignments/media-types/\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/TGN\">\n<rdfs:label xml:lang=\"en-US\">TGN</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of places specified by the Getty Thesaurus of Geographic Names.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#TGN-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.getty.edu/research/tools/vocabulary/tgn/index.html\"/>\n</rdf:Description>\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/NLM\">\n<rdfs:label xml:lang=\"en-US\">NLM</rdfs:label>\n<rdfs:comment xml:lang=\"en-US\">The set of conceptual resources specified by the National Library of Medicine Classification.</rdfs:comment>\n<rdfs:isDefinedBy rdf:resource=\"http://purl.org/dc/terms/\"/>\n<dcterms:issued>2005-06-13</dcterms:issued>\n<dcterms:modified>2008-01-14</dcterms:modified>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#NLM-002\"/>\n<rdfs:seeAlso rdf:resource=\"http://wwwcf.nlm.nih.gov/class/\"/>\n</rdf:Description>\n</rdf:RDF>\n"
  },
  {
    "path": "application/config/SysBase/foaf",
    "content": "<!-- This is the FOAF formal vocabulary description, expressed using W3C RDFS and OWL markup. -->\n<!-- For more information about FOAF:                                            -->\n<!--   see the FOAF project homepage, http://www.foaf-project.org/               -->\n<!--   FOAF specification, http://xmlns.com/foaf/spec/                             -->\n<!--                                                                             -->\n<!-- first we introduce a number of RDF namespaces we will be using... -->\n<rdf:RDF \n\txmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" \n\txmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" \n\txmlns:owl=\"http://www.w3.org/2002/07/owl#\" \n\txmlns:vs=\"http://www.w3.org/2003/06/sw-vocab-status/ns#\" \n\txmlns:foaf=\"http://xmlns.com/foaf/0.1/\" \n\txmlns:wot=\"http://xmlns.com/wot/0.1/\" \n\txmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n<!-- Here we describe general characteristics of the FOAF vocabulary ('ontology'). -->\n  <owl:Ontology rdf:about=\"http://xmlns.com/foaf/0.1/\" dc:title=\"Friend of a Friend (FOAF) vocabulary\" dc:description=\"The Friend of a Friend (FOAF) RDF vocabulary, described using W3C RDF Schema and the Web Ontology Language.\" dc:date=\"$Date: 2007-05-23 19:25:11 $\">\n\n<!-- outdated    <rdfs:seeAlso rdf:resource=\"http://www.w3.org/2001/08/rdfweb/foaf\"/> -->\n<!-- unfashionable, removing...\n\t    \t<owl:imports rdf:resource=\"http://www.w3.org/2000/01/rdf-schema\"/>\n    \t\t<owl:imports rdf:resource=\"http://www.w3.org/2002/07/owl\"/> \t\t-->\n\n    <wot:assurance rdf:resource=\"../foafsig\"/>\n    <wot:src_assurance rdf:resource=\"../htmlfoafsig\"/>\n  </owl:Ontology>\n\n\n  <!-- OWL/RDF interop section - geeks only -->\n  <!--  most folk can ignore this lot. the game here is to make FOAF\n  \twork with vanilla RDF/RDFS tools, and with the stricter OWL DL \n\tprofile of OWL. At the moment we're in the OWL Full flavour of OWL. \n\tThe following are tricks to try have the spec live in both worlds\n\tat once. See\n\t\thttp://phoebus.cs.man.ac.uk:9999/OWL/Validator\n\t\thttp://www.mindswap.org/2003/pellet/demo.shtml\n\t...for some tools that help. \t\t\t\t\t-->\n  <owl:AnnotationProperty rdf:about=\"http://xmlns.com/wot/0.1/assurance\"/>\n  <owl:AnnotationProperty rdf:about=\"http://xmlns.com/wot/0.1/src_assurance\"/>\n  <owl:AnnotationProperty rdf:about=\"http://www.w3.org/2003/06/sw-vocab-status/ns#term_status\"/>\n  <!--  DC terms are NOT annotation properties in general, so we consider the following \n\tclaims scoped to this document. They may be removed in future revisions if\n\tOWL tools become more flexible. -->\n  <owl:AnnotationProperty rdf:about=\"http://purl.org/dc/elements/1.1/description\"/>\n  <owl:AnnotationProperty rdf:about=\"http://purl.org/dc/elements/1.1/title\"/>\n  <owl:AnnotationProperty rdf:about=\"http://purl.org/dc/elements/1.1/date\"/>\n  <owl:Class rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n\n<!--  <owl:Class rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <owl:Class rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/> -->\n  <!-- end of OWL/RDF interop voodoo. mostly. -->\n\n  \n<!-- FOAF classes (types) are listed first. -->\n\n  <rdfs:Class rdf:about=\"http://xmlns.com/foaf/0.1/Person\" rdfs:label=\"Person\" rdfs:comment=\"A person.\" vs:term_status=\"stable\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <rdfs:subClassOf><owl:Class rdf:about=\"http://xmlns.com/wordnet/1.6/Person\"/></rdfs:subClassOf>\n    <rdfs:subClassOf><owl:Class rdf:about=\"http://xmlns.com/foaf/0.1/Agent\"/></rdfs:subClassOf>\n    <rdfs:subClassOf><owl:Class rdf:about=\"http://xmlns.com/wordnet/1.6/Agent\"/></rdfs:subClassOf>\n    <rdfs:subClassOf><owl:Class rdf:about=\"http://www.w3.org/2000/10/swap/pim/contact#Person\"/></rdfs:subClassOf>\n    <rdfs:subClassOf><owl:Class rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\"/></rdfs:subClassOf>\n    <!-- aside: \n\tare spatial things always spatially located? \n\tPerson includes imaginary people... discuss... -->\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <owl:disjointWith rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <owl:disjointWith rdf:resource=\"http://xmlns.com/foaf/0.1/Organization\"/>\n    <owl:disjointWith rdf:resource=\"http://xmlns.com/foaf/0.1/Project\"/>\n  </rdfs:Class>\n  <rdfs:Class rdf:about=\"http://xmlns.com/foaf/0.1/Document\" rdfs:label=\"Document\" rdfs:comment=\"A document.\" vs:term_status=\"testing\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <rdfs:subClassOf rdf:resource=\"http://xmlns.com/wordnet/1.6/Document\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <owl:disjointWith rdf:resource=\"http://xmlns.com/foaf/0.1/Organization\"/>\n    <owl:disjointWith rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <owl:disjointWith rdf:resource=\"http://xmlns.com/foaf/0.1/Project\"/>\n  </rdfs:Class>\n  <rdfs:Class rdf:about=\"http://xmlns.com/foaf/0.1/Organization\" rdfs:label=\"Organization\" rdfs:comment=\"An organization.\" vs:term_status=\"stable\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <rdfs:subClassOf><owl:Class rdf:about=\"http://xmlns.com/wordnet/1.6/Organization\"/></rdfs:subClassOf>\n    <rdfs:subClassOf rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <owl:disjointWith rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <owl:disjointWith rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n  </rdfs:Class>\n  <rdfs:Class rdf:about=\"http://xmlns.com/foaf/0.1/Group\" vs:term_status=\"stable\" rdfs:label=\"Group\" rdfs:comment=\"A class of Agents.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <rdfs:subClassOf rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n  </rdfs:Class>\n  <rdfs:Class rdf:about=\"http://xmlns.com/foaf/0.1/Agent\" vs:term_status=\"stable\" rdfs:label=\"Agent\" rdfs:comment=\"An agent (eg. person, group, software or physical artifact).\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <rdfs:subClassOf><owl:Class rdf:about=\"http://xmlns.com/wordnet/1.6/Agent-3\"/></rdfs:subClassOf>\n    <owl:disjointWith rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n  </rdfs:Class>\n  <rdfs:Class rdf:about=\"http://xmlns.com/foaf/0.1/Project\" vs:term_status=\"unstable\" rdfs:label=\"Project\" rdfs:comment=\"A project (a collective endeavour of some kind).\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <rdfs:subClassOf><owl:Class rdf:about=\"http://xmlns.com/wordnet/1.6/Project\"/></rdfs:subClassOf>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <owl:disjointWith rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <owl:disjointWith rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n<!-- arguably a subclass of Agent; to be discussed -->\n  </rdfs:Class>\n  <rdfs:Class rdf:about=\"http://xmlns.com/foaf/0.1/Image\" vs:term_status=\"testing\" rdfs:label=\"Image\" rdfs:comment=\"An image.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <rdfs:subClassOf><owl:Class rdf:about=\"http://xmlns.com/wordnet/1.6/Document\"/></rdfs:subClassOf>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdfs:Class>\n\n  <rdfs:Class rdf:about=\"http://xmlns.com/foaf/0.1/PersonalProfileDocument\" rdfs:label=\"PersonalProfileDocument\" rdfs:comment=\"A personal profile RDF document.\" vs:term_status=\"testing\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <rdfs:subClassOf rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n  </rdfs:Class>\n\t\n  <rdfs:Class rdf:about=\"http://xmlns.com/foaf/0.1/OnlineAccount\" vs:term_status=\"unstable\" rdfs:label=\"Online Account\" rdfs:comment=\"An online account.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n  </rdfs:Class>\n  <rdfs:Class rdf:about=\"http://xmlns.com/foaf/0.1/OnlineGamingAccount\" vs:term_status=\"unstable\" rdfs:label=\"Online Gaming Account\" rdfs:comment=\"An online gaming account.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <rdfs:subClassOf rdf:resource=\"http://xmlns.com/foaf/0.1/OnlineAccount\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdfs:Class>\n  <rdfs:Class rdf:about=\"http://xmlns.com/foaf/0.1/OnlineEcommerceAccount\" vs:term_status=\"unstable\" rdfs:label=\"Online E-commerce Account\" rdfs:comment=\"An online e-commerce account.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <rdfs:subClassOf rdf:resource=\"http://xmlns.com/foaf/0.1/OnlineAccount\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdfs:Class>\n  <rdfs:Class rdf:about=\"http://xmlns.com/foaf/0.1/OnlineChatAccount\" vs:term_status=\"unstable\" rdfs:label=\"Online Chat Account\" rdfs:comment=\"An online chat account.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <rdfs:subClassOf rdf:resource=\"http://xmlns.com/foaf/0.1/OnlineAccount\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdfs:Class>\n<!-- FOAF properties (ie. relationships). -->\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/mbox\" vs:term_status=\"stable\" rdfs:label=\"personal mailbox\" rdfs:comment=\"A \npersonal mailbox, ie. an Internet mailbox associated with exactly one owner, the first owner of this mailbox. This is a 'static inverse functional property', in that  there is (across time and change) at most one individual that ever has any particular value for foaf:mbox.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#InverseFunctionalProperty\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/mbox_sha1sum\" vs:term_status=\"testing\" rdfs:label=\"sha1sum of a personal mailbox URI name\" rdfs:comment=\"The sha1sum of the URI of an Internet mailbox associated with exactly one owner, the  first owner of the mailbox.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#InverseFunctionalProperty\"/>\n\n<!--\nput it back in again 2006-01-29 - see \nhttp://chatlogs.planetrdf.com/swig/2006-01-29.html#T21-12-35\nI have mailed rdfweb-dev@vapours.rdfweb.org for discussion.\nLibby\n\nCommenting out as a kindness to OWL DL users. The semantics didn't quite cover\nour usage anyway, since (a) we want static-across-time, which is so beyond OWL as \nto be from another planet (b) we want identity reasoning invariant across xml:lang \ntagging. FOAF code will know what to do. OWL folks note, this assertion might return. \n\ndanbri\n-->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/gender\" vs:term_status=\"testing\" \nrdfs:label=\"gender\" \nrdfs:comment=\"The gender of this Agent (typically but not necessarily 'male' or 'female').\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#FunctionalProperty\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <!-- whatever one's gender is, and we are liberal in leaving room for more options \n    than 'male' and 'female', we model this so that an agent has only one gender. -->\n  </rdf:Property>\n\n\n\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/geekcode\" vs:term_status=\"testing\" rdfs:label=\"geekcode\" rdfs:comment=\"A textual geekcode for this person, see http://www.geekcode.com/geek.html\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/dnaChecksum\" vs:term_status=\"unstable\" rdfs:label=\"DNA checksum\" rdfs:comment=\"A checksum for the DNA of some thing. Joke.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/sha1\" vs:term_status=\"unstable\" rdfs:label=\"sha1sum (hex)\" rdfs:comment=\"A sha1sum hash, in hex.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n<!-- rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#InverseFunctionalProperty\" -->\n<!-- IFP under discussion -->\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/based_near\" vs:term_status=\"unstable\" rdfs:label=\"based near\" rdfs:comment=\"A location that something is based near, for some broadly human notion of near.\">\n<!-- see http://esw.w3.org/topic/GeoOnion for extension  ideas -->\n<!-- this was ranged as Agent... hmm -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n<!-- FOAF naming properties -->\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/title\" vs:term_status=\"testing\" rdfs:label=\"title\" rdfs:comment=\"Title (Mr, Mrs, Ms, Dr. etc)\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/nick\" vs:term_status=\"testing\" rdfs:label=\"nickname\" rdfs:comment=\"A short informal nickname characterising an agent (includes login identifiers, IRC and other chat nicknames).\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n<!-- ......................... chat IDs ........................... -->\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/jabberID\" vs:term_status=\"testing\" rdfs:label=\"jabber ID\" rdfs:comment=\"A jabber ID for something.\">\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n<!--\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/nick\"/>\n...different to the other IM IDs, as Jabber has wider usage, so \nwe don't want the implied rdfs:domain here.\n\n-->\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <!-- there is a case for using resources/URIs here, ... -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#InverseFunctionalProperty\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/aimChatID\" vs:term_status=\"testing\" rdfs:label=\"AIM chat ID\" rdfs:comment=\"An AIM chat ID\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/nick\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#InverseFunctionalProperty\"/>\n  </rdf:Property>\n<!-- http://www.stud.uni-karlsruhe.de/~uck4/ICQ/Packet-112.html -->\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/icqChatID\" vs:term_status=\"testing\" rdfs:label=\"ICQ chat ID\" rdfs:comment=\"An ICQ chat ID\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/nick\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#InverseFunctionalProperty\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/yahooChatID\" vs:term_status=\"testing\" rdfs:label=\"Yahoo chat ID\" rdfs:comment=\"A Yahoo chat ID\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/nick\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#InverseFunctionalProperty\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/msnChatID\" vs:term_status=\"testing\" rdfs:label=\"MSN chat ID\" rdfs:comment=\"An MSN chat ID\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/nick\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#InverseFunctionalProperty\"/>\n  </rdf:Property>\n<!-- ....................................................... -->\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/name\" vs:term_status=\"testing\" rdfs:label=\"name\" rdfs:comment=\"A name for some thing.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/firstName\" vs:term_status=\"testing\" rdfs:label=\"firstName\" rdfs:comment=\"The first name of a person.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/givenname\" vs:term_status=\"testing\" rdfs:label=\"Given name\" rdfs:comment=\"The given name of some person.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/surname\" vs:term_status=\"testing\" rdfs:label=\"Surname\" rdfs:comment=\"The surname of some person.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/family_name\" vs:term_status=\"testing\" rdfs:label=\"family_name\" rdfs:comment=\"The family_name of some person.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n<!-- end of naming properties. See http://rdfweb.org/issues/show_bug.cgi?id=7\n\t   for open issue / re-design discussions.\n\t-->\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/phone\" vs:term_status=\"testing\" rdfs:label=\"phone\" rdfs:comment=\"A phone,  specified using fully qualified tel: URI scheme (refs: http://www.w3.org/Addressing/schemes.html#tel).\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/homepage\" vs:term_status=\"stable\" rdfs:label=\"homepage\" rdfs:comment=\"A homepage for some thing.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/page\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/isPrimaryTopicOf\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#InverseFunctionalProperty\"/>\n    <!--  previously: rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\" -->\n    <rdfs:domain rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/weblog\" vs:term_status=\"testing\" rdfs:label=\"weblog\" rdfs:comment=\"A weblog of some thing (whether person, group, company etc.).\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/page\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#InverseFunctionalProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/tipjar\" vs:term_status=\"testing\" rdfs:label=\"tipjar\" rdfs:comment=\"A tipjar document for this agent, describing means for payment and reward.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/page\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/plan\" vs:term_status=\"testing\" rdfs:label=\"plan\" rdfs:comment=\"A .plan comment, in the tradition of finger and '.plan' files.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/made\" vs:term_status=\"stable\" rdfs:label=\"made\" rdfs:comment=\"Something that was made by this agent.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <owl:inverseOf rdf:resource=\"http://xmlns.com/foaf/0.1/maker\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/maker\"  vs:term_status=\"stable\" rdfs:label=\"maker\" rdfs:comment=\"An agent that \nmade this thing.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <owl:inverseOf rdf:resource=\"http://xmlns.com/foaf/0.1/made\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/img\" vs:term_status=\"testing\" rdfs:label=\"image\" rdfs:comment=\"An image that can be used to represent some thing (ie. those depictions which are particularly representative of something, eg. one's photo on a homepage).\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Image\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/depiction\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/depiction\" vs:term_status=\"testing\" rdfs:label=\"depiction\" rdfs:comment=\"A depiction of some thing.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Image\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <owl:inverseOf rdf:resource=\"http://xmlns.com/foaf/0.1/depicts\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/depicts\" vs:term_status=\"testing\" rdfs:label=\"depicts\" rdfs:comment=\"A thing depicted in this representation.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Image\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <owl:inverseOf rdf:resource=\"http://xmlns.com/foaf/0.1/depiction\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/thumbnail\" vs:term_status=\"testing\" rdfs:label=\"thumbnail\" rdfs:comment=\"A derived thumbnail image.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Image\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Image\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/myersBriggs\" vs:term_status=\"testing\" rdfs:label=\"myersBriggs\" rdfs:comment=\"A Myers Briggs (MBTI) personality classification.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/workplaceHomepage\" vs:term_status=\"testing\" rdfs:label=\"workplace homepage\" rdfs:comment=\"A workplace homepage of some person; the homepage of an organization they work for.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/workInfoHomepage\" vs:term_status=\"testing\" rdfs:label=\"work info homepage\" rdfs:comment=\"A work info homepage of some person; a page about their work for some organization.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/schoolHomepage\" vs:term_status=\"testing\" rdfs:label=\"schoolHomepage\" rdfs:comment=\"A homepage of a school attended by the person.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/knows\" vs:term_status=\"testing\" rdfs:label=\"knows\" rdfs:comment=\"A person known by this person (indicating some level of reciprocated interaction between the parties).\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/interest\" vs:term_status=\"testing\" rdfs:label=\"interest\" rdfs:comment=\"A page about a topic of interest to this person.\">\n<!-- we should distinguish the page from the topic more carefully. danbri 2002-07-08 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/topic_interest\" vs:term_status=\"testing\" rdfs:label=\"interest_topic\" rdfs:comment=\"A thing of interest to this person.\">\n<!-- we should distinguish the page from the topic more carefully. danbri 2002-07-08 -->\n<!--    foaf:interest_topic(P,R) \n\t\talways true whenever\n\t\tfoaf:interest(P,D), foaf:topic(D,R) \n\t\tie. a person has a foaf:topic_interest in all things \n\t\tthat are the foaf:topic of pages they have a foaf:interest in. \n\t\thmm, does this mean i'm forced to be interested in all the things that are the \n\t\ttopic of a page i'm interested in. thats a strong restriction on foaf:topic's utility.\t-->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/publications\" vs:term_status=\"unstable\" rdfs:label=\"publications\" rdfs:comment=\"A link to the publications of this person.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n<!-- by libby for ILRT mappings 2001-10-31 -->\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/currentProject\" vs:term_status=\"testing\" rdfs:label=\"current project\" rdfs:comment=\"A current project this person works on.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/pastProject\" vs:term_status=\"testing\" rdfs:label=\"past project\" rdfs:comment=\"A project this person has previously worked on.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/fundedBy\" vs:term_status=\"unstable\" rdfs:label=\"funded by\" rdfs:comment=\"An organization funding a project or person.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/logo\" vs:term_status=\"testing\" rdfs:label=\"logo\" rdfs:comment=\"A logo representing some thing.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/topic\" vs:term_status=\"testing\" rdfs:label=\"topic\" rdfs:comment=\"A topic of some page or document.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <owl:inverseOf rdf:resource=\"http://xmlns.com/foaf/0.1/page\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/primaryTopic\"\n vs:term_status=\"testing\" rdfs:label=\"primary topic\" rdfs:comment=\"The primary topic of some page or document.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#FunctionalProperty\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <owl:inverseOf rdf:resource=\"http://xmlns.com/foaf/0.1/isPrimaryTopicOf\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/isPrimaryTopicOf\"\n vs:term_status=\"testing\" rdfs:label=\"is primary topic of\" rdfs:comment=\"A document that this thing is the primary topic of.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#InverseFunctionalProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/page\"/>\n    <owl:inverseOf rdf:resource=\"http://xmlns.com/foaf/0.1/primaryTopic\"/>\n    <rdfs:domain rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/page\" vs:term_status=\"testing\" rdfs:label=\"page\" rdfs:comment=\"A page or document about this thing.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n    <owl:inverseOf rdf:resource=\"http://xmlns.com/foaf/0.1/topic\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/theme\" vs:term_status=\"unstable\" rdfs:label=\"theme\" rdfs:comment=\"A theme.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/holdsAccount\" vs:term_status=\"unstable\" rdfs:label=\"holds account\" rdfs:comment=\"Indicates an account held by this agent.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/OnlineAccount\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/accountServiceHomepage\" vs:term_status=\"unstable\" rdfs:label=\"account service homepage\" rdfs:comment=\"Indicates a homepage of the service provide for this online account.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/OnlineAccount\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/accountName\" vs:term_status=\"unstable\" rdfs:label=\"account name\" rdfs:comment=\"Indicates the name (identifier) associated with this online account.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/OnlineAccount\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/member\" vs:term_status=\"stable\" rdfs:label=\"member\" rdfs:comment=\"Indicates a member of a Group\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Group\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/membershipClass\" vs:term_status=\"unstable\" rdfs:label=\"membershipClass\" rdfs:comment=\"Indicates the class of individuals that are a member of a Group\">\n    <!-- maybe we should just use SPARQL or Rules, instead of trying to use OWL here -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#AnnotationProperty\"/>\n    <!-- Added to keep OWL DL from bluescreening. DON'T CROSS THE STREAMERS, etc. -->\n    <!-- This may get dropped if it means non-DL tools don't expose it as a real property.\n\t Should be fine though; I think only OWL stuff cares about AnnotationProperty.\n\t Dan\t\t\t\t\t\t\t\t\t -->\n\n<!--    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Group\"/> prose only for now...-->\n<!--    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/> -->\n<!--    <rdfs:range rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/> -->\n\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n\n\n  <rdf:Property rdf:about=\"http://xmlns.com/foaf/0.1/birthday\" vs:term_status=\"unstable\" rdfs:label=\"birthday\" rdfs:comment=\"The birthday of this Agent, represented in mm-dd string form, eg. '12-31'.\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#FunctionalProperty\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://xmlns.com/foaf/0.1/\"/>\n  </rdf:Property>\n\n\n</rdf:RDF>\n\n"
  },
  {
    "path": "application/config/SysBase/geo",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?xml-stylesheet type=\"text/xsl\" href=\"rdfs-xhtml.xsl\"?>\n\n<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n\n<rdf:Description rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#\">\n <dc:title>WGS84 Geo Positioning: an RDF vocabulary</dc:title>\n <dc:description>A vocabulary for representing latitude, longitude and altitude information in the WGS84 geodetic reference datum. Version $Id: wgs84_pos.rdf,v 1.18 2006/02/01 22:01:04 danbri Exp $. See http://www.w3.org/2003/01/geo/ for more details.</dc:description>\n <dc:date>$Date: 2006/02/01 22:01:04 $</dc:date>\n <rdfs:label>geo</rdfs:label>\n\n <rdfs:comment>\nRecent changes to this namespace:\n$Log: wgs84_pos.rdf,v $\nRevision 1.18  2006/02/01 22:01:04  danbri\nClarified that lat and long are decimal degrees, and that alt is decimal metres about local reference ellipsoid\n\nRevision 1.17  2004/02/06 17:38:12  danbri\nFixed a bad commit screwup\n\nRevision 1.15  2003/04/19 11:24:08  danbri\nFixed the typo even more.\n\nRevision 1.14  2003/04/19 11:16:56  danbri\nfixed a typo\n\nRevision 1.13  2003/02/19 22:27:27  connolly\nrelaxed domain constraints on lat/long/alt from Point to SpatialThing\n\nRevision 1.12  2003/01/12 01:41:41  danbri\nTrying local copy of XSLT doc.\n\nRevision 1.11  2003/01/12 01:20:18  danbri\nadded a link to morten's xslt rdfs viewer.\n\nRevision 1.10  2003/01/11 18:56:49  danbri\nRemoved datatype range from lat and long properties, since they would\nhave required each occurance of the property to mention the datatype.\n\nRevision 1.9  2003/01/11 11:41:31  danbri\nAnother typo; repaired rdfs:Property to rdf:Property x4\n\nRevision 1.8  2003/01/11 11:05:02  danbri\nAdded an rdfs:range for each lat/long/alt property,\nhttp://www.w3.org/2001/XMLSchema#float\n\nRevision 1.7  2003/01/10 20:25:16  danbri\nLonger rdfs:comment for Point, trying to be Earth-centric and neutral about\ncoordinate system(s) at the same time. Feedback welcomed.\n\nRevision 1.6  2003/01/10 20:18:30  danbri\nAdded CVS log comments into the RDF/XML as an rdfs:comment property of the\nvocabulary. Note that this is not common practice (but seems both harmless\nand potentially useful).\n\n\nrevision 1.5\ndate: 2003/01/10 20:14:31;  author: danbri;  state: Exp;  lines: +16 -5\nUpdated schema:\nAdded a dc:date, added url for more info. Changed the rdfs:label of the\nnamespace from gp to geo. Added a class Point, set as the rdfs:domain of\neach property. Added XML comment on the lat_long property suggesting that\nwe might not need it (based on #rdfig commentary from implementors).\n\nrevision 1.4\ndate: 2003/01/10 20:01:07;  author: danbri;  state: Exp;  lines: +6 -5\nFixed typo; several rdfs:about attributes are now rdf:about. Thanks to MortenF in\n#rdfig for catching this error.\n\nrevision 1.3\ndate: 2003/01/10 11:59:03;  author: danbri;  state: Exp;  lines: +4 -3\nfixed buglet in vocab, added more wgs links\n\nrevision 1.2\ndate: 2003/01/10 11:01:11;  author: danbri;  state: Exp;  lines: +4 -4\nRemoved alt from the as-a-flat-string property, and switched from\nspace separated to comma separated.\n\nrevision 1.1\ndate: 2003/01/10 10:53:23;  author: danbri;  state: Exp;\nbasic geo vocab\n\n</rdfs:comment>\n\n</rdf:Description>\n\n\n<rdfs:Class rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\">\n <rdfs:label>SpatialThing</rdfs:label>\n <rdfs:comment>Anything with spatial extent, i.e. size, shape, or position. e.g. people, places, bowling balls, as well as abstract areas like cubes.\n</rdfs:comment>\n</rdfs:Class>\n\n\n<rdfs:Class rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#Point\">\n <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\" />\n <rdfs:label>Point</rdfs:label>\n <rdfs:comment>A point, typically described using a coordinate system relative to Earth, such as WGS84.\n</rdfs:comment>\n\n<rdfs:comment>\nUniquely identified by lat/long/alt. i.e.\n\nspaciallyIntersects(P1, P2) :- lat(P1, LAT), long(P1, LONG), alt(P1, ALT),\n  lat(P2, LAT), long(P2, LONG), alt(P2, ALT).\n\nsameThing(P1, P2) :- type(P1, Point), type(P2, Point), spaciallyIntersects(P1, P2).\n</rdfs:comment>\n</rdfs:Class>\n\n\n<rdf:Property rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#lat\">\n <rdfs:domain rdf:resource=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\" />\n <rdfs:label>latitude</rdfs:label>\n <rdfs:comment>The WGS84 latitude of a SpatialThing (decimal degrees).</rdfs:comment>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#long\">\n <rdfs:domain rdf:resource=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\" />\n <rdfs:label>longitude</rdfs:label>\n <rdfs:comment>The WGS84 longitude of a SpatialThing (decimal degrees).</rdfs:comment>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#alt\">\n <rdfs:domain rdf:resource=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\" />\n <rdfs:label>altitude</rdfs:label>\n <rdfs:comment>The WGS84 altitude of a SpatialThing (decimal meters \nabove the local reference ellipsoid).</rdfs:comment>\n</rdf:Property>\n\n<!-- not sure we really need this -->\n<rdf:Property rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#lat_long\">\n <rdfs:label>lat/long</rdfs:label>\n <rdfs:comment>A comma-separated representation of a latitude, longitude coordinate.</rdfs:comment>\n</rdf:Property>\n\n</rdf:RDF>\n"
  },
  {
    "path": "application/config/SysBase/owl",
    "content": "<?xml version=\"1.0\"?>\n<!DOCTYPE rdf:RDF [\n     <!ENTITY rdf  \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" >\n     <!ENTITY rdfs \"http://www.w3.org/2000/01/rdf-schema#\" >\n     <!ENTITY xsd  \"http://www.w3.org/2001/XMLSchema#\" >\n     <!ENTITY owl  \"http://www.w3.org/2002/07/owl#\" >\n   ]>\n\n<rdf:RDF\n  xmlns     =\"&owl;\"\n  xmlns:owl =\"&owl;\"\n  xml:base  =\"http://www.w3.org/2002/07/owl\"\n  xmlns:rdf =\"&rdf;\"\n  xmlns:rdfs=\"&rdfs;\"\n>\n\n<Ontology rdf:about=\"\">\n  <imports rdf:resource=\"http://www.w3.org/2000/01/rdf-schema\"/>\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/TR/2004/REC-owl-semantics-20040210/\" />\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/TR/2004/REC-owl-test-20040210/\" />\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/TR/2004/REC-owl-features-20040210/\" />\n  <rdfs:comment>This file specifies in RDF Schema format the\n    built-in classes and properties that together form the basis of\n    the RDF/XML syntax of OWL Full, OWL DL and OWL Lite.\n    We do not expect people to import this file\n    explicitly into their ontology. People that do import this file\n    should expect their ontology to be an OWL Full ontology. \n  </rdfs:comment>\n  <versionInfo>10 February 2004, revised $Date: 2004/09/24 18:12:02 $</versionInfo>\n  <priorVersion rdf:resource=\"http://www.daml.org/2001/03/daml+oil\"/>\n</Ontology>\n\n<rdfs:Class rdf:ID=\"Class\">\n  <rdfs:label>Class</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"&rdfs;Class\"/>\n</rdfs:Class>\n\n<Class rdf:ID=\"Thing\">\n  <rdfs:label>Thing</rdfs:label>\n  <unionOf rdf:parseType=\"Collection\">\n    <Class rdf:about=\"#Nothing\"/>\n    <Class>\n      <complementOf rdf:resource=\"#Nothing\"/>\n    </Class>\n  </unionOf>\n</Class>\n\n<Class rdf:ID=\"Nothing\">\n  <rdfs:label>Nothing</rdfs:label>\n  <complementOf rdf:resource=\"#Thing\"/>\n</Class>\n\n<rdf:Property rdf:ID=\"equivalentClass\">\n  <rdfs:label>equivalentClass</rdfs:label>\n  <rdfs:subPropertyOf rdf:resource=\"&rdfs;subClassOf\"/>\n  <rdfs:domain rdf:resource=\"#Class\"/>\n  <rdfs:range rdf:resource=\"#Class\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"disjointWith\">\n  <rdfs:label>disjointWith</rdfs:label>\n  <rdfs:domain rdf:resource=\"#Class\"/>\n  <rdfs:range rdf:resource=\"#Class\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"equivalentProperty\">\n  <rdfs:label>equivalentProperty</rdfs:label>\n  <rdfs:subPropertyOf rdf:resource=\"&rdfs;subPropertyOf\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"sameAs\"> \n  <rdfs:label>sameAs</rdfs:label>\n  <rdfs:domain rdf:resource=\"#Thing\"/>\n  <rdfs:range rdf:resource=\"#Thing\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"differentFrom\">\n  <rdfs:label>differentFrom</rdfs:label>\n  <rdfs:domain rdf:resource=\"#Thing\"/>\n  <rdfs:range rdf:resource=\"#Thing\"/>\n</rdf:Property>\n\n<rdfs:Class rdf:ID=\"AllDifferent\">\n  <rdfs:label>AllDifferent</rdfs:label>\n</rdfs:Class>\n\n<rdf:Property rdf:ID=\"distinctMembers\">\n  <rdfs:label>distinctMembers</rdfs:label>\n  <rdfs:domain rdf:resource=\"#AllDifferent\"/>\n  <rdfs:range rdf:resource=\"&rdf;List\"/>\n</rdf:Property>\n  \n<rdf:Property rdf:ID=\"unionOf\">\n  <rdfs:label>unionOf</rdfs:label>\n  <rdfs:domain rdf:resource=\"#Class\"/>\n  <rdfs:range rdf:resource=\"&rdf;List\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"intersectionOf\">\n  <rdfs:label>intersectionOf</rdfs:label>\n  <rdfs:domain rdf:resource=\"#Class\"/>\n  <rdfs:range rdf:resource=\"&rdf;List\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"complementOf\">\n  <rdfs:label>complementOf</rdfs:label>\n  <rdfs:domain rdf:resource=\"#Class\"/>\n  <rdfs:range rdf:resource=\"#Class\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"oneOf\">\n  <rdfs:label>oneOf</rdfs:label>\n  <rdfs:domain rdf:resource=\"&rdfs;Class\"/>\n  <rdfs:range rdf:resource=\"&rdf;List\"/>\n</rdf:Property>\n\n<rdfs:Class rdf:ID=\"Restriction\">\n  <rdfs:label>Restriction</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"#Class\"/>\n</rdfs:Class>\n\n<rdf:Property rdf:ID=\"onProperty\">\n  <rdfs:label>onProperty</rdfs:label>\n  <rdfs:domain rdf:resource=\"#Restriction\"/>\n  <rdfs:range rdf:resource=\"&rdf;Property\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"allValuesFrom\">\n  <rdfs:label>allValuesFrom</rdfs:label>\n  <rdfs:domain rdf:resource=\"#Restriction\"/>\n  <rdfs:range rdf:resource=\"&rdfs;Class\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"hasValue\">\n  <rdfs:label>hasValue</rdfs:label>\n  <rdfs:domain rdf:resource=\"#Restriction\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"someValuesFrom\">\n  <rdfs:label>someValuesFrom</rdfs:label>\n  <rdfs:domain rdf:resource=\"#Restriction\"/>\n  <rdfs:range rdf:resource=\"&rdfs;Class\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"minCardinality\">\n  <rdfs:label>minCardinality</rdfs:label>\n  <rdfs:domain rdf:resource=\"#Restriction\"/>\n  <rdfs:range rdf:resource=\"&xsd;nonNegativeInteger\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"maxCardinality\">\n  <rdfs:label>maxCardinality</rdfs:label>\n  <rdfs:domain rdf:resource=\"#Restriction\"/>\n  <rdfs:range rdf:resource=\"&xsd;nonNegativeInteger\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"cardinality\">\n  <rdfs:label>cardinality</rdfs:label>\n  <rdfs:domain rdf:resource=\"#Restriction\"/>\n  <rdfs:range rdf:resource=\"&xsd;nonNegativeInteger\"/>\n</rdf:Property>\n\n<rdfs:Class rdf:ID=\"ObjectProperty\">\n  <rdfs:label>ObjectProperty</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"&rdf;Property\"/>\n</rdfs:Class>\n\n<rdfs:Class rdf:ID=\"DatatypeProperty\">\n  <rdfs:label>DatatypeProperty</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"&rdf;Property\"/>\n</rdfs:Class>\n\n<rdf:Property rdf:ID=\"inverseOf\">\n  <rdfs:label>inverseOf</rdfs:label>\n  <rdfs:domain rdf:resource=\"#ObjectProperty\"/>\n  <rdfs:range rdf:resource=\"#ObjectProperty\"/>\n</rdf:Property>\n\n<rdfs:Class rdf:ID=\"TransitiveProperty\">\n  <rdfs:label>TransitiveProperty</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"#ObjectProperty\"/>\n</rdfs:Class>\n\n<rdfs:Class rdf:ID=\"SymmetricProperty\">\n  <rdfs:label>SymmetricProperty</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"#ObjectProperty\"/>\n</rdfs:Class>\n\n<rdfs:Class rdf:ID=\"FunctionalProperty\">\n  <rdfs:label>FunctionalProperty</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"&rdf;Property\"/>\n</rdfs:Class>\n\n<rdfs:Class rdf:ID=\"InverseFunctionalProperty\">\n  <rdfs:label>InverseFunctionalProperty</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"&owl;ObjectProperty\"/>\n</rdfs:Class>\n\n<rdfs:Class rdf:ID=\"AnnotationProperty\">\n  <rdfs:label>AnnotationProperty</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"&rdf;Property\"/>\n</rdfs:Class>\n\n<AnnotationProperty rdf:about=\"&rdfs;label\"/>\n<AnnotationProperty rdf:about=\"&rdfs;comment\"/>\n<AnnotationProperty rdf:about=\"&rdfs;seeAlso\"/>\n<AnnotationProperty rdf:about=\"&rdfs;isDefinedBy\"/>\n\n<rdfs:Class rdf:ID=\"Ontology\">\n  <rdfs:label>Ontology</rdfs:label>\n</rdfs:Class>\n\n<rdfs:Class rdf:ID=\"OntologyProperty\">\n  <rdfs:label>OntologyProperty</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"&rdf;Property\"/>\n</rdfs:Class>\n\n<rdf:Property rdf:ID=\"imports\">\n  <rdfs:label>imports</rdfs:label>\n  <rdf:type rdf:resource=\"#OntologyProperty\"/>\n  <rdfs:domain rdf:resource=\"#Ontology\"/>\n  <rdfs:range rdf:resource=\"#Ontology\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"versionInfo\">\n  <rdfs:label>versionInfo</rdfs:label>\n  <rdf:type rdf:resource=\"#AnnotationProperty\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"priorVersion\">\n  <rdfs:label>priorVersion</rdfs:label>\n  <rdf:type rdf:resource=\"#OntologyProperty\"/>\n  <rdfs:domain rdf:resource=\"#Ontology\"/>\n  <rdfs:range rdf:resource=\"#Ontology\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"backwardCompatibleWith\">\n  <rdfs:label>backwardCompatibleWith</rdfs:label>\n  <rdf:type rdf:resource=\"#OntologyProperty\"/>\n  <rdfs:domain rdf:resource=\"#Ontology\"/>\n  <rdfs:range rdf:resource=\"#Ontology\"/>\n</rdf:Property>\n\n<rdf:Property rdf:ID=\"incompatibleWith\">\n  <rdfs:label>incompatibleWith</rdfs:label>\n  <rdf:type rdf:resource=\"#OntologyProperty\"/>\n  <rdfs:domain rdf:resource=\"#Ontology\"/>\n  <rdfs:range rdf:resource=\"#Ontology\"/>\n</rdf:Property>\n\n<rdfs:Class rdf:ID=\"DeprecatedClass\">\n  <rdfs:label>DeprecatedClass</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"&rdfs;Class\"/>\n</rdfs:Class>\n\n<rdfs:Class rdf:ID=\"DeprecatedProperty\">\n  <rdfs:label>DeprecatedProperty</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"&rdf;Property\"/>\n</rdfs:Class>\n\n<rdfs:Class rdf:ID=\"DataRange\">\n  <rdfs:label>DataRange</rdfs:label>\n</rdfs:Class>\n\n</rdf:RDF>\n\n\n"
  },
  {
    "path": "application/config/SysBase/rdf",
    "content": "<rdf:RDF\n   xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n   xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"\n   xmlns:owl=\"http://www.w3.org/2002/07/owl#\" \n   xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n\n <owl:Ontology \n     rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n   <dc:title>The RDF Vocabulary (RDF)</dc:title>\n   <dc:description>This is the RDF Schema for the RDF vocabulary defined in the RDF namespace.</dc:description>\n </owl:Ontology>\n\n<rdf:Property rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>type</rdfs:label>\n  <rdfs:comment>The subject is an instance of a class.</rdfs:comment>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdf:Property>\n\n<rdfs:Class rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>Property</rdfs:label>\n  <rdfs:comment>The class of RDF properties.</rdfs:comment>\n  <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdfs:Class>\n\n<rdfs:Class rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>Statement</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <rdfs:comment>The class of RDF statements.</rdfs:comment>\n</rdfs:Class>\n\n<rdf:Property rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#subject\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>subject</rdfs:label>\n  <rdfs:comment>The subject of the subject RDF statement.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement\"/>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>predicate</rdfs:label>\n  <rdfs:comment>The predicate of the subject RDF statement.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement\"/>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#object\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>object</rdfs:label>\n  <rdfs:comment>The object of the subject RDF statement.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement\"/>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdf:Property>\n\n<rdfs:Class rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>Bag</rdfs:label>\n  <rdfs:comment>The class of unordered containers.</rdfs:comment>\n  <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Container\"/>\n</rdfs:Class>\n\n<rdfs:Class rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>Seq</rdfs:label>\n  <rdfs:comment>The class of ordered containers.</rdfs:comment>\n  <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Container\"/>\n</rdfs:Class>\n\n<rdfs:Class rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>Alt</rdfs:label>\n  <rdfs:comment>The class of containers of alternatives.</rdfs:comment>\n  <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Container\"/>\n</rdfs:Class>\n\n<rdf:Property rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#value\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>value</rdfs:label>\n  <rdfs:comment>Idiomatic property used for structured values.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdf:Property>\n\n<!-- the following are new additions, Nov 2002 -->\n\n<rdfs:Class rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#List\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>List</rdfs:label>\n  <rdfs:comment>The class of RDF Lists.</rdfs:comment>\n  <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdfs:Class>\n\n<rdf:List rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>nil</rdfs:label>\n  <rdfs:comment>The empty list, with no items in it. If the rest of a list is nil then the list has no more items in it.</rdfs:comment>\n</rdf:List>\n\n<rdf:Property rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#first\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>first</rdfs:label>\n  <rdfs:comment>The first item in the subject RDF list.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#List\"/>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>rest</rdfs:label>\n  <rdfs:comment>The rest of the subject RDF list after the first item.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#List\"/>\n  <rdfs:range rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#List\"/>\n</rdf:Property>\n\t\n<rdfs:Datatype rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral\">\n  <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/> \n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/>\n  <rdfs:label>XMLLiteral</rdfs:label>\n  <rdfs:comment>The class of XML literal values.</rdfs:comment>\n</rdfs:Datatype>\n\n<rdf:Description rdf:about=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n  <rdfs:seeAlso rdf:resource=\"http://www.w3.org/2000/01/rdf-schema-more\"/>\n</rdf:Description>\n\n</rdf:RDF>\n\n"
  },
  {
    "path": "application/config/SysBase/rdfs",
    "content": "<rdf:RDF\n   xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n   xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"\n   xmlns:owl=\"http://www.w3.org/2002/07/owl#\" \n   xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n\n <owl:Ontology \n     rdf:about=\"http://www.w3.org/2000/01/rdf-schema#\"\n     dc:title=\"The RDF Schema vocabulary (RDFS)\"/>\n\n<rdfs:Class rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Resource\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>Resource</rdfs:label>\n  <rdfs:comment>The class resource, everything.</rdfs:comment>\n</rdfs:Class>\n\n<rdfs:Class rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Class\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>Class</rdfs:label>\n  <rdfs:comment>The class of classes.</rdfs:comment>\n  <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdfs:Class>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#subClassOf\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>subClassOf</rdfs:label>\n  <rdfs:comment>The subject is a subclass of a class.</rdfs:comment>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#subPropertyOf\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>subPropertyOf</rdfs:label>\n  <rdfs:comment>The subject is a subproperty of a property.</rdfs:comment>\n  <rdfs:range rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#comment\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>comment</rdfs:label>\n  <rdfs:comment>A description of the subject resource.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#label\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>label</rdfs:label>\n  <rdfs:comment>A human-readable name for the subject.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#domain\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>domain</rdfs:label>\n  <rdfs:comment>A domain of the subject property.</rdfs:comment>\n <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#range\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>range</rdfs:label>\n  <rdfs:comment>A range of the subject property.</rdfs:comment>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#seeAlso\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>seeAlso</rdfs:label>\n  <rdfs:comment>Further information about the subject resource.</rdfs:comment>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <rdfs:domain   rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#isDefinedBy\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#seeAlso\"/>\n  <rdfs:label>isDefinedBy</rdfs:label>\n  <rdfs:comment>The defininition of the subject resource.</rdfs:comment>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdf:Property>\n\n<rdfs:Class rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Literal\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>Literal</rdfs:label>\n  <rdfs:comment>The class of literal values, eg. textual strings and integers.</rdfs:comment>\n  <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdfs:Class>\n\n<rdfs:Class rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Container\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>Container</rdfs:label>\n  <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <rdfs:comment>The class of RDF containers.</rdfs:comment>\n</rdfs:Class>\n\n<rdfs:Class rdf:about=\"http://www.w3.org/2000/01/rdf-schema#ContainerMembershipProperty\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>ContainerMembershipProperty</rdfs:label>\n  <rdfs:comment>The class of container membership properties, rdf:_1, rdf:_2, ...,\n                    all of which are sub-properties of 'member'.</rdfs:comment>\n  <rdfs:subClassOf rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n</rdfs:Class>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#member\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>member</rdfs:label>\n  <rdfs:comment>A member of the subject resource.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdf:Property>\n\n<rdfs:Class rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Datatype\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>Datatype</rdfs:label>\n  <rdfs:comment>The class of RDF datatypes.</rdfs:comment>\n  <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n</rdfs:Class>\n\t\n<rdf:Description rdf:about=\"http://www.w3.org/2000/01/rdf-schema#\">\n  <rdfs:seeAlso rdf:resource=\"http://www.w3.org/2000/01/rdf-schema-more\"/>\n</rdf:Description>\n\n</rdf:RDF>\n"
  },
  {
    "path": "application/config/SysBase/rel",
    "content": "<?xml version=\"1.0\"?>\n<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n  xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"\n  xmlns:dct=\"http://purl.org/dc/terms/\"\n  xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n  xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"\n  xmlns:vann=\"http://purl.org/vocab/vann/\"\n  xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\"\n  xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n\n  <rdf:Description rdf:about=\"http://vocab.org/relationship/.rdf\">\n    <rdf:type rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <rdf:type rdf:resource=\"http://purl.org/dc/dcmitype/Text\"/>\n    <foaf:primaryTopic rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n    <dct:hasFormat rdf:resource=\"http://vocab.org/relationship/.html\"/>\n    <dct:hasFormat rdf:resource=\"http://vocab.org/relationship/.json\"/>\n    <dct:hasFormat rdf:resource=\"http://vocab.org/relationship/.turtle\"/>\n    <foaf:topic rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://vocab.org/relationship/.html\">\n    <rdf:type rdf:resource=\"http://purl.org/dc/dcmitype/Text\"/>\n    <rdf:type rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <dc:format>text/html</dc:format>\n    <rdfs:label>HTML</rdfs:label>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://vocab.org/relationship/.json\">\n    <rdf:type rdf:resource=\"http://purl.org/dc/dcmitype/Text\"/>\n    <rdf:type rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <dc:format>application/json</dc:format>\n    <rdfs:label>JSON</rdfs:label>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://vocab.org/relationship/.turtle\">\n    <rdf:type rdf:resource=\"http://purl.org/dc/dcmitype/Text\"/>\n    <rdf:type rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\n    <dc:format>text/plain</dc:format>\n    <rdfs:label>Turtle</rdfs:label>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Ontology\"/>\n    <dc:creator rdf:resource=\"http://iandavis.com/id/me\"/>\n    <dc:creator rdf:nodeID=\"arc7ca3b1\"/>\n    <dc:title>RELATIONSHIP: A vocabulary for describing relationships between people</dc:title>\n    <dc:description>A vocabulary for describing relationships between people</dc:description>\n    <dc:identifier>http://purl.org/vocab/relationship/rel-vocab-20050810</dc:identifier>\n    <dct:isVersionOf rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n    <dct:replaces rdf:resource=\"http://purl.org/vocab/relationship/rel-vocab-20040308\"/>\n    <vann:preferredNamespaceUri>http://purl.org/vocab/relationship</vann:preferredNamespaceUri>\n    <vann:preferredNamespacePrefix>rel</vann:preferredNamespacePrefix>\n    <vann:example rdf:resource=\"http://purl.org/vocab/relationship/rel-example-foaf-20040303.html\"/>\n    <vann:example rdf:resource=\"http://purl.org/vocab/relationship/rel-example-html-20040308.html\"/>\n    <dct:issued>2004-02-11</dct:issued>\n    <skos:changeNote rdf:nodeID=\"arc7ca3b2\"/>\n    <skos:historyNote rdf:nodeID=\"arc7ca3b3\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://iandavis.com/id/me\">\n    <rdf:type rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <foaf:name>Ian Davis</foaf:name>\n  </rdf:Description>\n\n  <rdf:Description rdf:nodeID=\"arc7ca3b1\">\n    <rdf:type rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <foaf:name>Eric Vitiello Jr</foaf:name>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/rel-example-foaf-20040303.html\">\n    <dc:title>Using With FOAF</dc:title>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/rel-example-html-20040308.html\">\n    <dc:title>Using With HTML and XHTML</dc:title>\n  </rdf:Description>\n\n  <rdf:Description rdf:nodeID=\"arc7ca3b2\">\n    <rdf:value>Added isDefinedBy properties and updated documentation</rdf:value>\n    <dc:date>2005-08-10</dc:date>\n    <dc:creator>Ian Davis</dc:creator>\n  </rdf:Description>\n\n  <rdf:Description rdf:nodeID=\"arc7ca3b3\">\n    <rdf:value>Typed vocabulary as owl:Ontology</rdf:value>\n    <dc:date>2009-05-15</dc:date>\n    <dc:creator>Ian Davis</dc:creator>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/friendOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/friendOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">friend of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who shares mutual friendship with this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/acquaintanceOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/acquaintanceOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">acquaintance of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person having more than slight or superficial knowledge of this person but short of friendship.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/parentOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/parentOf\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/childOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">parent of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who has given birth to or nurtured and raised this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/siblingOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/siblingOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">sibling of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person having one or both parents in common with this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/childOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/childOf\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/parentOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">child of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who was given birth to or nurtured and raised by this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/grandchildOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/grandchildOf\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/grandparentOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">grandchild of</rdfs:label>\n    <rdfs:label>Grandchild Of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who is a child of any of this person's children.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/spouseOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/spouseOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">spouse of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who is married to this person</skos:definition>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/enemyOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/enemyOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">enemy of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person towards whom this person feels hatred, intends injury to, or opposes the interests of.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/antagonistOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/antagonistOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">antagonist of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who opposes and contends against this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/ambivalentOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/ambivalentOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">ambivalent of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person towards whom this person has mixed feelings or emotions.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/lostContactWith\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">lost contact with</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who was once known by this person but has subsequently become uncontactable.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/knowsOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">knows of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who has come to be known to this person through their actions or position.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/wouldLikeToKnow\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">would like to now</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person whom this person would desire to know more closely.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/knowsInPassing\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">knows in passing</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person whom this person has slight or superficial knowledge of.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/knowsByReputation\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">knows by reputation</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person known by this person primarily for a particular action, position or field of endeavour.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/closeFriendOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">close friend of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who shares a close mutual friendship with this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/hasMet\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">has met</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who has met this person whether in passing or longer.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/worksWith\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#TransitiveProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">works with</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who works for the same employer as this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/colleagueOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">colleague of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who is a member of the same profession as this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/collaboratesWith\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">collaborates with</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who works towards a common goal with this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/employerOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/employedBy\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">employer of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who engages the services of this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/employedBy\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/employerOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">employed by</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person for whom this person's services have been engaged.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/mentorOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/apprenticeTo\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">mentor of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who serves as a trusted counselor or teacher to this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/apprenticeTo\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/mentorOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">apprentice to</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person to whom this person serves as a trusted counselor or teacher.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/livesWith\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#TransitiveProperty\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">lives with</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who shares a residence with this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/neighborOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#TransitiveProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">neighbor of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who lives in the same locality as this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/grandparentOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/grandchildOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">grandparent of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who is the parent of any of this person's parents.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/lifePartnerOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">life partner of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who has made a long-term commitment to this person's.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/engagedTo\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">engaged to</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person to whom this person is betrothed.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/ancestorOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#TransitiveProperty\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/descendantOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">ancestor of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who is a descendant of this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/descendantOf\">\n    <rdfs:label>Descendant Of</rdfs:label>\n    <rdfs:label xml:lang=\"en\">descendant of</rdfs:label>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#TransitiveProperty\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/ancestorOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <skos:definition xml:lang=\"en\">A person from whom this person is descended.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/Relationship\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n    <rdfs:label xml:lang=\"en\">relationship</rdfs:label>\n    <skos:definition xml:lang=\"en\">A particular type of connection existing between people related to or having dealings with each other.</skos:definition>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/participantIn\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">participant in</rdfs:label>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://purl.org/vocab/relationship/Relationship\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/participant\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">participant</rdfs:label>\n    <rdfs:domain rdf:resource=\"http://purl.org/vocab/relationship/Relationship\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/influencedBy\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">influenced by</rdfs:label>\n    <skos:definition xml:lang=\"en\">a person who has influenced this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n</rdf:RDF>"
  },
  {
    "path": "application/config/SysBase/sioc",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n\r\n<rdf:RDF\r\n  xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\r\n  xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"\r\n  xmlns:owl=\"http://www.w3.org/2002/07/owl#\"\r\n  xmlns:vs=\"http://www.w3.org/2003/06/sw-vocab-status/ns#\"\r\n  xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"\r\n  xmlns:wot=\"http://xmlns.com/wot/0.1/\"\r\n  xmlns:dcterms=\"http://purl.org/dc/terms/\"\r\n  xmlns:sioc=\"http://rdfs.org/sioc/ns#\"\r\n>\r\n\r\n<!-- OWL-DL Compliance statements -->\r\n<!-- DC -->\r\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/title\">\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\r\n</rdf:Description>\r\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/description\">\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\r\n  </rdf:Description>\r\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/subject\">\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\r\n</rdf:Description>\r\n<rdf:Description rdf:about=\"http://purl.org/dc/terms/references\">\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\r\n</rdf:Description>\r\n<!-- FOAF -->\r\n<rdf:Description rdf:about=\"http://xmlns.com/foaf/0.1/OnlineAccount\">\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\r\n</rdf:Description>\r\n<rdf:Description rdf:about=\"http://xmlns.com/foaf/0.1/Agent\">\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\r\n</rdf:Description>\r\n<rdf:Description rdf:about=\"http://xmlns.com/foaf/0.1/depiction\">\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\r\n</rdf:Description>\r\n<rdf:Description rdf:about=\"http://xmlns.com/foaf/0.1/holdsAccount\">\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\r\n</rdf:Description>\r\n\r\n<!-- SIOC Core Ontology -->\r\n<owl:Ontology rdf:about=\"http://rdfs.org/sioc/ns#\" rdf:type=\"http://www.w3.org/2002/07/owl#Thing\">\r\n  <dcterms:title xml:lang=\"en\">SIOC Core Ontology Namespace</dcterms:title>\r\n  <owl:versionInfo>Revision: 1.31</owl:versionInfo>\r\n  <dcterms:description xml:lang=\"en\">SIOC (Semantically-Interlinked Online Communities) is an ontology for describing the information in online communities. \r\nThis information can be used to export information from online communities and to link them together. The scope of the application areas that SIOC can be used for includes (and is not limited to) weblogs, message boards, mailing lists and chat channels.</dcterms:description>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/spec\" rdfs:label=\"SIOC Core Ontology Specification\"/>\r\n</owl:Ontology>\r\n\r\n<!-- Classes -->\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/ns#Community\">\r\n  <rdfs:label xml:lang=\"en\">Community</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Community is a high-level concept that defines an online community and what it consists of.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Role\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/ns#Container\">\r\n  <rdfs:label xml:lang=\"en\">Container</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An area in which content Items are contained.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Role\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Usergroup\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/ns#Forum\">\r\n  <rdfs:label xml:lang=\"en\">Forum</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A discussion area on which Posts or entries are made.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/ns#Item\">\r\n  <rdfs:label xml:lang=\"en\">Item</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An Item is something which can be in a Container.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Role\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Space\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Usergroup\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/ns#Post\">\r\n  <rdfs:label xml:lang=\"en\">Post</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An article or message that can be posted to a Forum.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/ns#Role\">\r\n  <rdfs:label xml:lang=\"en\">Role</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A Role is a function of a User within a scope of a particular Forum, Site, etc.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Space\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Usergroup\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/ns#Space\">\r\n  <rdfs:label xml:lang=\"en\">Space</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A Space is a place where data resides, e.g. on a website, desktop, fileshare, etc.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Role\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Usergroup\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/ns#Site\">\r\n  <rdfs:label xml:lang=\"en\">Site</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A Site can be the location of an online community or set of communities, with Users and Usergroups creating Items in a set of Containers. It can be thought of as a web-accessible data Space.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Space\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/ns#Thread\">\r\n  <rdfs:label xml:lang=\"en\">Thread</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A container for a series of threaded discussion Posts or Items.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/ns#User\">\r\n  <rdfs:label xml:lang=\"en\">User</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A User account in an online community site.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://xmlns.com/foaf/0.1/OnlineAccount\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Role\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Space\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Usergroup\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/ns#Usergroup\">\r\n  <rdfs:label xml:lang=\"en\">Usergroup</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A set of User accounts whose owners have a common purpose or interest. Can be used for access control purposes.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Role\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#Space\"/>\r\n  <owl:disjointWith rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n</owl:Class>\r\n\r\n<!-- Properties -->\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#about\">\r\n  <rdfs:label xml:lang=\"en\">about</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Specifies that this Item is about a particular resource, e.g. a Post describing a book, hotel, etc.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#account_of\">\r\n  <rdfs:label xml:lang=\"en\">account_of</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Refers to the foaf:Agent or foaf:Person who owns this sioc:User online account.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:inverseOf rdf:resource=\"http://xmlns.com/foaf/0.1/holdsAccount\"/>\r\n</owl:ObjectProperty>\r\n\r\n<!-- @@todo: moving this property to the access module ? -->\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#administrator_of\">\r\n  <rdfs:label xml:lang=\"en\">administrator_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_administrator\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Site that the User is an administrator of.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Site\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#attachment\">\r\n  <rdfs:label xml:lang=\"en\">attachment</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">The URI of a file attached to an Item.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#avatar\">\r\n  <rdfs:label xml:lang=\"en\">avatar</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An image or depiction used to represent this User.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/depiction\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#container_of\">\r\n  <rdfs:label xml:lang=\"en\">container_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_container\"/>\r\n  <rdfs:comment xml:lang=\"en\">An Item that this Container contains.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"http://rdfs.org/sioc/ns#content\">\r\n  <rdfs:label xml:lang=\"en\">content</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">The content of the Item in plain text format.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#creator_of\">\r\n  <rdfs:label xml:lang=\"en\">creator_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_creator\"/>\r\n  <rdfs:comment xml:lang=\"en\">A resource that the User is a creator of.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:TransitiveProperty rdf:about=\"http://rdfs.org/sioc/ns#earlier_version\">\r\n  <rdfs:comment xml:lang=\"en\">Links to a previous (older) revision of this Item or Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <rdfs:label xml:lang=\"en\">earlier_version</rdfs:label>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#later_version\"/>\r\n</owl:TransitiveProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#email\">\r\n  <rdfs:label xml:lang=\"en\">email</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An electronic mail address of the User.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"http://rdfs.org/sioc/ns#email_sha1\">\r\n  <rdfs:label xml:lang=\"en\">email_sha1</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An electronic mail address of the User, encoded using SHA1.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#feed\">\r\n  <rdfs:label xml:lang=\"en\">feed</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A feed (e.g. RSS, Atom, etc.) pertaining to this resource (e.g. for a Forum, Site, User, etc.).</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"http://rdfs.org/sioc/ns#follows\">\r\n  <rdfs:label xml:lang=\"en\">follows</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Indicates that one User follows another User (e.g. for microblog posts or other content item updates).</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<!-- @@todo: moving this property to the access module ? -->\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#function_of\">\r\n  <rdfs:label xml:lang=\"en\">function_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_function\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User who has this Role.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Role\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_administrator\">\r\n  <rdfs:label xml:lang=\"en\">has_administrator</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#administrator_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User who is an administrator of this Site.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Site\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_container\">\r\n  <rdfs:label xml:lang=\"en\">has_container</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#container_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">The Container to which this Item belongs.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_creator\">\r\n  <rdfs:label xml:lang=\"en\">has_creator</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#creator_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">This is the User who made this resource.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<!-- @@todo: moving this property to the access module ? -->\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_function\">\r\n  <rdfs:label xml:lang=\"en\">has_function</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#function_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Role that this User has.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Role\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_host\">\r\n  <rdfs:label xml:lang=\"en\">has_host</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#host_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">The Site that hosts this Forum.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Forum\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Site\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_member\">\r\n  <rdfs:label xml:lang=\"en\">has_member</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#member_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User who is a member of this Usergroup.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Usergroup\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<!-- @@todo: moving this property to the access module ? -->\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_moderator\">\r\n  <rdfs:label xml:lang=\"en\">has_moderator</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User who is a moderator of this Forum.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Forum\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_modifier\">\r\n  <rdfs:label xml:lang=\"en\">has_modifier</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#modifier_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User who modified this Item.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_owner\">\r\n  <rdfs:label xml:lang=\"en\">has_owner</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#owner_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User that this resource is owned by.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_parent\">\r\n  <rdfs:label xml:lang=\"en\">has_parent</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#parent_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Container or Forum that this Container or Forum is a child of.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_reply\">\r\n  <rdfs:label xml:lang=\"en\">has_reply</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#reply_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">Points to an Item or Post that is a reply or response to this Item or Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<!-- @@todo: moving this property to the access module ? -->\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_scope\">\r\n  <rdfs:label xml:lang=\"en\">has_scope</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#scope_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A resource that this Role applies to.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Role\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_space\">\r\n  <rdfs:label xml:lang=\"en\">has_space</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#space_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A data Space which this resource is a part of.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Space\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_subscriber\">\r\n  <rdfs:label xml:lang=\"en\">has_subscriber</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#subscriber_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User who is subscribed to this Container.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/ns#feed\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_usergroup\">\r\n  <rdfs:label xml:lang=\"en\">has_usergroup</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#usergroup_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">Points to a Usergroup that has certain access to this Space.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Space\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Usergroup\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#host_of\">\r\n  <rdfs:label xml:lang=\"en\">host_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_host\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Forum that is hosted on this Site.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Site\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Forum\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"http://rdfs.org/sioc/ns#id\">\r\n  <rdfs:label xml:lang=\"en\">id</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An identifier of a SIOC concept instance. For example, a user ID. Must be unique for instances of each type of SIOC concept within the same site.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"http://rdfs.org/sioc/ns#ip_address\">\r\n  <rdfs:label xml:lang=\"en\">ip_address</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">The IP address used when creating this Item. This can be associated with a creator. Some wiki articles list the IP addresses for the creator or modifiers when the usernames are absent.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:TransitiveProperty rdf:about=\"http://rdfs.org/sioc/ns#later_version\">\r\n  <rdfs:comment xml:lang=\"en\">Links to a later (newer) revision of this Item or Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <rdfs:label xml:lang=\"en\">later_version</rdfs:label>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#earlier_version\"/>\r\n</owl:TransitiveProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#latest_version\">\r\n  <rdfs:comment xml:lang=\"en\">Links to the latest revision of this Item or Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <rdfs:label xml:lang=\"en\">latest_version</rdfs:label>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#link\">\r\n  <rdfs:label xml:lang=\"en\">link</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A URI of a document which contains this SIOC object.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#links_to\">\r\n  <rdfs:label xml:lang=\"en\">links_to</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Links extracted from hyperlinks within a SIOC concept, e.g. Post or Site.</rdfs:comment>\r\n  <rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/references\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#member_of\">\r\n  <rdfs:label xml:lang=\"en\">member_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_member\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Usergroup that this User is a member of.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Usergroup\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#moderator_of\">\r\n  <rdfs:label xml:lang=\"en\">moderator_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_moderator\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Forum that User is a moderator of.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Forum\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#modifier_of\">\r\n  <rdfs:label xml:lang=\"en\">modifier_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_modifier\"/>\r\n  <rdfs:comment xml:lang=\"en\">An Item that this User has modified.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"http://rdfs.org/sioc/ns#name\">\r\n  <rdfs:label xml:lang=\"en\">name</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">The name of a SIOC instance, e.g. a username for a User, group name for a Usergroup, etc.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#next_by_date\">\r\n  <rdfs:label xml:lang=\"en\">next_by_date</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#previous_by_date\"/>\r\n  <rdfs:comment xml:lang=\"en\">Next Item or Post in a given Container sorted by date.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#next_version\">\r\n  <rdfs:label xml:lang=\"en\">next_version</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#previous_version\"/>\r\n  <rdfs:comment xml:lang=\"en\">Links to the next revision of this Item or Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <rdfs:subPropertyOf rdf:resource=\"http://rdfs.org/sioc/ns#later_version\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"http://rdfs.org/sioc/ns#note\">\r\n  <rdfs:label xml:lang=\"en\">note</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A note associated with this resource, for example, if it has been edited by a User.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"http://rdfs.org/sioc/ns#num_replies\">\r\n  <rdfs:label xml:lang=\"en\">num_replies</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">The number of replies that this Item, Thread, Post, etc. has. Useful for when the reply structure is absent.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2001/XMLSchema#integer\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"http://rdfs.org/sioc/ns#num_views\">\r\n  <rdfs:label xml:lang=\"en\">num_views</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">The number of times this Item, Thread, User profile, etc. has been viewed.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2001/XMLSchema#integer\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#owner_of\">\r\n  <rdfs:label xml:lang=\"en\">owner_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_owner\"/>\r\n  <rdfs:comment xml:lang=\"en\">A resource owned by a particular User, for example, a weblog or image gallery.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#parent_of\">\r\n  <rdfs:label xml:lang=\"en\">parent_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_parent\"/>\r\n  <rdfs:comment xml:lang=\"en\">A child Container or Forum that this Container or Forum is a parent of.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#previous_by_date\">\r\n  <rdfs:label xml:lang=\"en\">previous_by_date</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#next_by_date\"/>\r\n  <rdfs:comment xml:lang=\"en\">Previous Item or Post in a given Container sorted by date.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#previous_version\">\r\n  <rdfs:label xml:lang=\"en\">previous_version</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#next_version\"/>\r\n  <rdfs:comment xml:lang=\"en\">Links to the previous revision of this Item or Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <rdfs:subPropertyOf rdf:resource=\"http://rdfs.org/sioc/ns#earlier_version\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#related_to\">\r\n  <rdfs:label xml:lang=\"en\">related_to</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\r\n  <rdfs:comment xml:lang=\"en\">Related Posts for this Post, perhaps determined implicitly from topics or references.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#reply_of\">\r\n  <rdfs:label xml:lang=\"en\">reply_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_reply\"/>\r\n  <rdfs:comment xml:lang=\"en\">Links to an Item or Post which this Item or Post is a reply to.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<!-- @@todo: moving this property to the access module ? -->\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#scope_of\">\r\n  <rdfs:label xml:lang=\"en\">scope_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_scope\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Role that has a scope of this resource.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Role\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:SymmetricProperty rdf:about=\"http://rdfs.org/sioc/ns#sibling\">\r\n  <rdfs:label xml:lang=\"en\">sibling</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An Item may have a sibling or a twin that exists in a different Container, but the siblings may differ in some small way (for example, language, category, etc.). The sibling of this Item should be self-describing (that is, it should contain all available information).</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:SymmetricProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#space_of\">\r\n  <rdfs:label xml:lang=\"en\">space_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_space\"/>\r\n  <rdfs:comment xml:lang=\"en\">A resource which belongs to this data Space.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Space\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#subscriber_of\">\r\n  <rdfs:label xml:lang=\"en\">subscriber_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_subscriber\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Container that a User is subscribed to.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/ns#feed\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#topic\">\r\n  <rdfs:label xml:lang=\"en\">topic</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A topic of interest, linking to the appropriate URI, e.g. in the Open Directory Project or of a SKOS category.</rdfs:comment>\r\n  <rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/subject\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#usergroup_of\">\r\n  <rdfs:label xml:lang=\"en\">usergroup_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_usergroup\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Space that the Usergroup has access to.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Usergroup\"/>\r\n  <rdfs:range rdf:resource=\"http://rdfs.org/sioc/ns#Space\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n</owl:ObjectProperty>\r\n\r\n<!-- Deprecated -->\r\n\r\n<owl:DeprecatedProperty rdf:about=\"http://rdfs.org/sioc/ns#title\">\r\n  <rdfs:label xml:lang=\"en\">title</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\r\n  <rdfs:comment xml:lang=\"en\">This is the title (subject line) of the Post. Note that for a Post within a threaded discussion that has no parents, it would detail the topic thread.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:versionInfo>This property is deprecated. Use dcterms:title from the Dublin Core ontology instead.</owl:versionInfo>\r\n</owl:DeprecatedProperty>\r\n\r\n<owl:DeprecatedProperty rdf:about=\"http://rdfs.org/sioc/ns#content_encoded\">\r\n  <rdfs:label xml:lang=\"en\">content_encoded</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\r\n  <rdfs:comment xml:lang=\"en\">The encoded content of the Post, contained in CDATA areas.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:versionInfo>This property is deprecated. Use content:encoded from the RSS 1.0 content module instead.</owl:versionInfo>\r\n</owl:DeprecatedProperty>\r\n\r\n<owl:DeprecatedProperty rdf:about=\"http://rdfs.org/sioc/ns#created_at\">\r\n  <rdfs:label xml:lang=\"en\">created_at</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\r\n  <rdfs:comment xml:lang=\"en\">When this was created, in ISO 8601 format.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:versionInfo>This property is deprecated. Use dcterms:created from the Dublin Core ontology instead.</owl:versionInfo>\r\n</owl:DeprecatedProperty>\r\n\r\n<owl:DeprecatedProperty rdf:about=\"http://rdfs.org/sioc/ns#description\">\r\n  <rdfs:label xml:lang=\"en\">description</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\r\n  <rdfs:comment xml:lang=\"en\">The content of the Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:versionInfo>This property is deprecated. Use sioc:content or other methods (AtomOwl, content:encoded from RSS 1.0, etc.) instead.</owl:versionInfo>\r\n</owl:DeprecatedProperty>\r\n\r\n<owl:DeprecatedProperty rdf:about=\"http://rdfs.org/sioc/ns#first_name\">\r\n  <rdfs:label xml:lang=\"en\">first_name</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\r\n  <rdfs:comment xml:lang=\"en\">First (real) name of this User. Synonyms include given name or christian name.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:versionInfo>This property is deprecated. Use foaf:name or foaf:firstName from the FOAF vocabulary instead.</owl:versionInfo>\r\n</owl:DeprecatedProperty>\r\n\r\n\r\n<owl:DeprecatedProperty rdf:about=\"http://rdfs.org/sioc/ns#group_of\">\r\n  <rdfs:label xml:lang=\"en\">group_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_group\"/>\r\n  <owl:versionInfo>This property has been renamed. Use sioc:usergroup_of instead.</owl:versionInfo>\r\n</owl:DeprecatedProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"http://rdfs.org/sioc/ns#has_discussion\">\r\n  <rdfs:comment xml:lang=\"en\">The discussion that is related to this Item.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <rdfs:label xml:lang=\"en\">has_discussion</rdfs:label>\r\n</owl:ObjectProperty>\r\n\r\n<owl:DeprecatedProperty rdf:about=\"http://rdfs.org/sioc/ns#has_group\">\r\n  <rdfs:label xml:lang=\"en\">has_group</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#group_of\"/>\r\n  <owl:versionInfo>This property has been renamed. Use sioc:has_usergroup instead.</owl:versionInfo>\r\n</owl:DeprecatedProperty>\r\n\r\n<owl:DeprecatedProperty rdf:about=\"http://rdfs.org/sioc/ns#has_part\">\r\n  <rdfs:label xml:lang=\"en\">has_part</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#part_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">An resource that is a part of this subject.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:versionInfo>This property is deprecated. Use dcterms:hasPart from the Dublin Core ontology instead.</owl:versionInfo>\r\n</owl:DeprecatedProperty>\r\n\r\n<owl:DeprecatedProperty rdf:about=\"http://rdfs.org/sioc/ns#last_name\">\r\n  <rdfs:label xml:lang=\"en\">last_name</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\r\n  <rdfs:comment xml:lang=\"en\">Last (real) name of this user. Synonyms include surname or family name.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#User\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:versionInfo>This property is deprecated. Use foaf:name or foaf:surname from the FOAF vocabulary instead.</owl:versionInfo>\r\n</owl:DeprecatedProperty>\r\n\r\n<owl:DeprecatedProperty rdf:about=\"http://rdfs.org/sioc/ns#modified_at\">\r\n  <rdfs:label xml:lang=\"en\">modified_at</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\r\n  <rdfs:comment xml:lang=\"en\">When this was modified, in ISO 8601 format.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:versionInfo>This property is deprecated. Use dcterms:modified from the Dublin Core ontology instead.</owl:versionInfo>\r\n</owl:DeprecatedProperty>\r\n\r\n<owl:DeprecatedProperty rdf:about=\"http://rdfs.org/sioc/ns#part_of\">\r\n  <rdfs:label xml:lang=\"en\">part_of</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\r\n  <owl:inverseOf rdf:resource=\"http://rdfs.org/sioc/ns#has_part\"/>\r\n  <rdfs:comment xml:lang=\"en\">A resource that the subject is a part of.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:versionInfo>This property is deprecated. Use dcterms:isPartOf from the Dublin Core ontology instead.</owl:versionInfo>\r\n</owl:DeprecatedProperty>\r\n\r\n<owl:DeprecatedProperty rdf:about=\"http://rdfs.org/sioc/ns#reference\">\r\n  <rdfs:label xml:lang=\"en\">reference</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\r\n  <rdfs:comment xml:lang=\"en\">Links either created explicitly or extracted implicitly on the HTML level from the Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:versionInfo>Renamed to sioc:links_to.</owl:versionInfo>\r\n</owl:DeprecatedProperty>\r\n\r\n<owl:DeprecatedProperty rdf:about=\"http://rdfs.org/sioc/ns#subject\">\r\n  <rdfs:label xml:lang=\"en\">subject</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\r\n  <rdfs:comment xml:lang=\"en\">Keyword(s) describing subject of the Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/ns#\"/>\r\n  <owl:versionInfo>This property is deprecated. Use dcterms:subject from the Dublin Core ontology for text keywords and sioc:topic if the subject can be represented by a URI instead.</owl:versionInfo>\r\n</owl:DeprecatedProperty>\r\n\r\n</rdf:RDF>\r\n"
  },
  {
    "path": "application/config/SysBase/sioct",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n\r\n<rdf:RDF\r\n  xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\r\n  xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"\r\n  xmlns:owl=\"http://www.w3.org/2002/07/owl#\"\r\n  xmlns:vs=\"http://www.w3.org/2003/06/sw-vocab-status/ns#\"\r\n  xmlns:wot=\"http://xmlns.com/wot/0.1/\"\r\n  xmlns:dcterms=\"http://purl.org/dc/terms/\"\r\n  xmlns:ibis=\"http://purl.org/ibis#\"\r\n  xmlns:sioc=\"http://rdfs.org/sioc/ns#\"\r\n  xmlns:atom=\"http://atomowl.org/ontologies/atomrdf#\"\r\n  xmlns:exif=\"http://www.w3.org/2003/12/exif/ns/\"\r\n  xmlns:annotea=\"http://www.w3.org/2002/01/bookmark#\"\r\n  xmlns:resume=\"http://captsolo.net/semweb/resume/cv.rdfs#\"\r\n  xmlns:review=\"http://www.isi.edu/webscripter/communityreview/abstract-review-o#\"\r\n  xmlns:calendar=\"http://www.w3.org/2002/12/cal/icaltzd#\"\r\n  xmlns:annotation=\"http://www.w3.org/2000/10/annotation-ns#\"\r\n  xmlns:doap=\"http://usefulinc.com/ns/doap#\"\r\n  xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"\r\n  xmlns:wikiont=\"http://sw.deri.org/2005/04/wikipedia/wikiont.owl\"\r\n>\r\n\r\n<!-- SIOC Types Ontology Module -->\r\n<!-- Used to extend the SIOC Core Ontology with subclasses and subproperties of SIOC terms -->\r\n<!-- For more detail see http://rdfs.org/sioc/spec/#sec-modules -->\r\n\r\n<!-- OWL-DL Compliance statements -->\r\n<!-- SKOS -->\r\n<rdf:Description rdf:about=\"http://www.w3.org/2008/05/skos#Concept\">\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\r\n</rdf:Description>\r\n\r\n<!-- Types module -->\r\n\r\n<owl:Ontology rdf:about=\"http://rdfs.org/sioc/types#\" rdf:type=\"http://www.w3.org/2002/07/owl#Thing\">\r\n  <dcterms:title xml:lang=\"en\">SIOC Types Ontology Module Namespace</dcterms:title>\r\n  <dcterms:description xml:lang=\"en\">Extends the SIOC Core Ontology (Semantically-Interlinked Online Communities) by defining subclasses and subproperties of SIOC terms.</dcterms:description>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/spec/#sec-modules\"/>\r\n  <owl:imports rdf:resource=\"http://rdfs.org/sioc/ns#\" rdf:type=\"http://www.w3.org/2002/07/owl#Ontology\"/>\r\n</owl:Ontology>\r\n\r\n<!-- Classes -->\r\n\r\n<!-- Subtypes of sioc:Container -->\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#AddressBook\">\r\n  <rdfs:label xml:lang=\"en\">Address Book</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a collection of personal or organisational addresses.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#AnnotationSet\">\r\n  <rdfs:label xml:lang=\"en\">Annotation Set</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a set of annotations, for example, those created by a particular user or related to a particular topic.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://www.w3.org/2000/10/annotation-ns#Annotation\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#AudioChannel\">\r\n  <rdfs:label xml:lang=\"en\">Audio Channel</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a channel for distributing audio or sound files, for example, a podcast.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://purl.org/dc/dcmitype/Sound\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#BookmarkFolder\">\r\n  <rdfs:label xml:lang=\"en\">Bookmark Folder</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a shared collection of bookmarks.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://www.w3.org/2002/01/bookmark#Bookmark\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#Briefcase\">\r\n  <rdfs:label xml:lang=\"en\">Briefcase</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a briefcase or file service.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#EventCalendar\">\r\n  <rdfs:label xml:lang=\"en\">Event Calendar</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a calendar of events.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://www.w3.org/2002/12/cal/icaltzd#VEVENT\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#ImageGallery\">\r\n  <rdfs:label xml:lang=\"en\">Image Gallery</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes an image gallery, for example, a photo album.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://www.w3.org/2003/12/exif/ns/IFD\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#ProjectDirectory\">\r\n  <rdfs:label xml:lang=\"en\">Project Directory</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a project directory.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://usefulinc.com/ns/doap#Project\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#ResumeBank\">\r\n  <rdfs:label xml:lang=\"en\">Resume Bank</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a collection of resumes.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://captsolo.net/semweb/resume/cv.rdfs#Resume\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#ReviewArea\">\r\n  <rdfs:label xml:lang=\"en\">Review Area</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes an area where reviews are posted.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://www.isi.edu/webscripter/communityreview/abstract-review-o#Review\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://dannyayers.com/xmlns/rev/#Review\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#SubscriptionList\">\r\n  <rdfs:label xml:lang=\"en\">Subscription List</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a shared set of feed subscriptions.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://atomowl.org/ontologies/atomrdf#Feed\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#SurveyCollection\">\r\n  <rdfs:label xml:lang=\"en\">Survey Collection</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes an area where survey data can be collected, e.g. from polls.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#Poll\"/>  \r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#VideoChannel\">\r\n  <rdfs:label xml:lang=\"en\">Video Channel</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a channel for distributing videos (moving image) files, for example, a video podcast.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://purl.org/dc/dcmitype/MovingImage\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#Wiki\">\r\n  <rdfs:label xml:lang=\"en\">Wiki</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a wiki space.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#WikiArticle\"/>  \r\n</owl:Class>\r\n\r\n<!-- Types of sioc:Container for creating lists -->\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#FavouriteThings\">\r\n  <rdfs:label xml:lang=\"en\">Favourite Things</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a list or a collection of one's favourite things.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#OfferList\">\r\n  <rdfs:label xml:lang=\"en\">Offer List</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a list of the items someone has available to offer.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#Playlist\">\r\n  <rdfs:label xml:lang=\"en\">Playlist</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a list of media items that have been played or can be played.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#ReadingList\">\r\n  <rdfs:label xml:lang=\"en\">Reading List</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a list of books or other materials that have been read or are suggested for reading.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#WishList\">\r\n  <rdfs:label xml:lang=\"en\">Wish List</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a list of the items someone wishes to get.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Container\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</owl:Class>\r\n\r\n<!-- Subtypes of sioc:Forum -->\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#ArgumentativeDiscussion\">\r\n  <rdfs:label xml:lang=\"en\">Argumentative Discussion</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a discussion area where logical arguments can take place.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Forum\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://purl.org/ibis#Idea\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#ChatChannel\">\r\n  <rdfs:label xml:lang=\"en\">Chat Channel</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a channel for chat or instant messages, for example, via IRC or IM.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Forum\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#InstantMessage\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#MailingList\">\r\n  <rdfs:label xml:lang=\"en\">Mailing List</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes an electronic mailing list.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Forum\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#MailMessage\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#MessageBoard\">\r\n  <rdfs:label xml:lang=\"en\">Message Board</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a message board, also known as an online bulletin board or discussion forum.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Forum\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#BoardPost\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#Microblog\">\r\n  <rdfs:label xml:lang=\"en\">Microblog</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a microblog, i.e. a blog consisting of short text messages.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Forum\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#MicroblogPost\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#Weblog\">\r\n  <rdfs:label xml:lang=\"en\">Weblog</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a weblog (blog), i.e. an online journal.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Forum\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#BlogPost\"/>\r\n</owl:Class>\r\n\r\n<!-- Subtypes of sioc:Item -->\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#Poll\">\r\n  <rdfs:label xml:lang=\"en\">Poll</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a posted item that contains a poll or survey content.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Item\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#SurveyCollection\"/>\r\n</owl:Class>\r\n\r\n<!-- Subtypes of sioc:Post -->\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#BlogPost\">\r\n  <rdfs:label xml:lang=\"en\">Blog Post</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a post that is specifically made on a weblog.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#Weblog\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#BoardPost\">\r\n  <rdfs:label xml:lang=\"en\">Board Post</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a post that is specifically made on a message board.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#MessageBoard\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#Comment\">\r\n  <rdfs:label xml:lang=\"en\">Comment</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Comment is a subtype of sioc:Post and allows one to explicitly indicate that this SIOC post is a comment.  Note that comments have a narrower scope than sioc:Post and may not apply to all types of community site.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#Forum\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#InstantMessage\">\r\n  <rdfs:label xml:lang=\"en\">Instant Message</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes an instant message, e.g. sent via Jabber.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#ChatChannel\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#MailMessage\">\r\n  <rdfs:label xml:lang=\"en\">Mail Message</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes an electronic mail message, e.g. a post sent to a mailing list.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#MailingList\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#MicroblogPost\">\r\n  <rdfs:label xml:lang=\"en\">Microblog Post</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a post that is specifically made on a microblog.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#Microblog\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#WikiArticle\">\r\n  <rdfs:label xml:lang=\"en\">Wiki Article</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a wiki article.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#Wiki\"/>\r\n</owl:Class>\r\n\r\n<!-- Subtypes of sioc:Post for question and answer sites -->\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#Answer\">\r\n  <rdfs:label xml:lang=\"en\">Answer</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A Post that provides an answer in reply to a Question.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#BestAnswer\">\r\n  <rdfs:label xml:lang=\"en\">Best Answer</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A Post that is the best answer to a Question, as chosen by the User who asked the Question or as voted by a Community of Users.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</owl:Class>\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#Question\">\r\n  <rdfs:label xml:lang=\"en\">Question</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A Post that asks a Question.</rdfs:comment>\r\n  <rdfs:subClassOf rdf:resource=\"http://rdfs.org/sioc/ns#Post\"/>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</owl:Class>\r\n\r\n<!-- Types of sioc:topic for defining some different ways used to classify things in online communities -->\r\n\r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#Category\">\r\n  <rdfs:label xml:lang=\"en\">Category</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Category is used on the object of sioc:topic to indicate that this resource is a category on a site.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:subClassOf rdf:resource=\"http://www.w3.org/2008/05/skos#Concept\"/>\r\n</owl:Class>\r\n  \r\n<owl:Class rdf:about=\"http://rdfs.org/sioc/types#Tag\">\r\n  <rdfs:label xml:lang=\"en\">Tag</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Tag is used on the object of sioc:topic to indicate that this resource is a tag on a site.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</owl:Class>\r\n\r\n</rdf:RDF>\r\n"
  },
  {
    "path": "application/config/SysBase/skos",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rdf:RDF xmlns:dct=\"http://purl.org/dc/terms/\"\n  xmlns:owl=\"http://www.w3.org/2002/07/owl#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n  xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\"\n  xml:base=\"http://www.w3.org/2004/02/skos/core\">\n  <!-- This schema represents a formalisation of a subset of the semantic conditions \n    described in the SKOS Reference document. XML comments of the form Sn are used to \n    indicate the semantic conditions that are being expressed. Comments of the form \n    [Sn] refer to assertions that are, strictly speaking, redundant as they follow \n    from the RDF(S) or OWL semantics.\n    \n    A number of semantic conditions are *not* expressed formally in this schema. These are:\n    \n    S12\n    S13\n    S14\n    S27\n    S36\n    S46\n    \n    For the conditions listed above, rdfs:comments are used to indicate the conditions.\n    \n   -->\n  <owl:Ontology rdf:about=\"http://www.w3.org/2004/02/skos/core\">\n    <dct:title xml:lang=\"en\">SKOS Vocabulary</dct:title>\n    <dct:contributor>Dave Beckett</dct:contributor>\n    <dct:contributor>Nikki Rogers</dct:contributor>\n    <dct:contributor>Participants in W3C's Semantic Web Deployment Working Group.</dct:contributor>\n    <dct:description xml:lang=\"en\">An RDF vocabulary for describing the basic structure and content of concept schemes such as thesauri, classification schemes, subject heading lists, taxonomies, 'folksonomies', other types of controlled vocabulary, and also concept schemes embedded in glossaries and terminologies.</dct:description>\n    <dct:creator>Alistair Miles</dct:creator>\n    <dct:creator>Sean Bechhofer</dct:creator>\n  </owl:Ontology>\n  <rdf:Description rdf:about=\"#Concept\">\n    <rdfs:label xml:lang=\"en\">Concept</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">An idea or notion; a unit of thought.</skos:definition>\n    <!-- S1 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#ConceptScheme\">\n    <rdfs:label xml:lang=\"en\">Concept Scheme</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">A set of concepts, optionally including statements about semantic relationships between those concepts.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">A concept scheme may be defined to include concepts from different sources.</skos:scopeNote>\n    <skos:example xml:lang=\"en\">Thesauri, classification schemes, subject heading lists, taxonomies, 'folksonomies', and other types of controlled vocabulary are all examples of concept schemes. Concept schemes are also embedded in glossaries and terminologies.</skos:example>\n    <!-- S2 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <!-- S9 -->\n    <owl:disjointWith rdf:resource=\"#Concept\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#Collection\">\n    <rdfs:label xml:lang=\"en\">Collection</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">A meaningful collection of concepts.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">Labelled collections can be used where you would like a set of concepts to be displayed under a 'node label' in the hierarchy.</skos:scopeNote>\n    <!-- S28 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <!-- S37 -->\n    <owl:disjointWith rdf:resource=\"#Concept\"/>\n    <!-- S37 -->\n    <owl:disjointWith rdf:resource=\"#ConceptScheme\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#OrderedCollection\">\n    <rdfs:label xml:lang=\"en\">Ordered Collection</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">An ordered collection of concepts, where both the grouping and the ordering are meaningful.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">Ordered collections can be used where you would like a set of concepts to be displayed in a specific order, and optionally under a 'node label'.</skos:scopeNote>\n    <!-- S28 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Class\"/>\n    <!-- S29 -->\n    <rdfs:subClassOf rdf:resource=\"#Collection\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#inScheme\">\n    <rdfs:label xml:lang=\"en\">is in scheme</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">Relates a resource (for example a concept) to a concept scheme in which it is included.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">A concept may be a member of more than one concept scheme.</skos:scopeNote>\n    <!-- S3 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S4 -->\n    <rdfs:range rdf:resource=\"#ConceptScheme\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#hasTopConcept\">\n    <rdfs:label xml:lang=\"en\">has top concept</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">Relates, by convention, a concept scheme to a concept which is topmost in the broader/narrower concept hierarchies for that scheme, providing an entry point to these hierarchies.</skos:definition>\n    <!-- S3 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S5 -->\n    <rdfs:domain rdf:resource=\"#ConceptScheme\"/>\n    <!-- S6 -->\n    <rdfs:range rdf:resource=\"#Concept\"/>\n    <!-- S8 -->\n    <owl:inverseOf rdf:resource=\"#topConceptOf\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#topConceptOf\">\n    <rdfs:label xml:lang=\"en\">is top concept in scheme</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">Relates a concept to the concept scheme that it is a top level concept of.</skos:definition>\n    <!-- S3 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S7 -->\n    <rdfs:subPropertyOf rdf:resource=\"#inScheme\"/>\n    <!-- S8 -->\n    <owl:inverseOf rdf:resource=\"#hasTopConcept\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:domain rdf:resource=\"#Concept\"/>\n    <rdfs:range rdf:resource=\"#ConceptScheme\"/> \n  </rdf:Description>\n  <rdf:Description rdf:about=\"#prefLabel\">\n    <rdfs:label xml:lang=\"en\">preferred label</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">The preferred lexical label for a resource, in a given language.</skos:definition>\n    <!-- S10 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#AnnotationProperty\"/>\n    <!-- S11 -->\n    <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\"/>\n    <!-- S14 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">A resource has no more than one value of skos:prefLabel per language tag.</rdfs:comment>\n    <!-- S12 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">The range of skos:prefLabel is the class of RDF plain literals.</rdfs:comment>\n    <!-- S13 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise\n      disjoint properties.</rdfs:comment>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#altLabel\">\n    <rdfs:label xml:lang=\"en\">alternative label</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">An alternative lexical label for a resource.</skos:definition>\n    <skos:example xml:lang=\"en\">Acronyms, abbreviations, spelling variants, and irregular plural/singular forms may be included among the alternative labels for a concept. Mis-spelled terms are normally included as hidden labels (see skos:hiddenLabel).</skos:example>\n    <!-- S10 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#AnnotationProperty\"/>\n    <!-- S11 -->\n    <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\"/>\n    <!-- S12 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">The range of skos:altLabel is the class of RDF plain literals.</rdfs:comment>\n    <!-- S13 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties.</rdfs:comment>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#hiddenLabel\">\n    <rdfs:label xml:lang=\"en\">hidden label</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">A lexical label for a resource that should be hidden when generating visual displays of the resource, but should still be accessible to free text search operations.</skos:definition>\n    <!-- S10 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#AnnotationProperty\"/>\n    <!-- S11 -->\n    <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\"/>\n    <!-- S12 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">The range of skos:hiddenLabel is the class of RDF plain literals.</rdfs:comment>\n    <!-- S13 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties.</rdfs:comment>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#notation\">\n    <rdfs:label xml:lang=\"en\">notation</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">A notation, also known as classification code, is a string of characters such as \"T58.5\" or \"303.4833\" used to uniquely identify a concept within the scope of a given concept scheme.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">By convention, skos:notation is used with a typed literal in the object position of the triple.</skos:scopeNote>\n    <!-- S15 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#note\">\n    <rdfs:label xml:lang=\"en\">note</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">A general note, for any purpose.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">This property may be used directly, or as a super-property for more specific note types.</skos:scopeNote>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#AnnotationProperty\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#changeNote\">\n    <rdfs:label xml:lang=\"en\">change note</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">A note about a modification to a concept.</skos:definition>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#AnnotationProperty\"/>\n    <!-- S17 -->\n    <rdfs:subPropertyOf rdf:resource=\"#note\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#definition\">\n    <rdfs:label xml:lang=\"en\">definition</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">A statement or formal explanation of the meaning of a concept.</skos:definition>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#AnnotationProperty\"/>\n    <!-- S17 -->\n    <rdfs:subPropertyOf rdf:resource=\"#note\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#editorialNote\">\n    <rdfs:label xml:lang=\"en\">editorial note</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">A note for an editor, translator or maintainer of the vocabulary.</skos:definition>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#AnnotationProperty\"/>\n    <!-- S17 -->\n    <rdfs:subPropertyOf rdf:resource=\"#note\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#example\">\n    <rdfs:label xml:lang=\"en\">example</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">An example of the use of a concept.</skos:definition>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#AnnotationProperty\"/>\n    <!-- S17 -->\n    <rdfs:subPropertyOf rdf:resource=\"#note\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#historyNote\">\n    <rdfs:label xml:lang=\"en\">history note</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">A note about the past state/use/meaning of a concept.</skos:definition>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#AnnotationProperty\"/>\n    <!-- S17 -->\n    <rdfs:subPropertyOf rdf:resource=\"#note\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#scopeNote\">\n    <rdfs:label xml:lang=\"en\">scope note</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">A note that helps to clarify the meaning and/or the use of a concept.</skos:definition>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#AnnotationProperty\"/>\n    <!-- S17 -->\n    <rdfs:subPropertyOf rdf:resource=\"#note\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#semanticRelation\">\n    <rdfs:label xml:lang=\"en\">is in semantic relation with</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">Links a concept to a concept related by meaning.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">This property should not be used directly, but as a super-property for all properties denoting a relationship of meaning between concepts.</skos:scopeNote>\n    <!-- S18 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S19 -->\n    <rdfs:domain rdf:resource=\"#Concept\"/>\n    <!-- S20 -->\n    <rdfs:range rdf:resource=\"#Concept\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#broader\">\n    <rdfs:label xml:lang=\"en\">has broader concept</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">Relates a concept to a concept that is more general in meaning.</skos:definition>\n    <rdfs:comment xml:lang=\"en\">Broader concepts are typically rendered as parents in a concept hierarchy (tree).</rdfs:comment>\n    <skos:scopeNote xml:lang=\"en\">By convention, skos:broader is only used to assert an immediate (i.e. direct) hierarchical link between two conceptual resources.</skos:scopeNote>\n    <!-- S18 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S22 -->\n    <rdfs:subPropertyOf rdf:resource=\"#broaderTransitive\"/>\n    <!-- S25 -->\n    <owl:inverseOf rdf:resource=\"#narrower\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#narrower\">\n    <rdfs:label xml:lang=\"en\">has narrower concept</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">Relates a concept to a concept that is more specific in meaning.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">By convention, skos:broader is only used to assert an immediate (i.e. direct) hierarchical link between two conceptual resources.</skos:scopeNote>\n    <rdfs:comment xml:lang=\"en\">Narrower concepts are typically rendered as children in a concept hierarchy (tree).</rdfs:comment>\n    <!-- S18 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S22 -->\n    <rdfs:subPropertyOf rdf:resource=\"#narrowerTransitive\"/>\n    <!-- S25 -->\n    <owl:inverseOf rdf:resource=\"#broader\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#related\">\n    <rdfs:label xml:lang=\"en\">has related concept</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">Relates a concept to a concept with which there is an associative semantic relationship.</skos:definition>\n    <!-- S18 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S21 -->\n    <rdfs:subPropertyOf rdf:resource=\"#semanticRelation\"/>\n    <!-- S23 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <!-- S27 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">skos:related is disjoint with skos:broaderTransitive</rdfs:comment>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#broaderTransitive\">\n    <rdfs:label xml:lang=\"en\">has broader transitive</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition>skos:broaderTransitive is a transitive superproperty of skos:broader.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">By convention, skos:broaderTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application.</skos:scopeNote>\n    <!-- S18 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S21 -->\n    <rdfs:subPropertyOf rdf:resource=\"#semanticRelation\"/>\n    <!-- S24 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#TransitiveProperty\"/>\n    <!-- S26 -->\n    <owl:inverseOf rdf:resource=\"#narrowerTransitive\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#narrowerTransitive\">\n    <rdfs:label xml:lang=\"en\">has narrower transitive</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition>skos:narrowerTransitive is a transitive superproperty of skos:narrower.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">By convention, skos:narrowerTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application.</skos:scopeNote>\n    <!-- S18 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S21 -->\n    <rdfs:subPropertyOf rdf:resource=\"#semanticRelation\"/>\n    <!-- S24 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#TransitiveProperty\"/>\n    <!-- S26 -->\n    <owl:inverseOf rdf:resource=\"#broaderTransitive\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#member\">\n    <rdfs:label xml:lang=\"en\">has member</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">Relates a collection to one of its members.</skos:definition>\n    <!-- S30 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S31 -->\n    <rdfs:domain rdf:resource=\"#Collection\"/>\n    <!-- S32 -->\n    <rdfs:range>\n      <owl:Class>\n\t<owl:unionOf rdf:parseType=\"Collection\">\n\t  <owl:Class rdf:about=\"#Concept\"/>\n\t  <owl:Class rdf:about=\"#Collection\"/>\n\t</owl:unionOf>\n      </owl:Class>\n    </rdfs:range>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#memberList\">\n    <rdfs:label xml:lang=\"en\">has member list</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">Relates an ordered collection to the RDF list containing its members.</skos:definition>\n    <!-- S30 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S33 -->\n    <rdfs:domain rdf:resource=\"#OrderedCollection\"/>\n    <!-- S35 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#FunctionalProperty\"/>\n    <!-- S34 -->\n    <rdfs:range rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#List\"/>\n    <!-- S36 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">For any resource, every item in the list given as the value of the\n      skos:memberList property is also a value of the skos:member property.</rdfs:comment>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#mappingRelation\">\n    <rdfs:label xml:lang=\"en\">is in mapping relation with</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">Relates two concepts coming, by convention, from different schemes, and that have comparable meanings</skos:definition>\n    <rdfs:comment xml:lang=\"en\">These concept mapping relations mirror semantic relations, and the data model defined below is similar (with the exception of skos:exactMatch) to the data model defined for semantic relations. A distinct vocabulary is provided for concept mapping relations, to provide a convenient way to differentiate links within a concept scheme from links between concept schemes. However, this pattern of usage is not a formal requirement of the SKOS data model, and relies on informal definitions of best practice.</rdfs:comment>\n    <!-- S38 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S39 -->\n    <rdfs:subPropertyOf rdf:resource=\"#semanticRelation\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#broadMatch\">\n    <rdfs:label xml:lang=\"en\">has broader match</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">skos:broadMatch is used to state a hierarchical mapping link between two conceptual resources in different concept schemes.</skos:definition>\n    <!-- S38 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S40 -->\n    <rdfs:subPropertyOf rdf:resource=\"#mappingRelation\"/>\n    <!-- S41 -->\n    <rdfs:subPropertyOf rdf:resource=\"#broader\"/>\n    <!-- S43 -->\n    <owl:inverseOf rdf:resource=\"#narrowMatch\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#narrowMatch\">\n    <rdfs:label xml:lang=\"en\">has narrower match</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">skos:narrowMatch is used to state a hierarchical mapping link between two conceptual resources in different concept schemes.</skos:definition>\n    <!-- S38 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S40 -->\n    <rdfs:subPropertyOf rdf:resource=\"#mappingRelation\"/>\n    <!-- S41 -->\n    <rdfs:subPropertyOf rdf:resource=\"#narrower\"/>\n    <!-- S43 -->\n    <owl:inverseOf rdf:resource=\"#broadMatch\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#relatedMatch\">\n    <rdfs:label xml:lang=\"en\">has related match</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">skos:relatedMatch is used to state an associative mapping link between two conceptual resources in different concept schemes.</skos:definition>\n    <!-- S38 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S40 -->\n    <rdfs:subPropertyOf rdf:resource=\"#mappingRelation\"/>\n    <!-- S41 -->\n    <rdfs:subPropertyOf rdf:resource=\"#related\"/>\n    <!-- S44 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#exactMatch\">\n    <rdfs:label xml:lang=\"en\">has exact match</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">skos:exactMatch is used to link two concepts, indicating a high degree of confidence that the concepts can be used interchangeably across a wide range of information retrieval applications. skos:exactMatch is a transitive property, and is a sub-property of skos:closeMatch.</skos:definition>\n    <!-- S38 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S42 -->\n    <rdfs:subPropertyOf rdf:resource=\"#closeMatch\"/>\n    <!-- S44 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <!-- S45 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#TransitiveProperty\"/>\n    <!-- S46 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">skos:exactMatch is disjoint with each of the properties skos:broadMatch and skos:relatedMatch.</rdfs:comment>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"#closeMatch\">\n    <rdfs:label xml:lang=\"en\">has close match</rdfs:label>\n    <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2004/02/skos/core\"/>\n    <skos:definition xml:lang=\"en\">skos:closeMatch is used to link two concepts that are sufficiently similar that they can be used interchangeably in some information retrieval applications. In order to avoid the possibility of \"compound errors\" when combining mappings across more than two concept schemes, skos:closeMatch is not declared to be a transitive property.</skos:definition>\n    <!-- S38 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\n    <!-- S40 -->\n    <rdfs:subPropertyOf rdf:resource=\"#mappingRelation\"/>\n    <!-- S44 -->\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n</rdf:RDF>\n"
  },
  {
    "path": "application/config/SysBase/tags",
    "content": "\n<!-- Processed by Id: cwm.py,v 1.149 2004/05/12 01:27:06 timbl Exp -->\n<!--     using base file:/Users/sir03rn/Desktop/tags.n3-->\n\n\n<rdf:RDF xmlns=\"http://www.w3.org/2000/01/rdf-schema#\"\n    xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n    xmlns:dct=\"http://purl.org/dc/terms/\"\n    xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"\n    xmlns:owl=\"http://www.w3.org/2002/07/owl#\"\n    xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n    xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"\n    xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\"\n    xmlns:vs=\"http://www.w3.org/2003/06/sw-vocab-status/ns#\">\n\n    <owl:Ontology rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/\">\n        <dc:contributor>Danny Ayers</dc:contributor>\n        <dc:contributor>Seth Russell</dc:contributor>\n        <dc:creator>Richard Newman</dc:creator>\n        <dc:description xml:lang=\"en\">An ontology that describes tags, as used in the popular del.icio.us and Flickr systems, and allows for relationships between tags to be described.</dc:description>\n        <dc:title xml:lang=\"en\">Tag ontology</dc:title>\n        <dct:issued>2005-03-23</dct:issued>\n        <dct:modified>2005-05-19</dct:modified>\n        <dct:modified>2005-11-27</dct:modified>\n        <dct:modified>2005-12-21</dct:modified>\n        <label xml:lang=\"en\">An ontology for tags.</label>\n        <foaf:maker rdf:resource=\"http://www.holygoat.co.uk/foaf.rdf#RichardNewman\"/>\n    </owl:Ontology>\n\n    <owl:Class rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/RestrictedTagging\">\n        <comment xml:lang=\"en\">A Tagging which has precisely one associated resource, and one associated tag.</comment>\n        <label xml:lang=\"en\">restricted tagging</label>\n        <subClassOf rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tagging\"/>\n        <subClassOf rdf:parseType=\"Resource\">\n            <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Restriction\"/>\n            <owl:cardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#integer\">1</owl:cardinality>\n            <owl:onProperty rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedResource\"/>\n        </subClassOf>\n        <subClassOf rdf:parseType=\"Resource\">\n            <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Restriction\"/>\n            <owl:cardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#integer\">1</owl:cardinality>\n            <owl:onProperty rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/associatedTag\"/>\n        </subClassOf>\n    </owl:Class>\n\n    <owl:Class rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\">\n        <label xml:lang=\"en\">Tag</label>\n        <subClassOf rdf:resource=\"http://www.w3.org/2004/02/skos/core#Concept\"/>\n        <skos:definition xml:lang=\"en\">A natural-language concept which is used to annotate another resource.</skos:definition>\n    </owl:Class>\n\n    <owl:Class rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tagging\">\n        <comment xml:lang=\"en\">A reified class which defines an instance of a tagging by an agent of a resource with one or more tags.</comment>\n        <label xml:lang=\"en\">tagging</label>\n        <vs:term_status>testing</vs:term_status>\n    </owl:Class>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/associatedTag\">\n        <comment xml:lang=\"en\">The object is a Tag which plays a role in the subject Tagging.</comment>\n        <domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tagging\"/>\n        <label>associated tag</label>\n        <range rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <vs:term_status>testing</vs:term_status>\n    </owl:ObjectProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/equivalentTag\">\n        <comment xml:lang=\"en\">The two tags are asserted to be equivalent --- that is, that whenever one is associated with a resource, the other tag can be logically inferred to also be associated. Be very careful with this. I'm not sure if this should be a subproperty of owl:sameAs.</comment>\n        <domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <label xml:lang=\"en\">equivalent tag</label>\n        <range rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <subPropertyOf rdf:resource=\"http://www.w3.org/2002/07/owl#sameAs\"/>\n        <vs:term_status>testing</vs:term_status>\n    </owl:ObjectProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/isTagOf\">\n        <comment xml:lang=\"en\">Indicates that the subject tag applies to the object resource. This does not assert by who, when, or why the tagging occurred. For that information, use a reified Tagging resource.</comment>\n        <domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <label xml:lang=\"en\">is tag of</label>\n        <owl:inverseOf rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedWithTag\"/>\n    </owl:ObjectProperty>\n\n    <owl:DatatypeProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/name\">\n        <comment xml:lang=\"en\">The name of a tag. Note that we can't relate this to skos:prefLabel because we cannot guarantee that tags have unique labels in a given conceptual scheme. Or can we?</comment>\n        <domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <label xml:lang=\"en\">tag name</label>\n        <subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/title\"/>\n        <subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\"/>\n    </owl:DatatypeProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/relatedTag\">\n        <comment xml:lang=\"en\">The two tags are asserted as being related. This might be symmetric, but it certainly isn't transitive.</comment>\n        <domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <label xml:lang=\"en\">related tag</label>\n        <range rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <subPropertyOf rdf:resource=\"http://www.w3.org/2004/02/skos/core#semanticRelation\"/>\n        <vs:term_status>testing</vs:term_status>\n    </owl:ObjectProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/tag\">\n        <comment xml:lang=\"en\">The relationship between a resource and a Tagging. Note, of course, that this allows us to tag tags and taggings themselves...</comment>\n        <label xml:lang=\"en\">tag</label>\n        <range rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tagging\"/>\n    </owl:ObjectProperty>\n\n    <owl:DatatypeProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/tagName\">\n        <comment xml:lang=\"en\">The name of a tag. Note that we can't relate this to skos:prefLabel because we cannot guarantee that tags have unique labels in a given conceptual scheme. Or can we? DEPRECATED 2005-05-19: redundant 'tag'.</comment>\n        <domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <label xml:lang=\"en\">tag name</label>\n        <subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/title\"/>\n        <subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\"/>\n    </owl:DatatypeProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedBy\">\n        <comment xml:lang=\"en\">The object plays the role of the tagger in the subject Tagging.</comment>\n        <domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tagging\"/>\n        <label xml:lang=\"en\">tagged by</label>\n        <range rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n        <vs:term_status>testing</vs:term_status>\n    </owl:ObjectProperty>\n\n    <owl:DatatypeProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedOn\">\n        <comment xml:lang=\"en\">The subject Tagging occurred at the subject time and date.</comment>\n        <domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tagging\"/>\n        <label xml:lang=\"en\">tagged on</label>\n        <subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n        <vs:term_status>testing</vs:term_status>\n    </owl:DatatypeProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedResource\">\n        <comment xml:lang=\"en\">The object is a resource which plays a role in the subject Tagging.</comment>\n        <domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tagging\"/>\n        <label xml:lang=\"en\">tagged resource</label>\n        <vs:term_status>testing</vs:term_status>\n    </owl:ObjectProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedWithTag\">\n        <comment xml:lang=\"en\">Indicates that the subject has been tagged with the object tag. This does not assert by who, when, or why the tagging occurred. For that information, use a reified Tagging resource.</comment>\n        <label xml:lang=\"en\">tagged with tag</label>\n        <range rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <subPropertyOf rdf:resource=\"http://www.w3.org/2004/02/skos/core#subject\"/>\n    </owl:ObjectProperty>\n</rdf:RDF>\n"
  },
  {
    "path": "application/config/SysBase.rdf",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE rdf:RDF [\n <!ENTITY owl  \"http://www.w3.org/2002/07/owl#\">\n <!ENTITY rdf  \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <!ENTITY rdfs \"http://www.w3.org/2000/01/rdf-schema#\">\n <!ENTITY dc   \"http://purl.org/dc/elements/1.1/\">\n <!ENTITY dcterms  \"http://purl.org/dc/terms/\">\n <!ENTITY foaf \"http://xmlns.com/foaf/0.1/\">\n <!ENTITY skos \"http://www.w3.org/2004/02/skos/core#\">\n <!ENTITY sioc \"http://rdfs.org/sioc/ns#\">\n <!ENTITY sioct \"http://rdfs.org/sioc/types#\">\n <!ENTITY geo \"http://www.w3.org/2003/01/geo/wgs84_pos#\">\n <!ENTITY xsd  \"http://www.w3.org/2001/XMLSchema#\" >\n <!ENTITY rel \"http://purl.org/vocab/relationship/\" >\n]>\n\n<rdf:RDF\n\txmlns:owl=\"&owl;\" xmlns:rdf=\"&rdf;\" xmlns:rdfs=\"&rdfs;\"\n\txmlns:dc=\"&dc;\" xmlns:dcterms=\"&dcterms;\" xmlns:skos=\"&skos;\"\n\txmlns:foaf=\"&foaf;\" xmlns:sioc=\"&sioc;\" xmlns:sioct=\"&sioct;\" xmlns:rel=\"&rel;\"\n\txmlns:vs=\"http://www.w3.org/2003/06/sw-vocab-status/ns#\" \n>\n\n<owl:Ontology rdf:about=\"http://ns.ontowiki.net/SysBase/\">\n  <rdfs:label>OntoWiki System Base</rdfs:label>\n\t<owl:versionInfo>$Id: SysBase.rdf 4285 2009-10-12 13:15:09Z sebastian.dietzold $</owl:versionInfo>\n  <owl:versionInfo rdf:resource=\"http://code.google.com/p/ontowiki/source/list?path=/trunk/ontowiki/src/application/config/SysBase.rdf\" />\n  <rdfs:comment>This is a collection of several property and class descriptions intended to be imported automatically.</rdfs:comment>\n\t<dcterms:description>This model consists of all statements from the RDF, RDFS, OWL, DC, DCTERMS, SKOS, FOAF, SIOC and GEO namespaces to provide proper labels for standard properties and support better resource selection for standard object properties.</dcterms:description>\n  <skos:note>Do NOT import this ontology directly! Instead, use the original resources you got from the seeAlso links.</skos:note>\n  <skos:editorialNote>Inside OntoWiki, this model is used for the following tasks: (1) property selection in edit widgets (2) property labels in several tabs and modules.</skos:editorialNote>\n\t<rdfs:seeAlso rdf:resource=\"&owl;\" />\n\t<rdfs:seeAlso rdf:resource=\"&rdf;\" />\n\t<rdfs:seeAlso rdf:resource=\"&rdfs;\" />\n\t<rdfs:seeAlso rdf:resource=\"&dc;\" />\n\t<rdfs:seeAlso rdf:resource=\"&dcterms;\" />\n\t<rdfs:seeAlso rdf:resource=\"&skos;\" />\n\t<rdfs:seeAlso rdf:resource=\"&foaf;\" />\n\t<rdfs:seeAlso rdf:resource=\"&sioc;\" />\n\t<rdfs:seeAlso rdf:resource=\"&geo;\" />\n\t<rdfs:seeAlso rdf:resource=\"&rel;\" />\n</owl:Ontology>\n\n<!-- RDF -->\n\n<rdf:Property rdf:about=\"&rdf;type\">\n  <rdfs:label>type</rdfs:label>\n  <rdfs:comment>The subject is an instance of a class.</rdfs:comment>\n  <rdfs:range rdf:resource=\"&rdfs;Class\"/>\n  <rdfs:domain rdf:resource=\"&rdfs;Resource\"/>\n</rdf:Property>\n\n<rdf:Description rdf:about=\"&rdf;Property\">\n  <rdfs:label>Property</rdfs:label>\n  <rdfs:comment>The class of RDF properties.</rdfs:comment>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&rdf;Statement\">\n  <rdfs:label>Statement</rdfs:label>\n  <rdfs:comment>The class of RDF statements.</rdfs:comment>\n</rdf:Description>\n\n<rdf:Property rdf:about=\"&rdf;subject\">\n  <rdfs:label>subject</rdfs:label>\n  <rdfs:comment>The subject of the subject RDF statement.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"&rdf;Statement\"/>\n  <rdfs:range rdf:resource=\"&rdfs;Resource\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&rdf;predicate\">\n  <rdfs:label>predicate</rdfs:label>\n  <rdfs:comment>The predicate of the subject RDF statement.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"&rdf;Statement\"/>\n  <rdfs:range rdf:resource=\"&rdfs;Resource\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&rdf;object\">\n  <rdfs:label>object</rdfs:label>\n  <rdfs:comment>The object of the subject RDF statement.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"&rdf;Statement\"/>\n  <rdfs:range rdf:resource=\"&rdfs;Resource\"/>\n</rdf:Property>\n\n<rdf:Description rdf:about=\"&rdf;Bag\">\n  <rdfs:label>Bag</rdfs:label>\n  <rdfs:comment>The class of unordered containers.</rdfs:comment>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&rdf;Seq\">\n  <rdfs:label>Seq</rdfs:label>\n  <rdfs:comment>The class of ordered containers.</rdfs:comment>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&rdf;Alt\">\n  <rdfs:label>Alt</rdfs:label>\n  <rdfs:comment>The class of containers of alternatives.</rdfs:comment>\n</rdf:Description>\n\n<rdf:Property rdf:about=\"&rdf;value\">\n  <rdfs:label>value</rdfs:label>\n  <rdfs:comment>Idiomatic property used for structured values.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"&rdfs;Resource\"/>\n  <rdfs:range rdf:resource=\"&rdfs;Resource\"/>\n</rdf:Property>\n\n<!-- the following are new additions, Nov 2002 -->\n\n<rdf:Description rdf:about=\"&rdf;List\">\n  <rdfs:label>List</rdfs:label>\n  <rdfs:comment>The class of RDF Lists.</rdfs:comment>\n</rdf:Description>\n\n<rdf:List rdf:about=\"&rdf;nil\">\n  <rdfs:label>nil</rdfs:label>\n  <rdfs:comment>The empty list, with no items in it. If the rest of a list is nil then the list has no more items in it.</rdfs:comment>\n</rdf:List>\n\n<rdf:Property rdf:about=\"&rdf;first\">\n  <rdfs:label>first</rdfs:label>\n  <rdfs:comment>The first item in the subject RDF list.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"&rdf;List\"/>\n  <rdfs:range rdf:resource=\"&rdfs;Resource\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&rdf;rest\">\n  <rdfs:label>rest</rdfs:label>\n  <rdfs:comment>The rest of the subject RDF list after the first item.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"&rdf;List\"/>\n  <rdfs:range rdf:resource=\"&rdf;List\"/>\n</rdf:Property>\n\t\n<rdfs:Datatype rdf:about=\"&rdf;XMLLiteral\">\n  <rdfs:label>XMLLiteral</rdfs:label>\n  <rdfs:comment>The class of XML literal values.</rdfs:comment>\n</rdfs:Datatype>\n\n<rdf:Description rdf:about=\"&rdf;\">\n  <rdfs:seeAlso rdf:resource=\"http://www.w3.org/2000/01/rdf-schema-more\"/>\n</rdf:Description>\n\n\n<!-- RDF Schema -->\n\n\n<rdf:Description rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Resource\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>Resource</rdfs:label>\n  <rdfs:comment>The class resource, everything.</rdfs:comment>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Class\">\n\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>Class</rdfs:label>\n  <rdfs:comment>The class of classes.</rdfs:comment>\n</rdf:Description>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#subClassOf\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>subClassOf</rdfs:label>\n\n  <rdfs:comment>The subject is a subclass of a class.</rdfs:comment>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#subPropertyOf\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>subPropertyOf</rdfs:label>\n  <rdfs:comment>The subject is a subproperty of a property.</rdfs:comment>\n\n  <rdfs:range rdf:resource=\"&rdfs;Property\"/>\n  <rdfs:domain rdf:resource=\"&rdfs;Property\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#comment\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>comment</rdfs:label>\n  <rdfs:comment>A description of the subject resource.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#label\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>label</rdfs:label>\n  <rdfs:comment>A human-readable name for the subject.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#domain\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>domain</rdfs:label>\n  <rdfs:comment>A domain of the subject property.</rdfs:comment>\n <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n  <rdfs:domain rdf:resource=\"&rdfs;Property\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#range\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>range</rdfs:label>\n  <rdfs:comment>A range of the subject property.</rdfs:comment>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n  <rdfs:domain rdf:resource=\"&rdfs;Property\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#seeAlso\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n\n  <rdfs:label>seeAlso</rdfs:label>\n  <rdfs:comment>Further information about the subject resource.</rdfs:comment>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <rdfs:domain   rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#isDefinedBy\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#seeAlso\"/>\n\n  <rdfs:label>isDefinedBy</rdfs:label>\n  <rdfs:comment>The defininition of the subject resource.</rdfs:comment>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdf:Property>\n\n<rdf:Description rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Literal\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>Literal</rdfs:label>\n\n  <rdfs:comment>The class of literal values, eg. textual strings and integers.</rdfs:comment>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Container\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>Container</rdfs:label>\n  <rdfs:comment>The class of RDF containers.</rdfs:comment>\n\n</rdf:Description>\n\n<rdf:Description rdf:about=\"http://www.w3.org/2000/01/rdf-schema#ContainerMembershipProperty\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>ContainerMembershipProperty</rdfs:label>\n  <rdfs:comment>The class of container membership properties, rdf:_1, rdf:_2, ...,\n                    all of which are sub-properties of 'member'.</rdfs:comment>\n</rdf:Description>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2000/01/rdf-schema#member\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n\n  <rdfs:label>member</rdfs:label>\n  <rdfs:comment>A member of the subject resource.</rdfs:comment>\n  <rdfs:domain rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n</rdf:Property>\n\n<rdf:Description rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Datatype\">\n  <rdfs:isDefinedBy rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#\"/>\n  <rdfs:label>Datatype</rdfs:label>\n\n  <rdfs:comment>The class of RDF datatypes.</rdfs:comment>\n</rdf:Description>\n\t\n<!-- OWL -->\n\n\n\n<rdf:Description rdf:about=\"&owl;Class\">\n  <rdfs:label>Class</rdfs:label>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&owl;Thing\">\n  <rdfs:label>Thing</rdfs:label>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&owl;Nothing\">\n  <rdfs:label>Nothing</rdfs:label>\n  <owl:complementOf rdf:resource=\"&owl;Thing\"/>\n</rdf:Description>\n\n<rdf:Property rdf:about=\"&owl;equivalentClass\">\n  <rdfs:label>equivalentClass</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Class\"/>\n  <rdfs:range rdf:resource=\"&owl;Class\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;disjointWith\">\n  <rdfs:label>disjointWith</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Class\"/>\n  <rdfs:range rdf:resource=\"&owl;Class\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;equivalentProperty\">\n  <rdfs:label>equivalentProperty</rdfs:label>\n  <rdfs:subPropertyOf rdf:resource=\"&rdfs;subPropertyOf\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;sameAs\"> \n  <rdfs:label>sameAs</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Thing\"/>\n  <rdfs:range rdf:resource=\"&owl;Thing\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;differentFrom\">\n  <rdfs:label>differentFrom</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Thing\"/>\n  <rdfs:range rdf:resource=\"&owl;Thing\"/>\n</rdf:Property>\n\n<rdf:Description rdf:about=\"&owl;AllDifferent\">\n  <rdfs:label>AllDifferent</rdfs:label>\n</rdf:Description>\n\n<rdf:Property rdf:about=\"&owl;distinctMembers\">\n  <rdfs:label>distinctMembers</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;AllDifferent\"/>\n  <rdfs:range rdf:resource=\"&rdf;List\"/>\n</rdf:Property>\n  \n<rdf:Property rdf:about=\"&owl;unionOf\">\n  <rdfs:label>unionOf</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Class\"/>\n  <rdfs:range rdf:resource=\"&rdf;List\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;intersectionOf\">\n  <rdfs:label>intersectionOf</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Class\"/>\n  <rdfs:range rdf:resource=\"&rdf;List\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;complementOf\">\n  <rdfs:label>complementOf</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Class\"/>\n  <rdfs:range rdf:resource=\"&owl;Class\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;oneOf\">\n  <rdfs:label>oneOf</rdfs:label>\n  <rdfs:domain rdf:resource=\"&rdfs;Class\"/>\n  <rdfs:range rdf:resource=\"&rdf;List\"/>\n</rdf:Property>\n\n<rdf:Description rdf:about=\"&owl;Restriction\">\n  <rdfs:label>Restriction</rdfs:label>\n</rdf:Description>\n\n<rdf:Property rdf:about=\"&owl;onProperty\">\n  <rdfs:label>onProperty</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Restriction\"/>\n  <rdfs:range rdf:resource=\"&rdf;Property\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;allValuesFrom\">\n  <rdfs:label>allValuesFrom</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Restriction\"/>\n  <rdfs:range rdf:resource=\"&rdfs;Class\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;hasValue\">\n  <rdfs:label>hasValue</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Restriction\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;someValuesFrom\">\n  <rdfs:label>someValuesFrom</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Restriction\"/>\n  <rdfs:range rdf:resource=\"&rdfs;Class\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;minCardinality\">\n  <rdfs:label>minCardinality</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Restriction\"/>\n  <rdfs:range rdf:resource=\"&xsd;nonNegativeInteger\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;maxCardinality\">\n  <rdfs:label>maxCardinality</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Restriction\"/>\n  <rdfs:range rdf:resource=\"&xsd;nonNegativeInteger\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;cardinality\">\n  <rdfs:label>cardinality</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;Restriction\"/>\n  <rdfs:range rdf:resource=\"&xsd;nonNegativeInteger\"/>\n</rdf:Property>\n\n<rdf:Description rdf:about=\"&owl;ObjectProperty\">\n  <rdfs:label>ObjectProperty</rdfs:label>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&owl;DatatypeProperty\">\n  <rdfs:label>DatatypeProperty</rdfs:label>\n</rdf:Description>\n\n<rdf:Property rdf:about=\"&owl;inverseOf\">\n  <rdfs:label>inverseOf</rdfs:label>\n  <rdfs:domain rdf:resource=\"&owl;ObjectProperty\"/>\n  <rdfs:range rdf:resource=\"&owl;ObjectProperty\"/>\n</rdf:Property>\n\n<rdf:Description rdf:about=\"&owl;TransitiveProperty\">\n  <rdfs:label>TransitiveProperty</rdfs:label>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&owl;SymmetricProperty\">\n  <rdfs:label>SymmetricProperty</rdfs:label>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&owl;FunctionalProperty\">\n  <rdfs:label>FunctionalProperty</rdfs:label>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&owl;InverseFunctionalProperty\">\n  <rdfs:label>InverseFunctionalProperty</rdfs:label>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&owl;AnnotationProperty\">\n  <rdfs:label>AnnotationProperty</rdfs:label>\n</rdf:Description>\n\n<owl:AnnotationProperty rdf:about=\"&rdfs;label\"/>\n<owl:AnnotationProperty rdf:about=\"&rdfs;comment\"/>\n<owl:AnnotationProperty rdf:about=\"&rdfs;seeAlso\"/>\n<owl:AnnotationProperty rdf:about=\"&rdfs;isDefinedBy\"/>\n\n<rdf:Description rdf:about=\"&owl;Ontology\">\n  <rdfs:label>Ontology</rdfs:label>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&owl;OntologyProperty\">\n  <rdfs:label>OntologyProperty</rdfs:label>\n</rdf:Description>\n\n<rdf:Property rdf:about=\"&owl;imports\">\n  <rdfs:label>imports</rdfs:label>\n  <rdf:type rdf:resource=\"&owl;OntologyProperty\"/>\n  <rdfs:domain rdf:resource=\"&owl;Ontology\"/>\n  <rdfs:range rdf:resource=\"&owl;Ontology\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;versionInfo\">\n  <rdfs:label>versionInfo</rdfs:label>\n  <rdf:type rdf:resource=\"&owl;AnnotationProperty\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;priorVersion\">\n  <rdfs:label>priorVersion</rdfs:label>\n  <rdf:type rdf:resource=\"&owl;OntologyProperty\"/>\n  <rdfs:domain rdf:resource=\"&owl;Ontology\"/>\n  <rdfs:range rdf:resource=\"&owl;Ontology\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;backwardCompatibleWith\">\n  <rdfs:label>backwardCompatibleWith</rdfs:label>\n  <rdf:type rdf:resource=\"&owl;OntologyProperty\"/>\n  <rdfs:domain rdf:resource=\"&owl;Ontology\"/>\n  <rdfs:range rdf:resource=\"&owl;Ontology\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&owl;incompatibleWith\">\n  <rdfs:label>incompatibleWith</rdfs:label>\n  <rdf:type rdf:resource=\"&owl;OntologyProperty\"/>\n  <rdfs:domain rdf:resource=\"&owl;Ontology\"/>\n  <rdfs:range rdf:resource=\"&owl;Ontology\"/>\n</rdf:Property>\n\n<rdf:Description rdf:about=\"&owl;DeprecatedClass\">\n  <rdfs:label>DeprecatedClass</rdfs:label>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&owl;DeprecatedProperty\">\n  <rdfs:label>DeprecatedProperty</rdfs:label>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&owl;DataRange\">\n  <rdfs:label>DataRange</rdfs:label>\n</rdf:Description>\n\n<!-- DC -->\n\n<rdf:Property rdf:about=\"&dc;title\">\n<rdfs:label xml:lang=\"en\">Title</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A name given to the resource.</rdfs:comment>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#title-006\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;creator\">\n<rdfs:label xml:lang=\"en\">Creator</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An entity primarily responsible for making the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples of a Creator include a person, an organization, or a service. Typically, the name of a Creator should be used to indicate the entity.</dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#creator-006\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;subject\">\n<rdfs:label xml:lang=\"en\">Subject</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The topic of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Typically, the subject will be represented using keywords, key phrases, or classification codes. Recommended best practice is to use a controlled vocabulary. To describe the spatial or temporal topic of the resource, use the Coverage element.</dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#subject-006\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;description\">\n<rdfs:label xml:lang=\"en\">Description</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An account of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Description may include but is not limited to: an abstract, a table of contents, a graphical representation, or a free-text account of the resource.</dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#description-006\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;publisher\">\n<rdfs:label xml:lang=\"en\">Publisher</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An entity responsible for making the resource available.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples of a Publisher include a person, an organization, or a service. Typically, the name of a Publisher should be used to indicate the entity.</dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#publisher-006\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;contributor\">\n<rdfs:label xml:lang=\"en\">Contributor</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An entity responsible for making contributions to the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples of a Contributor include a person, an organization, or a service. Typically, the name of a Contributor should be used to indicate the entity.</dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#contributor-006\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;date\">\n<rdfs:label xml:lang=\"en\">Date</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A point or period of time associated with an event in the lifecycle of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Date may be used to express temporal information at any level of granularity.  Recommended best practice is to use an encoding scheme, such as the W3CDTF profile of ISO 8601 [W3CDTF].</dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#date-006\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;type\">\n<rdfs:label xml:lang=\"en\">Type</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The nature or genre of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Recommended best practice is to use a controlled vocabulary such as the DCMI Type Vocabulary [DCMITYPE]. To describe the file format, physical medium, or dimensions of the resource, use the Format element.</dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#type-006\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;format\">\n<rdfs:label xml:lang=\"en\">Format</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The file format, physical medium, or dimensions of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples of dimensions include size and duration. Recommended best practice is to use a controlled vocabulary such as the list of Internet Media Types [MIME].</dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#format-007\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;identifier\">\n<rdfs:label xml:lang=\"en\">Identifier</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An unambiguous reference to the resource within a given context.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Recommended best practice is to identify the resource by means of a string conforming to a formal identification system. </dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#identifier-006\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;source\">\n<rdfs:label xml:lang=\"en\">Source</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource from which the described resource is derived.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">The described resource may be derived from the related resource in whole or in part. Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system.</dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#source-006\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;language\">\n<rdfs:label xml:lang=\"en\">Language</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A language of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Recommended best practice is to use a controlled vocabulary such as RFC 4646 [RFC4646].</dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#language-007\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.ietf.org/rfc/rfc4646.txt\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;relation\">\n<rdfs:label xml:lang=\"en\">Relation</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system. </dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#relation-006\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;coverage\">\n<rdfs:label xml:lang=\"en\">Coverage</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Spatial topic and spatial applicability may be a named place or a location specified by its geographic coordinates. Temporal topic may be a named period, date, or date range. A jurisdiction may be a named administrative entity or a geographic place to which the resource applies. Recommended best practice is to use a controlled vocabulary such as the Thesaurus of Geographic Names [TGN]. Where appropriate, named places or time periods can be used in preference to numeric identifiers such as sets of coordinates or date ranges.</dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#coverage-006\"/>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"&dc;rights\">\n<rdfs:label xml:lang=\"en\">Rights</rdfs:label>\n<rdfs:comment xml:lang=\"en\">Information about rights held in and over the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights.</dcterms:description>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#rights-006\"/>\n</rdf:Property>\n\n\n<!-- DCTERMS -->\n\n\n<rdf:Description rdf:about=\"&dcterms;title\">\n<rdfs:label xml:lang=\"en\">Title</rdfs:label>\n<dcterms:description xml:lang=\"en\">A name given to the resource.</dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#titleT-001\"/>\n<skos:note xml:lang=\"en\">In current practice, this term is used primarily with literal values; however, there are important uses with non-literal values as well.  As of December 2007, the DCMI Usage Board is leaving this range unspecified pending an investigation of options.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/title\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;creator\">\n<rdfs:label xml:lang=\"en\">Creator</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An entity primarily responsible for making the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples of a Creator include a person, an organization, or a service. Typically, the name of a Creator should be used to indicate the entity.</dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#creatorT-001\"/>\n<rdfs:range rdf:resource=\"&dcterms;Agent\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/creator\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;contributor\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;subject\">\n<rdfs:label xml:lang=\"en\">Subject</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The topic of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Typically, the subject will be represented using keywords, key phrases, or classification codes. Recommended best practice is to use a controlled vocabulary. To describe the spatial or temporal topic of the resource, use the Coverage element.</dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#subjectT-001\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/subject\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;description\">\n<rdfs:label xml:lang=\"en\">Description</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An account of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Description may include but is not limited to: an abstract, a table of contents, a graphical representation, or a free-text account of the resource.</dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#descriptionT-001\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/description\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;publisher\">\n<rdfs:label xml:lang=\"en\">Publisher</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An entity responsible for making the resource available.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples of a Publisher include a person, an organization, or a service. Typically, the name of a Publisher should be used to indicate the entity.</dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#publisherT-001\"/>\n<rdfs:range rdf:resource=\"&dcterms;Agent\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/publisher\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;contributor\">\n<rdfs:label xml:lang=\"en\">Contributor</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An entity responsible for making contributions to the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples of a Contributor include a person, an organization, or a service. Typically, the name of a Contributor should be used to indicate the entity.</dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#contributorT-001\"/>\n<rdfs:range rdf:resource=\"&dcterms;Agent\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/contributor\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;date\">\n<rdfs:label xml:lang=\"en\">Date</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A point or period of time associated with an event in the lifecycle of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Date may be used to express temporal information at any level of granularity.  Recommended best practice is to use an encoding scheme, such as the W3CDTF profile of ISO 8601 [W3CDTF].</dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#dateT-001\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;type\">\n<rdfs:label xml:lang=\"en\">Type</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The nature or genre of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Recommended best practice is to use a controlled vocabulary such as the DCMI Type Vocabulary [DCMITYPE]. To describe the file format, physical medium, or dimensions of the resource, use the Format element.</dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#typeT-001\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/type\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;format\">\n<rdfs:label xml:lang=\"en\">Format</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The file format, physical medium, or dimensions of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples of dimensions include size and duration. Recommended best practice is to use a controlled vocabulary such as the list of Internet Media Types [MIME].</dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#formatT-001\"/>\n<rdfs:range rdf:resource=\"&dcterms;MediaTypeOrExtent\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/format\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;identifier\">\n<rdfs:label xml:lang=\"en\">Identifier</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An unambiguous reference to the resource within a given context.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Recommended best practice is to identify the resource by means of a string conforming to a formal identification system. </dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#identifierT-001\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/identifier\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;source\">\n<rdfs:label xml:lang=\"en\">Source</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource from which the described resource is derived.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">The described resource may be derived from the related resource in whole or in part. Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system.</dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#sourceT-001\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/source\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;language\">\n<rdfs:label xml:lang=\"en\">Language</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A language of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Recommended best practice is to use a controlled vocabulary such as RFC 4646 [RFC4646].</dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#languageT-001\"/>\n<rdfs:range rdf:resource=\"&dcterms;LinguisticSystem\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/language\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;relation\">\n<rdfs:label xml:lang=\"en\">Relation</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system. </dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#relationT-001\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;coverage\">\n<rdfs:label xml:lang=\"en\">Coverage</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Spatial topic and spatial applicability may be a named place or a location specified by its geographic coordinates. Temporal topic may be a named period, date, or date range. A jurisdiction may be a named administrative entity or a geographic place to which the resource applies. Recommended best practice is to use a controlled vocabulary such as the Thesaurus of Geographic Names [TGN]. Where appropriate, named places or time periods can be used in preference to numeric identifiers such as sets of coordinates or date ranges.</dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#coverageT-001\"/>\n<rdfs:range rdf:resource=\"&dcterms;LocationPeriodOrJurisdiction\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/coverage\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;rights\">\n<rdfs:label xml:lang=\"en\">Rights</rdfs:label>\n<rdfs:comment xml:lang=\"en\">Information about rights held in and over the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights.</dcterms:description>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#rightsT-001\"/>\n<rdfs:range rdf:resource=\"&dcterms;RightsStatement\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/rights\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;audience\">\n<rdfs:label xml:lang=\"en\">Audience</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A class of entity for whom the resource is intended or useful.</rdfs:comment>\n<dcterms:issued>2001-05-21</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#audience-003\"/>\n<rdfs:range rdf:resource=\"&dcterms;AgentClass\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;alternative\">\n<rdfs:label xml:lang=\"en\">Alternative Title</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An alternative name for the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">The distinction between titles and alternative titles is application-specific.</dcterms:description>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#alternative-003\"/>\n<skos:note xml:lang=\"en\">In current practice, this term is used primarily with literal values; however, there are important uses with non-literal values as well.  As of December 2007, the DCMI Usage Board is leaving this range unspecified pending an investigation of options.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/title\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;title\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;tableOfContents\">\n<rdfs:label xml:lang=\"en\">Table Of Contents</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A list of subunits of the resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#tableOfContents-003\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/description\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;description\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;abstract\">\n<rdfs:label xml:lang=\"en\">Abstract</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A summary of the resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#abstract-003\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/description\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;description\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;created\">\n<rdfs:label xml:lang=\"en\">Date Created</rdfs:label>\n<rdfs:comment xml:lang=\"en\">Date of creation of the resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#created-003\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;date\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;valid\">\n<rdfs:label xml:lang=\"en\">Date Valid</rdfs:label>\n<rdfs:comment xml:lang=\"en\">Date (often a range) of validity of a resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#valid-003\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;date\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;available\">\n<rdfs:label xml:lang=\"en\">Date Available</rdfs:label>\n<rdfs:comment xml:lang=\"en\">Date (often a range) that the resource became or will become available.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#available-003\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;date\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;issued\">\n<rdfs:label xml:lang=\"en\">Date Issued</rdfs:label>\n<rdfs:comment xml:lang=\"en\">Date of formal issuance (e.g., publication) of the resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#issued-003\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;date\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;modified\">\n<rdfs:label xml:lang=\"en\">Date Modified</rdfs:label>\n<rdfs:comment xml:lang=\"en\">Date on which the resource was changed.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#modified-003\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;date\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;extent\">\n<rdfs:label xml:lang=\"en\">Extent</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The size or duration of the resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#extent-003\"/>\n<rdfs:range rdf:resource=\"&dcterms;SizeOrDuration\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/format\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;format\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;medium\">\n<rdfs:label xml:lang=\"en\">Medium</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The material or physical carrier of the resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#medium-003\"/>\n<rdfs:domain rdf:resource=\"&dcterms;PhysicalResource\"/>\n<rdfs:range rdf:resource=\"&dcterms;PhysicalMedium\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/format\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;format\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;isVersionOf\">\n<rdfs:label xml:lang=\"en\">Is Version Of</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource of which the described resource is a version, edition, or adaptation.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Changes in version imply substantive changes in content rather than differences in format.</dcterms:description>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#isVersionOf-003\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;hasVersion\">\n<rdfs:label xml:lang=\"en\">Has Version</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource that is a version, edition, or adaptation of the described resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#hasVersion-003\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;isReplacedBy\">\n<rdfs:label xml:lang=\"en\">Is Replaced By</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource that supplants, displaces, or supersedes the described resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#isReplacedBy-003\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;replaces\">\n<rdfs:label xml:lang=\"en\">Replaces</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource that is supplanted, displaced, or superseded by the described resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#replaces-003\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;isRequiredBy\">\n<rdfs:label xml:lang=\"en\">Is Required By</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource that requires the described resource to support its function, delivery, or coherence.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#isRequiredBy-003\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;requires\">\n<rdfs:label xml:lang=\"en\">Requires</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource that is required by the described resource to support its function, delivery, or coherence.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#requires-003\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;isPartOf\">\n<rdfs:label xml:lang=\"en\">Is Part Of</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource in which the described resource is physically or logically included.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#isPartOf-003\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;hasPart\">\n<rdfs:label xml:lang=\"en\">Has Part</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource that is included either physically or logically in the described resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#hasPart-003\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;isReferencedBy\">\n<rdfs:label xml:lang=\"en\">Is Referenced By</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource that references, cites, or otherwise points to the described resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#isReferencedBy-003\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;references\">\n<rdfs:label xml:lang=\"en\">References</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource that is referenced, cited, or otherwise pointed to by the described resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#references-003\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;isFormatOf\">\n<rdfs:label xml:lang=\"en\">Is Format Of</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource that is substantially the same as the described resource, but in another format.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#isFormatOf-003\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;hasFormat\">\n<rdfs:label xml:lang=\"en\">Has Format</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A related resource that is substantially the same as the pre-existing described resource, but in another format.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#hasFormat-003\"/>\n<skos:note xml:lang=\"en\">This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).  As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.</skos:note>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;conformsTo\">\n<rdfs:label xml:lang=\"en\">Conforms To</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An established standard to which the described resource conforms.</rdfs:comment>\n<dcterms:issued>2001-05-21</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#conformsTo-003\"/>\n<rdfs:range rdf:resource=\"&dcterms;Standard\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/relation\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;relation\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;spatial\">\n<rdfs:label xml:lang=\"en\">Spatial Coverage</rdfs:label>\n<rdfs:comment xml:lang=\"en\">Spatial characteristics of the resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#spatial-003\"/>\n<rdfs:range rdf:resource=\"&dcterms;Location\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/coverage\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;coverage\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;temporal\">\n<rdfs:label xml:lang=\"en\">Temporal Coverage</rdfs:label>\n<rdfs:comment xml:lang=\"en\">Temporal characteristics of the resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#temporal-003\"/>\n<rdfs:range rdf:resource=\"&dcterms;PeriodOfTime\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/coverage\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;coverage\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;mediator\">\n<rdfs:label xml:lang=\"en\">Mediator</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An entity that mediates access to the resource and for whom the resource is intended or useful.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">In an educational context, a mediator might be a parent, teacher, teaching assistant, or care-giver.</dcterms:description>\n<dcterms:issued>2001-05-21</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#mediator-003\"/>\n<rdfs:range rdf:resource=\"&dcterms;AgentClass\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;audience\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;dateAccepted\">\n<rdfs:label xml:lang=\"en\">Date Accepted</rdfs:label>\n<rdfs:comment xml:lang=\"en\">Date of acceptance of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples of resources to which a Date Accepted may be relevant are a thesis (accepted by a university department) or an article (accepted by a journal).</dcterms:description>\n<dcterms:issued>2002-07-13</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#dateAccepted-002\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;date\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;dateCopyrighted\">\n<rdfs:label xml:lang=\"en\">Date Copyrighted</rdfs:label>\n<rdfs:comment xml:lang=\"en\">Date of copyright.</rdfs:comment>\n<dcterms:issued>2002-07-13</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#dateCopyrighted-002\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;date\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;dateSubmitted\">\n<rdfs:label xml:lang=\"en\">Date Submitted</rdfs:label>\n<rdfs:comment xml:lang=\"en\">Date of submission of the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples of resources to which a Date Submitted may be relevant are a thesis (submitted to a university department) or an article (submitted to a journal).</dcterms:description>\n<dcterms:issued>2002-07-13</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#dateSubmitted-002\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;date\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;educationLevel\">\n<rdfs:label xml:lang=\"en\">Audience Education Level</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.</rdfs:comment>\n<dcterms:issued>2002-07-13</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#educationLevel-002\"/>\n<rdfs:range rdf:resource=\"&dcterms;AgentClass\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;audience\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;accessRights\">\n<rdfs:label xml:lang=\"en\">Access Rights</rdfs:label>\n<rdfs:comment xml:lang=\"en\">Information about who can access the resource or an indication of its security status.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Access Rights may include information regarding access or restrictions based on privacy, security, or other policies.</dcterms:description>\n<dcterms:issued>2003-02-15</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#accessRights-002\"/>\n<rdfs:range rdf:resource=\"&dcterms;RightsStatement\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/rights\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;rights\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;bibliographicCitation\">\n<rdfs:label xml:lang=\"en\">Bibliographic Citation</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A bibliographic reference for the resource.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Recommended practice is to include sufficient bibliographic detail to identify the resource as unambiguously as possible.</dcterms:description>\n<dcterms:issued>2003-02-15</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#bibliographicCitation-002\"/>\n<rdfs:domain rdf:resource=\"&dcterms;BibliographicResource\"/>\n<rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/identifier\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;identifier\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;license\">\n<rdfs:label xml:lang=\"en\">License</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A legal document giving official permission to do something with the resource.</rdfs:comment>\n<dcterms:issued>2004-06-14</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#license-002\"/>\n<rdfs:range rdf:resource=\"&dcterms;LicenseDocument\"/>\n<rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/rights\"/>\n<rdfs:subPropertyOf rdf:resource=\"&dcterms;rights\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;rightsHolder\">\n<rdfs:label xml:lang=\"en\">Rights Holder</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A person or organization owning or managing rights over the resource.</rdfs:comment>\n<dcterms:issued>2004-06-14</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#rightsHolder-002\"/>\n<rdfs:range rdf:resource=\"&dcterms;Agent\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;provenance\">\n<rdfs:label xml:lang=\"en\">Provenance</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">The statement may include a description of any changes successive custodians made to the resource.</dcterms:description>\n<dcterms:issued>2004-09-20</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#provenance-002\"/>\n<rdfs:range rdf:resource=\"&dcterms;ProvenanceStatement\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;instructionalMethod\">\n<rdfs:label xml:lang=\"en\">Instructional Method</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Instructional Method will typically include ways of presenting instructional materials or conducting instructional activities, patterns of learner-to-learner and learner-to-instructor interactions, and mechanisms by which group and individual levels of learning are measured.  Instructional methods include all aspects of the instruction and learning processes from planning and implementation through evaluation and feedback.</dcterms:description>\n<dcterms:issued>2005-06-13</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#instructionalMethod-002\"/>\n<rdfs:range rdf:resource=\"&dcterms;MethodOfInstruction\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;accrualMethod\">\n<rdfs:label xml:lang=\"en\">Accrual Method</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The method by which items are added to a collection.</rdfs:comment>\n<dcterms:issued>2005-06-13</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#accrualMethod-002\"/>\n<rdfs:domain rdf:resource=\"&dcterms;Collection\"/>\n<rdfs:range rdf:resource=\"&dcterms;MethodOfAccrual\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;accrualPeriodicity\">\n<rdfs:label xml:lang=\"en\">Accrual Periodicity</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The frequency with which items are added to a collection.</rdfs:comment>\n<dcterms:issued>2005-06-13</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#accrualPeriodicity-002\"/>\n<rdfs:domain rdf:resource=\"&dcterms;Collection\"/>\n<rdfs:range rdf:resource=\"&dcterms;Frequency\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;accrualPolicy\">\n<rdfs:label xml:lang=\"en\">Accrual Policy</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The policy governing the addition of items to a collection.</rdfs:comment>\n<dcterms:issued>2005-06-13</dcterms:issued>\n<rdf:type rdf:resource=\"&rdf;Property\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#accrualPolicy-002\"/>\n<rdfs:domain rdf:resource=\"&dcterms;Collection\"/>\n<rdfs:range rdf:resource=\"&dcterms;Policy\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;Agent\">\n<rdfs:label xml:lang=\"en\">Agent</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A resource that acts or has the power to act.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples of Agent include person, organization, and software agent.</dcterms:description>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Agent-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;AgentClass\">\n<rdfs:label xml:lang=\"en\">Agent Class</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A group of agents.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples of Agent Class include groups seen as classes, such as students, women, charities, lecturers.</dcterms:description>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#AgentClass-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;BibliographicResource\">\n<rdfs:label xml:lang=\"en\">Bibliographic Resource</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A book, article, or other documentary resource.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#BibliographicResource-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;FileFormat\">\n<rdfs:label xml:lang=\"en\">File Format</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A digital resource format.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples include the formats defined by the list of Internet Media Types.</dcterms:description>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#FileFormat-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;Frequency\">\n<rdfs:label xml:lang=\"en\">Frequency</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A rate at which something recurs.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Frequency-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;Jurisdiction\">\n<rdfs:label xml:lang=\"en\">Jurisdiction</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The extent or range of judicial, law enforcement, or other authority.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Jurisdiction-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;LicenseDocument\">\n<rdfs:label xml:lang=\"en\">License Document</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A legal document giving official permission to do something with a Resource.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#LicenseDocument-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;LinguisticSystem\">\n<rdfs:label xml:lang=\"en\">Linguistic System</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A system of signs, symbols, sounds, gestures, or rules used in communication.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples include written, spoken, sign, and computer languages.</dcterms:description>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#LinguisticSystem-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;Location\">\n<rdfs:label xml:lang=\"en\">Location</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A spatial region or named place.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Location-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;LocationPeriodOrJurisdiction\">\n<rdfs:label xml:lang=\"en\">Location, Period, or Jurisdiction</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A location, period of time, or jurisdiction.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#LocationPeriodOrJurisdiction-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;MediaType\">\n<rdfs:label xml:lang=\"en\">Media Type</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A file format or physical medium.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#MediaType-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;MediaTypeOrExtent\">\n<rdfs:label xml:lang=\"en\">Media Type or Extent</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A media type or extent.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#MediaTypeOrExtent-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;MethodOfInstruction\">\n<rdfs:label xml:lang=\"en\">Method of Instruction</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A process that is used to engender knowledge, attitudes, and skills.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#MethodOfInstruction-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;MethodOfAccrual\">\n<rdfs:label xml:lang=\"en\">Method of Accrual</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A method by which resources are added to a collection.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#MethodOfAccrual-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;PeriodOfTime\">\n<rdfs:label xml:lang=\"en\">Period of Time</rdfs:label>\n<rdfs:comment xml:lang=\"en\">An interval of time that is named or defined by its start and end dates.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#PeriodOfTime-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;PhysicalMedium\">\n<rdfs:label xml:lang=\"en\">Physical Medium</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A physical material or carrier.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples include paper, canvas, or DVD.</dcterms:description>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#PhysicalMedium-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;PhysicalResource\">\n<rdfs:label xml:lang=\"en\">Physical Resource</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A material thing.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#PhysicalResource-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;Policy\">\n<rdfs:label xml:lang=\"en\">Policy</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A plan or course of action by an authority, intended to influence and determine decisions, actions, and other matters.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Policy-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;ProvenanceStatement\">\n<rdfs:label xml:lang=\"en\">Provenance Statement</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A statement of any changes in ownership and custody of a resource since its creation that are significant for its authenticity, integrity, and interpretation.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#ProvenanceStatement-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;RightsStatement\">\n<rdfs:label xml:lang=\"en\">Rights Statement</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A statement about the intellectual property rights (IPR) held in or over a Resource, a legal document giving official permission to do something with a resource, or a statement about access rights.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#RightsStatement-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;SizeOrDuration\">\n<rdfs:label xml:lang=\"en\">Size or Duration</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A dimension or extent, or a time taken to play or execute.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">Examples include a number of pages, a specification of length, width, and breadth, or a period in hours, minutes, and seconds.</dcterms:description>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#SizeOrDuration-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;Standard\">\n<rdfs:label xml:lang=\"en\">Standard</rdfs:label>\n<rdfs:comment xml:lang=\"en\">A basis for comparison; a reference point against which other things can be evaluated.</rdfs:comment>\n\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Standard-001\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;ISO639-2\">\n<rdfs:label xml:lang=\"en\">ISO 639-2</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The three-letter alphabetic codes listed in ISO639-2 for the representation of names of languages.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#ISO639-2-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://lcweb.loc.gov/standards/iso639-2/langhome.html\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;RFC1766\">\n<rdfs:label xml:lang=\"en\">RFC 1766</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of tags, constructed according to RFC 1766, for the identification of languages.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#RFC1766-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.ietf.org/rfc/rfc1766.txt\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;URI\">\n<rdfs:label xml:lang=\"en\">URI</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of identifiers constructed according to the generic syntax for Uniform Resource Identifiers as specified by the Internet Engineering Task Force.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#URI-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.ietf.org/rfc/rfc3986.txt\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;Point\">\n<rdfs:label xml:lang=\"en\">DCMI Point</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of points in space defined by their geographic coordinates according to the DCMI Point Encoding Scheme.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Point-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://dublincore.org/documents/dcmi-point/\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;ISO3166\">\n<rdfs:label xml:lang=\"en\">ISO 3166</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of codes listed in ISO 3166-1 for the representation of names of countries.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#ISO3166-004\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;Box\">\n<rdfs:label xml:lang=\"en\">DCMI Box</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of regions in space defined by their geographic coordinates according to the DCMI Box Encoding Scheme.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Box-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://dublincore.org/documents/dcmi-box/\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;Period\">\n<rdfs:label xml:lang=\"en\">DCMI Period</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of time intervals defined by their limits according to the DCMI Period Encoding Scheme.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#Period-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://dublincore.org/documents/dcmi-period/\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;W3CDTF\">\n<rdfs:label xml:lang=\"en\">W3C-DTF</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of dates and times constructed according to the W3C Date and Time Formats Specification.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#W3CDTF-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.w3.org/TR/NOTE-datetime\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;RFC3066\">\n<rdfs:label xml:lang=\"en\">RFC 3066</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of tags constructed according to RFC 3066 for the identification of languages.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">RFC 3066 has been obsoleted by RFC 4646.</dcterms:description>\n<dcterms:issued>2002-07-13</dcterms:issued>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#RFC3066-002\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.ietf.org/rfc/rfc3066.txt\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;RFC4646\">\n<rdfs:label xml:lang=\"en\">RFC 4646</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of tags constructed according to RFC 4646 for the identification of languages.</rdfs:comment>\n<dcterms:description xml:lang=\"en\">RFC 4646 obsoletes RFC 3066.</dcterms:description>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#RFC4646-001\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.ietf.org/rfc/rfc4646.txt\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;ISO639-3\">\n<rdfs:label xml:lang=\"en\">ISO 639-3</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of three-letter codes listed in ISO 639-3 for the representation of names of languages.</rdfs:comment>\n<rdf:type rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Datatype\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#ISO639-3-001\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.sil.org/iso639-3/\"/>\n</rdf:Description>\n\n<!--\n<rdf:Description rdf:about=\"&dcterms;LCSH\">\n<rdfs:label xml:lang=\"en\">LCSH</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of labeled concepts specified by the Library of Congress Subject Headings.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#LCSH-003\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;MESH\">\n<rdfs:label xml:lang=\"en\">MeSH</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of labeled concepts specified by the Medical Subject Headings.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#MESH-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.nlm.nih.gov/mesh/meshhome.html\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;DDC\">\n<rdfs:label xml:lang=\"en\">DDC</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of conceptual resources specified by the Dewey Decimal Classification.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#DDC-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.oclc.org/dewey/\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;LCC\">\n<rdfs:label xml:lang=\"en\">LCC</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of conceptual resources specified by the Library of Congress Classification.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#LCC-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://lcweb.loc.gov/catdir/cpso/lcco/lcco.html\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;UDC\">\n<rdfs:label xml:lang=\"en\">UDC</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of conceptual resources specified by the Universal Decimal Classification.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#UDC-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.udcc.org/\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;DCMIType\">\n<rdfs:label xml:lang=\"en\">DCMI Type Vocabulary</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of classes specified by the DCMI Type Vocabulary, used to categorize the nature or genre of the resource.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#DCMIType-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://dublincore.org/documents/dcmi-type-vocabulary/\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;IMT\">\n<rdfs:label xml:lang=\"en\">IMT</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of media types specified by the Internet Assigned Numbers Authority.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#IMT-004\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.iana.org/assignments/media-types/\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;TGN\">\n<rdfs:label xml:lang=\"en\">TGN</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of places specified by the Getty Thesaurus of Geographic Names.</rdfs:comment>\n<dcterms:issued>2000-07-11</dcterms:issued>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#TGN-003\"/>\n<rdfs:seeAlso rdf:resource=\"http://www.getty.edu/research/tools/vocabulary/tgn/index.html\"/>\n</rdf:Description>\n\n<rdf:Description rdf:about=\"&dcterms;NLM\">\n<rdfs:label xml:lang=\"en\">NLM</rdfs:label>\n<rdfs:comment xml:lang=\"en\">The set of conceptual resources specified by the National Library of Medicine Classification.</rdfs:comment>\n<dcterms:issued>2005-06-13</dcterms:issued>\n<rdf:type rdf:resource=\"http://purl.org/dc/dcam/VocabularyEncodingScheme\"/>\n<dcterms:hasVersion rdf:resource=\"http://dublincore.org/usage/terms/history/#NLM-002\"/>\n<rdfs:seeAlso rdf:resource=\"http://wwwcf.nlm.nih.gov/class/\"/>\n</rdf:Description>\n-->\n\n<!-- SKOS -->\n\n\n\n  <rdf:Description rdf:about=\"&skos;Concept\">\n    <rdfs:label xml:lang=\"en\">Concept</rdfs:label>\n    <skos:definition xml:lang=\"en\">An idea or notion; a unit of thought.</skos:definition>\n    <!-- S1 -->\n    \n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;ConceptScheme\">\n    <rdfs:label xml:lang=\"en\">Concept Scheme</rdfs:label>\n    <skos:definition xml:lang=\"en\">A set of concepts, optionally including statements about semantic relationships between those concepts.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">A concept scheme may be defined to include concepts from different sources.</skos:scopeNote>\n    <skos:example xml:lang=\"en\">Thesauri, classification schemes, subject heading lists, taxonomies, 'folksonomies', and other types of controlled vocabulary are all examples of concept schemes. Concept schemes are also embedded in glossaries and terminologies.</skos:example>\n    <!-- S2 -->\n    \n    <!-- S9 -->\n    <owl:disjointWith rdf:resource=\"&skos;Concept\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;Collection\">\n\n    <rdfs:label xml:lang=\"en\">Collection</rdfs:label>\n    <skos:definition xml:lang=\"en\">A meaningful collection of concepts.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">Labelled collections can be used where you would like a set of concepts to be displayed under a 'node label' in the hierarchy.</skos:scopeNote>\n    <!-- S28 -->\n    \n    <!-- S37 -->\n    <owl:disjointWith rdf:resource=\"&skos;Concept\"/>\n    <!-- S37 -->\n    <owl:disjointWith rdf:resource=\"&skos;ConceptScheme\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;OrderedCollection\">\n    <rdfs:label xml:lang=\"en\">Ordered Collection</rdfs:label>\n    <skos:definition xml:lang=\"en\">An ordered collection of concepts, where both the grouping and the ordering are meaningful.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">Ordered collections can be used where you would like a set of concepts to be displayed in a specific order, and optionally under a 'node label'.</skos:scopeNote>\n    <!-- S28 -->\n    \n    <!-- S29 -->\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;inScheme\">\n    <rdfs:label xml:lang=\"en\">is in scheme</rdfs:label>\n    <skos:definition xml:lang=\"en\">Relates a resource (for example a concept) to a concept scheme in which it is included.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">A concept may be a member of more than one concept scheme.</skos:scopeNote>\n    <!-- S3 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S4 -->\n    <rdfs:range rdf:resource=\"&skos;ConceptScheme\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;hasTopConcept\">\n    <rdfs:label xml:lang=\"en\">has top concept</rdfs:label>\n    <skos:definition xml:lang=\"en\">Relates, by convention, a concept scheme to a concept which is topmost in the broader/narrower concept hierarchies for that scheme, providing an entry point to these hierarchies.</skos:definition>\n    <!-- S3 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S5 -->\n    <rdfs:domain rdf:resource=\"&skos;ConceptScheme\"/>\n    <!-- S6 -->\n    <rdfs:range rdf:resource=\"&skos;Concept\"/>\n    <!-- S8 -->\n    <owl:inverseOf rdf:resource=\"&skos;topConceptOf\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;topConceptOf\">\n    <rdfs:label xml:lang=\"en\">is top concept in scheme</rdfs:label>\n    <skos:definition xml:lang=\"en\">Relates a concept to the concept scheme that it is a top level concept of.</skos:definition>\n    <!-- S3 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S7 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;inScheme\"/>\n    <!-- S8 -->\n    <owl:inverseOf rdf:resource=\"&skos;hasTopConcept\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:domain rdf:resource=\"&skos;Concept\"/>\n    <rdfs:range rdf:resource=\"&skos;ConceptScheme\"/> \n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;prefLabel\">\n    <rdfs:label xml:lang=\"en\">preferred label</rdfs:label>\n    <skos:definition xml:lang=\"en\">The preferred lexical label for a resource, in a given language.</skos:definition>\n    <!-- S10 -->\n    <rdf:type rdf:resource=\"&owl;AnnotationProperty\"/>\n    <!-- S11 -->\n    <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\"/>\n    <!-- S14 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">A resource has no more than one value of skos:prefLabel per language tag.</rdfs:comment>\n    <!-- S12 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">The range of skos:prefLabel is the class of RDF plain literals.</rdfs:comment>\n    <!-- S13 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise\n      disjoint properties.</rdfs:comment>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;altLabel\">\n    <rdfs:label xml:lang=\"en\">alternative label</rdfs:label>\n    <skos:definition xml:lang=\"en\">An alternative lexical label for a resource.</skos:definition>\n    <skos:example xml:lang=\"en\">Acronyms, abbreviations, spelling variants, and irregular plural/singular forms may be included among the alternative labels for a concept. Mis-spelled terms are normally included as hidden labels (see skos:hiddenLabel).</skos:example>\n    <!-- S10 -->\n    <rdf:type rdf:resource=\"&owl;AnnotationProperty\"/>\n    <!-- S11 -->\n    <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\"/>\n    <!-- S12 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">The range of skos:altLabel is the class of RDF plain literals.</rdfs:comment>\n    <!-- S13 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties.</rdfs:comment>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;hiddenLabel\">\n    <rdfs:label xml:lang=\"en\">hidden label</rdfs:label>\n    <skos:definition xml:lang=\"en\">A lexical label for a resource that should be hidden when generating visual displays of the resource, but should still be accessible to free text search operations.</skos:definition>\n    <!-- S10 -->\n    <rdf:type rdf:resource=\"&owl;AnnotationProperty\"/>\n    <!-- S11 -->\n    <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\"/>\n    <!-- S12 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">The range of skos:hiddenLabel is the class of RDF plain literals.</rdfs:comment>\n    <!-- S13 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties.</rdfs:comment>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;notation\">\n    <rdfs:label xml:lang=\"en\">notation</rdfs:label>\n    <skos:definition xml:lang=\"en\">A notation, also known as classification code, is a string of characters such as \"T58.5\" or \"303.4833\" used to uniquely identify a concept within the scope of a given concept scheme.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">By convention, skos:notation is used with a typed literal in the object position of the triple.</skos:scopeNote>\n    <!-- S15 -->\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;note\">\n    <rdfs:label xml:lang=\"en\">note</rdfs:label>\n    <skos:definition xml:lang=\"en\">A general note, for any purpose.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">This property may be used directly, or as a super-property for more specific note types.</skos:scopeNote>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"&owl;AnnotationProperty\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;changeNote\">\n    <rdfs:label xml:lang=\"en\">change note</rdfs:label>\n    <skos:definition xml:lang=\"en\">A note about a modification to a concept.</skos:definition>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"&owl;AnnotationProperty\"/>\n    <!-- S17 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;note\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;definition\">\n    <rdfs:label xml:lang=\"en\">definition</rdfs:label>\n    <skos:definition xml:lang=\"en\">A statement or formal explanation of the meaning of a concept.</skos:definition>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"&owl;AnnotationProperty\"/>\n    <!-- S17 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;note\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;editorialNote\">\n    <rdfs:label xml:lang=\"en\">editorial note</rdfs:label>\n    <skos:definition xml:lang=\"en\">A note for an editor, translator or maintainer of the vocabulary.</skos:definition>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"&owl;AnnotationProperty\"/>\n    <!-- S17 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;note\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;example\">\n    <rdfs:label xml:lang=\"en\">example</rdfs:label>\n    <skos:definition xml:lang=\"en\">An example of the use of a concept.</skos:definition>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"&owl;AnnotationProperty\"/>\n    <!-- S17 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;note\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;historyNote\">\n    <rdfs:label xml:lang=\"en\">history note</rdfs:label>\n    <skos:definition xml:lang=\"en\">A note about the past state/use/meaning of a concept.</skos:definition>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"&owl;AnnotationProperty\"/>\n    <!-- S17 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;note\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;scopeNote\">\n    <rdfs:label xml:lang=\"en\">scope note</rdfs:label>\n    <skos:definition xml:lang=\"en\">A note that helps to clarify the meaning and/or the use of a concept.</skos:definition>\n    <!-- S16 -->\n    <rdf:type rdf:resource=\"&owl;AnnotationProperty\"/>\n    <!-- S17 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;note\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;semanticRelation\">\n    <rdfs:label xml:lang=\"en\">is in semantic relation with</rdfs:label>\n\n    <skos:definition xml:lang=\"en\">Links a concept to a concept related by meaning.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">This property should not be used directly, but as a super-property for all properties denoting a relationship of meaning between concepts.</skos:scopeNote>\n    <!-- S18 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S19 -->\n    <rdfs:domain rdf:resource=\"&skos;Concept\"/>\n    <!-- S20 -->\n    <rdfs:range rdf:resource=\"&skos;Concept\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;broader\">\n    <rdfs:label xml:lang=\"en\">has broader concept</rdfs:label>\n    <skos:definition xml:lang=\"en\">Relates a concept to a concept that is more general in meaning.</skos:definition>\n    <rdfs:comment xml:lang=\"en\">Broader concepts are typically rendered as parents in a concept hierarchy (tree).</rdfs:comment>\n    <skos:scopeNote xml:lang=\"en\">By convention, skos:broader is only used to assert an immediate (i.e. direct) hierarchical link between two conceptual resources.</skos:scopeNote>\n    <!-- S18 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S22 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;broaderTransitive\"/>\n    <!-- S25 -->\n    <owl:inverseOf rdf:resource=\"&skos;narrower\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;narrower\">\n    <rdfs:label xml:lang=\"en\">has narrower concept</rdfs:label>\n    <skos:definition xml:lang=\"en\">Relates a concept to a concept that is more specific in meaning.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">By convention, skos:broader is only used to assert an immediate (i.e. direct) hierarchical link between two conceptual resources.</skos:scopeNote>\n    <rdfs:comment xml:lang=\"en\">Narrower concepts are typically rendered as children in a concept hierarchy (tree).</rdfs:comment>\n    <!-- S18 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S22 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;narrowerTransitive\"/>\n    <!-- S25 -->\n    <owl:inverseOf rdf:resource=\"&skos;broader\"/>\n    <!-- For non-OWL aware applications -->\n\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;related\">\n    <rdfs:label xml:lang=\"en\">has related concept</rdfs:label>\n    <skos:definition xml:lang=\"en\">Relates a concept to a concept with which there is an associative semantic relationship.</skos:definition>\n    <!-- S18 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S21 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;semanticRelation\"/>\n    <!-- S23 -->\n    <rdf:type rdf:resource=\"&owl;SymmetricProperty\"/>\n    <!-- S27 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">skos:related is disjoint with skos:broaderTransitive</rdfs:comment>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;broaderTransitive\">\n    <rdfs:label xml:lang=\"en\">has broader transitive</rdfs:label>\n    <skos:definition>skos:broaderTransitive is a transitive superproperty of skos:broader.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">By convention, skos:broaderTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application.</skos:scopeNote>\n    <!-- S18 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S21 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;semanticRelation\"/>\n    <!-- S24 -->\n    <rdf:type rdf:resource=\"&owl;TransitiveProperty\"/>\n    <!-- S26 -->\n    <owl:inverseOf rdf:resource=\"&skos;narrowerTransitive\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;narrowerTransitive\">\n    <rdfs:label xml:lang=\"en\">has narrower transitive</rdfs:label>\n    <skos:definition>skos:narrowerTransitive is a transitive superproperty of skos:narrower.</skos:definition>\n    <skos:scopeNote xml:lang=\"en\">By convention, skos:narrowerTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application.</skos:scopeNote>\n    <!-- S18 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S21 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;semanticRelation\"/>\n    <!-- S24 -->\n    <rdf:type rdf:resource=\"&owl;TransitiveProperty\"/>\n    <!-- S26 -->\n    <owl:inverseOf rdf:resource=\"&skos;broaderTransitive\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;member\">\n    <rdfs:label xml:lang=\"en\">has member</rdfs:label>\n    <skos:definition xml:lang=\"en\">Relates a collection to one of its members.</skos:definition>\n    <!-- S30 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S31 -->\n    <rdfs:domain rdf:resource=\"&skos;Collection\"/>\n    <!-- S32 -->\n    <rdfs:range>\n      <rdf:Description>\n\t<owl:unionOf rdf:parseType=\"Collection\">\n\t  <rdf:Description rdf:about=\"&skos;Concept\"/>\n\t  <rdf:Description rdf:about=\"&skos;Collection\"/>\n\t</owl:unionOf>\n      </rdf:Description>\n    </rdfs:range>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;memberList\">\n    <rdfs:label xml:lang=\"en\">has member list</rdfs:label>\n    <skos:definition xml:lang=\"en\">Relates an ordered collection to the RDF list containing its members.</skos:definition>\n    <!-- S30 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S33 -->\n    <rdfs:domain rdf:resource=\"&skos;OrderedCollection\"/>\n    <!-- S35 -->\n    <rdf:type rdf:resource=\"&owl;FunctionalProperty\"/>\n    <!-- S34 -->\n    <rdfs:range rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#List\"/>\n    <!-- S36 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">For any resource, every item in the list given as the value of the\n      skos:memberList property is also a value of the skos:member property.</rdfs:comment>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;mappingRelation\">\n    <rdfs:label xml:lang=\"en\">is in mapping relation with</rdfs:label>\n    <skos:definition xml:lang=\"en\">Relates two concepts coming, by convention, from different schemes, and that have comparable meanings</skos:definition>\n    <rdfs:comment xml:lang=\"en\">These concept mapping relations mirror semantic relations, and the data model defined below is similar (with the exception of skos:exactMatch) to the data model defined for semantic relations. A distinct vocabulary is provided for concept mapping relations, to provide a convenient way to differentiate links within a concept scheme from links between concept schemes. However, this pattern of usage is not a formal requirement of the SKOS data model, and relies on informal definitions of best practice.</rdfs:comment>\n    <!-- S38 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S39 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;semanticRelation\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;broadMatch\">\n    <rdfs:label xml:lang=\"en\">has broader match</rdfs:label>\n    <skos:definition xml:lang=\"en\">skos:broadMatch is used to state a hierarchical mapping link between two conceptual resources in different concept schemes.</skos:definition>\n    <!-- S38 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S40 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;mappingRelation\"/>\n    <!-- S41 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;broader\"/>\n    <!-- S43 -->\n    <owl:inverseOf rdf:resource=\"&skos;narrowMatch\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;narrowMatch\">\n    <rdfs:label xml:lang=\"en\">has narrower match</rdfs:label>\n\n    <skos:definition xml:lang=\"en\">skos:narrowMatch is used to state a hierarchical mapping link between two conceptual resources in different concept schemes.</skos:definition>\n    <!-- S38 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S40 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;mappingRelation\"/>\n    <!-- S41 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;narrower\"/>\n    <!-- S43 -->\n    <owl:inverseOf rdf:resource=\"&skos;broadMatch\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;relatedMatch\">\n    <rdfs:label xml:lang=\"en\">has related match</rdfs:label>\n    <skos:definition xml:lang=\"en\">skos:relatedMatch is used to state an associative mapping link between two conceptual resources in different concept schemes.</skos:definition>\n    <!-- S38 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S40 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;mappingRelation\"/>\n    <!-- S41 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;related\"/>\n    <!-- S44 -->\n    <rdf:type rdf:resource=\"&owl;SymmetricProperty\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;exactMatch\">\n    <rdfs:label xml:lang=\"en\">has exact match</rdfs:label>\n    <skos:definition xml:lang=\"en\">skos:exactMatch is used to link two concepts, indicating a high degree of confidence that the concepts can be used interchangeably across a wide range of information retrieval applications. skos:exactMatch is a transitive property, and is a sub-property of skos:closeMatch.</skos:definition>\n    <!-- S38 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S42 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;closeMatch\"/>\n    <!-- S44 -->\n    <rdf:type rdf:resource=\"&owl;SymmetricProperty\"/>\n    <!-- S45 -->\n    <rdf:type rdf:resource=\"&owl;TransitiveProperty\"/>\n    <!-- S46 (not formally stated) -->\n    <rdfs:comment xml:lang=\"en\">skos:exactMatch is disjoint with each of the properties skos:broadMatch and skos:relatedMatch.</rdfs:comment>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&skos;closeMatch\">\n    <rdfs:label xml:lang=\"en\">has close match</rdfs:label>\n    <skos:definition xml:lang=\"en\">skos:closeMatch is used to link two concepts that are sufficiently similar that they can be used interchangeably in some information retrieval applications. In order to avoid the possibility of \"compound errors\" when combining mappings across more than two concept schemes, skos:closeMatch is not declared to be a transitive property.</skos:definition>\n    <!-- S38 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <!-- S40 -->\n    <rdfs:subPropertyOf rdf:resource=\"&skos;mappingRelation\"/>\n    <!-- S44 -->\n    <rdf:type rdf:resource=\"&owl;SymmetricProperty\"/>\n    <!-- For non-OWL aware applications -->\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n  </rdf:Description>\n\n\n<!-- FOAF -->\n\n  <owl:AnnotationProperty rdf:about=\"http://xmlns.com/wot/0.1/assurance\"/>\n  <owl:AnnotationProperty rdf:about=\"http://xmlns.com/wot/0.1/src_assurance\"/>\n  <owl:AnnotationProperty rdf:about=\"http://www.w3.org/2003/06/sw-vocab-status/ns#term_status\"/>\n  <!--  DC terms are NOT annotation properties in general, so we consider the following \n\tclaims scoped to this document. They may be removed in future revisions if\n\tOWL tools become more flexible. -->\n  <owl:AnnotationProperty rdf:about=\"http://purl.org/dc/elements/1.1/description\"/>\n  <owl:AnnotationProperty rdf:about=\"http://purl.org/dc/elements/1.1/title\"/>\n  <owl:AnnotationProperty rdf:about=\"http://purl.org/dc/elements/1.1/date\"/>\n  <rdf:Description rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Class\"/>\n\n<!--  <rdf:Description rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Resource\"/>\n  <rdf:Description rdf:about=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/> -->\n  <!-- end of OWL/RDF interop voodoo. mostly. -->\n\n  \n<!-- FOAF classes (types) are listed first. -->\n\n  <rdf:Description rdf:about=\"&foaf;Person\" rdfs:label=\"Person\" rdfs:comment=\"A person.\" vs:term_status=\"stable\">\n    \n    <!-- aside: \n\tare spatial things always spatially located? \n\tPerson includes imaginary people... discuss... -->\n    <owl:disjointWith rdf:resource=\"&foaf;Document\"/>\n    <owl:disjointWith rdf:resource=\"&foaf;Organization\"/>\n    <owl:disjointWith rdf:resource=\"&foaf;Project\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"&foaf;Document\" rdfs:label=\"Document\" rdfs:comment=\"A document.\" vs:term_status=\"testing\">\n    \n    <owl:disjointWith rdf:resource=\"&foaf;Organization\"/>\n    <owl:disjointWith rdf:resource=\"&foaf;Person\"/>\n    <owl:disjointWith rdf:resource=\"&foaf;Project\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"&foaf;Organization\" rdfs:label=\"Organization\" rdfs:comment=\"An organization.\" vs:term_status=\"stable\">\n    \n    <owl:disjointWith rdf:resource=\"&foaf;Person\"/>\n    <owl:disjointWith rdf:resource=\"&foaf;Document\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"&foaf;Group\" vs:term_status=\"stable\" rdfs:label=\"Group\" rdfs:comment=\"A class of Agents.\">\n    \n  </rdf:Description>\n  <rdf:Description rdf:about=\"&foaf;Agent\" vs:term_status=\"stable\" rdfs:label=\"Agent\" rdfs:comment=\"An agent (eg. person, group, software or physical artifact).\">\n    \n    <owl:disjointWith rdf:resource=\"&foaf;Document\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"&foaf;Project\" vs:term_status=\"unstable\" rdfs:label=\"Project\" rdfs:comment=\"A project (a collective endeavour of some kind).\">\n    \n    <owl:disjointWith rdf:resource=\"&foaf;Person\"/>\n    <owl:disjointWith rdf:resource=\"&foaf;Document\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"&foaf;Image\" vs:term_status=\"testing\" rdfs:label=\"Image\" rdfs:comment=\"An image.\">\n    \n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"&foaf;PersonalProfileDocument\" rdfs:label=\"PersonalProfileDocument\" rdfs:comment=\"A personal profile RDF document.\" vs:term_status=\"testing\">\n    \n  </rdf:Description>\n\t\n  <rdf:Description rdf:about=\"&foaf;OnlineAccount\" vs:term_status=\"unstable\" rdfs:label=\"Online Account\" rdfs:comment=\"An online account.\">\n    \n  </rdf:Description>\n  <rdf:Description rdf:about=\"&foaf;OnlineGamingAccount\" vs:term_status=\"unstable\" rdfs:label=\"Online Gaming Account\" rdfs:comment=\"An online gaming account.\">\n    \n  </rdf:Description>\n  <rdf:Description rdf:about=\"&foaf;OnlineEcommerceAccount\" vs:term_status=\"unstable\" rdfs:label=\"Online E-commerce Account\" rdfs:comment=\"An online e-commerce account.\">\n    \n  </rdf:Description>\n  <rdf:Description rdf:about=\"&foaf;OnlineChatAccount\" vs:term_status=\"unstable\" rdfs:label=\"Online Chat Account\" rdfs:comment=\"An online chat account.\">\n    \n  </rdf:Description>\n<!-- FOAF properties (ie. relationships). -->\n  <rdf:Property rdf:about=\"&foaf;mbox\" vs:term_status=\"stable\" rdfs:label=\"personal mailbox\" rdfs:comment=\"A \npersonal mailbox, ie. an Internet mailbox associated with exactly one owner, the first owner of this mailbox. This is a 'static inverse functional property', in that  there is (across time and change) at most one individual that ever has any particular value for foaf:mbox.\">\n    <rdf:type rdf:resource=\"&owl;InverseFunctionalProperty\"/>\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Agent\"/>\n    <rdfs:range rdf:resource=\"&owl;Thing\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;mbox_sha1sum\" vs:term_status=\"testing\" rdfs:label=\"sha1sum of a personal mailbox URI name\" rdfs:comment=\"The sha1sum of the URI of an Internet mailbox associated with exactly one owner, the  first owner of the mailbox.\">\n    <rdf:type rdf:resource=\"&owl;InverseFunctionalProperty\"/>\n\n<!--\nput it back in again 2006-01-29 - see \nhttp://chatlogs.planetrdf.com/swig/2006-01-29.html#T21-12-35\nI have mailed rdfweb-dev@vapours.rdfweb.org for discussion.\nLibby\n\nCommenting out as a kindness to OWL DL users. The semantics didn't quite cover\nour usage anyway, since (a) we want static-across-time, which is so beyond OWL as \nto be from another planet (b) we want identity reasoning invariant across xml:lang \ntagging. FOAF code will know what to do. OWL folks note, this assertion might return. \n\ndanbri\n-->\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n  </rdf:Property>\n\n  <rdf:Property rdf:about=\"&foaf;gender\" vs:term_status=\"testing\" \nrdfs:label=\"gender\" \nrdfs:comment=\"The gender of this Agent (typically but not necessarily 'male' or 'female').\">\n    <rdf:type rdf:resource=\"&owl;FunctionalProperty\"/>\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <!-- whatever one's gender is, and we are liberal in leaving room for more options \n    than 'male' and 'female', we model this so that an agent has only one gender. -->\n  </rdf:Property>\n\n\n\n  <rdf:Property rdf:about=\"&foaf;geekcode\" vs:term_status=\"testing\" rdfs:label=\"geekcode\" rdfs:comment=\"A textual geekcode for this person, see http://www.geekcode.com/geek.html\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;dnaChecksum\" vs:term_status=\"unstable\" rdfs:label=\"DNA checksum\" rdfs:comment=\"A checksum for the DNA of some thing. Joke.\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;sha1\" vs:term_status=\"unstable\" rdfs:label=\"sha1sum (hex)\" rdfs:comment=\"A sha1sum hash, in hex.\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Document\"/>\n<!-- rdf:type rdf:resource=\"&owl;InverseFunctionalProperty\" -->\n<!-- IFP under discussion -->\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;based_near\" vs:term_status=\"unstable\" rdfs:label=\"based near\" rdfs:comment=\"A location that something is based near, for some broadly human notion of near.\">\n<!-- see http://esw.w3.org/topic/GeoOnion for extension  ideas -->\n<!-- this was ranged as Agent... hmm -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\"/>\n  </rdf:Property>\n<!-- FOAF naming properties -->\n  <rdf:Property rdf:about=\"&foaf;title\" vs:term_status=\"testing\" rdfs:label=\"title\" rdfs:comment=\"Title (Mr, Mrs, Ms, Dr. etc)\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;nick\" vs:term_status=\"testing\" rdfs:label=\"nickname\" rdfs:comment=\"A short informal nickname characterising an agent (includes login identifiers, IRC and other chat nicknames).\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n  </rdf:Property>\n<!-- ......................... chat IDs ........................... -->\n  <rdf:Property rdf:about=\"&foaf;jabberID\" vs:term_status=\"testing\" rdfs:label=\"jabber ID\" rdfs:comment=\"A jabber ID for something.\">\n<!--\n    <rdfs:subPropertyOf rdf:resource=\"&foaf;nick\"/>\n...different to the other IM IDs, as Jabber has wider usage, so \nwe don't want the implied rdfs:domain here.\n\n-->\n    <rdfs:domain rdf:resource=\"&foaf;Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <!-- there is a case for using resources/URIs here, ... -->\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdf:type rdf:resource=\"&owl;InverseFunctionalProperty\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;aimChatID\" vs:term_status=\"testing\" rdfs:label=\"AIM chat ID\" rdfs:comment=\"An AIM chat ID\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"&foaf;nick\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdf:type rdf:resource=\"&owl;InverseFunctionalProperty\"/>\n  </rdf:Property>\n<!-- http://www.stud.uni-karlsruhe.de/~uck4/ICQ/Packet-112.html -->\n  <rdf:Property rdf:about=\"&foaf;icqChatID\" vs:term_status=\"testing\" rdfs:label=\"ICQ chat ID\" rdfs:comment=\"An ICQ chat ID\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"&foaf;nick\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdf:type rdf:resource=\"&owl;InverseFunctionalProperty\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;yahooChatID\" vs:term_status=\"testing\" rdfs:label=\"Yahoo chat ID\" rdfs:comment=\"A Yahoo chat ID\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"&foaf;nick\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdf:type rdf:resource=\"&owl;InverseFunctionalProperty\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;msnChatID\" vs:term_status=\"testing\" rdfs:label=\"MSN chat ID\" rdfs:comment=\"An MSN chat ID\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"&foaf;nick\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Agent\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdf:type rdf:resource=\"&owl;InverseFunctionalProperty\"/>\n  </rdf:Property>\n<!-- ....................................................... -->\n  <rdf:Property rdf:about=\"&foaf;name\" vs:term_status=\"testing\" rdfs:label=\"name\" rdfs:comment=\"A name for some thing.\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"&owl;Thing\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;firstName\" vs:term_status=\"testing\" rdfs:label=\"firstName\" rdfs:comment=\"The first name of a person.\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;givenname\" vs:term_status=\"testing\" rdfs:label=\"Given name\" rdfs:comment=\"The given name of some person.\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;surname\" vs:term_status=\"testing\" rdfs:label=\"Surname\" rdfs:comment=\"The surname of some person.\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;family_name\" vs:term_status=\"testing\" rdfs:label=\"family_name\" rdfs:comment=\"The family_name of some person.\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n  </rdf:Property>\n<!-- end of naming properties. See http://rdfweb.org/issues/show_bug.cgi?id=7\n\t   for open issue / re-design discussions.\n\t-->\n  <rdf:Property rdf:about=\"&foaf;phone\" vs:term_status=\"testing\" rdfs:label=\"phone\" rdfs:comment=\"A phone,  specified using fully qualified tel: URI scheme (refs: http://www.w3.org/Addressing/schemes.html#tel).\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;homepage\" vs:term_status=\"stable\" rdfs:label=\"homepage\" rdfs:comment=\"A homepage for some thing.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"&foaf;page\"/>\n    <rdfs:subPropertyOf rdf:resource=\"&foaf;isPrimaryTopicOf\"/>\n    <rdf:type rdf:resource=\"&owl;InverseFunctionalProperty\"/>\n    <!--  previously: rdfs:domain rdf:resource=\"&foaf;Agent\" -->\n    <rdfs:domain rdf:resource=\"&owl;Thing\"/>\n    <rdfs:range rdf:resource=\"&foaf;Document\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;weblog\" vs:term_status=\"testing\" rdfs:label=\"weblog\" rdfs:comment=\"A weblog of some thing (whether person, group, company etc.).\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"&foaf;page\"/>\n    <rdf:type rdf:resource=\"&owl;InverseFunctionalProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Agent\"/>\n    <rdfs:range rdf:resource=\"&foaf;Document\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;tipjar\" vs:term_status=\"testing\" rdfs:label=\"tipjar\" rdfs:comment=\"A tipjar document for this agent, describing means for payment and reward.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"&foaf;page\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Agent\"/>\n    <rdfs:range rdf:resource=\"&foaf;Document\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;plan\" vs:term_status=\"testing\" rdfs:label=\"plan\" rdfs:comment=\"A .plan comment, in the tradition of finger and '.plan' files.\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;made\" vs:term_status=\"stable\" rdfs:label=\"made\" rdfs:comment=\"Something that was made by this agent.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Agent\"/>\n    <rdfs:range rdf:resource=\"&owl;Thing\"/>\n    <owl:inverseOf rdf:resource=\"&foaf;maker\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;maker\"  vs:term_status=\"stable\" rdfs:label=\"maker\" rdfs:comment=\"An agent that \nmade this thing.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&owl;Thing\"/>\n    <rdfs:range rdf:resource=\"&foaf;Agent\"/>\n    <owl:inverseOf rdf:resource=\"&foaf;made\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;img\" vs:term_status=\"testing\" rdfs:label=\"image\" rdfs:comment=\"An image that can be used to represent some thing (ie. those depictions which are particularly representative of something, eg. one's photo on a homepage).\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"&foaf;Image\"/>\n    <rdfs:subPropertyOf rdf:resource=\"&foaf;depiction\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;depiction\" vs:term_status=\"testing\" rdfs:label=\"depiction\" rdfs:comment=\"A depiction of some thing.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&owl;Thing\"/>\n    <rdfs:range rdf:resource=\"&foaf;Image\"/>\n    <owl:inverseOf rdf:resource=\"&foaf;depicts\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;depicts\" vs:term_status=\"testing\" rdfs:label=\"depicts\" rdfs:comment=\"A thing depicted in this representation.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:range rdf:resource=\"&owl;Thing\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Image\"/>\n    <owl:inverseOf rdf:resource=\"&foaf;depiction\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;thumbnail\" vs:term_status=\"testing\" rdfs:label=\"thumbnail\" rdfs:comment=\"A derived thumbnail image.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Image\"/>\n    <rdfs:range rdf:resource=\"&foaf;Image\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;myersBriggs\" vs:term_status=\"testing\" rdfs:label=\"myersBriggs\" rdfs:comment=\"A Myers Briggs (MBTI) personality classification.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;workplaceHomepage\" vs:term_status=\"testing\" rdfs:label=\"workplace homepage\" rdfs:comment=\"A workplace homepage of some person; the homepage of an organization they work for.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"&foaf;Document\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;workInfoHomepage\" vs:term_status=\"testing\" rdfs:label=\"work info homepage\" rdfs:comment=\"A work info homepage of some person; a page about their work for some organization.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"&foaf;Document\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;schoolHomepage\" vs:term_status=\"testing\" rdfs:label=\"schoolHomepage\" rdfs:comment=\"A homepage of a school attended by the person.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"&foaf;Document\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;knows\" vs:term_status=\"testing\" rdfs:label=\"knows\" rdfs:comment=\"A person known by this person (indicating some level of reciprocated interaction between the parties).\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"&foaf;Person\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;interest\" vs:term_status=\"testing\" rdfs:label=\"interest\" rdfs:comment=\"A page about a topic of interest to this person.\">\n<!-- we should distinguish the page from the topic more carefully. danbri 2002-07-08 -->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"&foaf;Document\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;topic_interest\" vs:term_status=\"testing\" rdfs:label=\"interest_topic\" rdfs:comment=\"A thing of interest to this person.\">\n<!-- we should distinguish the page from the topic more carefully. danbri 2002-07-08 -->\n<!--    foaf:interest_topic(P,R) \n\t\talways true whenever\n\t\tfoaf:interest(P,D), foaf:topic(D,R) \n\t\tie. a person has a foaf:topic_interest in all things \n\t\tthat are the foaf:topic of pages they have a foaf:interest in. \n\t\thmm, does this mean i'm forced to be interested in all the things that are the \n\t\ttopic of a page i'm interested in. thats a strong restriction on foaf:topic's utility.\t-->\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"&owl;Thing\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;publications\" vs:term_status=\"unstable\" rdfs:label=\"publications\" rdfs:comment=\"A link to the publications of this person.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"&foaf;Document\"/>\n  </rdf:Property>\n<!-- by libby for ILRT mappings 2001-10-31 -->\n  <rdf:Property rdf:about=\"&foaf;currentProject\" vs:term_status=\"testing\" rdfs:label=\"current project\" rdfs:comment=\"A current project this person works on.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"&owl;Thing\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;pastProject\" vs:term_status=\"testing\" rdfs:label=\"past project\" rdfs:comment=\"A project this person has previously worked on.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Person\"/>\n    <rdfs:range rdf:resource=\"&owl;Thing\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;fundedBy\" vs:term_status=\"unstable\" rdfs:label=\"funded by\" rdfs:comment=\"An organization funding a project or person.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&owl;Thing\"/>\n    <rdfs:range rdf:resource=\"&owl;Thing\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;logo\" vs:term_status=\"testing\" rdfs:label=\"logo\" rdfs:comment=\"A logo representing some thing.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&owl;Thing\"/>\n    <rdfs:range rdf:resource=\"&owl;Thing\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;topic\" vs:term_status=\"testing\" rdfs:label=\"topic\" rdfs:comment=\"A topic of some page or document.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Document\"/>\n    <rdfs:range rdf:resource=\"&owl;Thing\"/>\n    <owl:inverseOf rdf:resource=\"&foaf;page\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;primaryTopic\"\n vs:term_status=\"testing\" rdfs:label=\"primary topic\" rdfs:comment=\"The primary topic of some page or document.\">\n    <rdf:type rdf:resource=\"&owl;FunctionalProperty\"/>\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Document\"/>\n    <rdfs:range rdf:resource=\"&owl;Thing\"/>\n    <owl:inverseOf rdf:resource=\"&foaf;isPrimaryTopicOf\"/>\n  </rdf:Property>\n\n  <rdf:Property rdf:about=\"&foaf;isPrimaryTopicOf\"\n vs:term_status=\"testing\" rdfs:label=\"is primary topic of\" rdfs:comment=\"A document that this thing is the primary topic of.\">\n    <rdf:type rdf:resource=\"&owl;InverseFunctionalProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"&foaf;page\"/>\n    <owl:inverseOf rdf:resource=\"&foaf;primaryTopic\"/>\n    <rdfs:domain rdf:resource=\"&owl;Thing\"/>\n    <rdfs:range rdf:resource=\"&foaf;Document\"/>\n  </rdf:Property>\n\n  <rdf:Property rdf:about=\"&foaf;page\" vs:term_status=\"testing\" rdfs:label=\"page\" rdfs:comment=\"A page or document about this thing.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&owl;Thing\"/>\n    <rdfs:range rdf:resource=\"&foaf;Document\"/>\n    <owl:inverseOf rdf:resource=\"&foaf;topic\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;theme\" vs:term_status=\"unstable\" rdfs:label=\"theme\" rdfs:comment=\"A theme.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&owl;Thing\"/>\n    <rdfs:range rdf:resource=\"&owl;Thing\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;holdsAccount\" vs:term_status=\"unstable\" rdfs:label=\"holds account\" rdfs:comment=\"Indicates an account held by this agent.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Agent\"/>\n    <rdfs:range rdf:resource=\"&foaf;OnlineAccount\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;accountServiceHomepage\" vs:term_status=\"unstable\" rdfs:label=\"account service homepage\" rdfs:comment=\"Indicates a homepage of the service provide for this online account.\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;OnlineAccount\"/>\n    <rdfs:range rdf:resource=\"&foaf;Document\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;accountName\" vs:term_status=\"unstable\" rdfs:label=\"account name\" rdfs:comment=\"Indicates the name (identifier) associated with this online account.\">\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;OnlineAccount\"/>\n    <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\n  </rdf:Property>\n  <rdf:Property rdf:about=\"&foaf;member\" vs:term_status=\"stable\" rdfs:label=\"member\" rdfs:comment=\"Indicates a member of a Group\">\n    <rdf:type rdf:resource=\"&owl;ObjectProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Group\"/>\n    <rdfs:range rdf:resource=\"&foaf;Agent\"/>\n  </rdf:Property>\n\n  <rdf:Property rdf:about=\"&foaf;membershipClass\" vs:term_status=\"unstable\" rdfs:label=\"membershipClass\" rdfs:comment=\"Indicates the class of individuals that are a member of a Group\">\n    <rdf:type rdf:resource=\"&owl;AnnotationProperty\"/>\n  </rdf:Property>\n\n\n  <rdf:Property rdf:about=\"&foaf;birthday\" vs:term_status=\"unstable\" rdfs:label=\"birthday\" rdfs:comment=\"The birthday of this Agent, represented in mm-dd string form, eg. '12-31'.\">\n    <rdf:type rdf:resource=\"&owl;FunctionalProperty\"/>\n    <rdf:type rdf:resource=\"&owl;DatatypeProperty\"/>\n    <rdfs:domain rdf:resource=\"&foaf;Agent\"/>\n    <rdfs:range rdf:resource=\"&rdfs;Literal\"/>\n  </rdf:Property>\n\n\n<!-- SIOC -->\n\n\n\r\n<!-- Classes -->\r\n<rdf:Description rdf:about=\"&sioc;Community\">\r\n  <rdfs:label xml:lang=\"en\">Community</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Community is a high-level concept that defines an online community and what it consists of.</rdfs:comment>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Item\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Role\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;User\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"&sioc;Container\">\r\n  <rdfs:label xml:lang=\"en\">Container</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An area in which content Items are contained.</rdfs:comment>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Item\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Role\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;User\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Usergroup\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"&sioc;Forum\">\r\n  <rdfs:label xml:lang=\"en\">Forum</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A discussion area on which Posts or entries are made.</rdfs:comment>\r\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"&sioc;Item\">\r\n  <rdfs:label xml:lang=\"en\">Item</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An Item is something which can be in a Container.</rdfs:comment>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Container\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Role\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Space\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;User\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Usergroup\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"&sioc;Post\">\r\n  <rdfs:label xml:lang=\"en\">Post</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An article or message that can be posted to a Forum.</rdfs:comment>\r\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"&sioc;Role\">\r\n  <rdfs:label xml:lang=\"en\">Role</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A Role is a function of a User within a scope of a particular Forum, Site, etc.</rdfs:comment>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Container\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Item\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Space\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;User\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Usergroup\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"&sioc;Space\">\r\n  <rdfs:label xml:lang=\"en\">Space</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A Space is a place where data resides, e.g. on a website, desktop, fileshare, etc.</rdfs:comment>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Item\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Role\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;User\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Usergroup\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"&sioc;Site\">\r\n  <rdfs:label xml:lang=\"en\">Site</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A Site can be the location of an online community or set of communities, with Users and Usergroups creating Items in a set of Containers. It can be thought of as a web-accessible data Space.</rdfs:comment>\r\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"&sioc;Thread\">\r\n  <rdfs:label xml:lang=\"en\">Thread</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A container for a series of threaded discussion Posts or Items.</rdfs:comment>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"&sioc;User\">\r\n  <rdfs:label xml:lang=\"en\">User</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A User account in an online community site.</rdfs:comment>\r\n\r\n  <owl:disjointWith rdf:resource=\"&sioc;Container\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Item\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Role\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Space\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Usergroup\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"&sioc;Usergroup\">\r\n  <rdfs:label xml:lang=\"en\">Usergroup</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A set of User accounts whose owners have a common purpose or interest. Can be used for access control purposes.</rdfs:comment>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Container\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Item\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Role\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;Space\"/>\r\n  <owl:disjointWith rdf:resource=\"&sioc;User\"/>\r\n</rdf:Description>\r\n\r\n<!-- Properties -->\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;about\">\r\n  <rdfs:label xml:lang=\"en\">about</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Specifies that this Item is about a particular resource, e.g. a Post describing a book, hotel, etc.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;account_of\">\r\n  <rdfs:label xml:lang=\"en\">account_of</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Refers to the foaf:Agent or foaf:Person who owns this sioc:User online account.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;User\"/>\r\n  <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\r\n  <owl:inverseOf rdf:resource=\"http://xmlns.com/foaf/0.1/holdsAccount\"/>\r\n</owl:ObjectProperty>\r\n\r\n<!-- @@todo: moving this property to the access module ? -->\r\n<owl:ObjectProperty rdf:about=\"&sioc;administrator_of\">\r\n  <rdfs:label xml:lang=\"en\">administrator_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_administrator\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Site that the User is an administrator of.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;User\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Site\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;attachment\">\r\n  <rdfs:label xml:lang=\"en\">attachment</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">The URI of a file attached to an Item.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;avatar\">\r\n  <rdfs:label xml:lang=\"en\">avatar</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An image or depiction used to represent this User.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;User\"/>\r\n  <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/depiction\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;container_of\">\r\n  <rdfs:label xml:lang=\"en\">container_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_container\"/>\r\n  <rdfs:comment xml:lang=\"en\">An Item that this Container contains.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Container\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Item\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"&sioc;content\">\r\n  <rdfs:label xml:lang=\"en\">content</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">The content of the Item in plain text format.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;creator_of\">\r\n  <rdfs:label xml:lang=\"en\">creator_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_creator\"/>\r\n  <rdfs:comment xml:lang=\"en\">A resource that the User is a creator of.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;User\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:TransitiveProperty rdf:about=\"&sioc;earlier_version\">\r\n  <rdfs:comment xml:lang=\"en\">Links to a previous (older) revision of this Item or Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:label xml:lang=\"en\">earlier_version</rdfs:label>\r\n  <rdfs:range rdf:resource=\"&sioc;Item\"/>\r\n  <owl:inverseOf rdf:resource=\"&sioc;later_version\"/>\r\n</owl:TransitiveProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;email\">\r\n  <rdfs:label xml:lang=\"en\">email</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An electronic mail address of the User.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;User\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"&sioc;email_sha1\">\r\n  <rdfs:label xml:lang=\"en\">email_sha1</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An electronic mail address of the User, encoded using SHA1.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;User\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;feed\">\r\n  <rdfs:label xml:lang=\"en\">feed</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A feed (e.g. RSS, Atom, etc.) pertaining to this resource (e.g. for a Forum, Site, User, etc.).</rdfs:comment>\r\n</owl:ObjectProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"&sioc;follows\">\r\n  <rdfs:label xml:lang=\"en\">follows</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Indicates that one User follows another User (e.g. for microblog posts or other content item updates).</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;User\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;User\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<!-- @@todo: moving this property to the access module ? -->\r\n<owl:ObjectProperty rdf:about=\"&sioc;function_of\">\r\n  <rdfs:label xml:lang=\"en\">function_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_function\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User who has this Role.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Role\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_administrator\">\r\n  <rdfs:label xml:lang=\"en\">has_administrator</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;administrator_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User who is an administrator of this Site.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Site\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;User\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_container\">\r\n  <rdfs:label xml:lang=\"en\">has_container</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;container_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">The Container to which this Item belongs.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Container\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_creator\">\r\n  <rdfs:label xml:lang=\"en\">has_creator</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;creator_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">This is the User who made this resource.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"&sioc;User\"/>\r\n</owl:ObjectProperty>\r\n\r\n<!-- @@todo: moving this property to the access module ? -->\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_function\">\r\n  <rdfs:label xml:lang=\"en\">has_function</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;function_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Role that this User has.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"&sioc;Role\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_host\">\r\n  <rdfs:label xml:lang=\"en\">has_host</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;host_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">The Site that hosts this Forum.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Forum\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Site\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_member\">\r\n  <rdfs:label xml:lang=\"en\">has_member</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;member_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User who is a member of this Usergroup.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Usergroup\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;User\"/>\r\n</owl:ObjectProperty>\r\n\r\n<!-- @@todo: moving this property to the access module ? -->\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_moderator\">\r\n  <rdfs:label xml:lang=\"en\">has_moderator</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User who is a moderator of this Forum.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Forum\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;User\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_modifier\">\r\n  <rdfs:label xml:lang=\"en\">has_modifier</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;modifier_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User who modified this Item.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;User\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_owner\">\r\n  <rdfs:label xml:lang=\"en\">has_owner</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;owner_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User that this resource is owned by.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"&sioc;User\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_parent\">\r\n  <rdfs:label xml:lang=\"en\">has_parent</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;parent_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Container or Forum that this Container or Forum is a child of.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Container\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Container\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_reply\">\r\n  <rdfs:label xml:lang=\"en\">has_reply</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;reply_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">Points to an Item or Post that is a reply or response to this Item or Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Item\"/>\r\n</owl:ObjectProperty>\r\n\r\n<!-- @@todo: moving this property to the access module ? -->\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_scope\">\r\n  <rdfs:label xml:lang=\"en\">has_scope</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;scope_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A resource that this Role applies to.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Role\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_space\">\r\n  <rdfs:label xml:lang=\"en\">has_space</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;space_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A data Space which this resource is a part of.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"&sioc;Space\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_subscriber\">\r\n  <rdfs:label xml:lang=\"en\">has_subscriber</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;subscriber_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">A User who is subscribed to this Container.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Container\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;User\"/>\r\n  <rdfs:seeAlso rdf:resource=\"&sioc;feed\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;has_usergroup\">\r\n  <rdfs:label xml:lang=\"en\">has_usergroup</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;usergroup_of\"/>\r\n  <rdfs:comment xml:lang=\"en\">Points to a Usergroup that has certain access to this Space.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Space\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Usergroup\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;host_of\">\r\n  <rdfs:label xml:lang=\"en\">host_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_host\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Forum that is hosted on this Site.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Site\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Forum\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"&sioc;id\">\r\n  <rdfs:label xml:lang=\"en\">id</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An identifier of a SIOC concept instance. For example, a user ID. Must be unique for instances of each type of SIOC concept within the same site.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"&sioc;ip_address\">\r\n  <rdfs:label xml:lang=\"en\">ip_address</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">The IP address used when creating this Item. This can be associated with a creator. Some wiki articles list the IP addresses for the creator or modifiers when the usernames are absent.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:TransitiveProperty rdf:about=\"&sioc;later_version\">\r\n  <rdfs:comment xml:lang=\"en\">Links to a later (newer) revision of this Item or Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:label xml:lang=\"en\">later_version</rdfs:label>\r\n  <rdfs:range rdf:resource=\"&sioc;Item\"/>\r\n  <owl:inverseOf rdf:resource=\"&sioc;earlier_version\"/>\r\n</owl:TransitiveProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;latest_version\">\r\n  <rdfs:comment xml:lang=\"en\">Links to the latest revision of this Item or Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:label xml:lang=\"en\">latest_version</rdfs:label>\r\n  <rdfs:range rdf:resource=\"&sioc;Item\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;link\">\r\n  <rdfs:label xml:lang=\"en\">link</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A URI of a document which contains this SIOC object.</rdfs:comment>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;links_to\">\r\n  <rdfs:label xml:lang=\"en\">links_to</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Links extracted from hyperlinks within a SIOC concept, e.g. Post or Site.</rdfs:comment>\r\n  <rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/references\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;member_of\">\r\n  <rdfs:label xml:lang=\"en\">member_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_member\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Usergroup that this User is a member of.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;User\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Usergroup\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;moderator_of\">\r\n  <rdfs:label xml:lang=\"en\">moderator_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_moderator\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Forum that User is a moderator of.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;User\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Forum\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;modifier_of\">\r\n  <rdfs:label xml:lang=\"en\">modifier_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_modifier\"/>\r\n  <rdfs:comment xml:lang=\"en\">An Item that this User has modified.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;User\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Item\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"&sioc;name\">\r\n  <rdfs:label xml:lang=\"en\">name</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">The name of a SIOC instance, e.g. a username for a User, group name for a Usergroup, etc.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;next_by_date\">\r\n  <rdfs:label xml:lang=\"en\">next_by_date</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;previous_by_date\"/>\r\n  <rdfs:comment xml:lang=\"en\">Next Item or Post in a given Container sorted by date.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Item\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;next_version\">\r\n  <rdfs:label xml:lang=\"en\">next_version</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;previous_version\"/>\r\n  <rdfs:comment xml:lang=\"en\">Links to the next revision of this Item or Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:subPropertyOf rdf:resource=\"&sioc;later_version\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"&sioc;note\">\r\n  <rdfs:label xml:lang=\"en\">note</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A note associated with this resource, for example, if it has been edited by a User.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"&sioc;num_replies\">\r\n  <rdfs:label xml:lang=\"en\">num_replies</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">The number of replies that this Item, Thread, Post, etc. has. Useful for when the reply structure is absent.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2001/XMLSchema#integer\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:DatatypeProperty rdf:about=\"&sioc;num_views\">\r\n  <rdfs:label xml:lang=\"en\">num_views</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">The number of times this Item, Thread, User profile, etc. has been viewed.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"http://www.w3.org/2001/XMLSchema#integer\"/>\r\n</owl:DatatypeProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;owner_of\">\r\n  <rdfs:label xml:lang=\"en\">owner_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_owner\"/>\r\n  <rdfs:comment xml:lang=\"en\">A resource owned by a particular User, for example, a weblog or image gallery.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;User\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;parent_of\">\r\n  <rdfs:label xml:lang=\"en\">parent_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_parent\"/>\r\n  <rdfs:comment xml:lang=\"en\">A child Container or Forum that this Container or Forum is a parent of.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Container\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Container\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;previous_by_date\">\r\n  <rdfs:label xml:lang=\"en\">previous_by_date</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;next_by_date\"/>\r\n  <rdfs:comment xml:lang=\"en\">Previous Item or Post in a given Container sorted by date.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Item\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;previous_version\">\r\n  <rdfs:label xml:lang=\"en\">previous_version</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;next_version\"/>\r\n  <rdfs:comment xml:lang=\"en\">Links to the previous revision of this Item or Post.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:subPropertyOf rdf:resource=\"&sioc;earlier_version\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;related_to\">\r\n  <rdfs:label xml:lang=\"en\">related_to</rdfs:label>\r\n  <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/>\r\n  <rdfs:comment xml:lang=\"en\">Related Posts for this Post, perhaps determined implicitly from topics or references.</rdfs:comment>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;reply_of\">\r\n  <rdfs:label xml:lang=\"en\">reply_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_reply\"/>\r\n  <rdfs:comment xml:lang=\"en\">Links to an Item or Post which this Item or Post is a reply to.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Item\"/>\r\n</owl:ObjectProperty>\r\n\r\n<!-- @@todo: moving this property to the access module ? -->\r\n<owl:ObjectProperty rdf:about=\"&sioc;scope_of\">\r\n  <rdfs:label xml:lang=\"en\">scope_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_scope\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Role that has a scope of this resource.</rdfs:comment>\r\n  <rdfs:range rdf:resource=\"&sioc;Role\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:SymmetricProperty rdf:about=\"&sioc;sibling\">\r\n  <rdfs:label xml:lang=\"en\">sibling</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">An Item may have a sibling or a twin that exists in a different Container, but the siblings may differ in some small way (for example, language, category, etc.). The sibling of this Item should be self-describing (that is, it should contain all available information).</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Item\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Item\"/>\r\n</owl:SymmetricProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;space_of\">\r\n  <rdfs:label xml:lang=\"en\">space_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_space\"/>\r\n  <rdfs:comment xml:lang=\"en\">A resource which belongs to this data Space.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Space\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;subscriber_of\">\r\n  <rdfs:label xml:lang=\"en\">subscriber_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_subscriber\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Container that a User is subscribed to.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;User\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Container\"/>\r\n  <rdfs:seeAlso rdf:resource=\"&sioc;feed\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;topic\">\r\n  <rdfs:label xml:lang=\"en\">topic</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A topic of interest, linking to the appropriate URI, e.g. in the Open Directory Project or of a SKOS category.</rdfs:comment>\r\n  <rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/terms/subject\"/>\r\n</owl:ObjectProperty>\r\n\r\n<owl:ObjectProperty rdf:about=\"&sioc;usergroup_of\">\r\n  <rdfs:label xml:lang=\"en\">usergroup_of</rdfs:label>\r\n  <owl:inverseOf rdf:resource=\"&sioc;has_usergroup\"/>\r\n  <rdfs:comment xml:lang=\"en\">A Space that the Usergroup has access to.</rdfs:comment>\r\n  <rdfs:domain rdf:resource=\"&sioc;Usergroup\"/>\r\n  <rdfs:range rdf:resource=\"&sioc;Space\"/>\r\n</owl:ObjectProperty>\r\n\r\n<!-- SIOC TYPES -->\n\n\n<!-- Classes -->\r\n\r\n<!-- Subtypes of sioc:Container -->\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#AddressBook\">\r\n  <rdfs:label xml:lang=\"en\">Address Book</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a collection of personal or organisational addresses.</rdfs:comment>\r\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#AnnotationSet\">\r\n  <rdfs:label xml:lang=\"en\">Annotation Set</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a set of annotations, for example, those created by a particular user or related to a particular topic.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://www.w3.org/2000/10/annotation-ns#Annotation\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#AudioChannel\">\r\n  <rdfs:label xml:lang=\"en\">Audio Channel</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a channel for distributing audio or sound files, for example, a podcast.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://purl.org/dc/dcmitype/Sound\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#BookmarkFolder\">\r\n  <rdfs:label xml:lang=\"en\">Bookmark Folder</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a shared collection of bookmarks.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://www.w3.org/2002/01/bookmark#Bookmark\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#Briefcase\">\r\n  <rdfs:label xml:lang=\"en\">Briefcase</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a briefcase or file service.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://xmlns.com/foaf/0.1/Document\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#EventCalendar\">\r\n  <rdfs:label xml:lang=\"en\">Event Calendar</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a calendar of events.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://www.w3.org/2002/12/cal/icaltzd#VEVENT\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#ImageGallery\">\r\n  <rdfs:label xml:lang=\"en\">Image Gallery</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes an image gallery, for example, a photo album.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://www.w3.org/2003/12/exif/ns/IFD\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#ProjectDirectory\">\r\n  <rdfs:label xml:lang=\"en\">Project Directory</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a project directory.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://usefulinc.com/ns/doap#Project\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#ResumeBank\">\r\n  <rdfs:label xml:lang=\"en\">Resume Bank</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a collection of resumes.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://captsolo.net/semweb/resume/cv.rdfs#Resume\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#ReviewArea\">\r\n  <rdfs:label xml:lang=\"en\">Review Area</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes an area where reviews are posted.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://www.isi.edu/webscripter/communityreview/abstract-review-o#Review\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://dannyayers.com/xmlns/rev/#Review\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#SubscriptionList\">\r\n  <rdfs:label xml:lang=\"en\">Subscription List</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a shared set of feed subscriptions.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://atomowl.org/ontologies/atomrdf#Feed\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#SurveyCollection\">\r\n  <rdfs:label xml:lang=\"en\">Survey Collection</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes an area where survey data can be collected, e.g. from polls.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#Poll\"/>  \r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#VideoChannel\">\r\n  <rdfs:label xml:lang=\"en\">Video Channel</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a channel for distributing videos (moving image) files, for example, a video podcast.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://purl.org/dc/dcmitype/MovingImage\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#Wiki\">\r\n  <rdfs:label xml:lang=\"en\">Wiki</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a wiki space.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#WikiArticle\"/>  \r\n</rdf:Description>\r\n\r\n<!-- Types of sioc:Container for creating lists -->\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#FavouriteThings\">\r\n  <rdfs:label xml:lang=\"en\">Favourite Things</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a list or a collection of one's favourite things.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#OfferList\">\r\n  <rdfs:label xml:lang=\"en\">Offer List</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a list of the items someone has available to offer.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#Playlist\">\r\n  <rdfs:label xml:lang=\"en\">Playlist</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a list of media items that have been played or can be played.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#ReadingList\">\r\n  <rdfs:label xml:lang=\"en\">Reading List</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a list of books or other materials that have been read or are suggested for reading.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#WishList\">\r\n  <rdfs:label xml:lang=\"en\">Wish List</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a list of the items someone wishes to get.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</rdf:Description>\r\n\r\n<!-- Subtypes of sioc:Forum -->\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#ArgumentativeDiscussion\">\r\n  <rdfs:label xml:lang=\"en\">Argumentative Discussion</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a discussion area where logical arguments can take place.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://purl.org/ibis#Idea\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#ChatChannel\">\r\n  <rdfs:label xml:lang=\"en\">Chat Channel</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a channel for chat or instant messages, for example, via IRC or IM.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#InstantMessage\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#MailingList\">\r\n  <rdfs:label xml:lang=\"en\">Mailing List</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes an electronic mailing list.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#MailMessage\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#MessageBoard\">\r\n  <rdfs:label xml:lang=\"en\">Message Board</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a message board, also known as an online bulletin board or discussion forum.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#BoardPost\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#Microblog\">\r\n  <rdfs:label xml:lang=\"en\">Microblog</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a microblog, i.e. a blog consisting of short text messages.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#MicroblogPost\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#Weblog\">\r\n  <rdfs:label xml:lang=\"en\">Weblog</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a weblog (blog), i.e. an online journal.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#BlogPost\"/>\r\n</rdf:Description>\r\n\r\n<!-- Subtypes of sioc:Item -->\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#Poll\">\r\n  <rdfs:label xml:lang=\"en\">Poll</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a posted item that contains a poll or survey content.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#SurveyCollection\"/>\r\n</rdf:Description>\r\n\r\n<!-- Subtypes of sioc:Post -->\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#BlogPost\">\r\n  <rdfs:label xml:lang=\"en\">Blog Post</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a post that is specifically made on a weblog.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#Weblog\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#BoardPost\">\r\n  <rdfs:label xml:lang=\"en\">Board Post</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a post that is specifically made on a message board.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#MessageBoard\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#Comment\">\r\n  <rdfs:label xml:lang=\"en\">Comment</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Comment is a subtype of sioc:Post and allows one to explicitly indicate that this SIOC post is a comment.  Note that comments have a narrower scope than sioc:Post and may not apply to all types of community site.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#Forum\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#InstantMessage\">\r\n  <rdfs:label xml:lang=\"en\">Instant Message</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes an instant message, e.g. sent via Jabber.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#ChatChannel\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#MailMessage\">\r\n  <rdfs:label xml:lang=\"en\">Mail Message</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes an electronic mail message, e.g. a post sent to a mailing list.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#MailingList\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#MicroblogPost\">\r\n  <rdfs:label xml:lang=\"en\">Microblog Post</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a post that is specifically made on a microblog.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#Microblog\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#WikiArticle\">\r\n  <rdfs:label xml:lang=\"en\">Wiki Article</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Describes a wiki article.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n  <rdfs:seeAlso rdf:resource=\"http://rdfs.org/sioc/types#Wiki\"/>\r\n</rdf:Description>\r\n\r\n<!-- Subtypes of sioc:Post for question and answer sites -->\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#Answer\">\r\n  <rdfs:label xml:lang=\"en\">Answer</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A Post that provides an answer in reply to a Question.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#BestAnswer\">\r\n  <rdfs:label xml:lang=\"en\">Best Answer</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A Post that is the best answer to a Question, as chosen by the User who asked the Question or as voted by a Community of Users.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</rdf:Description>\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#Question\">\r\n  <rdfs:label xml:lang=\"en\">Question</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">A Post that asks a Question.</rdfs:comment>\r\n\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</rdf:Description>\r\n\r\n<!-- Types of sioc:topic for defining some different ways used to classify things in online communities -->\r\n\r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#Category\">\r\n  <rdfs:label xml:lang=\"en\">Category</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Category is used on the object of sioc:topic to indicate that this resource is a category on a site.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n\r\n</rdf:Description>\r\n  \r\n<rdf:Description rdf:about=\"http://rdfs.org/sioc/types#Tag\">\r\n  <rdfs:label xml:lang=\"en\">Tag</rdfs:label>\r\n  <rdfs:comment xml:lang=\"en\">Tag is used on the object of sioc:topic to indicate that this resource is a tag on a site.</rdfs:comment>\r\n  <rdfs:isDefinedBy rdf:resource=\"http://rdfs.org/sioc/types#\"/>\r\n</rdf:Description>\r\n\n\n\n<!-- GEO -->\n\n<rdf:Description rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\">\n <rdfs:label>SpatialThing</rdfs:label>\n <rdfs:comment>Anything with spatial extent, i.e. size, shape, or position. e.g. people, places, bowling balls, as well as abstract areas like cubes.\n</rdfs:comment>\n</rdf:Description>\n\n\n<rdf:Description rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#Point\">\n\n <rdfs:label>Point</rdfs:label>\n <rdfs:comment>A point, typically described using a coordinate system relative to Earth, such as WGS84.\n</rdfs:comment>\n\n<rdfs:comment>\nUniquely identified by lat/long/alt. i.e.\n\nspaciallyIntersects(P1, P2) :- lat(P1, LAT), long(P1, LONG), alt(P1, ALT),\n  lat(P2, LAT), long(P2, LONG), alt(P2, ALT).\n\nsameThing(P1, P2) :- type(P1, Point), type(P2, Point), spaciallyIntersects(P1, P2).\n</rdfs:comment>\n</rdf:Description>\n\n\n<rdf:Property rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#lat\">\n <rdfs:domain rdf:resource=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\" />\n <rdfs:label>latitude</rdfs:label>\n <rdfs:comment>The WGS84 latitude of a SpatialThing (decimal degrees).</rdfs:comment>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#long\">\n <rdfs:domain rdf:resource=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\" />\n <rdfs:label>longitude</rdfs:label>\n <rdfs:comment>The WGS84 longitude of a SpatialThing (decimal degrees).</rdfs:comment>\n</rdf:Property>\n\n<rdf:Property rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#alt\">\n <rdfs:domain rdf:resource=\"http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing\" />\n <rdfs:label>altitude</rdfs:label>\n <rdfs:comment>The WGS84 altitude of a SpatialThing (decimal meters \nabove the local reference ellipsoid).</rdfs:comment>\n</rdf:Property>\n\n<!-- not sure we really need this -->\n<rdf:Property rdf:about=\"http://www.w3.org/2003/01/geo/wgs84_pos#lat_long\">\n <rdfs:label>lat/long</rdfs:label>\n <rdfs:comment>A comma-separated representation of a latitude, longitude coordinate.</rdfs:comment>\n</rdf:Property>\n\n\n<!-- RELATIONSHIP -->\n\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/friendOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/friendOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">friend of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who shares mutual friendship with this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/acquaintanceOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/acquaintanceOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">acquaintance of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person having more than slight or superficial knowledge of this person but short of friendship.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/parentOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/parentOf\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/childOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">parent of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who has given birth to or nurtured and raised this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/siblingOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/siblingOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">sibling of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person having one or both parents in common with this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/childOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/childOf\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/parentOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">child of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who was given birth to or nurtured and raised by this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/grandchildOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/grandchildOf\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/grandparentOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">grandchild of</rdfs:label>\n    <rdfs:label>Grandchild Of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who is a child of any of this person's children.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/spouseOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/spouseOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">spouse of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who is married to this person</skos:definition>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/enemyOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/enemyOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">enemy of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person towards whom this person feels hatred, intends injury to, or opposes the interests of.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/antagonistOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/antagonistOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">antagonist of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who opposes and contends against this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/ambivalentOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:equivalentClass rdf:resource=\"http://www.perceive.net/schemas/relationship/ambivalentOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">ambivalent of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person towards whom this person has mixed feelings or emotions.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/lostContactWith\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">lost contact with</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who was once known by this person but has subsequently become uncontactable.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/knowsOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">knows of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who has come to be known to this person through their actions or position.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/wouldLikeToKnow\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">would like to now</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person whom this person would desire to know more closely.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/knowsInPassing\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">knows in passing</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person whom this person has slight or superficial knowledge of.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/knowsByReputation\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">knows by reputation</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person known by this person primarily for a particular action, position or field of endeavour.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/closeFriendOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">close friend of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who shares a close mutual friendship with this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/hasMet\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">has met</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who has met this person whether in passing or longer.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/worksWith\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#TransitiveProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">works with</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who works for the same employer as this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/colleagueOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">colleague of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who is a member of the same profession as this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/collaboratesWith\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">collaborates with</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who works towards a common goal with this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/employerOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/employedBy\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">employer of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who engages the services of this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/employedBy\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/employerOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">employed by</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person for whom this person's services have been engaged.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/mentorOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/apprenticeTo\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">mentor of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who serves as a trusted counselor or teacher to this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/apprenticeTo\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/mentorOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">apprentice to</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person to whom this person serves as a trusted counselor or teacher.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/livesWith\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#TransitiveProperty\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">lives with</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who shares a residence with this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/neighborOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#TransitiveProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">neighbor of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who lives in the same locality as this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/grandparentOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/grandchildOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">grandparent of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who is the parent of any of this person's parents.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/lifePartnerOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">life partner of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who has made a long-term commitment to this person's.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/engagedTo\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#SymmetricProperty\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">engaged to</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person to whom this person is betrothed.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/ancestorOf\">\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#TransitiveProperty\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/descendantOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">ancestor of</rdfs:label>\n    <skos:definition xml:lang=\"en\">A person who is a descendant of this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/descendantOf\">\n    <rdfs:label>Descendant Of</rdfs:label>\n    <rdfs:label xml:lang=\"en\">descendant of</rdfs:label>\n    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#TransitiveProperty\"/>\n    <owl:inverseOf rdf:resource=\"http://purl.org/vocab/relationship/ancestorOf\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <skos:definition xml:lang=\"en\">A person from whom this person is descended.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/participantIn\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">participant in</rdfs:label>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://purl.org/vocab/relationship/Relationship\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/participant\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">participant</rdfs:label>\n    <rdfs:domain rdf:resource=\"http://purl.org/vocab/relationship/Relationship\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n  <rdf:Description rdf:about=\"http://purl.org/vocab/relationship/influencedBy\">\n    <rdf:type rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property\"/>\n    <rdfs:subPropertyOf rdf:resource=\"http://xmlns.com/foaf/0.1/knows\"/>\n    <rdfs:label xml:lang=\"en\">influenced by</rdfs:label>\n    <skos:definition xml:lang=\"en\">a person who has influenced this person.</skos:definition>\n    <rdfs:domain rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Person\"/>\n    <rdfs:isDefinedBy rdf:resource=\"http://purl.org/vocab/relationship/\"/>\n  </rdf:Description>\n\n\n<!-- TAGS -->\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/associatedTag\">\n        <rdfs:comment xml:lang=\"en\">The object is a Tag which plays a role in the subject Tagging.</rdfs:comment>\n        <rdfs:domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tagging\"/>\n        <rdfs:label>associated tag</rdfs:label>\n        <rdfs:range rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <vs:term_status>testing</vs:term_status>\n    </owl:ObjectProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/equivalentTag\">\n        <rdfs:comment xml:lang=\"en\">The two tags are asserted to be equivalent --- that is, that whenever one is associated with a resource, the other tag can be logically inferred to also be associated. Be very careful with this. I'm not sure if this should be a subproperty of owl:sameAs.</rdfs:comment>\n        <rdfs:domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <rdfs:label xml:lang=\"en\">equivalent tag</rdfs:label>\n        <rdfs:range rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2002/07/owl#sameAs\"/>\n        <vs:term_status>testing</vs:term_status>\n    </owl:ObjectProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/isTagOf\">\n        <rdfs:comment xml:lang=\"en\">Indicates that the subject tag applies to the object resource. This does not assert by who, when, or why the tagging occurred. For that information, use a reified Tagging resource.</rdfs:comment>\n        <rdfs:domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <rdfs:label xml:lang=\"en\">is tag of</rdfs:label>\n        <owl:inverseOf rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedWithTag\"/>\n    </owl:ObjectProperty>\n\n    <owl:DatatypeProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/name\">\n        <rdfs:comment xml:lang=\"en\">The name of a tag. Note that we can't relate this to skos:prefLabel because we cannot guarantee that tags have unique labels in a given conceptual scheme. Or can we?</rdfs:comment>\n        <rdfs:domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <rdfs:label xml:lang=\"en\">tag name</rdfs:label>\n        <rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/title\"/>\n        <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\"/>\n    </owl:DatatypeProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/relatedTag\">\n        <rdfs:comment xml:lang=\"en\">The two tags are asserted as being related. This might be symmetric, but it certainly isn't transitive.</rdfs:comment>\n        <rdfs:domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <rdfs:label xml:lang=\"en\">related tag</rdfs:label>\n        <rdfs:range rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2004/02/skos/core#semanticRelation\"/>\n        <vs:term_status>testing</vs:term_status>\n    </owl:ObjectProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/tag\">\n        <rdfs:comment xml:lang=\"en\">The relationship between a resource and a Tagging. Note, of course, that this allows us to tag tags and taggings themselves...</rdfs:comment>\n        <rdfs:label xml:lang=\"en\">tag</rdfs:label>\n        <rdfs:range rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tagging\"/>\n    </owl:ObjectProperty>\n\n    <owl:DatatypeProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/tagName\">\n        <rdfs:comment xml:lang=\"en\">The name of a tag. Note that we can't relate this to skos:prefLabel because we cannot guarantee that tags have unique labels in a given conceptual scheme. Or can we? DEPRECATED 2005-05-19: redundant 'tag'.</rdfs:comment>\n        <rdfs:domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <rdfs:label xml:lang=\"en\">tag name</rdfs:label>\n        <rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/title\"/>\n        <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\"/>\n    </owl:DatatypeProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedBy\">\n        <rdfs:comment xml:lang=\"en\">The object plays the role of the tagger in the subject Tagging.</rdfs:comment>\n        <rdfs:domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tagging\"/>\n        <rdfs:label xml:lang=\"en\">tagged by</rdfs:label>\n        <rdfs:range rdf:resource=\"http://xmlns.com/foaf/0.1/Agent\"/>\n        <vs:term_status>testing</vs:term_status>\n    </owl:ObjectProperty>\n\n    <owl:DatatypeProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedOn\">\n        <rdfs:comment xml:lang=\"en\">The subject Tagging occurred at the subject time and date.</rdfs:comment>\n        <rdfs:domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tagging\"/>\n        <rdfs:label xml:lang=\"en\">tagged on</rdfs:label>\n        <rdfs:subPropertyOf rdf:resource=\"http://purl.org/dc/elements/1.1/date\"/>\n        <vs:term_status>testing</vs:term_status>\n    </owl:DatatypeProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedResource\">\n        <rdfs:comment xml:lang=\"en\">The object is a resource which plays a role in the subject Tagging.</rdfs:comment>\n        <rdfs:domain rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tagging\"/>\n        <rdfs:label xml:lang=\"en\">tagged resource</rdfs:label>\n        <vs:term_status>testing</vs:term_status>\n    </owl:ObjectProperty>\n\n    <owl:ObjectProperty rdf:about=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedWithTag\">\n        <rdfs:comment xml:lang=\"en\">Indicates that the subject has been tagged with the object tag. This does not assert by who, when, or why the tagging occurred. For that information, use a reified Tagging resource.</rdfs:comment>\n        <rdfs:label xml:lang=\"en\">tagged with tag</rdfs:label>\n        <rdfs:range rdf:resource=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tag\"/>\n        <rdfs:subPropertyOf rdf:resource=\"http://www.w3.org/2004/02/skos/core#subject\"/>\n    </owl:ObjectProperty>\n\n\n\n\n    <owl:DatatypeProperty rdf:about=\"http://ns.ontowiki.net/SysOnt/order\" rdfs:label=\"order\">\n      <rdf:type rdf:resource=\"&owl;FunctionalProperty\"/>\n      <rdfs:domain rdf:resource=\"&owl;Thing\"/>\n      <rdfs:range rdf:resource=\"&xsd;nonNegativeInteger\"/>\n    </owl:DatatypeProperty>\n\n</rdf:RDF>\n\n\n"
  },
  {
    "path": "application/config/application.ini",
    "content": ";;\n; Zend application setup file\n;\n; Do not edit this file by hand unless you know what you are doing!\n;;\n\n[default]\n\n; Bootstrap config\nbootstrap.path = APPLICATION_PATH \"Bootstrap.php\"\nbootstrap.class = \"Bootstrap\"\nbootstrap.sessionVars[] = selectedResource\nbootstrap.sessionVars[] = selectedModel\nbootstrap.sessionVars[] = selectedClass \nbootstrap.sessionVars[] = authResult \nbootstrap.sessionVars[] = lastRoute \nbootstrap.sessionVars[] = errorState\nbootstrap.sessionVars[] = lastList\nbootstrap.sessionVars[] = managedLists\n\n; Resources\n; resources.frontController.controllerDirectory = APPLICATION_PATH \"controllers\"\n\n; Autoloader config\nincludePaths.libraries = ONTOWIKI_ROOT \"libraries\"\nincludePaths.classes = APPLICATION_PATH \"classes\"\nautoloaderNamespaces.ontoWiki = \"OntoWiki_\"\nautoloaderNamespaces.erfurt = \"Erfurt_\"\n\n[unit_testing : default]\nbootstrap.path = APPLICATION_PATH \"classes/OntoWiki/Test/UnitTestBootstrap.php\"\nbootstrap.class = \"OntoWiki_Test_UnitTestBootstrap\"\n\n[integration_testing : default]\nbootstrap.path = APPLICATION_PATH \"classes/OntoWiki/Test/IntegrationTestBootstrap.php\"\nbootstrap.class = \"OntoWiki_Test_IntegrationTestBootstrap\"\n\n[extension_unit_testing : default]\nbootstrap.path = APPLICATION_PATH \"classes/OntoWiki/Test/ExtensionUnitTestBootstrap.php\"\nbootstrap.class = \"OntoWiki_Test_ExtensionUnitTestBootstrap\"\n\n"
  },
  {
    "path": "application/config/default.ini",
    "content": ";;\n; OntoWiki main config file\n;\n; Host-specific options can be found in\n; config.ini.\n;\n; @package    application\n; @subpackage config\n; @copyright  Copyright (c) 2008, {@link http://aksw.org AKSW}\n; @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n;;\n\n[default]\n\nsysbase.model = \"http://ns.ontowiki.net/SysBase/\"\nsysbase.path  = \"application/config/SysBase.rdf\"\n\nsysont.properties.hiddenImports = \"http://ns.ontowiki.net/SysOnt/hiddenImports\"\nsysont.properties.hidden        = \"http://ns.ontowiki.net/SysOnt/hidden\"\nsysont.properties.isLarge       = \"http://ns.ontowiki.net/SysOnt/isLarge\"\n\n\n;;\n; Main title prefix (head)\n;;\ntitle.prefix = \"OntoWiki\"\n\n;;\n; Main title separator (OntoWiki <sep> Class <sep> Instance)\n;;\ntitle.separator = \" — \"\n\n;; Option for specifying the RSS/Atom feed loaded in the OntoWiki index actions \"News\" module\n;; set to \"false\" to completely disable the feed\nnews.feedUrl = \"http://blog.aksw.org/feed/?cat=5&client={{version.label}}&version={{version.number}}&suffix={{version.suffix}}\"\n\n;;\n; Title Helper Configuration\n; Properties to be searched for values with a human-readable\n; string that represents a resource. The third part of the key has no\n; meaning, just make sure to use a unique string. Numbers can cause your\n; title properties to be overwritten when configs are merged.\n;;\n\n;; these are more important than rdfs:label\ntitleHelper.properties.skosPlabel  = \"http://www.w3.org/2004/02/skos/core#prefLabel\"\ntitleHelper.properties.dcTitle     = \"http://purl.org/dc/elements/1.1/title\"\ntitleHelper.properties.dcTitle2    = \"http://purl.org/dc/terms/title\"\ntitleHelper.properties.swrcTitle   = \"http://swrc.ontoware.org/ontology#title\"\ntitleHelper.properties.foafName    = \"http://xmlns.com/foaf/0.1/name\"\ntitleHelper.properties.doapName    = \"http://usefulinc.com/ns/doap#name\"\ntitleHelper.properties.siocName    = \"http://rdfs.org/sioc/ns#name\"\ntitleHelper.properties.tagName     = \"http://www.holygoat.co.uk/owl/redwood/0.1/tags/name\"\ntitleHelper.properties.lgeodName   = \"http://linkedgeodata.org/vocabulary#name\"\ntitleHelper.properties.geoName     = \"http://www.geonames.org/ontology#name\"\ntitleHelper.properties.goName      = \"http://www.geneontology.org/dtds/go.dtd#name\"\n\ntitleHelper.properties.rdfsLabel   = \"http://www.w3.org/2000/01/rdf-schema#label\"\n\n;; these are less important than rdfs:label ...\ntitleHelper.properties.accountName = \"http://xmlns.com/foaf/0.1/accountName\"\ntitleHelper.properties.foafNick    = \"http://xmlns.com/foaf/0.1/nick\"\ntitleHelper.properties.foafSurname = \"http://xmlns.com/foaf/0.1/surname\"\ntitleHelper.properties.skosAlabel  = \"http://www.w3.org/2004/02/skos/core#altLabel\"\n\n;;\n; Determines whether Title Helper prefers the property or the language\n; when searching for title values.\n;\n; Possible values are \"property\" and \"language\"\n;\n; In property mode, the first value of a title property as defined in\n; titleHelper.properties.* is used.\n; In language mode, title helper searches through all title properties\n; until it finds the best possible match to the requested language.\n;;\ntitleHelper.searchMode = \"language\"\n\n\n;;\n; Always fall back to the local part of the URI for unknown resources.\n;;\ntitleHelper.useLocalNames = true\n\n\n;;\n; Model Info description properties (maybe later a description helper?)\n; Current usage is only /model/info/\n;;\ndescriptionHelper.properties.rdfsComment = \"http://www.w3.org/2000/01/rdf-schema#comment\"\ndescriptionHelper.properties.dcDesc1 = \"http://purl.org/dc/terms/description\"\ndescriptionHelper.properties.dcDesc2 = \"http://purl.org/dc/elements/1.1/description\"\ndescriptionHelper.properties.skosNote = \"http://www.w3.org/2004/02/skos/core#note\"\ndescriptionHelper.properties.skosEditorialNote = \"http://www.w3.org/2004/02/skos/core#editorialNote\"\n\n;;\n; AC settings\n;;\n;ac.deactivateRegistration = true\n\n;;\n; List settings\n;;\nlists.showTypeColumnByDefault = \"true\"\n\n;;\n; Version info\n;;\nversion.label  = \"OntoWiki\"\nversion.number = \"1.0.0\"\nversion.suffix = \"\"\n\n;;\n; Help Menu URLs\n;;\nhelp.documentation = \"http://docs.ontowiki.net\"\nhelp.issues = \"https://github.com/AKSW/OntoWiki/issues\"\nhelp.versioninfo = \"https://raw.github.com/AKSW/OntoWiki/master/debian/changelog\"\n\n\n;;\n; Zend routes for built-in controllers\n; Routes are applied in reverse order, so most specific routes should go last.\n;;\n; routes.linkeddata.route               = \"*\"\n; routes.linkeddata.defaults.controller = \"ttt\"\n; routes.linkeddata.defaults.action     = \"ttt\"\nroutes.default.route                  = \":controller/:action/*\"\nroutes.default.defaults.action        = \"index\"\nroutes.empty.route                    = \"\"\nroutes.empty.defaults.controller      = \"index\"\nroutes.empty.defaults.action          = \"index\"\nroutes.properties.route               = \"view/*\"\nroutes.properties.defaults.controller = \"resource\"\nroutes.properties.defaults.action     = \"properties\"\nroutes.instances.route                = \"list/*\"\nroutes.instances.defaults.controller  = \"resource\"\nroutes.instances.defaults.action      = \"instances\"\nroutes.data.route                     = \"data/*\"\nroutes.data.defaults.controller       = \"resource\"\nroutes.data.defaults.action           = \"export\"\nroutes.sparql.route                   = \"sparql/*\"\nroutes.sparql.defaults.controller     = \"service\"\nroutes.sparql.defaults.action         = \"sparql\"\nroutes.update.route                   = \"update/*\"\nroutes.update.defaults.controller     = \"service\"\nroutes.update.defaults.action         = \"update\"\nroutes.search.route                   = \"search/*\"\nroutes.search.defaults.controller     = \"application\"\nroutes.search.defaults.action         = \"search\"\n\n;routes.showsitemap.route               = \"sitemap.xml\"\n;routes.showsitemap.defaults.controller = \"semanticsitemap\"\n;routes.showsitemap.defaults.action     = \"sitemap\"\n\n; Default route name\nroute.default.name = 'properties'\n\n; Default index action if called action wasn't found\nindex.default.controller = \"index\"\nindex.default.action = \"news\"\n\n;;\n; HTML page encoding\n;;\nencoding = \"utf-8\"\n\n\n;;\n; Path for external libraries\n;;\nlibraries.path = \"libraries\"\n\n\n;;\n; Default theme and themes folder\n;;\nthemes.default = \"silverblue\"\nthemes.path    = \"extensions/themes\"\n\n\n;;\n; Extension directories\n;;\nextensions.base   = \"extensions/\"\nextensions.legacy = \"plugins/legacy/\"\nextensions.core[] = \"application\"\nextensions.core[] = \"account\"\nextensions.core[] = \"exconf\"\n\n\n;;\n; language options\n;;\nlanguages.locale = en\nlanguages.path   = \"translations\"\ncache.translation = on\n\n;;\n; RDFa widget configuration\n;;\nupdate.endpoint = \"endpoint\"\n\n\n;;\n; Zend_Cache options\n;;\ncache.path        = \"cache\"\ncache.modules     = off\n\n\n;;\n; Set this identifier to a unique value if you want to run multiple OntoWiki\n; installations on one server\n;;\n;session.identifier = \"abc123\"\n\n\n;;\n; Disables certain inference features that make OntoWiki slow when used\n; with large models (> 100.000 triples)\n;;\nsystem.inference = true\n\n\n;;\n; Web service configuration\n;;\nservice.auth.allowGet = false\n\n\n; Enables logging up to a certain level. The specified logs folder needs to\n; be writable. To disable logging at all set this option to false. If the\n; debug option is set to true logging is enabled (7) automatically.\n;\n; The following log levels are supported:\n;\n;   0: Emergency     - System is unusable\n;   1: Alert         - Action must be taken immediately\n;   2: Critical      - Critical conditions\n;   3: Error         - Error conditions\n;   4: Warning       - Warning conditions\n;   5: Notice        - Normal but significant condition\n;   6: Informational - Informational messages\n;   7: Debug         - Debug messages\n;\nlog.enabled = true\nlog.level = 4\nlog.path  = \"logs\"\n\n;;\n; Debug mode. Enables Debug outputs and logging\n;;\n; debug = true\n\n\n;;\n; Database setup. Please adjust these settings in\n; config.ini.\n;;\n; store.backend         = zenddb\n; store.schema          = rap\n;\n; store.zenddb.adapter  = mysqli\n; store.zenddb.host     = localhost\n; store.zenddb.username = owuser\n; store.zenddb.password = owpass\n; store.zenddb.dbname   = ontowiki\n;;\n\n\n;;\n; Some Erfurt Config Options\n;;\n\n;; Versioning switch\nversioning = true\n\n;; Erfurt Query Cache\ncache.query.enable = false\n;; logging is not recommended (performance)\n;cache.query.logging = 0\n;; only database caching at the moment\ncache.query.type = database\n\n;; Erfurt Object Cache\ncache.enable            = false                    ; clear the cache if you switch from 0 to 1!\ncache.type             = database              ; database, sqllite\n\n\n;; Options for cache frontend\ncache.frontend.enable\t\t\t\t\t\t\t\t= false\ncache.frontend.lifetime\t\t\t\t\t\t\t\t= 0\n;cache.frontend.logging\t\t\t\t\t\t\t\t= false\n;cache.frontend.write_control\t\t\t\t\t\t= true\n;cache.frontend.automatic_cleaning_factor\t\t\t= 10\n;cache.frontend.ignore_user_abort\t\t\t\t\t= false\ncache.frontend.cache_id_prefix\t\t\t\t\t\t= 'OW_'\n\n;; Cache backend options\n;; Available: file | memcached | database | sqlite | apc\n;; Recommended: memcached | file\ncache.backend.type\t\t\t\t\t\t\t\t\t= \"file\"\n\n;; Options for file cache backend\ncache.backend.file.cache_dir\t\t\t\t\t\t= \"./cache/\"\ncache.backend.file.file_locking\t\t\t\t\t\t= NULL\n\n;; Options for memcached cache backend\n;cache.backend.memcached.compression\t\t\t\t\t= false\n;cache.backend.memcached.compatibility\t\t\t\t= false\n;; You can define several servers: copy block, below and increase number and configure properly\ncache.backend.memcached.servers.0.host\t\t\t\t= \"localhost\"\n;cache.backend.memcached.servers.0.port\t\t\t\t= 11211\n;cache.backend.memcached.servers.0.persistent\t\t= true\n;cache.backend.memcached.servers.0.weight\t\t\t= 1\n;cache.backend.memcached.servers.0.timeout\t\t\t= 5\n;cache.backend.memcached.servers.0.retry_interval\t= 15\n;cache.backend.memcached.servers.0.status\t\t\t= 15\n\n;; Options for sqlite cache backend\ncache.backend.sqlite.cache_db_complete_path\t\t\t= \"/tmp/ow_cache.sqlite\"\n;cache.backend.sqlite.automatic_vacuum_factor\t\t= 10\n\n;; Options for worker\nworker.enable  = false\nworker.backend = \"Gearman\"\nworker.servers = \"localhost:4730\"\n\n;; Virtual host configurations (optional, e.g. when OntoWiki is reachable via multiple domains)\n;vhosts[] = \"http://graph1.ontowiki.de\"\n;vhosts[] = \"http://graph2.ontowiki.de\"\n"
  },
  {
    "path": "application/config/default.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <http://ns.ontowiki.net/Extensions/ontowiki/> .\n\n<> foaf:primaryTopic :ontowiki .\n:ontowiki a doap:Project ;\n  owconfig:privateNamespace <http://ns.ontowiki.net/Extensions/ontowiki/> ;\n  :encoding \"utf-8\" ;\n  :versioning \"true\"^^xsd:boolean ;\n  owconfig:hasModule :Default .\n:Default a owconfig:Module ;\n  rdfs:label \"OntoWiki\" ;\n  rdfs:label \" — \" .\n:ontowiki doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "application/controllers/ApplicationController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki application controller.\n *\n * @category OntoWiki\n * @package  OntoWiki_Controller\n * @author   Norman Heino <norman.heino@gmail.com>\n * @author   Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass ApplicationController extends OntoWiki_Controller_Base\n{\n    /**\n     * Displays OntoWiki's about page\n     */\n    public function aboutAction()\n    {\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        $this->view->placeholder('main.window.title')\n            ->set('About ' . $this->_config->version->label);\n\n        $version = $this->_config->version->number;\n        if (isset($this->_config->version->suffix)) {\n            $version .= ' ' . $this->_config->version->suffix;\n        }\n\n        if (is_writable($this->_config->cache->path)) {\n            $cacheWritable = ' <span style=\"color:#aea\">(writable)</span>';\n        } else {\n            $cacheWritable = ' <span style=\"color:#eaa\">(not writable!)</span>';\n        }\n\n        if (is_writable($this->_config->log->path)) {\n            $logWritable = ' <span style=\"color:#aea\">(writable)</span>';\n        } else {\n            $logWritable = ' <span style=\"color:#eaa\">(not writable!)</span>';\n        }\n\n        $cacheBackend         = $this->_config->cache->backend->type;\n        $cacheBackendOptions  = array();\n        $cacheFrontendOptions = array();\n        foreach ($this->_config->cache->frontend->toArray() as $key => $value) {\n            $cacheFrontendOptions[] = $key.\": \".(string)$value;\n        }\n        if (isset($this->_config->cache->backend->$cacheBackend)) {\n            foreach ($this->_config->cache->backend->$cacheBackend->toArray() as $key => $value) {\n                $cacheBackendOptions[] = $key.\": \".(string)$value;\n            }\n        }\n        $cacheFrontendOptions = join(\", \", $cacheFrontendOptions);\n        $cacheBackendOptions  = join(\", \", $cacheBackendOptions);\n\n        $data = array(\n            'System'         => array(\n                'Release'     => $version,\n                'PHP Version' => phpversion(),\n                'Backend'     => $this->_owApp->erfurt->getStore()->getBackendName(),\n                'Debug Mode'  => defined('_OWDEBUG') ? 'enabled' : 'disabled'\n            ),\n            'User Interface' => array(\n                'Theme'    => rtrim($this->_config->themes->default, '/'),\n                'Language' => $this->_config->languages->locale,\n            ),\n            'Paths'          => array(\n                'Extensions Path'     => _OWROOT . rtrim($this->_config->extensions->base, '/'),\n                'Translations Path'   => _OWROOT . rtrim($this->_config->languages->path, '/'),\n                'Themes Path'         => _OWROOT . rtrim($this->_config->themes->path, '/'),\n                'Temporary Directory' => Erfurt_App::getInstance()->getTmpDir()\n            ),\n            'Cache'          => array(\n                'State'               => $this->_config->cache->frontend->enable ? 'enabled' : 'disabled',\n                'Frontend Options'    => $cacheFrontendOptions,\n                'Backend'             => $cacheBackend,\n                'Backend Options'     => $cacheBackendOptions,\n//                'Path'                => rtrim($this->_config->cache->path, '/') . $cacheWritable,\n                'Module Caching'      => ((bool)$this->_config->cache->modules == true) ? 'enabled' : 'disabled',\n                'Translation Caching' => ((bool)$this->_config->cache->translation == true) ? 'enabled' : 'disabled'\n            ),\n            'Logging'        => array(\n                'Path'  => rtrim($this->_config->log->path, '/') . $logWritable,\n                'Status' => (bool)$this->_config->log->enabled ? 'enabled' : 'disabled',\n                'Level' => (int)$this->_config->log->level\n            )\n        );\n\n        // check if the git comand exists and ontowiki is a working directory\n        if (file_exists('.git') && substr(@exec('git --version'), 0, 11) == 'git version') {\n            $data['Git Versioning'] = array(\n                'Version'     => @exec('git describe'),\n                'Branch'      => @exec('git rev-parse --abbrev-ref HEAD'),\n                'last commit' => @exec(\"git log --pretty=format:'%ar' -n 1\")\n            );\n        }\n\n        $this->view->data = $data;\n    }\n\n    /**\n     * Authenticates with Erfurt using the provided credentials.\n     */\n    public function loginAction()\n    {\n        $erfurt = $this->_owApp->erfurt;\n        $post   = $this->_request->getPost();\n\n        $this->_helper->layout()->disableLayout();\n        $this->_helper->viewRenderer->setNoRender();\n\n        // If remember option is on make session persistent\n        if (!empty($post['login-save']) && $post['login-save'] == 'on') {\n            // Make session persistent (for about 23 years)\n            Zend_Session::rememberMe(726364800);\n        }\n\n        $loginType = $post['logintype'];\n        // lokaler Login\n        if ($loginType === 'locallogin') {\n            $username   = $post['username'];\n            $password   = $post['password'];\n            $authResult = $erfurt->authenticate($username, $password);\n        } else {\n            if ($loginType === 'openidlogin') {\n                // OpenID\n                $username    = $post['openid_url'];\n                $redirectUrl = $post['redirect-uri'];\n                $verifyUrl   = $this->_config->urlBase . 'application/verifyopenid';\n                $authResult  = $erfurt->authenticateWithOpenId($username, $verifyUrl, $redirectUrl);\n            } else {\n                if ($loginType === 'webidlogin') {\n                    // FOAF+SSL\n                    $redirectUrl = $this->_config->urlBase . 'application/loginfoafssl';\n                    $authResult  = $erfurt->authenticateWithFoafSsl(null, $redirectUrl);\n                } else {\n                    // Not supported...\n                    return;\n                }\n            }\n        }\n\n        // reload selected model w/ new privileges\n        if ($this->_owApp->selectedModel instanceof Erfurt_Rdf_Model) {\n            $this->_owApp->selectedModel = $erfurt->getStore()->getModel((string)$this->_owApp->selectedModel);\n        }\n\n        $this->_owApp->authResult = $authResult->getMessages();\n    }\n\n    public function verifyopenidAction()\n    {\n        $erfurt = $this->_owApp->erfurt;\n        $get    = $this->_request->getQuery();\n\n        $authResult = $erfurt->verifyOpenIdResult($get);\n\n        $this->_owApp->authResult = $authResult->getMessages();\n\n        if (isset($get['ow_redirect_url'])) {\n            $this->_redirect(urldecode($get['ow_redirect_url']), array('prependBase' => false));\n        } else {\n            $this->_redirect($this->_config->urlBase, array('prependBase' => false));\n        }\n    }\n\n    public function loginfoafsslAction()\n    {\n        $erfurt = $this->_owApp->erfurt;\n        $get    = $this->_request->getQuery();\n\n        $authResult               = $erfurt->authenticateWithFoafSsl($get);\n        $this->_owApp->authResult = $authResult->getMessages();\n\n        $this->_redirect($this->_config->urlBase, array('prependBase' => false));\n    }\n\n    /**\n     * Destroys auth credentials and logs the current agent out.\n     */\n    public function logoutAction()\n    {\n        // destroy auth\n        Erfurt_Auth::getInstance()->clearIdentity();\n        // destroy any selections user has made\n        Zend_Session::destroy(true);\n\n        $this->_redirect($this->_config->urlBase);\n    }\n\n    /**\n     * Registers a new user\n     */\n    public function registerAction()\n    {\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        //check if the Register Action is allowed\n        if (isset($this->_owApp->config->ac)\n            && ((boolean)$this->_owApp->config->ac->deactivateRegistration === true)\n        ) {\n            $this->_helper->viewRenderer->setNoRender();\n            $this->view->placeholder('main.window.title')->set('Register User');\n            $message = 'The registration is deactivated, please consult an Admin about this.';\n            $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n            return;\n        }\n        $this->_helper->viewRenderer->setScriptAction('register');\n\n        $this->view->placeholder('main.window.title')->set('Register User');\n\n        $this->view->formActionUrl = $this->_config->urlBase . 'application/register';\n        $this->view->formMethod    = 'post';\n        $this->view->formClass     = 'simple-input input-justify-left';\n        $this->view->formName      = 'registeruser';\n        $this->view->username      = '';\n        $this->view->readonly      = '';\n        $this->view->email         = '';\n\n        $toolbar = $this->_owApp->toolbar;\n        $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Register User'))\n            ->appendButton(OntoWiki_Toolbar::RESET, array('name' => 'Reset Form'));\n        $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n        $post = $this->_request->getPost();\n\n        $this->_owApp->appendMessage(\n            new OntoWiki_Message(\n                'Already own an <span class=\"openid\">OpenID?</span> <a href=\"' . $this->_config->urlBase .\n                'application/openidreg\">Register here</a>',\n                OntoWiki_Message::INFO,\n                array('escape' => false, 'translate' => false)\n            )\n        );\n\n        $contentType = $this->_request->getHeader('Content-Type');\n        if (strstr($contentType, 'application/json')) {\n            $rawBody     = $this->_request->getRawBody();\n            echo $rawBody;\n            $post = Zend_Json::decode($rawBody);\n        }\n\n        if ($post) {\n            /* status var in order to fire corresponding events */\n            $registrationError = true;\n            $registeredUsernames      = array();\n            $registeredEmailAddresses = array();\n\n            foreach ($this->_erfurt->getUsers() as $userUri => $userArray) {\n                if (array_key_exists('userName', $userArray)) {\n                    $registeredUsernames[] = $userArray['userName'];\n                }\n\n                if (array_key_exists('userEmail', $userArray)) {\n                    $registeredEmailAddresses[] = str_replace('mailto:', '', $userArray['userEmail']);\n                }\n            }\n\n            $email                = $post['email'];\n            $this->view->email    = $email;\n            $username             = $post['username'];\n            $this->view->username = $username;\n            $password             = $post['password'];\n            $passwordTwo          = $post['password2'];\n\n            $emailValidator = new Zend_Validate_EmailAddress();\n\n            if (!$this->_erfurt->isActionAllowed('RegisterNewUser')\n                || !($actionConfig = $this->_erfurt->getActionConfig('RegisterNewUser'))\n            ) {\n                $message = 'Action not permitted for the current user.';\n                $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n\n            } else if (trim($email) == '') {\n                $message = 'Email address must not be empty.';\n                $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n\n            } else if (in_array($email, $registeredEmailAddresses)) {\n                $message = 'Email address is already registered.';\n                $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n            } else {\n                if (isset($actionConfig['mailvalidation'])\n                    && $actionConfig['mailvalidation'] == 'yes'\n                    && !$emailValidator->isValid($email)\n                ) {\n                    $message = 'Email address validation failed.';\n                    $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n                } else {\n                    if (in_array($username, $registeredUsernames)\n                        || ($username == $this->_owApp->erfurt->getStore()->getDbUser())\n                    ) {\n                        $message = 'Username already registered.';\n                        $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n                    } else {\n                        if (isset($actionConfig['uidregexp'])\n                            && !preg_match($actionConfig['uidregexp'], $username)\n                        ) {\n                            $message = 'Username contains illegal characters.';\n                            $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n                        } else {\n                            if ($password !== $passwordTwo) {\n                                $message = 'Passwords do not match.';\n                                $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n                            } else {\n                                if (strlen($password) < 5) {\n                                    $message = 'Password needs at least 5 characters.';\n                                    $this->_owApp->appendMessage(\n                                        new OntoWiki_Message($message, OntoWiki_Message::ERROR)\n                                    );\n                                } else {\n                                    if (isset($actionConfig['passregexp'])\n                                        && $actionConfig['passregexp'] != ''\n                                        && !@preg_match($actionConfig['passregexp'], $password)\n                                    ) {\n                                        $message\n                                            = 'Password does not match regular expression set in system configuration';\n                                        $this->_owApp->appendMessage(\n                                            new OntoWiki_Message($message, OntoWiki_Message::ERROR)\n                                        );\n                                    } else {\n                                        // give default group?\n                                        if (isset($actionConfig['defaultGroup'])) {\n                                            $group = $actionConfig['defaultGroup'];\n                                        }\n                                        // add new user\n                                        if ($this->_erfurt->addUser($username, $password, $email, $group)) {\n                                            $message = 'The user \"' . $username . '\" has been successfully registered.';\n                                            $this->_owApp->appendMessage(\n                                                new OntoWiki_Message($message, OntoWiki_Message::SUCCESS)\n                                            );\n                                            $registrationError = false;\n                                        } else {\n                                            $message = 'A registration error occured. Please refer to the log entries.';\n                                            $this->_owApp->appendMessage(\n                                                new OntoWiki_Message($message, OntoWiki_Message::ERROR)\n                                            );\n                                        }\n                                    }\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n\n            /*\n             * fire events for success and error\n             */\n            if ($registrationError === false) {\n                $event           = new Erfurt_Event('onRegisterUser');\n                $event->username = $username;\n                $event->response = $this->_response;\n                $event->trigger();\n            } else {\n                $event           = new Erfurt_Event('onRegisterUserFailed');\n                $event->username = $username;\n                $event->message = $message;\n                $event->response = $this->_response;\n                $event->trigger();\n            }\n        }\n    }\n\n    /**\n     * Registers a new user with a given OpenID.\n     */\n    public function openidregAction()\n    {\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        //check if the Register Action is allowed\n        if (isset($this->_owApp->config->ac)\n            && ((boolean)$this->_owApp->config->ac->deactivateRegistration === true)\n        ) {\n            $this->_helper->viewRenderer->setNoRender();\n            $this->view->placeholder('main.window.title')->set('Register User');\n            $message = 'The registration is deactivated, please consult an Admin about this.';\n            $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n            return;\n        }\n        // We render a template, that is also used for preferences.\n        $this->_helper->viewRenderer->setScriptAction('openid');\n\n        $this->view->placeholder('main.window.title')->set('Register User with OpenID');\n        $this->view->formActionUrl = $this->_config->urlBase . 'application/openidreg';\n        $this->view->formMethod    = 'post';\n        $this->view->formClass     = 'simple-input input-justify-left';\n        $this->view->formName      = 'registeruser';\n\n        // Fetch POST and GET of the request. One of them or both will be empty.\n        $post = $this->_request->getPost();\n        $get  = $this->_request->getQuery();\n\n        if (!empty($post)) {\n            // Step 1: User entered data and clicked on 'Check OpenID'\n            if ((int)$post['step'] === 1) {\n                $openId = $post['openid_url'];\n                $label  = $post['label'];\n                $email  = $post['email'];\n\n                $emailValidator = new Zend_Validate_EmailAddress();\n\n                // Is register action allowed for current user?\n                if (!$this->_erfurt->isActionAllowed('RegisterNewUser')\n                    || !($actionConfig = $this->_erfurt->getActionConfig('RegisterNewUser'))\n                ) {\n\n                    $message = 'Action not permitted for the current user.';\n                    $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n                } else if (empty($openId)) {\n                    // openid_url field must not be empty\n                    $message = 'No OpenID was entered.';\n                    $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n                } else if (array_key_exists($openId, $this->_erfurt->getUsers())) {\n                    // Does user already exist?\n                    $message = 'A user with the given OpenID is already registered.';\n                    $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n                } else if (!empty($email)\n                    && isset($actionConfig['mailvalidation'])\n                    && $actionConfig['mailvalidation'] === 'yes'\n                    && !$emailValidator->isValid($email)\n                ) {\n                    // If an (optional) email address is given, check whether it is valid.\n\n                    $message = 'Email address validation failed.';\n                    $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n                } else {\n                    // Everything seems to be OK... Check the OpenID (redirect to the provider).\n                    // We want to verify the OpenID auth response in this action.\n                    $verifyUrl = $this->_config->urlBase . 'application/openidreg';\n\n                    // If label and/or email are given, put them at the end of the request url, for\n                    // we need them later.\n                    if (!empty($label) && !empty($email)) {\n                        $verifyUrl .= '?label=' . urlencode($label) . '&email=' . urlencode($email);\n                    } else if (!empty($label)) {\n                        $verifyUrl .= '?label=' . urlencode($label);\n                    } else if (!empty($email)) {\n                        $verifyUrl .= '?email=' . urlencode($email);\n                    }\n\n                    $sReg = new Zend_OpenId_Extension_Sreg(\n                        array(\n                             'nickname' => false,\n                             'email'    => false),\n                        null,\n                        1.1\n                    );\n\n                    $adapter = new Erfurt_Auth_Adapter_OpenId($openId, $verifyUrl, null, null, $sReg);\n                    // We use the adapter directly, for we do not store the identity in session.\n                    $result = $adapter->authenticate();\n\n                    // If we reach this point, something went wrong\n                    $message = 'OpenID check failed.';\n                    $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n                }\n\n                // If we reach this section, something went wrong, so we reset the form and show the message.\n                $this->view->openid   = '';\n                $this->view->readonly = '';\n                $this->view->email    = '';\n                $this->view->label    = '';\n                $this->view->step     = 1;\n\n                $toolbar = $this->_owApp->toolbar;\n                $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Check OpenID'))\n                    ->appendButton(OntoWiki_Toolbar::RESET, array('name' => 'Reset Form'));\n                $this->view->placeholder('main.window.toolbar')->set($toolbar);\n            } else if ((int)$post['step'] === 2) {\n                // Step 2: OpenID was verified and user clicked on register button.\n                $openid = $post['openid_url'];\n                $email  = $post['email'];\n                $label  = $post['label'];\n\n                // Give user default group?\n                $actionConfig = $this->_erfurt->getActionConfig('RegisterNewUser');\n                $group        = null;\n                if (isset($actionConfig['defaultGroup'])) {\n                    $group = $actionConfig['defaultGroup'];\n                }\n                // Add the new user.\n                if ($this->_erfurt->addOpenIdUser($openid, $email, $label, $group)) {\n                    $message = 'The user with the OpenID \"' . $openid . '\" has been successfully registered.';\n                    $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::SUCCESS));\n                } else {\n                    $message = 'A registration error occured. Please refer to the log entries.';\n                    $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n                }\n\n                // Reset the form...\n                $this->view->openid   = '';\n                $this->view->readonly = '';\n                $this->view->email    = '';\n                $this->view->label    = '';\n                $this->view->step     = 1;\n\n                $toolbar = $this->_owApp->toolbar;\n                $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Check OpenID'))\n                    ->appendButton(OntoWiki_Toolbar::RESET, array('name' => 'Reset Form'));\n                $this->view->placeholder('main.window.toolbar')->set($toolbar);\n            }\n        } else if (!empty($get)) {\n            // This is the verify request\n            $sReg = new Zend_OpenId_Extension_Sreg(\n                array(\n                     'nickname' => false,\n                     'email'    => false),\n                null,\n                1.1\n            );\n\n            $adapter = new Erfurt_Auth_Adapter_OpenId(null, null, null, $get, $sReg);\n            // We use the adapter directly, for we do not store the identity in session.\n            $result = $adapter->authenticate();\n\n            if (!$result->isValid()) {\n                // Something went wrong, show a message\n                $message = 'OpenID verification failed.';\n                $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n            }\n\n            $data = $sReg->getProperties();\n\n            // Use the prefilled data from the user (if given) or if not use the data from the provider (if\n            // available).\n            if (isset($get['email'])) {\n                $email = $get['email'];\n            } else if (isset($data['email'])) {\n                $email = $data['email'];\n            } else {\n                $email = '';\n            }\n            if (isset($get['label'])) {\n                $label = $get['label'];\n            } else if (isset($data['nickname'])) {\n                $label = $data['nickname'];\n            } else {\n                $label = '';\n            }\n\n            $this->view->openid   = $get['openid_identity'];\n            $this->view->readonly = 'readonly=\"readonly\"'; // OpenID must not be changed now.\n            $this->view->email    = $email;\n            $this->view->label    = $label;\n            $this->view->step     = 2;\n            $this->view->checked  = true; // We use this to show a green icon for success\n\n            $toolbar = $this->_owApp->toolbar;\n            $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Register User'))\n                ->appendButton(OntoWiki_Toolbar::CANCEL, array('name' => 'Cancel', 'class' => 'openidreg-cancel'));\n            $this->view->placeholder('main.window.toolbar')->set($toolbar);\n        } else {\n            // No post and get data... This is the initial form...\n            $this->view->openid   = '';\n            $this->view->readonly = '';\n            $this->view->email    = '';\n            $this->view->label    = '';\n            $this->view->step     = 1;\n\n            $toolbar = $this->_owApp->toolbar;\n            $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Check OpenID'))\n                ->appendButton(OntoWiki_Toolbar::RESET, array('name' => 'Reset Form'));\n            $this->view->placeholder('main.window.toolbar')->set($toolbar);\n        }\n    }\n\n    public function webidregAction()\n    {\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        //check if the Register Action is allowed\n        if (isset($this->_owApp->config->ac)\n            && ((boolean)$this->_owApp->config->ac->deactivateRegistration === true)\n        ) {\n            $this->_helper->viewRenderer->setNoRender();\n            $this->view->placeholder('main.window.title')->set('Register User');\n            $message = 'The registration is deactivated, please consult an Admin about this.';\n            $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n            return;\n        }\n        // We render a template, that is also used for preferences.\n        $this->_helper->viewRenderer->setScriptAction('webid');\n\n        $this->view->placeholder('main.window.title')->set('Register User with FOAF+SSL');\n        $this->view->formActionUrl = $this->_config->urlBase . 'application/webidreg';\n        $this->view->formMethod    = 'post';\n        $this->view->formClass     = 'simple-input input-justify-left';\n        $this->view->formName      = 'registeruser';\n\n        // Fetch POST and GET of the request. One of them or both will be empty.\n        $post = $this->_request->getPost();\n        $get  = $this->_request->getQuery();\n\n        // Step 1: Fetch the WebID...\n        if (empty($post) && empty($get)) {\n            $redirectUrl = $this->_config->urlBase . 'application/webidreg';\n\n            $adapter = new Erfurt_Auth_Adapter_FoafSsl(null, $redirectUrl);\n            $webId   = $adapter->fetchWebId();\n\n            // We should not reach this point;\n            return;\n        } else if (!empty($get)) {\n            // Step 2: Check the web id and fetch foaf data\n            $get['url'] = $this->_request->getRequestUri();\n\n            $adapter = new Erfurt_Auth_Adapter_FoafSsl();\n\n            try {\n                $valid = $adapter->verifyIdpResult($get);\n\n                if ($valid) {\n                    $webId    = $get['webid'];\n                    $foafData = Erfurt_Auth_Adapter_FoafSsl::getFoafData($webId);\n\n                    if ($foafData !== false) {\n                        // Try to get a mbox and label...\n                        if (isset($foafData[$webId]['http://xmlns.com/foaf/0.1/mbox'])) {\n                            $email = $foafData[$webId]['http://xmlns.com/foaf/0.1/mbox'][0]['value'];\n                        } else {\n                            $email = '';\n                        }\n\n                        if (isset($foafData[$webId][EF_RDFS_LABEL])) {\n                            $label = $foafData[$webId][EF_RDFS_LABEL][0]['value'];\n                        } else {\n                            $label = '';\n                        }\n                    } else {\n                        $email = '';\n                        $label = '';\n                    }\n\n                    $this->view->webid = $webId;\n                    if ($webId != '') {\n                        $this->view->checked = true;\n                    }\n\n                    if (null !== $email) {\n                        $this->view->email = $email;\n                    } else {\n                        $this->view->email = '';\n                    }\n                    if (null !== $label) {\n                        $this->view->label = $label;\n                    } else {\n                        $this->view->label = '';\n                    }\n\n                    $toolbar = $this->_owApp->toolbar;\n                    $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Register'));\n                    $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n                    return;\n                } else {\n                    // TODO Error message\n                    $this->view->webid = '';\n                    $this->view->email = '';\n                    $this->view->label = '';\n\n                    $this->_owApp->appendMessage(\n                        new OntoWiki_Message('No valid certificate found.', OntoWiki_Message::ERROR)\n                    );\n\n                    return;\n                }\n            } catch (Exception $e) {\n                $this->view->webid = '';\n                $this->view->email = '';\n                $this->view->label = '';\n\n                $this->_owApp->appendMessage(\n                    new OntoWiki_Message('Something went wrong: ' . $e->getMessage(), OntoWiki_Message::ERROR)\n                );\n\n                return;\n            }\n        } else if (!empty($post)) {\n            $webId = $post['webid_url'];\n            $label = $post['label'];\n            $email = $post['email'];\n\n            $emailValidator = new Zend_Validate_EmailAddress();\n\n            // Is register action allowed for current user?\n            if (!$this->_erfurt->isActionAllowed('RegisterNewUser')\n                || !($actionConfig = $this->_erfurt->getActionConfig('RegisterNewUser'))\n            ) {\n                $message = 'Action not permitted for the current user.';\n                $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n            } else if (empty($webId)) {\n                // openid_url field must not be empty\n                $message = 'No WebID was entered.';\n                $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n            } else if (array_key_exists($webId, $this->_erfurt->getUsers())) {\n                // Does user already exist?\n                $message = 'A user with the given WebID is already registered.';\n                $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n            } else if (!empty($email)\n                && isset($actionConfig['mailvalidation'])\n                && $actionConfig['mailvalidation'] === 'yes'\n                && !$emailValidator->isValid($email)\n            ) {\n                // If an (optional) email address is given, check whether it is valid.\n                $message = 'Email address validation failed.';\n                $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n            } else {\n                // Everything seems to be OK...\n                $actionConfig = $this->_erfurt->getActionConfig('RegisterNewUser');\n                $group        = null;\n                if (isset($actionConfig['defaultGroup'])) {\n                    $group = $actionConfig['defaultGroup'];\n                }\n                // Add the new user.\n                if ($this->_erfurt->addOpenIdUser($webId, $email, $label, $group)) {\n                    $message = 'The user with the WebID \"' . $webId . '\" has been successfully registered.';\n                    $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::SUCCESS));\n                } else {\n                    $message = 'A registration error occured. Please refer to the log entries.';\n                    $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n                }\n            }\n\n            // If we reach this section, something went wrong, so we reset the form and show the message.\n            $this->view->webid = '';\n            $this->view->email = '';\n            $this->view->label = '';\n        }\n    }\n\n    /**\n     * Edits user preferences\n     */\n    public function preferencesAction()\n    {\n        $this->view->placeholder('main.window.title')->set('User Preferences');\n        $this->addModuleContext('main.window.preferences');\n\n        $user = $this->_owApp->getUser();\n\n        // Anonymous and Db-User have no prefs.\n        if ($user->isAnonymousUser() || $user->isDbUser()) {\n            $this->_redirect($this->_config->urlBase, array('prependBase' => false));\n        }\n\n        $post = $this->_request->getPost();\n        if ($post) {\n            // We catch all exceptions here, for we do not want the user to see ow crash if something unexpected\n            // happens.\n            try {\n                if (isset($post['openid'])) {\n                    $this->_updateOpenIdUser($post);\n                } else {\n                    $this->_updateUser($post);\n                }\n            } catch (Exception $e) {\n                $this->_owApp->appendMessage(\n                    new OntoWiki_Message('Something went wrong: ' . $e->getMessage(), OntoWiki_Message::ERROR)\n                );\n            }\n\n            if (!$this->_owApp->hasMessages()) {\n                $message = 'Changes saved.';\n                $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::SUCCESS));\n            }\n        }\n\n        $this->view->isOpenIdUser = ($user->isOpenId() || $user->isWebId());\n        if ($user->isOpenId() || $user->isWebId()) {\n            $this->view->openid = $user->getUri();\n\n            $usernameReadonly = '';\n        } else {\n            $usernameReadonly = 'readonly=\"readonly\"';\n        }\n\n        $email = $user->getEmail();\n        if (substr($email, 0, 7) === 'mailto:') {\n            $email = substr($email, 7);\n        }\n\n        $username = $user->getUsername();\n\n        $this->view->formActionUrl = $this->_config->urlBase . 'application/preferences';\n        $this->view->formMethod    = 'post';\n        $this->view->formClass     = 'simple-input input-justify-left';\n        $this->view->formName      = 'registeruser';\n        $this->view->username      = $username;\n        $this->view->userReadonly  = $usernameReadonly;\n        $this->view->email         = $email;\n        $this->view->submitText    = 'Save Changes';\n\n        $toolbar = $this->_owApp->toolbar;\n        $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Save Changes', 'id' => 'registeruser'))\n            ->appendButton(OntoWiki_Toolbar::RESET, array('name' => 'Reset Form'));\n        $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n        $this->_helper->viewRenderer->setScriptAction('userdetails');\n    }\n\n    protected function _updateEmailAddress($newEmail)\n    {\n        try {\n            $this->_erfurt->getAuth()->setEmail($newEmail);\n        } catch (Erfurt_Auth_Identity_Exception $e) {\n            $this->_owApp->appendMessage(new OntoWiki_Message($e->getMessage(), OntoWiki_Message::ERROR));\n\n            return false;\n        }\n\n        return true;\n    }\n\n    protected function _updateUsername($newUsername)\n    {\n        try {\n            $this->_erfurt->getAuth()->setUsername($newUsername);\n        } catch (Erfurt_Auth_Identity_Exception $e) {\n            $this->_owApp->appendMessage(new OntoWiki_Message($e->getMessage(), OntoWiki_Message::ERROR));\n\n            return false;\n        }\n\n        return true;\n    }\n\n    protected function _updatePassword($passwordOne, $passwordTwo)\n    {\n        if ($passwordOne !== $passwordTwo) {\n            $message = 'Passwords do not match.';\n            $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n\n            return false;\n        }\n\n        try {\n            $this->_erfurt->getAuth()->getIdentity()->setPassword($passwordOne);\n        } catch (Erfurt_Auth_Identity_Exception $e) {\n            $this->_owApp->appendMessage(new OntoWiki_Message($e->getMessage(), OntoWiki_Message::ERROR));\n\n            return false;\n        }\n\n        return true;\n    }\n\n    protected function _updateOpenIdUser($post)\n    {\n        if ($this->_updateUsername($post['username'])) {\n            if ($this->_updateEmailAddress($post['email'])) {\n                if (isset($post['changepassword']) && $post['changepassword'] === '1') {\n                    return $this->_updatePassword($post['password1'], $post['password2']);\n                } else {\n                    return true;\n                }\n            }\n        }\n\n        return false;\n    }\n\n    protected function _updateUser($post)\n    {\n        if ($this->_updateEmailAddress($post['email'])) {\n            if (isset($post['changepassword']) && $post['changepassword'] === '1') {\n                return $this->_updatePassword($post['password1'], $post['password2']);\n            } else {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Handles search requests\n     */\n    public function searchAction()\n    {\n        $title = $this->_owApp->translate->_('Resource Search');\n        $this->view->placeholder('main.window.title')->set($title);\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n        $store = $this->_erfurt->getStore();\n\n        if (isset($this->_owApp->selectedModel) && null !== $this->_owApp->selectedModel) {\n            $modelUri = $this->_owApp->selectedModel->getModelIri();\n        } else {\n            $modelUri = null;\n        }\n\n        if ($this->_request->getParam('searchtext-input') !== null) {\n            $searchText = trim($this->getParam('searchtext-input'));\n        }\n\n        $error    = false;\n        $errorMsg = '';\n\n        // check if search is already errorenous\n        if (!$error) {\n\n            // try sparql query pre search check (with limit to 1)\n            $elements = $store->getSearchPattern($searchText, $modelUri);\n\n            $query = new Erfurt_Sparql_Query2();\n            $query->addElements($elements);\n            $query->setLimit(1);\n            $query->addFrom($modelUri);\n\n            try {\n\n                $store->sparqlQuery($query);\n\n            } catch (Exception $e) {\n\n                // build error message\n                $this->_owApp->appendMessage(\n                    new OntoWiki_Message(\n                        $this->_owApp->translate->_('search failed'),\n                        OntoWiki_Message::ERROR\n                    )\n                );\n\n                $error = true;\n                $errorMsg .= 'Message details: ';\n                $errorMsg .= str_replace('LIMIT 1', '', $e->getMessage());\n\n            }\n\n        }\n\n        // if error occured set output for error page\n        if ($error) {\n\n            $this->view->errorMsg = $errorMsg;\n\n        } else {\n            // set redirect to effective search controller\n            $url = new OntoWiki_Url(array('controller' => 'list'), array());\n            $url->setParam('s', $searchText);\n            $url->setParam('init', '1');\n            $this->_redirect($url);\n\n        }\n    }\n}\n"
  },
  {
    "path": "application/controllers/DebugController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki debug controller.\n *\n * @category   OntoWiki\n * @package    OntoWiki_Controller\n * @author     Norman Heino <norman.heino@gmail.com>\n */\nclass DebugController extends OntoWiki_Controller_Base\n{\n    /**\n     * Clears the module cache\n     *\n     * @return void\n     */\n    public function clearmodulecacheAction()\n    {\n        $this->view->clearModuleCache();\n\n        $this->_redirect($_SERVER['HTTP_REFERER'], array('code' => 302));\n    }\n\n    /**\n     * Clears the translation cache\n     *\n     * @return void\n     */\n    public function cleartranslationcacheAction()\n    {\n        if (Zend_Translate::hasCache()) {\n            Zend_Translate::clearCache();\n        }\n\n        $this->_redirect($_SERVER['HTTP_REFERER'], array('code' => 302));\n    }\n\n    /**\n     * Destroys the current session\n     *\n     * @return void\n     */\n    public function destroysessionAction()\n    {\n        Zend_Session::destroy(true);\n\n        $this->_redirect($this->_config->urlBase);\n    }\n\n    /**\n     * Destroys complete query cache and object cache\n     *\n     * @return void\n     */\n    public function clearquerycacheAction()\n    {\n        $queryCache            = $this->_erfurt->getQueryCache();\n        $queryCacheReturnValue = $queryCache->cleanUpCache(array('mode' => 'uninstall'));\n\n        $objectCache            = $this->_erfurt->getCache();\n        $objectCacheReturnValue = $objectCache->clean();\n\n        $this->_redirect($_SERVER['HTTP_REFERER'], array('code' => 302));\n\n    }\n}\n"
  },
  {
    "path": "application/controllers/ErrorController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki error controller.\n * Fetched by default through the Zend_Controller_Plugin_ErrorHandler\n *\n * @category   OntoWiki\n * @package    OntoWiki_Controller\n * @author     Norman Heino <norman.heino@gmail.com>\n */\nclass ErrorController extends Zend_Controller_Action\n{\n    /**\n     * OntoWiki Application\n     *\n     * @var OntoWiki\n     */\n    protected $_owApp = null;\n\n    /**\n     * OntoWiki Application config\n     *\n     * @var Zend_Config\n     */\n    protected $_config = null;\n\n    /**\n     * The session store\n     *\n     * @var Zend_Session\n     */\n    protected $_session = null;\n\n    /**\n     * Erfurt App\n     *\n     * @var Erfurt_App\n     */\n    protected $_erfurt = null;\n\n    /**\n     * Constructor\n     */\n    public function init()\n    {\n        // init controller variables\n        $this->_owApp   = OntoWiki::getInstance();\n        $this->_config  = $this->_owApp->config;\n        $this->_session = $this->_owApp->session;\n        $this->_erfurt  = $this->_owApp->erfurt;\n    }\n\n    /**\n     * Default action that is triggered when an error occures\n     * during the dispatch process.\n     */\n    public function errorAction()\n    {\n        if (defined('_OWDEBUG')) {\n            $this->_debugError();\n        } else {\n            $this->_gracefulError();\n        }\n\n        // we provide a complete page\n        $this->_helper->layout()->disableLayout();\n    }\n\n    /*\n     * the debug error output has a stacktrace and other debug information\n     */\n    protected function _debugError()\n    {\n        if ($this->_request->has('error_handler')) {\n            // get errors passed by error handler plug-in\n            $errors    = $this->_getParam('error_handler');\n            $exception = $errors->exception;\n\n            // check error type and send headers accordingly\n            switch ($errors->type) {\n                case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n                case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n                    $this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found');\n                    break;\n                default:\n                    // don't change headers\n            }\n\n            switch (true) {\n                case ($exception instanceof OntoWiki_Http_Exception):\n                    $this->_helper->layout()->disableLayout();\n                    $this->_helper->viewRenderer->setNoRender();\n\n                    $response = $this->getResponse();\n                    $response->setHttpResponseCode($exception->getResponseCode());\n                    $response->setBody($exception->getResponseMessage());\n\n                    return;\n            }\n\n            // exception code determines whether error or info\n            // see erfurt developer documentation\n            if (($exception->getCode() > 0) && ($exception->getCode() < 2000)) {\n                $this->view->heading   = 'OntoWiki Info Notice';\n                $this->view->errorType = 'info';\n                $this->view->code      = $exception->getCode();\n            } else {\n                $this->view->heading   = 'OntoWiki Error';\n                $this->view->errorType = 'error';\n\n                if ($exception->getCode() !== 0) {\n                    $this->view->code = $exception->getCode();\n                }\n\n                $response = $this->getResponse();\n                $response->setHttpResponseCode(500);\n            }\n\n            $errorString = $exception->getMessage();\n\n            $this->view->exceptionType = get_class($exception);\n            $this->view->exceptionFile = $exception->getFile() . '@' . $exception->getLine();\n\n            $stacktrace       = $exception->getTrace();\n            $stacktraceString = '';\n            foreach ($stacktrace as $i => $spec) {\n                $lineStr = '';\n                if (isset($spec['file'])) {\n                    $lineStr = '@' . $spec['file'];\n                    if (isset($spec['line'])) {\n                        $lineStr .= ':' . $spec['line'];\n                    }\n                }\n                $stacktraceString .= '#' . $i . ': ' . (isset($spec['class']) ? $spec['class'] : '') .\n                    (isset($spec['type']) ? $spec['type'] : '') . $spec['function'] .\n                    $lineStr . '<br />';\n\n            }\n\n            $this->view->stacktrace = $stacktraceString;\n        } else {\n            $this->view->heading   = 'OntoWiki Error';\n            $this->view->errorType = 'error';\n\n            $message = current(OntoWiki::getInstance()->drawMessages());\n            if ($message instanceof OntoWiki_Message) {\n                $errorString = $message->getText();\n            } else {\n                // No message, redirect to index page\n                $this->_redirect($this->config->urlBase, array('code' => 302));\n            }\n        }\n\n        $this->view->urlBase   = $this->_config->urlBase;\n        $this->view->errorText = $errorString;\n    }\n\n    /*\n     * the graceful error output tries to be as nice as possible\n     */\n    protected function _gracefulError()\n    {\n        $requestExtra = str_replace(\n            $this->getRequest()->getBaseUrl(),\n            '',\n            $this->getRequest()->getRequestUri()\n        );\n        $requestedUri = OntoWiki::getInstance()->config->urlBase . ltrim($requestExtra, '/');\n\n        $createUrl             = new OntoWiki_Url(array(), array());\n        $createUrl->controller = 'resource';\n        $createUrl->action     = 'new';\n        $createUrl->setParam('r', $requestedUri);\n        $this->view->requestedUrl = (string)$requestedUri;\n        $this->view->createUrl    = (string)$createUrl;\n        $this->view->urlBase      = OntoWiki::getInstance()->config->urlBase;\n\n        $exception     = null;\n        $exceptionType = null;\n        if ($this->_request->has('error_handler')) {\n            // get errors passed by error handler plug-in\n            $errors        = $this->_getParam('error_handler');\n            $exception     = $errors->exception;\n            $exceptionType = get_class($exception);\n            $errorString   = $exception->getMessage();\n            OntoWiki::getInstance()->logger->emerg(\n                $exceptionType . ': ' . $errorString . ' -> ' .\n                $exception->getFile() . '@' . $exception->getLine()\n            );\n        }\n\n        // Zend_Controller_Dispatcher_Exception means invalid controller\n        // -> resource not found\n        if (($this->_request->has('error_handler'))\n            && ($exceptionType != 'Zend_Controller_Dispatcher_Exception')\n        ) {\n            if ((null !== $exception)\n                && (method_exists($exception, 'getResponseCode'))\n                && (null !== $exception->getResponseCode())\n            ) {\n                $this->getResponse()->setHttpResponseCode($exception->getResponseCode());\n                $this->_helper->viewRenderer->setScriptAction('error');\n            } else {\n                $this->getResponse()->setHttpResponseCode(500);\n                $this->_helper->viewRenderer->setScriptAction('500');\n            }\n        } else {\n            $this->getResponse()->setHttpResponseCode(404);\n            $this->_helper->viewRenderer->setScriptAction('404');\n        }\n    }\n}\n"
  },
  {
    "path": "application/controllers/IndexController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki index controller.\n *\n * @category   OntoWiki\n * @package    OntoWiki_Controller\n * @author     Norman Heino <norman.heino@gmail.com>\n */\nclass IndexController extends OntoWiki_Controller_Base\n{\n\n    /**\n     * Timeout for reading the OntoWiki RSS news feed.\n     */\n    const NEWS_FEED_TIMEOUT_IN_SECONDS = 3;\n\n    /**\n     * Displays the OntoWiki news feed short summary (dashboard part)\n     */\n    public function newsshortAction()\n    {\n        // requires zend Feed module\n        // number of news\n        $feedCount = 3;\n        $owFeed = $this->getNews();\n\n        // create new array for data\n        $data = array();\n        // parse feed items into array\n        foreach ($owFeed as $feedItem) {\n            // form temporary array with needed data\n            $description = substr($feedItem->description(), 0, strpos($feedItem->description(), ' ', 40)) . ' [...]';\n            $tempdata = array(\n                'link'        => $feedItem->link(),\n                'title'       => $feedItem->title(),\n                'description' => $description\n            );\n            // append temporary array to data array\n            $data[] = $tempdata;\n\n            // take only needed items\n            if (count($data) == $feedCount) {\n                break;\n            }\n        }\n        // assign data array to view rss data variable\n        $this->view->rssData = $data;\n    }\n\n    /**\n     * Displays messages only without any other content.\n     */\n    public function messagesAction()\n    {\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        $this->view->placeholder('main.window.title')->set('OntoWiki Messages');\n        $this->_helper->viewRenderer->setNoRender();\n    }\n\n    /**\n     * Displays the OntoWiki news feed\n     */\n    public function newsAction()\n    {\n        $this->view->placeholder('main.window.title')->set('News');\n\n        $owFeed = $this->getNews();\n        $this->view->feed = $owFeed;\n        if ($owFeed instanceof Zend_Feed_Abstract) {\n            $this->view->title       = $owFeed->title();\n            $this->view->link        = $owFeed->link();\n            $this->view->description = $owFeed->description();\n        }\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n    }\n\n    /**\n     * Default action if called action wasn't found\n     */\n    public function __call($action, $params)\n    {\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        $this->view->placeholder('main.window.title')->set('Welcome to OntoWiki');\n\n        if ($this->_owApp->hasMessages()) {\n            $this->_forward('messages', 'index');\n        } else {\n            if (!isset($this->_config->index->default->controller)\n                || !isset($this->_config->index->default->action)\n            ) {\n                $this->_forward('news', 'index');\n            } else {\n                $this->_forward($this->_config->index->default->action, $this->_config->index->default->controller);\n            }\n        }\n    }\n\n    /**\n     * This action display simply no main window section and is useful\n     * in combination with index.default.controller and index.default.action\n     */\n    public function emptyAction()\n    {\n        // service controller needs no view renderer\n        $this->_helper->viewRenderer->setNoRender();\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        // sorry for this hack, but I dont wanted to modify the the main layout too much ...\n        $this->view->placeholder('main.window.additionalclasses')->set('hidden');\n    }\n\n    /**\n     * Reads OntoWiki news from the AKSW RSS feed.\n     *\n     * @return array|Zend_Feed_Abstract\n     */\n    public function getNews()\n    {\n        // get current version\n        $version = $this->_config->version;\n        // try reading\n        try {\n            if (isset($this->_config->news) && isset($this->_config->news->feedUrl)) {\n                $url = $this->_config->news->feedUrl;\n            } else {\n                $url = 'http://blog.aksw.org/feed/?cat=5&client='\n                    . urlencode($version->label)\n                    . '&version='\n                    . urlencode($version->number)\n                    . '&suffix='\n                    . urlencode($version->suffix);\n            }\n            if ($url) {\n                $url = strtr(\n                    $url, array(\n                    '{{version.label}}'  => urlencode($version->label),\n                    '{{version.number}}' => urlencode($version->number),\n                    '{{version.suffix}}' => urlencode($version->suffix)\n                    )\n                );\n\n                /* @var $client Zend_Http_Client */\n                $client = Zend_Feed::getHttpClient();\n                $client->setConfig(array('timeout' => self::NEWS_FEED_TIMEOUT_IN_SECONDS));\n                $owFeed = Zend_Feed::import($url);\n                return $owFeed;\n            } else {\n                $message = 'Feed disabled in config.ini. You can configure a feed '\n                         . 'using the \"news.feedUrl\" key in your config.ini.';\n                $this->_owApp->appendMessage(\n                    new OntoWiki_Message($message, OntoWiki_Message::INFO)\n                );\n                return array();\n            }\n        } catch (Exception $e) {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message('Error loading feed: ' . $url, OntoWiki_Message::WARNING)\n            );\n            return array();\n        }\n    }\n}\n"
  },
  {
    "path": "application/controllers/ModelController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2017, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki model controller.\n *\n * @category   OntoWiki\n * @package    OntoWiki_Controller\n * @author     Norman Heino <norman.heino@gmail.com>\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass ModelController extends OntoWiki_Controller_Base\n{\n    /**\n     * Adds statement to a named graph\n     */\n    public function addAction()\n    {\n        $this->view->placeholder('main.window.title')->set('Import Statements to the Knowledge Base');\n        $this->_helper->viewRenderer->setScriptAction('create');\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n        $this->view->formActionUrl    = $this->_config->urlBase . 'model/add';\n        $this->view->formEncoding     = 'multipart/form-data';\n        $this->view->formClass        = 'simple-input input-justify-left';\n        $this->view->formMethod       = 'post';\n        $this->view->formName         = 'addmodel';\n\n        $this->view->title    = $this->view->_('Add Statements to Knowledge Base');\n\n        $model                     = $this->_owApp->selectedModel;\n        $this->view->modelTitle    = $model->getTitle();\n        $this->view->importActions = $this->_getImportActions();\n\n        if ($model->isEditable()) {\n            $toolbar = $this->_owApp->toolbar;\n            $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Add Data', 'id' => 'addmodel'))\n                ->appendButton(OntoWiki_Toolbar::RESET, array('name' => 'Cancel'));\n            $this->view->placeholder('main.window.toolbar')->set($toolbar);\n        } else {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message(\n                    'No write permissions on model \"' . $this->view->modelTitle . '\"',\n                    OntoWiki_Message::WARNING\n                )\n            );\n            return;\n        }\n\n        if (!$this->_request->isPost()) {\n            // FIX: http://www.webmasterworld.com/macintosh_webmaster/3300569.htm\n            // disable connection keep-alive\n            $response = $this->getResponse();\n            $response->setHeader('Connection', 'close', true);\n            $response->sendHeaders();\n\n            return;\n        } else {\n            $this->_doImportActionRedirect((string)$model);\n        }\n    }\n\n    /**\n     * Configures options for a specified graph.\n     */\n    public function configAction()\n    {\n        $this->addModuleContext('main.window.modelconfig');\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n        if (!$this->_request->getParam('m')) {\n            throw new OntoWiki_Controller_Exception(\"Missing parameter 'm'.\");\n        }\n\n        $store    = $this->_owApp->erfurt->getStore();\n        $graphUri = $this->_request->getParam('m');\n        $model    = $store->getModel($graphUri);\n\n        // Make sure the current user is allowed to edit the model.\n        if (!$model || !$model->isEditable()) {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message(\"No write permissions on model '{$graphUri}'\", OntoWiki_Message::WARNING)\n            );\n\n            return;\n        } else {\n            $toolbar = $this->_owApp->toolbar;\n            $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Save Model Configuration'))\n                ->appendButton(OntoWiki_Toolbar::RESET, array('name' => 'Cancel'));\n            $this->view->placeholder('main.window.toolbar')->set($toolbar);\n        }\n\n        // get cache for invalidation later\n        $queryCache = $this->_erfurt->getQueryCache();\n\n        // disable versioning\n        $versioning = $this->_erfurt->getVersioning();\n        $versioning->enableVersioning(false);\n\n        // If there is POST data, this is the set request\n        if ($this->_request->isPost()) {\n            $this->view->clearModuleCache('modellist');\n\n            $post = $this->_request->getPost();\n\n            // Check the is hidden option.\n            if (isset($post['ishidden']) && $post['ishidden'] === 'ishidden') {\n                // In this case we need to set the value to true in the sys ont.\n                $model->setOption(\n                    $this->_config->sysont->properties->hidden,\n                    array(\n                         array(\n                             'value'    => 'true',\n                             'type'     => 'literal',\n                             'datatype' => EF_XSD_BOOLEAN\n                         )\n                    )\n                );\n            } else {\n                // We unset the value here (means not hidden).\n                $model->setOption($this->_config->sysont->properties->hidden);\n            }\n\n            // Check the is isLarge option.\n            if (isset($post['isLarge']) && $post['isLarge'] === 'isLarge') {\n                // In this case we need to set the value to true in the sys ont.\n                $model->setOption(\n                    $this->_config->sysont->properties->isLarge,\n                    array(\n                         array(\n                             'value'    => 'true',\n                             'type'     => 'literal',\n                             'datatype' => EF_XSD_BOOLEAN\n                         )\n                    )\n                );\n            } else {\n                // We unset the value here (means not hidden).\n                $model->setOption($this->_config->sysont->properties->isLarge);\n            }\n\n            // Check the use sysbase option.\n            if (isset($post['usesysbase']) && $post['usesysbase'] === 'usesysbase') {\n                // Checked, so check, whether the value is already set.\n                if ($graphUri !== $this->_config->sysbase->model) {\n                    $useSysBaseOld = $model->getOption($this->_config->sysont->properties->hiddenImports);\n\n                    if (null !== $useSysBaseOld) {\n                        $alreadySet = false;\n                        foreach ($useSysBaseOld as $row) {\n                            if ($row['value'] === $this->_config->sysbase->model && $row['type'] === 'uri') {\n                                $alreadySet = true;\n                                break;\n                            }\n                        }\n\n                        if (!$alreadySet) {\n                            $useSysBaseNew   = $useSysBaseOld;\n                            $useSysBaseNew[] = array(\n                                'type'  => 'uri',\n                                'value' => $this->_config->sysbase->model\n                            );\n\n                            $model->setOption($this->_config->sysont->properties->hiddenImports, $useSysBaseNew);\n                        }\n                    } else {\n                        $useSysBaseNew   = array();\n                        $useSysBaseNew[] = array(\n                            'type'  => 'uri',\n                            'value' => $this->_config->sysbase->model\n                        );\n\n                        $model->setOption($this->_config->sysont->properties->hiddenImports, $useSysBaseNew);\n                    }\n                }\n\n                // Check whether SysBase is already available... If not import it.\n                if (!$store->isModelAvailable($this->_config->sysbase->model, false)) {\n                    $m = $store->getNewModel($this->_config->sysbase->model, '', 'owl', false);\n                    try {\n                        if (is_readable($this->_config->sysbase->path)) {\n                            // load SysOnt from file\n                            $store->importRdf(\n                                $this->_config->sysbase->model,\n                                _OWROOT . $this->_config->sysbase->path,\n                                'rdfxml',\n                                Erfurt_Syntax_RdfParser::LOCATOR_FILE,\n                                false\n                            );\n                        } else {\n                            throw new Erfurt_Exception();\n                        }\n                    } catch (Erfurt_Exception $e) {\n                        // Delete the model, for the import failed.\n                        $store->deleteModel($this->_config->sysbase->model, false);\n\n                        throw new Erfurt_Store_Exception(\n                            'Import of \"' . $this->_config->sysbase->model . '\" failed: \"' . $e->getMessage() . '\"'\n                        );\n                    }\n\n                    // Set SysBase hidden!\n                    $m->setOption(\n                        $this->_config->sysont->properties->hidden,\n                        array(\n                             array(\n                                 'value'    => 'true',\n                                 'type'     => 'literal',\n                                 'datatype' => EF_XSD_BOOLEAN\n                             )\n                        )\n                    );\n                }\n            } else {\n                // Not checked... Remove if currently set.\n                if ($graphUri !== $this->_config->sysbase->model) {\n                    $useSysBaseOld = $model->getOption($this->_config->sysont->properties->hiddenImports);\n\n                    if (null !== $useSysBaseOld) {\n                        $currentlySet = false;\n                        foreach ($useSysBaseOld as $i => $row) {\n                            if (($row['value'] === $this->_config->sysbase->model) && ($row['type'] === 'uri')) {\n                                $currentlySet = true;\n                                unset($useSysBaseOld[$i]);\n                                break;\n                            }\n                        }\n\n                        if ($currentlySet) {\n                            $useSysBaseNew = $useSysBaseOld;\n\n                            $model->setOption($this->_config->sysont->properties->hiddenImports, $useSysBaseNew);\n                        }\n                    }\n                }\n            }\n\n            /**\n             * insert a new prefix and namespace to the model\n             */\n            if (isset($post['new_prefix_prefix']) || isset($post['new_prefix_namespace'])) {\n                if (!isset($post['new_prefix_prefix']) || !isset($post['new_prefix_namespace'])) {\n                    // Incomplete input\n                    $this->_owApp->appendMessage(\n                        new OntoWiki_Message(\n                            'Incomplete input, namespace or prefix is missing.',\n                            OntoWiki_Message::ERROR\n                        )\n                    );\n                } else {\n                    try {\n                        if ($post['new_prefix_prefix'] != '' && $post['new_prefix_namespace'] != '') {\n                            $model->addNamespacePrefix($post['new_prefix_prefix'], $post['new_prefix_namespace']);\n                        }\n                    } catch (Erfurt_Ac_Exception $e) {\n                        $this->_owApp->appendMessage(\n                            new OntoWiki_Message(\n                                'No write permissions on model \"' . $this->view->modelTitle . '\"',\n                                OntoWiki_Message::WARNING\n                            )\n                        );\n                    } catch (Erfurt_Exception $e) {\n                        $this->_owApp->appendMessage(\n                            new OntoWiki_Message($e->getMessage(), OntoWiki_Message::ERROR)\n                        );\n                    }\n                }\n            }\n\n            // invalidate model and config model and sysbase if available\n            if ($store->isModelAvailable($this->_config->sysbase->model, false)) {\n                $queryCache->invalidateWithModelIri($this->_config->sysbase->model);\n            }\n            $queryCache->invalidateWithModelIri($this->_config->sysont->model);\n            $queryCache->invalidateWithModelIri($graphUri);\n\n            // Forward to info action\n            $this->_redirect(\n                $this->_config->urlBase . 'model/config/?m=' . urlencode($this->_request->m),\n                array('code' => 302)\n            );\n\n            return;\n        } else {\n            if (isset($this->_request->delete_prefix)) {\n                try {\n                    $model->deleteNamespacePrefix($this->_request->delete_prefix);\n                } catch (Erfurt_Ac_Exception $e) {\n                    $this->_owApp->appendMessage(\n                        new OntoWiki_Message(\n                            'No write permissions on model \"' . $this->view->modelTitle . '\"',\n                            OntoWiki_Message::WARNING\n                        )\n                    );\n                } catch (Erfurt_Exception $e) {\n                    $this->_owApp->appendMessage(\n                        new OntoWiki_Message($e->getMessage(), OntoWiki_Message::ERROR)\n                    );\n                }\n\n                // invalidate model and config model\n                $queryCache->invalidateWithModelIri($this->_config->sysont->model);\n                $queryCache->invalidateWithModelIri($graphUri);\n\n                // Forward to info action\n                $this->_redirect(\n                    $this->_config->urlBase . 'model/config/?m=' . urlencode($this->_request->m),\n                    array('code' => 302)\n                );\n\n                return;\n            } else {\n                // Set the window title in the appropriate language.\n                $translate   = $this->_owApp->translate;\n                $windowTitle = $translate->_('Model Configuration');\n                $this->view->placeholder('main.window.title')->set($windowTitle);\n\n                $this->view->formActionUrl = $this->_config->urlBase . 'model/config';\n                $this->view->formMethod    = 'post';\n                $this->view->formClass     = 'simple-input input-justify-left';\n                $this->view->formName      = 'modelconfig';\n\n                $isLarge = $model->getOption($this->_config->sysont->properties->isLarge);\n                if (null !== $isLarge && ($isLarge[0]['value'] === 'true') || ($isLarge[0]['value'] == 1)) {\n                    // Model does not count currently\n                    $this->view->isLarge = 'checked=\"checked\"';\n                } else {\n                    $this->view->isLarge = '';\n                }\n\n                $isHidden = $model->getOption($this->_config->sysont->properties->hidden);\n                if (null !== $isHidden && ($isHidden[0]['value'] === 'true') || ($isHidden[0]['value'] == 1)) {\n                    // Model is currently hidden\n                    $this->view->isHidden = 'checked=\"checked\"';\n                } else {\n                    $this->view->isHidden = '';\n                }\n\n                $useSysBase      = $model->getOption($this->_config->sysont->properties->hiddenImports);\n                $sysBaseImported = false;\n\n                if (is_array($useSysBase)) {\n                    // Option is set... now check whether one of the values is the SysBase uri.\n                    foreach ($useSysBase as $row) {\n                        if ($row['value'] == $this->_config->sysbase->model) {\n                            $sysBaseImported = true;\n                            break;\n                        }\n                    }\n                }\n\n                if ($sysBaseImported) {\n                    $this->view->useSysBase = 'checked=\"checked\"';\n                } else {\n                    $this->view->useSysBase = '';\n\n                    // show a warning message\n                    $translate   = $this->_owApp->translate;\n                    $messageText = 'This knowledge base does not import the OntoWiki System Base model.'\n                        . ' This means you probably don\\'t have human-readable representations for the'\n                        . ' most commonly used vocabularies. If you want to use the OntoWiki System'\n                        . ' Base just check the according box and click \\'Save Model Configuration\\'.';\n                    $this->_owApp->appendMessage(\n                        new OntoWiki_Message(\n                            $translate->_($messageText),\n                            OntoWiki_Message::WARNING\n                        )\n                    );\n                }\n\n                if ($graphUri === $this->_config->sysbase->model) {\n                    $this->view->useSysBaseDisabled = 'disabled=\"disabled\"';\n                } else {\n                    $this->view->useSysBaseDisabled = '';\n                }\n\n                $this->view->readonly = 'readonly=\"readonly\"';\n                $this->view->modeluri = $graphUri;\n                $this->view->baseuri  = $model->getBaseUri();\n\n                /**\n                 * Sending prefixes to the config view\n                 */\n                $prefixes             = $model->getNamespacePrefixes();\n                $this->view->prefixes = array();\n                ksort($prefixes);\n                foreach ($prefixes as $prefix => $namespace) {\n                    $this->view->prefixes[] = array($prefix, $namespace);\n                }\n            }\n        }\n\n        // re-enable versioning again\n        $versioning->enableVersioning(true);\n    }\n\n    /**\n     * Creates a new named graph\n     */\n    public function createAction()\n    {\n        $this->addModuleContext('main.window.modelcreate');\n        $store = $this->_erfurt->getStore();\n        $this->view->clearModuleCache('modellist');\n\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        $this->view->placeholder('main.window.title')->set('Create New Knowledge Base');\n        $this->view->formActionUrl = $this->_config->urlBase . 'model/create';\n        $this->view->formEncoding  = 'multipart/form-data';\n        $this->view->formClass     = 'simple-input input-justify-left';\n        $this->view->formMethod    = 'post';\n        $this->view->formName      = 'createmodel';\n\n        // this is the default action\n        $defaultActions = array(\n            'empty' => array(\n                'parameter' => 'checked',\n                'controller' => 'model',\n                'action' => 'info',\n                'label' => 'Create a (nearly) empty knowledge base',\n                'description' => 'Just add the label and type to the new model.'\n            )\n        );\n        $importActions = array_merge($defaultActions, $this->_getImportActions());\n        $this->view->importActions = $importActions;\n\n        if (!$this->_erfurt->isActionAllowed('ModelManagement')) {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message('Model management is not allowed.', OntoWiki_Message::ERROR)\n            );\n            $this->view->errorFlag = true;\n\n            return;\n        }\n\n        // TODO: add this to the template in order to allow users to tune it\n        $this->view->modelUri = $this->_config->urlBase .'NEWMODEL/';\n\n        $toolbar = $this->_owApp->toolbar;\n        $toolbar->appendButton(\n            OntoWiki_Toolbar::SUBMIT,\n            array('name' => 'Create Knowledge Base', 'id' => 'createmodel')\n        )->appendButton(\n            OntoWiki_Toolbar::RESET,\n            array('name' => 'Cancel', 'id' => 'createmodel')\n        );\n        $this->view->placeholder('main.window.toolbar')->set($toolbar);\n        $this->view->title = $this->view->_('Create Knowledge Base');\n\n        if (!$this->_request->isPost()) {\n            // FIX: http://www.webmasterworld.com/macintosh_webmaster/3300569.htm\n            // disable connection keep-alive\n            $response = $this->getResponse();\n            $response->setHeader('Connection', 'close', true);\n            $response->sendHeaders();\n            return;\n        } else {\n            // process the user input\n            $post = $this->_request->getPost();\n\n            // determine or create the model URI\n            $newModelUri = '';\n            if (trim($post['modeluri']) != '') {\n                // URI given via form input\n                $newModelUri = trim($post['modeluri']);\n            } else if (trim($post['title']) != '') {\n                // create a nice URI from the title (poor mans way)\n                $urlBase        = $this->_config->urlBase;\n                $title          = trim($post['title']);\n                $title          = str_replace(' ', '', $title);\n                $title          = urlencode($title);\n                $newModelUri    = $urlBase . $title . '/';\n            } else {\n                // create a default model with counter\n                $urlBase = $this->_config->urlBase . 'kb';\n                $counter = 0;\n                do {\n                    $newModelUri = $urlBase . ($counter++) . '/';\n                } while ($store->isModelAvailable($newModelUri, false));\n            }\n\n            if ($newModelUri == '') {\n                $this->_owApp->appendMessage(\n                    new OntoWiki_Message(\n                        'Please provide at least a valid URI for the new Knowledge Base.',\n                        OntoWiki_Message::ERROR\n                    )\n                );\n                $this->view->errorFlag = true;\n                return;\n            }\n\n            // create model\n            if ($store->isModelAvailable($newModelUri, false)) {\n                // model exists\n                $this->_owApp->appendMessage(\n                    new OntoWiki_Message('Given Knowledge Base already exists.', OntoWiki_Message::ERROR)\n                );\n                $this->view->errorFlag = true;\n                return;\n            } else if (filter_var($newModelUri, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) === false\n                && strcmp(substr($newModelUri, 0, 4), 'urn:') != 0\n            ) {\n                //the filter doesnt filter urn's properly, hence they are excluded from the check\n                $this->_owApp->appendMessage(\n                    new OntoWiki_Message('The given String is no legal URI', OntoWiki_Message::ERROR)\n                );\n            } else {\n                // model does not exist, will be created\n                $model = $store->getNewModel(\n                    $newModelUri, $newModelUri, Erfurt_Store::MODEL_TYPE_OWL\n                );\n                $this->_owApp->appendMessage(\n                    new OntoWiki_Message('Knowledge Base successfully created.', OntoWiki_Message::SUCCESS)\n                );\n\n                // add label\n                $additions = new Erfurt_Rdf_MemoryModel();\n                if (isset($post['title']) && trim($post['title']) != '') {\n                    $additions->addAttribute($newModelUri, EF_RDFS_LABEL, $post['title']);\n                }\n                $model->addMultipleStatements($additions->getStatements());\n\n                // TODO: add ACL infos based on the post data\n\n                $this->_doImportActionRedirect($newModelUri);\n            }\n        }\n    }\n\n    public function deleteAction()\n    {\n        $model = $this->_request->model;\n        if ($this->_erfurt->isActionAllowed('ModelManagement')) {\n            $event           = new Erfurt_Event('onPreDeleteModel');\n            $event->modelUri = $model;\n            $event->trigger();\n\n            try {\n                $this->_erfurt->getStore()->deleteModel($model);\n\n                if ((null !== $this->_owApp->selectedModel)\n                    && ($this->_owApp->selectedModel->getModelIri() === $model)\n                ) {\n                    $this->_owApp->selectedModel = null;\n                    //deletes selected model - always needed?\n                    $this->view->clearModuleCache();\n\n                    $url = new OntoWiki_Url(\n                        array(\n                            'controller' => $this->_config->index->default->controller,\n                            'action' => $this->_config->index->default->action,\n                        ),\n                        array()\n                    );\n                    $this->_redirect($url, array('code' => 302));\n                }\n            } catch (Exception $e) {\n                $this->_owApp->appendMessage(\n                    new OntoWiki_Message(\n                        'Error deleting model: ' . $e->getMessage() . '<br/>' . $e->getTraceAsString(),\n                        OntoWiki_Message::ERROR\n                    )\n                );\n            }\n        } else {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message('Error deleting model: Not allowed.', OntoWiki_Message::ERROR)\n            );\n            $this->_redirect($_SERVER['HTTP_REFERER'], array('code' => 302));\n\n            return;\n        }\n        $this->view->clearModuleCache(); //deletes selected model - always needed?\n        $this->_redirect($_SERVER['HTTP_REFERER'], array('code' => 302));\n    }\n\n    /**\n     * Serializes a given model or (if supported) all models into a given format.\n     */\n    public function exportAction()\n    {\n        if (!$this->_owApp->erfurt->getAc()->isActionAllowed(Erfurt_Ac_Default::ACTION_MODEL_EXPORT)) {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message('Model export not allowed.', OntoWiki_Message::ERROR)\n            );\n            $this->_redirect($_SERVER['HTTP_REFERER'], array('code' => 302));\n\n            return;\n        }\n\n        // Check whether the f parameter is given. If not: default to rdf/xml\n        if (!isset($this->_request->f)) {\n            $format = 'rdfxml';\n        } else {\n            $format = $this->_request->f;\n        }\n        $format = Erfurt_Syntax_RdfSerializer::normalizeFormat($format);\n\n        $store = $this->_erfurt->getStore();\n\n        // Check whether given format is supported. If not: 400 Bad Request.\n        if (!in_array($format, array_keys(Erfurt_Syntax_RdfSerializer::getSupportedFormats()))) {\n            $response = $this->getResponse();\n            $response->setRawHeader('HTTP/1.0 400 Bad Request');\n            throw new OntoWiki_Controller_Exception(\"Format '$format' not supported.\");\n        }\n\n        // Check whether a model uri is given\n        if (isset($this->_request->m)) {\n            $modelUri = $this->_request->m;\n\n            // Check whether model exists. If not: 404 Not Found.\n            if (!$store->isModelAvailable($modelUri, false)) {\n                $response = $this->getResponse();\n                $response->setRawHeader('HTTP/1.0 404 Not Found');\n                throw new OntoWiki_Controller_Exception(\"Model '$modelUri' not found.\");\n            }\n\n            // Check whether model is available (with acl). If not: 403 Forbidden.\n            if (!$store->isModelAvailable($modelUri)) {\n                $response = $this->getResponse();\n                $response->setRawHeader('HTTP/1.0 403 Forbidden');\n                throw new OntoWiki_Controller_Exception(\"Model '$modelUri' not available.\");\n            }\n\n            $filename = 'export' . date('Y-m-d_Hi');\n\n            $description = Erfurt_Syntax_RdfSerializer::getFormatDescription($format);\n            $contentType = $description['contentType'];\n            $filename .= $description['fileExtension'];\n\n            $this->_helper->viewRenderer->setNoRender();\n            $this->_helper->layout->disableLayout();\n\n            $response = $this->getResponse();\n            $response->setHeader('Content-Type', $contentType, true);\n            $response->setHeader('Content-Disposition', ('filename=\"' . $filename . '\"'));\n\n            $serializer = Erfurt_Syntax_RdfSerializer::rdfSerializerWithFormat($format);\n            echo $serializer->serializeGraphToString($modelUri);\n\n            return;\n        } else {\n            // Else use all available models.\n            // TODO Exporters need to support this feature...\n            $response = $this->getResponse();\n            $response->setRawHeader('HTTP/1.0 400 Bad Request');\n            throw new OntoWiki_Controller_Exception(\"No Graph URI given.\");\n        }\n    }\n\n    public function infoAction()\n    {\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        $this->_owApp->selectedResource = new OntoWiki_Resource(\n            $this->_request->getParam('m'), $this->_owApp->selectedModel\n        );\n        $store                          = $this->_owApp->erfurt->getStore();\n        $graph                          = $this->_owApp->selectedModel;\n        $resource                       = $this->_owApp->selectedResource;\n        $translate = $this->_owApp->translate;\n\n        $event        = new Erfurt_Event('onPropertiesAction');\n        $event->uri   = (string)$resource;\n        $event->graph = (string)$resource;\n        $event->trigger();\n\n        $windowTitle = $translate->_('Model info');\n        $this->view->placeholder('main.window.title')->set($windowTitle);\n\n        $title                    = $resource->getTitle($this->_owApp->getConfig()->languages->locale);\n        $this->view->modelTitle   = $title ? $title : OntoWiki_Utils::contractNamespace((string)$resource);\n        $resourcesUrl             = new OntoWiki_Url(array('route' => 'instances'), array());\n        $resourcesUrl->init       = true;\n        $this->view->resourcesUrl = (string)$resourcesUrl;\n\n        if (!empty($resource)) {\n            $model = new OntoWiki_Model_Resource($store, $graph, (string)$resource);\n\n            $values     = $model->getValues();\n            $predicates = $model->getPredicates();\n\n            $titleHelper = new OntoWiki_Model_TitleHelper($graph);\n            $graphs      = array_keys($predicates);\n            $titleHelper->addResources($graphs);\n\n            $graphInfo     = array();\n            $editableFlags = array();\n            foreach ($graphs as $g) {\n                $graphInfo[$g]     = $titleHelper->getTitle($g, $this->_config->languages->locale);\n                $editableFlags[$g] = false;\n            }\n\n            $this->view->graphs            = $graphInfo;\n            $this->view->resourceIri       = (string)$resource;\n            $this->view->graphIri          = $graph->getModelIri();\n            $this->view->values            = $values;\n            $this->view->predicates        = $predicates;\n            $this->view->graphBaseIri      = $graph->getBaseIri();\n            $this->view->namespacePrefixes = $graph->getNamespacePrefixes();\n            $this->view->editableFlags     = $editableFlags;\n\n            if (!is_array($this->view->namespacePrefixes)) {\n                $this->view->namespacePrefixes = array();\n            }\n            if (!array_key_exists(OntoWiki_Utils::DEFAULT_BASE, $this->view->namespacePrefixes)) {\n                $this->view->namespacePrefixes[OntoWiki_Utils::DEFAULT_BASE] = $graph->getBaseIri();\n            }\n\n            $infoUris = $this->_config->descriptionHelper->properties;\n\n            if (count($values) > 0) {\n                $query = 'ASK FROM <' . (string)$resource . '>'\n                    . ' WHERE {'\n                    . '     <' . (string)$resource . '> a <http://xmlns.com/foaf/0.1/PersonalProfileDocument>'\n                    . ' }';\n                $q     = Erfurt_Sparql_SimpleQuery::initWithString($query);\n                if ($this->_owApp->extensionManager->isExtensionActive('foafprofileviewer')\n                    && $store->sparqlAsk($q) === true\n                ) {\n                    $this->view->showFoafLink = true;\n                    $this->view->foafLink     = $this->_config->urlBase . 'foafprofileviewer/display';\n                }\n            }\n\n            $this->view->infoPredicates = array();\n            foreach ($infoUris as $infoUri) {\n                if (isset($predicates[(string)$graph]) && array_key_exists($infoUri, $predicates[(string)$graph])) {\n                    $this->view->infoPredicates[$infoUri] = $predicates[(string)$graph][$infoUri];\n                }\n            }\n        }\n\n        $this->addModuleContext('main.window.modelinfo');\n    }\n\n    public function selectAction()\n    {\n        if (isset($this->_request->m)) {\n            // reset resource/class\n            unset($this->_owApp->selectedResource);\n            unset($this->_owApp->selectedClass);\n            unset($this->_session->hierarchyOpen);\n\n            $this->_redirect(\n                $this->_config->urlBase . 'model/info/?m=' . urlencode($this->_request->m),\n                array('code' => 302)\n            );\n        }\n        $this->_redirect($this->_config->urlBase, array('code' => 302));\n    }\n\n    /**\n     * Updates the current model with statements sent as JSON\n     */\n    public function updateAction()\n    {\n        $this->_helper->viewRenderer->setNoRender();\n        $this->_helper->layout()->disableLayout();\n\n        $errors = array();\n\n        // check graph parameter\n        if (!$this->_request->has('named-graph-uri')) {\n            $errors[] = \"Missing parameter 'named-graph-uri'.\";\n        }\n\n        // Parsing may go wrong, when user types in corrupt data... So we catch all exceptions here...\n        try {\n            $flag = false;\n            // check original graph\n            if ($this->_request->has('original-graph')) {\n                $flag               = true;\n                $originalFormat     = $this->_request->getParam('original-format', 'rdfjson');\n                $parser             = Erfurt_Syntax_RdfParser::rdfParserWithFormat($originalFormat);\n                $originalStatements = $parser->parse(\n                    $this->getParam('original-graph', false),\n                    Erfurt_Syntax_RdfParser::LOCATOR_DATASTRING\n                );\n            }\n            // check changed graph\n            if ($this->_request->has('modified-graph')) {\n                $flag               = true;\n                $modifiedFormat     = $this->_request->getParam('modified-format', 'rdfjson');\n                $parser             = Erfurt_Syntax_RdfParser::rdfParserWithFormat($modifiedFormat);\n                $modifiedStatements = $parser->parse(\n                    $this->getParam('modified-graph', false),\n                    Erfurt_Syntax_RdfParser::LOCATOR_DATASTRING\n                );\n            }\n        } catch (Exception $e) {\n            $errors[] = 'Something went wrong: ' . $e->getMessage();\n        }\n\n        if (!$flag) {\n            $errors[] = \"At least one of the parameters 'original-graph' or 'modified-graph' must be supplied.\";\n        }\n\n        // errors occured... so do not update... instead show error message or mark as bad request\n        if (!empty($errors)) {\n            if (null === $this->_request->getParam('redirect-uri')) {\n                // This means, we do not redirect, so we can mark this request as bad request.\n                $response = $this->getResponse();\n                $response->setRawHeader('HTTP/1.0 400 Bad Request');\n                throw new OntoWiki_Controller_Exception(implode(PHP_EOL, $errors));\n            } else {\n                // We have a redirect uri given, so we do not redirect, but show the error messages\n                foreach ($errors as $e) {\n                    $this->_owApp->appendMessage(new OntoWiki_Message($e, OntoWiki_Message::ERROR));\n                }\n                $server = $this->_request->getServer();\n                if (isset($server['HTTP_REFERER'])) {\n                    $this->_request->setParam('redirect-uri', $server['HTTP_REFERER']);\n                }\n\n                return;\n            }\n        }\n\n        // instantiate model\n        $graph = Erfurt_App::getInstance()->getStore()->getModel($this->getParam('named-graph-uri'));\n\n        // update model\n        $graph->updateWithMutualDifference($originalStatements, $modifiedStatements);\n    }\n\n    /**\n     * prepare and do the redirect\n     */\n    private function _doImportActionRedirect($modelUri)\n    {\n        $id            = $this->_request->getPost('importAction');\n        $importOptions = $this->_request->getPost('importOptions');\n        $actions       = $this->_getImportActions();\n\n        if (isset($actions[$id])) {\n            $controller = $actions[$id]['controller'];\n            $action     = $actions[$id]['action'];\n        } else {\n            $controller = 'model';\n            $action     = 'info';\n        }\n\n        $url = new OntoWiki_Url(\n            array(\n                'controller' => $controller,\n                'action' => $action\n            ),\n            array('m', 'importOptions')\n        );\n        $url->setParam('m', $modelUri);\n        $url->setParam('importOptions', $importOptions);\n\n        $this->_redirect($url, array('code' => 302));\n    }\n\n    private function _getImportActions()\n    {\n        /**\n         * @trigger onProvideImportActions event to provide additional import actions\n         *\n         * Parameter: importActions\n         *\n         * Example:\n         * <code>\n         * <?php\n         * $importActions = array('empty' => array(\n         *   'controller' => 'model',\n         *   'action' => 'info',\n         *   'label' => 'Create an (nearly) empty knowledge base',\n         *   'description' => 'Just add the label to the new model.'\n         *   ));\n         * ?>\n         * </code>\n         */\n        $event                = new Erfurt_Event('onProvideImportActions');\n        $event->importActions = array();\n        $result               = $event->trigger();\n        return $event->importActions;\n    }\n}\n"
  },
  {
    "path": "application/controllers/ModuleController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module controller.\n *\n * @category   OntoWiki\n * @package    OntoWiki_Controller\n * @author     Norman Heino <norman.heino@gmail.com>\n */\nclass ModuleController extends OntoWiki_Controller_Base\n{\n    public function indexAction()\n    {\n        $this->_forward('get');\n    }\n\n    public function getAction()\n    {\n        $this->_helper->viewRenderer->setNoRender();\n        $this->_helper->layout->disableLayout();\n\n        // mandatory\n        if (!isset($this->_request->name)) {\n            throw new OntoWiki_Exeption(\"Missing parameter 'name'.\");\n        }\n        $name = $this->_request->name;\n\n        if (isset($this->_request->class)) {\n            $class = $this->_request->class;\n        } else {\n            $class = '';\n        }\n\n        if (isset($this->_request->id)) {\n            $id = $this->_request->id;\n        } else {\n            $id = '';\n        }\n\n        $this->_response->setHeader('Content-Type', 'text/html');\n        $this->_response->setBody(\n            $this->view->module($name, new Zend_Config(array('classes' => $class, 'id' => $id), true))\n        );\n    }\n}\n\n\n"
  },
  {
    "path": "application/controllers/ResourceController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki resource controller.\n *\n * @category OntoWiki\n * @package  OntoWiki_Controller\n */\nclass ResourceController extends OntoWiki_Controller_Base\n{\n    private function _addLastModifiedHeader()\n    {\n        $r = $this->_owApp->selectedResource;\n        $m = $this->_owApp->selectedModel;\n\n        if (!$m || !$r) {\n            return;\n        }\n\n        $versioning   = Erfurt_App::getInstance()->getVersioning();\n        $lastModArray = $versioning->getLastModifiedForResource($r, $m->getModelUri());\n\n        if (null === $lastModArray || !is_numeric($lastModArray['tstamp'])) {\n            return;\n        }\n\n        $response = $this->getResponse();\n        $response->setHeader('Last-Modified', date('r', $lastModArray['tstamp']), true);\n    }\n\n    /**\n     * Displays all preoperties and values for a resource, denoted by parameter\n     */\n    public function propertiesAction()\n    {\n        $this->_addLastModifiedHeader();\n\n        $store      = $this->_owApp->erfurt->getStore();\n        $graph      = $this->_owApp->selectedModel;\n        $resource   = $this->_owApp->selectedResource;\n        $navigation = $this->_owApp->navigation;\n        $translate  = $this->_owApp->translate;\n\n        // add export formats to resource menu\n        $resourceMenu = OntoWiki_Menu_Registry::getInstance()->getMenu('resource');\n\n        $menu = new OntoWiki_Menu();\n        $menu->setEntry('Resource', $resourceMenu);\n\n        $event           = new Erfurt_Event('onCreateMenu');\n        $event->menu     = $resourceMenu;\n        $event->resource = $this->_owApp->selectedResource;\n        $event->model    = $this->_owApp->selectedModel;\n        $event->trigger();\n\n        $event        = new Erfurt_Event('onPropertiesAction');\n        $event->uri   = (string)$resource;\n        $event->graph = $this->_owApp->selectedModel->getModelUri();\n        $event->trigger();\n\n        // Give plugins a chance to add entries to the menu\n        $this->view->placeholder('main.window.menu')->set($menu->toArray(false, true));\n\n        if ($resource->getTitle($this->_config->languages->locale)) {\n            $title = $resource->getTitle($this->_config->languages->locale);\n        } else {\n            $title = OntoWiki_Utils::contractNamespace((string)$resource);\n        }\n\n        $windowTitle = sprintf($translate->_('Properties of %1$s'), $title);\n        $this->view->placeholder('main.window.title')->set($windowTitle);\n\n        if (!empty($resource)) {\n            $event      = new Erfurt_Event('onPreTabsContentAction');\n            $event->uri = (string)$resource;\n            $result     = $event->trigger();\n\n            if ($result) {\n                $this->view->preTabsContent = $result;\n            }\n\n            $event      = new Erfurt_Event('onPrePropertiesContentAction');\n            $event->uri = (string)$resource;\n            $result     = $event->trigger();\n\n            if ($result) {\n                $this->view->prePropertiesContent = $result;\n            }\n\n            $model      = new OntoWiki_Model_Resource($store, $graph, (string)$resource);\n            $values     = $model->getValues();\n            $predicates = $model->getPredicates();\n\n            // new trigger onPropertiesActionData to work with data (reorder with plugin)\n            $event             = new Erfurt_Event('onPropertiesActionData');\n            $event->uri        = (string)$resource;\n            $event->predicates = $predicates;\n            $event->values     = $values;\n            $result            = $event->trigger();\n\n            if ($result) {\n                $predicates = $event->predicates;\n                $values     = $event->values;\n            }\n\n            $titleHelper = new OntoWiki_Model_TitleHelper($graph);\n            // add graphs\n            $graphs = array_keys($predicates);\n            $titleHelper->addResources($graphs);\n\n            // set RDFa widgets update info for editable graphs and other graph info\n            $graphInfo     = array();\n            $editableFlags = array();\n            foreach ($graphs as $g) {\n                $graphInfo[$g] = $titleHelper->getTitle($g, $this->_config->languages->locale);\n\n                if ($this->_erfurt->getAc()->isModelAllowed('edit', $g)) {\n                    $editableFlags[$g] = true;\n                    $this->view->placeholder('update')->append(\n                        array(\n                             'sourceGraph'    => $g,\n                             'queryEndpoint'  => $this->_config->urlBase . 'sparql/',\n                             'updateEndpoint' => $this->_config->urlBase . 'update/'\n                        )\n                    );\n                } else {\n                    $editableFlags[$g] = false;\n                }\n            }\n\n            $this->view->graphs        = $graphInfo;\n            $this->view->editableFlags = $editableFlags;\n            $this->view->values        = $values;\n            $this->view->predicates    = $predicates;\n            $this->view->resourceUri   = (string)$resource;\n            $this->view->graphUri      = $graph->getModelIri();\n            $this->view->graphBaseUri  = $graph->getBaseIri();\n            $this->view->editable      = false; // use $this->editableFlags[$graph] now\n            // prepare namespaces\n            $namespacePrefixes         = $graph->getNamespacePrefixes();\n            $graphBase  = $graph->getBaseUri();\n            if (!array_key_exists(OntoWiki_Utils::DEFAULT_BASE, $namespacePrefixes)) {\n                $namespacePrefixes[OntoWiki_Utils::DEFAULT_BASE] = $graphBase;\n            }\n            $this->view->namespacePrefixes = $namespacePrefixes;\n        }\n\n        $toolbar = $this->_owApp->toolbar;\n\n        // show only if not forwarded and if model is writeable\n        // TODO: why is isEditable not false here?\n        if ($this->_request->getParam('action') == 'properties' && $graph->isEditable()\n            && $this->_owApp->erfurt->getAc()->isModelAllowed('edit', $this->_owApp->selectedModel)\n        ) {\n            // TODO: check acl\n            $toolbar->appendButton(\n                OntoWiki_Toolbar::EDIT,\n                array('name' => 'Edit Properties', 'title' => 'SHIFT + ALT + e')\n            );\n            $toolbar->appendButton(\n                OntoWiki_Toolbar::EDITADD,\n                array(\n                     'name'  => 'Clone',\n                     'class' => 'clone-resource',\n                     'title' => 'SHIFT + ALT + l'\n                )\n            );\n            $url = new OntoWiki_Url(\n                array('controller' => 'resource', 'action' => 'delete'),\n                array('r')\n            );\n            $url->setParam('r', (string)$resource, false);\n            $params = array(\n                'name' => 'Delete',\n                'url'  => (string)$url\n            );\n            $toolbar->appendButton(OntoWiki_Toolbar::SEPARATOR);\n            $toolbar->appendButton(OntoWiki_Toolbar::DELETE, $params);\n\n            $toolbar->prependButton(OntoWiki_Toolbar::SEPARATOR);\n            $toolbar->prependButton(\n                OntoWiki_Toolbar::ADD,\n                array(\n                     'name'   => 'Add Property',\n                     '+class' => 'property-add',\n                     'title'  => 'SHIFT + ALT + a'\n                )\n            );\n\n            $toolbar->prependButton(OntoWiki_Toolbar::SEPARATOR);\n            $toolbar->prependButton(\n                OntoWiki_Toolbar::CANCEL,\n                array(\n                     '+class' => 'hidden',\n                     'title'  => 'SHIFT + ALT + c'\n                )\n            );\n\n            $toolbar->prependButton(\n                OntoWiki_Toolbar::SAVE,\n                array(\n                     '+class' => 'hidden',\n                     'title'  => 'SHIFT + ALT + s'\n                )\n            );\n        }\n\n        // let plug-ins add buttons\n        $toolbarEvent           = new Erfurt_Event('onCreateToolbar');\n        $toolbarEvent->resource = (string)$resource;\n        $toolbarEvent->graph    = (string)$graph;\n        $toolbarEvent->toolbar  = $toolbar;\n        $eventResult            = $toolbarEvent->trigger();\n\n        if ($eventResult instanceof OntoWiki_Toolbar) {\n            $toolbar = $eventResult;\n        }\n\n        // add toolbar\n        $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n        //show modules\n        $this->addModuleContext('main.window.properties');\n    }\n\n    /**\n     * Displays resources of a certain type and property values that have\n     * been selected by the user.\n     */\n    public function instancesAction()\n    {\n        $store = $this->_owApp->erfurt->getStore();\n        $graph = $this->_owApp->selectedModel;\n\n        // the list is managed by a controller plugin that catches special http-parameters\n        // @see Ontowiki/Controller/Plugin/ListSetupHelper.php\n\n        //here this list is added to the view\n        $listHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('List');\n        $listName   = 'instances';\n        if ($listHelper->listExists($listName)) {\n            $list = $listHelper->getList($listName);\n            $list->setStore($store);\n            $listHelper->addList($listName, $list, $this->view);\n        } else {\n            if ($this->_owApp->selectedModel == null) {\n                $this->_owApp->appendMessage(\n                    new OntoWiki_Message('your session timed out. select a model', OntoWiki_Message::ERROR)\n                );\n                $this->_redirect($this->_config->baseUrl);\n            }\n            $list = new OntoWiki_Model_Instances($store, $this->_owApp->selectedModel, array());\n            $listHelper->addListPermanently($listName, $list, $this->view);\n        }\n\n        //begin view building\n        $this->view->placeholder('main.window.title')->set('Resource List');\n\n        // rdfauthor on a list is not possible yet\n        // TODO: check acl\n        // build toolbar\n        /*\n         * toolbar disabled for 0.9.5 (reactived hopefully later :) ) */\n\n        if ($graph->isEditable()) {\n            $toolbar = $this->_owApp->toolbar;\n            $toolbar->appendButton(\n                OntoWiki_Toolbar::EDITADD, array('name' => 'Add Instance', 'class' => 'init-resource')\n            );\n            $toolbar->prependButton(OntoWiki_Toolbar::SEPARATOR);\n            $toolbar->prependButton(\n                OntoWiki_Toolbar::CANCEL,\n                array(\n                     '+class' => 'hidden',\n                     'title'  => 'SHIFT + ALT + c'\n                )\n            );\n\n            $toolbar->prependButton(\n                OntoWiki_Toolbar::SAVE,\n                array(\n                     '+class' => 'hidden',\n                     'title'  => 'SHIFT + ALT + s'\n                )\n            );\n            $this->view->placeholder('main.window.toolbar')->set($toolbar);\n        }\n\n        $url                     = new OntoWiki_Url();\n        $this->view->redirectUrl = (string)$url;\n\n        $this->addModuleContext('main.window.list');\n        $this->addModuleContext('main.window.instances');\n    }\n\n    /**\n     * Deletes one or more resources denoted by param 'r'\n     * TODO: This should be done by a evolution pattern in the future\n     */\n    public function deleteAction()\n    {\n        $this->view->clearModuleCache();\n\n        $this->_helper->viewRenderer->setNoRender();\n        $this->_helper->layout->disableLayout();\n\n        $store    = $this->_erfurt->getStore();\n        $model    = $this->_owApp->selectedModel;\n        $modelIri = (string)$model;\n        $redirect = $this->_request->getParam('redirect', $this->_config->urlBase);\n\n        if (isset($this->_request->r)) {\n            $resources = $this->_request->getParam('r', array());\n        } else {\n            throw new OntoWiki_Exception('Missing parameter r!');\n        }\n\n        if (!is_array($resources)) {\n            $resources = array($resources);\n        }\n\n        // get versioning\n        $versioning = $this->_erfurt->getVersioning();\n\n        $count = 0;\n        if ($this->_erfurt->getAc()->isModelAllowed('edit', $modelIri)) {\n            foreach ($resources as $resource) {\n\n                // if we have only a nice uri, fill to full uri\n                if (Zend_Uri::check($resource) == false) {\n                    // check for namespace\n                    if (strstr($resource, ':')) {\n                        $resource = OntoWiki_Utils::expandNamespace($resource);\n                    } else {\n                        $resource = $model->getBaseIri() . $resource;\n                    }\n                }\n\n                // action spec for versioning\n                $actionSpec                = array();\n                $actionSpec['type']        = 130;\n                $actionSpec['modeluri']    = $modelIri;\n                $actionSpec['resourceuri'] = $resource;\n\n                // starting action\n                $versioning->startAction($actionSpec);\n\n                $stmtArray = array();\n\n                // query for all triples to delete them\n                $sparqlQuery = new Erfurt_Sparql_SimpleQuery();\n                $sparqlQuery->setSelectClause('SELECT ?p ?o');\n                $sparqlQuery->addFrom($modelIri);\n                $sparqlQuery->setWherePart('{ <' . $resource . '> ?p ?o . }');\n\n                $result = $store->sparqlQuery($sparqlQuery, array('result_format' => 'extended'));\n                // transform them to statement array to be compatible with store methods\n                foreach ($result['results']['bindings'] as $stmt) {\n                    $stmtArray[$resource][$stmt['p']['value']][] = $stmt['o'];\n                }\n\n                $store->deleteMultipleStatements($modelIri, $stmtArray);\n\n                // stopping action\n                $versioning->endAction();\n\n                $count++;\n            }\n\n            $message = $count\n                . ' resource' . ($count != 1 ? 's' : '')\n                . ($count ? ' successfully' : '')\n                . ' deleted.';\n\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message($message, OntoWiki_Message::SUCCESS)\n            );\n\n        } else {\n\n            $message = 'not allowed.';\n\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message($message, OntoWiki_Message::WARNING)\n            );\n        }\n\n        $event                = new Erfurt_Event('onDeleteResources');\n        $event->resourceArray = $resources;\n        $event->modelUri      = $modelIri;\n        $event->trigger();\n\n        $this->_redirect($redirect, array('code' => 302));\n    }\n\n    public function exportAction()\n    {\n        $this->_addLastModifiedHeader();\n\n        $this->_helper->viewRenderer->setNoRender();\n        $this->_helper->layout->disableLayout();\n\n        if (isset($this->_request->m)) {\n            $modelUri = $this->_request->m;\n        } else {\n            if (isset($this->_owApp->selectedModel)) {\n                $modelUri = $this->_owApp->selectedModel->getModelUri();\n            } else {\n                $response = $this->getResponse();\n                $response->setRawHeader('HTTP/1.0 400 Bad Request');\n                throw new OntoWiki_Controller_Exception(\"No model given.\");\n            }\n        }\n\n        $resource = $this->getParam('r', true);\n\n        // Check whether the f parameter is given. If not: default to rdf/xml\n        if (!isset($this->_request->f)) {\n            $format = 'rdfxml';\n        } else {\n            $format = $this->_request->f;\n        }\n\n        $format = Erfurt_Syntax_RdfSerializer::normalizeFormat($format);\n\n        $store = $this->_erfurt->getStore();\n\n        // Check whether given format is supported. If not: 400 Bad Request.\n        if (!in_array($format, array_keys(Erfurt_Syntax_RdfSerializer::getSupportedFormats()))) {\n            $response = $this->getResponse();\n            $response->setRawHeader('HTTP/1.0 400 Bad Request');\n            throw new OntoWiki_Controller_Exception(\"Format '$format' not supported.\");\n        }\n\n        // Check whether model exists. If not: 404 Not Found.\n        if (!$store->isModelAvailable($modelUri, false)) {\n            $response = $this->getResponse();\n            $response->setRawHeader('HTTP/1.0 404 Not Found');\n            throw new OntoWiki_Controller_Exception(\"Model '$modelUri' not found.\");\n        }\n\n        // Check whether model is available (with acl). If not: 403 Forbidden.\n        if (!$store->isModelAvailable($modelUri)) {\n            $response = $this->getResponse();\n            $response->setRawHeader('HTTP/1.0 403 Forbidden');\n            throw new OntoWiki_Controller_Exception(\"Model '$modelUri' not available.\");\n        }\n\n        $filename = 'export' . date('Y-m-d_Hi');\n\n        $formatDescription = Erfurt_Syntax_RdfSerializer::getFormatDescription($format);\n        $contentType = $formatDescription['contentType'];\n        $filename .= $formatDescription['fileExtension'];\n\n        /*\n         * Event: allow for adding / deleting statements to the export\n         *   event uses a memory model and gets an empty memory model as\n         *   default value, all plugins should add statements to the existing\n         *   value and should not create a new model as return value\n         */\n        $event             = new Erfurt_Event('beforeExportResource');\n        $event->resource   = $resource;\n        $event->modelUri   = $modelUri;\n        $event->setDefault = new Erfurt_Rdf_MemoryModel();\n        $addedModel        = $event->trigger();\n        if (is_object($addedModel) && get_class($addedModel) == 'Erfurt_Rdf_MemoryModel') {\n            $addedStatements = $addedModel->getStatements();\n        } else {\n            $addedStatements = array();\n        }\n\n        $response = $this->getResponse();\n        $response->setHeader('Content-Type', $contentType, true);\n        $response->setHeader('Content-Disposition', ('filename=\"' . $filename . '\"'));\n\n        $serializer = Erfurt_Syntax_RdfSerializer::rdfSerializerWithFormat($format);\n        echo $serializer->serializeResourceToString($resource, $modelUri, false, true, $addedStatements);\n    }\n\n    public function headAction()\n    {\n        // disable layout for Ajax requests\n        $this->_helper->layout()->disableLayout();\n        // disable rendering\n        $this->_helper->viewRenderer->setNoRender();\n\n        $redirect    = $this->getParam('noredirect', false);\n        $resourceUri = $this->getParam('r', '');\n\n        if (\"\" == $resourceUri) {\n            echo json_encode(array());\n        } else {\n            $options = array(\n                'timeout' => 30\n            );\n\n            if ('true' == $redirect) {\n                $options['maxredirects'] = 0;\n            }\n\n            $httpClient = Erfurt_App::getInstance()->getHttpClient($resourceUri, $options);\n            $httpClient->setHeaders(\n                'Accept',\n                'text/turtle; q=1.0, application/x-turtle; q=0.9, text/n3; ' .\n                'q=0.8, application/rdf+xml; q=0.5, text/plain; q=0.1'\n            );\n\n            echo json_encode($httpClient->request()->getHeaders());\n        }\n    }\n}\n"
  },
  {
    "path": "application/controllers/ServiceController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki service controller.\n *\n * @category OntoWiki\n * @package  OntoWiki_Controller\n */\nclass ServiceController extends Zend_Controller_Action\n{\n    /** @var OntoWiki */\n    protected $_owApp = null;\n\n    /** @var Zend_Config */\n    protected $_config = null;\n\n    /**\n     * Attempts an authentication to the underlying Erfurt framework via\n     * HTTP GET/POST parameters.\n     */\n    public function authAction()\n    {\n        if (!$this->_config->service->allowGetAuth) {\n            // disallow get\n            if (!$this->_request->isPost()) {\n                $this->_response->setHttpResponseCode(405);\n                $this->_response->setHeader('Allow', 'POST');\n\n                return;\n            }\n        }\n\n        // fetch params\n        $l = $this->_request->logout;\n        if (isset($l) && ('true' == $l || 'false' == $l)) {\n            $logout = $this->_request->logout == 'true' ? true : false;\n        } elseif (isset($this->_request->u)) {\n            $username = $this->_request->u;\n            $password = $this->_request->getParam('p', '');\n        } else {\n            $this->_response->setHttpResponseCode(400);\n\n            return;\n        }\n\n        if (isset($logout) && true == $logout) {\n            // logout\n            Erfurt_Auth::getInstance()->clearIdentity();\n            session_destroy();\n            $this->_response->setHttpResponseCode(200);\n\n            return;\n        } else {\n            // authenticate\n            $result = $this->_owApp->erfurt->authenticate($username, $password);\n        }\n\n        // return HTTP result\n        if ($result->isValid()) {\n            $this->_response->setHttpResponseCode(200);\n\n            return;\n        } else {\n            $this->_response->setHttpResponseCode(401);\n\n            return;\n        }\n    }\n\n    public function hierarchyAction()\n    {\n        $options = array();\n        if (isset($this->_request->entry)) {\n            $options['entry'] = $this->_request->entry;\n        }\n\n        $model = new OntoWiki_Model_Hierarchy(\n            Erfurt_App::getInstance()->getStore(),\n            $this->_owApp->selectedModel,\n            $options\n        );\n\n        $this->view->open    = true;\n        $this->view->classes = $model->getHierarchy();\n        $this->_response->setBody($this->view->render('partials/hierarchy_list.phtml'));\n    }\n\n    /**\n     * Constructor\n     */\n    public function init()\n    {\n        // init controller variables\n        $this->_owApp   = OntoWiki::getInstance();\n        $this->_config  = $this->_owApp->config;\n        $this->_session = $this->_owApp->session;\n\n        // prepare Ajax context\n        $ajaxContext = $this->_helper->getHelper('AjaxContext');\n        $ajaxContext->addActionContext('view', 'html')\n            ->addActionContext('form', 'html')\n            ->addActionContext('process', 'json')\n            ->initContext();\n    }\n\n    /**\n     * Menu Action to generate JSON serializations of OntoWiki_Menu for context-, module-, component-menus\n     */\n    public function menuAction()\n    {\n        $module   = $this->_request->getParam('module');\n        $resource = $this->_request->getParam('resource');\n        $model    = $this->_request->getParam('model');\n\n        $translate = $this->_owApp->translate;\n\n        // create empty menu first\n        $menuRegistry = OntoWiki_Menu_Registry::getInstance();\n        if (!empty($resource)) {\n            $menu         = $menuRegistry->getMenu('resource', $resource);\n        } else if (!empty($model)) {\n            $menu         = $menuRegistry->getMenu('model', $model);\n        }\n\n        if (!empty($module)) {\n            $moduleRegistry = OntoWiki_Module_Registry::getInstance();\n            $menu           = $moduleRegistry->getModule($module)->getContextMenu();\n        }\n\n        // Fire a event;\n        $event           = new Erfurt_Event('onCreateMenu');\n        $event->menu     = $menu;\n        $event->resource = $resource;\n        if (!empty($model)) {\n            $event->isModel = true;\n            $event->model = $model;\n        } else {\n            $event->model = $this->_owApp->selectedModel;\n        }\n        $event->trigger();\n\n        echo $menu->toJson();\n    }\n\n    public function preDispatch()\n    {\n        // disable auto-rendering\n        $this->_helper->viewRenderer->setNoRender();\n\n        // disable layout for Ajax requests\n        $this->_helper->layout()->disableLayout();\n    }\n\n    public function sessionAction()\n    {\n        if (!isset($this->_request->name)) {\n            throw new OntoWiki_Exception(\"Missing parameter 'name'.\");\n        }\n\n        if (isset($this->_request->namespace)) {\n            $namespace = $this->_request->namespace;\n        } else {\n            $namespace = _OWSESSION;\n        }\n\n        $session = new Zend_Session_Namespace($namespace);\n        $name    = $this->_request->name;\n        $method  = 'set'; // default\n        if (isset($this->_request->method)) {\n            $method = $this->_request->method;\n        }\n\n        if (isset($this->_request->value)) {\n            $value = $this->_request->value;\n        } else {\n            if (($method != 'unsetArray')\n                && ($method != 'unsetArrayKey')\n                && !($method == 'unset' && !is_array($session->$name))\n            ) {\n                throw new OntoWiki_Exception('Missing parameter \"value\".');\n            }\n        }\n\n        if (isset($this->_request->value) && isset($this->_request->valueIsSerialized)\n            && $this->_request->valueIsSerialized == \"true\"\n        ) {\n            $value = json_decode(stripslashes($value), true);\n        }\n\n        if (isset($this->_request->key)) {\n            $key = $this->_request->key;\n        } else {\n            if ($method == 'setArrayValue' || $method == 'unsetArrayKey') {\n                throw new OntoWiki_Exception('Missing parameter \"key\".');\n            }\n        }\n\n        switch ($method) {\n            case 'set':\n                $session->$name = $value;\n                break;\n            case 'setArrayValue':\n                if (!is_array($session->$name)) {\n                    $session->$name = array();\n                }\n                $array          = $session->$name;\n                $array[$key]    = $value;\n                $session->$name = $array; //strange (because the __get and __set interceptors)\n                break;\n            case 'push':\n                if (!is_array($session->$name)) {\n                    $session->$name = array();\n                }\n                array_push($session->$name, $value);\n                break;\n            case 'merge':\n                if (!is_array($session->$name)) {\n                    $session->$name = array();\n                }\n                $session->$name = array_merge($session->$name, $value);\n                break;\n            case 'unset':\n                // unset a value by inverting the array\n                // and unsetting the specified key\n                if (is_array($session->$name)) {\n                    $valuesAsKeys = array_flip($session->$name);\n                    unset($valuesAsKeys[$value]);\n                    $session->$name = array_flip($valuesAsKeys);\n                } else {\n                    //unset a non-array\n                    unset($session->$name);\n                }\n                break;\n            case 'unsetArrayKey':\n                //done this way because of interceptor-methods...\n                $new = array();\n                if (is_array($session->$name)) {\n                    foreach ($session->$name as $comparekey => $comparevalue) {\n                        if ($comparekey != $key) {\n                            $new[] = $comparevalue;\n                        }\n                    }\n                }\n                $session->$name = $new;\n                break;\n            case 'unsetArray':\n                // unset the array\n                // (the above unsets only values in arrays)\n                unset($session->$name);\n                break;\n        }\n\n        $msg = 'sessionStore: '\n            . $name\n            . ' = '\n            . print_r($session->$name, true);\n\n        $this->_owApp->logger->debug($msg);\n    }\n\n    /**\n     * This action returns status values of the current session, like the selectedModel and the\n     * logged in User as JSON object.\n     */\n    public function statusAction()\n    {\n        // service controller needs no view renderer\n        $this->_helper->viewRenderer->setNoRender();\n        // disable layout for Ajax requests\n        $this->_helper->layout()->disableLayout();\n\n        $status = new stdClass();\n\n        if (isset($this->_owApp->selectedModel)) {\n            $status->selectedModel = $this->_owApp->selectedModel->getModelIri();\n        } else {\n            $status->selectedModel = null;\n        }\n\n        $user = $this->_owApp->getUser();\n        if (get_class($user) == 'Erfurt_Auth_Identity') {\n            // TODO add serialization method to Erfurt_Auth_Identity\n            $status->user = new stdClass();\n            $status->user->isAnonymous = $user->isAnonymousUser();\n            $status->user->uri = $user->getUri();\n            $status->user->username = $user->getUsername();\n        } else {\n            $status->user = null;\n        }\n\n        $status->hasMessages = $this->_owApp->hasMessages();\n\n        // TODO add method to get sessionVars to OntoWiki class and dump them all into this status\n\n        $response = $this->getResponse();\n        $response->setHeader('Content-Type', 'application/json');\n        $response->setBody(json_encode($status));\n    }\n\n    /**\n     * OntoWiki Sparql Endpoint\n     *\n     * Implements the SPARQL protocol according to {@link http://www.w3.org/TR/rdf-sparql-protocol/}.\n     */\n    public function sparqlAction()\n    {\n        // service controller needs no view renderer\n        $this->_helper->viewRenderer->setNoRender();\n        // disable layout for Ajax requests\n        $this->_helper->layout()->disableLayout();\n\n        $store    = OntoWiki::getInstance()->erfurt->getStore();\n        $response = $this->getResponse();\n\n        // fetch params\n        // TODO: support maxOccurs:unbound\n        $queryString = $this->_request->getParam('query', '');\n        if (get_magic_quotes_gpc()) {\n            $queryString = stripslashes($queryString);\n        }\n        $defaultGraph = $this->_request->getParam('default-graph-uri', null);\n        $namedGraph   = $this->_request->getParam('named-graph-uri', null);\n\n        if (!empty($queryString)) {\n            $query = Erfurt_Sparql_SimpleQuery::initWithString($queryString);\n\n            // overwrite query-specidfied dataset with protocoll-specified dataset\n            if (null !== $defaultGraph) {\n                $query->setFrom((array)$defaultGraph);\n            }\n            if (null !== $namedGraph) {\n                $query->setFromNamed((array)$namedGraph);\n            }\n\n            // check graph availability\n            $ac = Erfurt_App::getInstance()->getAc();\n            foreach (array_merge($query->getFrom(), $query->getFromNamed()) as $graphUri) {\n                if (!$ac->isModelAllowed('view', $graphUri)) {\n                    if (Erfurt_App::getInstance()->getAuth()->getIdentity()->isAnonymousUser()) {\n                        // In this case we allow the requesting party to authorize...\n                        $response->setRawHeader('HTTP/1.1 401 Unauthorized')\n                            ->setHeader('WWW-Authenticate', 'Basic realm=\"OntoWiki\"')\n                            ->setHttpResponseCode(401);\n\n                        return;\n\n                    } else {\n                        $response->setRawHeader('HTTP/1.1 500 Internal Server Error')\n                            ->setBody('QueryRequestRefused')\n                            ->setHttpResponseCode(500);\n\n                        return;\n                    }\n                }\n            }\n\n            $typeMapping = array(\n                'application/sparql-results+xml'  => 'xml',\n                'application/json'                => 'json',\n                'application/sparql-results+json' => 'json'\n            );\n\n            try {\n                $type = OntoWiki_Utils::matchMimetypeFromRequest($this->_request, array_keys($typeMapping));\n            } catch (Exeption $e) {\n                //\n            }\n\n            if (empty($type) && isset($this->_request->callback)) {\n                // JSONp\n                $type = 'application/sparql-results+json';\n            } else {\n                if (empty($type)) {\n                    // default: XML\n                    $type = 'application/sparql-results+xml';\n                }\n            }\n\n            try {\n                // get result for mimetype\n                $result = $store->sparqlQuery($query, array('result_format' => $typeMapping[$type]));\n            } catch (Exception $e) {\n                $response->setRawHeader('HTTP/1.1 400 Bad Request')\n                    ->setBody('MalformedQuery: ' . $e->getMessage())\n                    ->setHttpResponseCode(400);\n\n                return;\n            }\n\n            if (isset($this->_request->callback)) {\n                // return jsonp\n                $response->setHeader('Content-Type', 'application/javascript');\n                $padding = $this->_request->getParam('callback', '');\n                $response->setBody($padding . '(' . $result . ')');\n            } else {\n                // set header\n                $response->setHeader('Content-Type', $type);\n                // return normally\n                $response->setBody($result);\n            }\n            $response->setHttpResponseCode(200);\n\n            return;\n        }\n    }\n\n    /**\n     * OntoWiki Update Endpoint\n     *\n     * Only data inserts and deletes are implemented at the moment (e.g. no graph patterns).\n     *\n     * @todo LOAD <> INTO <>, CLEAR GRAPH <>, CREATE[SILENT] GRAPH <>, DROP[ SILENT] GRAPH <>\n     */\n    public function updateAction()\n    {\n        // service controller needs no view renderer\n        $this->_helper->viewRenderer->setNoRender();\n        // disable layout for Ajax requests\n        $this->_helper->layout()->disableLayout();\n\n        $store        = OntoWiki::getInstance()->erfurt->getStore();\n        $response     = $this->getResponse();\n        $defaultGraph = $this->_request->getParam('default-graph-uri', null);\n        $namedGraph   = $this->_request->getParam('named-graph-uri', null);\n        $insertGraph  = null;\n        $deleteGraph  = null;\n        $insertModel  = null;\n        $deleteModel  = null;\n\n        if (isset($this->_request->query)) {\n            // we have a query, enter SPARQL/Update mode\n            $query = $this->_request->getParam('query', '');\n            OntoWiki::getInstance()->logger->info('SPARQL/Update query: ' . $query);\n\n            $matches = array();\n            // insert\n            preg_match('/INSERT\\s+DATA(\\s+INTO\\s*<(.+)>)?\\s*{\\s*([^}]*)/i', $query, $matches);\n            $insertGraph   = (isset($matches[2]) && ($matches[2] !== '')) ? $matches[2] : null;\n            $insertTriples = isset($matches[3]) ? $matches[3] : '';\n\n            if ((null === $insertGraph) && ($insertTriples !== '')) {\n                if (null !== $defaultGraph) {\n                    $insertGraph = $defaultGraph;\n                }\n                if (null !== $namedGraph) {\n                    $insertGraph = $namedGraph;\n                }\n            }\n\n            OntoWiki::getInstance()->logger->info('SPARQL/Update insertGraph: ' . $insertGraph);\n            OntoWiki::getInstance()->logger->info('SPARQL/Update insertTriples: ' . $insertTriples);\n\n            // delete\n            preg_match('/DELETE\\s+DATA(\\s+FROM\\s*<(.+)>)?\\s*{\\s*([^}]*)/i', $query, $matches);\n            $deleteGraph   = (isset($matches[2]) && ($matches[2] !== '')) ? $matches[2] : null;\n            $deleteTriples = isset($matches[3]) ? $matches[3] : '';\n\n            if ((null === $deleteGraph) && ($deleteTriples !== '')) {\n                if (null !== $defaultGraph) {\n                    $deleteGraph = $defaultGraph;\n                }\n                if (null !== $namedGraph) {\n                    $deleteGraph = $namedGraph;\n                }\n            }\n\n            // TODO: normalize literals\n\n            $parser = Erfurt_Syntax_RdfParser::rdfParserWithFormat('nt');\n            $insert = $parser->parse($insertTriples, Erfurt_Syntax_RdfParser::LOCATOR_DATASTRING);\n            $parser->reset();\n            $delete = $parser->parse($deleteTriples, Erfurt_Syntax_RdfParser::LOCATOR_DATASTRING);\n\n            if (null !== $insertGraph) {\n                try {\n                    $insertModel = $insertGraph ? $store->getModel($insertGraph) : $store->getModel($namedGraph);\n                } catch (Erfurt_Store_Exception $e) {\n                    // TODO: error\n                    if (defined('_OWDEBUG')) {\n                        OntoWiki::getInstance()->logger->info('Could not instantiate models.');\n                    }\n\n                    return;\n                }\n            }\n\n            if (null !== $deleteGraph) {\n                try {\n                    $deleteModel = $deleteGraph ? $store->getModel($deleteGraph) : $store->getModel($namedGraph);\n                } catch (Erfurt_Store_Exception $e) {\n                    // TODO: error\n                    if (defined('_OWDEBUG')) {\n                        OntoWiki::getInstance()->logger->info('Could not instantiate models.');\n                    }\n\n                    return;\n                }\n            }\n        } else {\n            // no query, inserts and delete triples by JSON via param\n            $insert = json_decode($this->_request->getParam('insert', '{}'), true);\n            $delete = json_decode($this->_request->getParam('delete', '{}'), true);\n\n            if ($this->_request->has('delete_hashed')) {\n                $hashedObjectStatements = $this->_findStatementsForObjectsWithHashes(\n                    $namedGraph,\n                    json_decode($this->_request->getParam('delete_hashed'), true)\n                );\n                $delete                 = array_merge_recursive($delete, $hashedObjectStatements);\n            }\n\n            try {\n                $namedModel  = $store->getModel($namedGraph);\n                $insertModel = $namedModel;\n                $deleteModel = $namedModel;\n            } catch (Erfurt_Store_Exception $e) {\n                // TODO: error\n                if (defined('_OWDEBUG')) {\n                    OntoWiki::getInstance()->logger->info('Could not instantiate models.');\n                }\n\n                return;\n            }\n        }\n\n        $flag = false;\n\n        /**\n         * @trigger onUpdateServiceAction is triggered when Service-Controller Update Action is executed.\n         * Event contains following attributes:\n         * deleteModel  :   model to delete statments from\n         * deleteData   :   statements payload being deleted\n         * insertModel  :   model to add statements to\n         * insertData   :   statements payload being added\n         */\n        $event              = new Erfurt_Event('onUpdateServiceAction');\n        $event->deleteModel = $deleteModel;\n        $event->insertModel = $insertModel;\n        $event->deleteData  = $delete;\n        $event->insertData  = $insert;\n        $event->trigger();\n\n        // writeback\n        $delete  = $event->deleteData;\n        $insert  = $event->insertData;\n        $changes = isset($event->changes) ? $event->changes : null;\n\n        // delete\n        if ($deleteModel && $deleteModel->isEditable()) {\n            try {\n                $deleteModel->deleteMultipleStatements((array)$delete);\n\n                $flag = true;\n                if (defined('_OWDEBUG')) {\n                    OntoWiki::getInstance()->logger->info(\n                        sprintf('Deleted statements from graph <%s>', $deleteModel->getModelUri())\n                    );\n                }\n            } catch (Erfurt_Store_Exception $e) {\n                if (defined('_OWDEBUG')) {\n                    OntoWiki::getInstance()->logger->info(\n                        'Could not delete statements from graph: ' . $e->getMessage() . PHP_EOL .\n                        'Statements: ' . print_r($delete, true)\n                    );\n                }\n            }\n\n        }\n\n        // insert\n        if ($insertModel && $insertModel->isEditable()) {\n            OntoWiki::getInstance()->logger->info(\n                'add Statements: ' . print_r($delete, true)\n            );\n            $count = $insertModel->addMultipleStatements($this->sanitizeStatements((array)$insert));\n            $flag  = true;\n            if (defined('_OWDEBUG')) {\n                OntoWiki::getInstance()->logger->info(\n                    sprintf('Inserted %i statements into graph <%s>', $count, $insertModel->getModelUri())\n                );\n            }\n        }\n\n        // nothing done?\n        if (!$flag) {\n            // When no user is given (Anoymous) give the requesting party a chance to authenticate.\n            if (Erfurt_App::getInstance()->getAuth()->getIdentity()->isAnonymousUser()) {\n                // In this case we allow the requesting party to authorize\n                $response->setRawHeader('HTTP/1.1 401 Unauthorized');\n                $response->setHeader('WWW-Authenticate', 'Basic realm=\"OntoWiki\"');\n\n                return;\n            }\n        }\n\n        if ($changes) {\n            /**\n             * @see {http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2}\n             */\n            $response->setHttpResponseCode(201);\n            $response->setHeader('Location', $changes['changed']);\n            $response->setHeader('Content-Type', 'application/json');\n            $response->setBody(json_encode($changes));\n        }\n    }\n\n    /**\n     * Renders a template and responds with the output.\n     *\n     * All GET and POST parameters are populated into the view object\n     * and therefore available in the view script. You have to know\n     * which parameters the script uses and objects obviously cannot\n     * be passed via GET/POST.\n     */\n    public function templateAction()\n    {\n        // fetch folder parameter\n        if (isset($this->_request->f)) {\n            $folder = $this->_request->getParam('f');\n        } else {\n            throw new OntoWiki_Exception('Missing parameter f!');\n        }\n\n        // fetch template parameter\n        if (isset($this->_request->t)) {\n            $template = $this->_request->getParam('t');\n        } else {\n            throw new OntoWiki_Exception('Missing parameter t!');\n        }\n\n        if (!preg_match('/^[a-z_]+$/', $folder) || !preg_match('/^[a-z_]+$/', $template)) {\n            throw new OntoWiki_Exception('Illegal characters in folder or template name!');\n        }\n\n        $path = _OWROOT . $this->_config->themes->path . $this->_config->themes->default . 'templates/' . $folder\n            . DIRECTORY_SEPARATOR;\n        $file = $template . '.' . $this->_helper->viewRenderer->getViewSuffix();\n\n        if (!is_readable($path . $file)) {\n            throw new OntoWiki_Exception('Template file not readable. ' . $path . $file);\n        }\n\n        // set script path\n        $this->view->setScriptPath($path);\n\n        // assign get and post parameters to view\n        $this->view->assign($this->_request->getParams());\n\n        // set header\n        $this->_response->setRawHeader('Content-type: text/html');\n\n        // render script\n        $this->_response->setBody($this->view->render($file));\n    }\n\n\n    /**\n     * JSON outputs of the transitive closure of resources to a given start\n     * resource and an transitive attribute\n     */\n    public function transitiveclosureAction()\n    {\n        // service controller needs no view renderer\n        $this->_helper->viewRenderer->setNoRender();\n        // disable layout for Ajax requests\n        $this->_helper->layout()->disableLayout();\n\n        $store    = OntoWiki::getInstance()->erfurt->getStore();\n        $response = $this->getResponse();\n\n        // fetch start resource parameter\n        if (isset($this->_request->sr)) {\n            $resource = $this->_request->getParam('sr', null, true);\n        } else {\n            throw new OntoWiki_Exception('Missing parameter sr (start resource)!');\n        }\n\n        // fetch property resource parameter\n        if (isset($this->_request->p)) {\n            $property = $this->_request->getParam('p', null, true);\n        } else {\n            throw new OntoWiki_Exception('Missing parameter p (property)!');\n        }\n\n        // m is automatically used and selected\n        if ((!isset($this->_request->m)) && (!$this->_owApp->selectedModel)) {\n            throw new OntoWiki_Exception('No model pre-selected model and missing parameter m (model)!');\n        } else {\n            $model = $this->_owApp->selectedModel;\n        }\n\n        // fetch inverse parameter\n        $inverse = $this->_request->getParam('inverse', 'true');\n        switch ($inverse) {\n            case 'false': /* fallthrough */\n            case 'no': /* fallthrough */\n            case 'off': /* fallthrough */\n            case '0':\n                $inverse = false;\n                break;\n            default:\n                $inverse = true;\n        }\n\n        $store = $model->getStore();\n\n        // get the transitive closure\n        $closure = $store->getTransitiveClosure((string)$model, $property, array($resource), $inverse);\n\n        // send the response\n        $response->setHeader('Content-Type', 'application/json');\n        $response->setBody(json_encode($closure));\n    }\n\n    /**\n     * JSON output of the RDFauthor selection Cache File of the current model or\n     * of the model given in parameter m\n     */\n    public function rdfauthorcacheAction()\n    {\n        // service controller needs no view renderer\n        $this->_helper->viewRenderer->setNoRender();\n        // disable layout for Ajax requests\n        $this->_helper->layout()->disableLayout();\n\n        $store    = OntoWiki::getInstance()->erfurt->getStore();\n        $response = $this->getResponse();\n        $model    = $this->_owApp->selectedModel;\n\n        if (isset($this->_request->m)) {\n            $model = $store->getModel($this->_request->m);\n        }\n        if (empty($model)) {\n            throw new OntoWiki_Exception('Missing parameter m (model) and no selected model in session!');\n        }\n\n        $output = array();\n\n        $properties = $model->sparqlQuery(\n            'SELECT DISTINCT ?uri {\n            ?uri a ?propertyClass.\n            FILTER(\n                sameTerm(?propertyClass, <' . EF_OWL_OBJECT_PROPERTY . '>) ||\n                sameTerm(?propertyClass, <' . EF_OWL_DATATYPE_PROPERTY . '>) ||\n                sameTerm(?propertyClass, <' . EF_OWL_ONTOLOGY_PROPERTY . '>) ||\n                sameTerm(?propertyClass, <' . EF_RDF_PROPERTY . '>)\n            )} LIMIT 200 '\n        );\n        if (!empty($properties)) {\n\n            // push all URIs to titleHelper\n            $titleHelper = new OntoWiki_Model_TitleHelper($model);\n            foreach ($properties as $property) {\n                $titleHelper->addResource($property['uri']);\n            }\n\n            $lastProperty = end($properties);\n            foreach ($properties as $property) {\n                $newProperty = array();\n\n                // return title from titleHelper\n                $newProperty['label'] = $titleHelper->getTitle($property['uri']);\n\n                $pdata = $model->sparqlQuery(\n                    'SELECT DISTINCT ?key ?value\n                    WHERE {\n                        <' . $property['uri'] . '> ?key ?value\n                        FILTER(\n                         sameTerm(?key, <' . EF_RDF_TYPE . '>) ||\n                         sameTerm(?key, <' . EF_RDFS_DOMAIN . '>) ||\n                         sameTerm(?key, <' . EF_RDFS_RANGE . '>)\n                        )\n                        FILTER(isUri(?value))\n                    }\n                LIMIT 20'\n                );\n\n                if (!empty($pdata)) {\n                    $types   = array();\n                    $ranges  = array();\n                    $domains = array();\n                    // prepare the data in arrays\n                    foreach ($pdata as $data) {\n                        if (($data['key'] == EF_RDF_TYPE) && ($data['value'] != EF_RDF_PROPERTY)) {\n                            $types[] = $data['value'];\n                        } elseif ($data['key'] == EF_RDFS_RANGE) {\n                            $ranges[] = $data['value'];\n                        } elseif ($data['key'] == EF_RDFS_DOMAIN) {\n                            $domains[] = $data['value'];\n                        }\n                    }\n\n                    if (!empty($types)) {\n                        $newProperty['type'] = array_unique($types);\n                    }\n\n                    if (!empty($ranges)) {\n                        $newProperty['range'] = array_unique($ranges);\n                    }\n\n                    if (!empty($domains)) {\n                        $newProperty['domain'] = array_unique($domains);\n                    }\n\n                }\n                $output[$property['uri']] = $newProperty;\n            }\n        }\n\n        // send the response\n        $response->setHeader('Content-Type', 'application/json');\n        $response->setBody(json_encode($output));\n    }\n\n\n    /**\n     * JSON output of the RDFauthor init config, which is a RDF/JSON Model\n     * without objects where the user should be able to add data\n     *\n     * get/post parameters:\n     *   mode - class, resource or clone\n     *          class: prop list based on one class' resources\n     *          resource: prop list based on one resource\n     *          clone: prop list and values based on one resource (with new uri)\n     *          edit: prop list and values based on one resource\n     *   uri  - parameter for mode (class uri, resource uri)\n     */\n    public function rdfauthorinitAction()\n    {\n        // service controller needs no view renderer\n        $this->_helper->viewRenderer->setNoRender();\n        // disable layout for Ajax requests\n        $this->_helper->layout()->disableLayout();\n\n        $store    = OntoWiki::getInstance()->erfurt->getStore();\n        $response = $this->getResponse();\n        $model    = $this->_owApp->selectedModel;\n\n        if (isset($this->_request->m)) {\n            $model = $store->getModel($this->_request->m);\n        }\n        if (empty($model)) {\n            throw new OntoWiki_Exception('Missing parameter m (model) and no selected model in session!');\n        }\n\n        if ((isset($this->_request->uri)) && (Zend_Uri::check($this->_request->uri))) {\n            $parameter = $this->_request->uri;\n        } else {\n            throw new OntoWiki_Exception('Missing or invalid parameter uri (clone uri) !');\n        }\n\n        if (isset($this->_request->mode)) {\n            $workingMode = $this->_request->mode;\n        } else {\n            $workingMode = 'resource';\n        }\n\n        if ($workingMode != 'edit') {\n            $resourceUri = $model->getBaseUri() . 'newResource/' . md5(date('F j, Y, g:i:s:u a'));\n        } else {\n            $resourceUri = $parameter;\n        }\n\n        if ($workingMode == 'class') {\n            $properties = $model->sparqlQuery(\n                'SELECT DISTINCT ?uri ?value {\n                ?s ?uri ?value.\n                ?s a <' . $parameter . '>.\n                } LIMIT 20 ', array('result_format' => 'extended')\n            );\n        } elseif ($workingMode == 'clone') {\n            // FIXME: more than one values of a property are not supported right now\n            // FIXME: Literals are not supported right now\n            $properties = $model->sparqlQuery(\n                'SELECT ?uri ?value {\n                <' . $parameter . '> ?uri ?value.\n                #FILTER (isUri(?value))\n                } LIMIT 20 ', array('result_format' => 'extended')\n            );\n        } elseif ($workingMode == 'edit') {\n            $properties = $model->sparqlQuery(\n                'SELECT ?uri ?value {\n                <' . $parameter . '> ?uri ?value.\n                } LIMIT 20 ', array('result_format' => 'extended')\n            );\n        } else { // resource\n            $properties = $model->sparqlQuery(\n                'SELECT DISTINCT ?uri ?value {\n                <' . $parameter . '> ?uri ?value.\n                } LIMIT 20 ', array('result_format' => 'extended')\n            );\n        }\n\n        // empty object to hold data\n        $output        = new stdClass();\n        $newProperties = new stdClass();\n\n        $properties = $properties['results']['bindings'];\n\n        // feed title helper w/ URIs\n        $titleHelper = new OntoWiki_Model_TitleHelper($model);\n        $titleHelper->addResources($properties, 'uri');\n\n        if (!empty($properties)) {\n            foreach ($properties as $property) {\n\n                $currentUri   = $property['uri']['value'];\n                $currentValue = $property['value']['value'];\n                $currentType  = $property['value']['type'];\n\n                $value = new stdClass();\n\n                if ($currentType == 'literal' || $currentType == 'typed-literal') {\n                    if (isset($property['value']['datatype'])) {\n                        $value->datatype = $property['value']['datatype'];\n                    } else {\n                        if (isset($property['value']['xml:lang'])) {\n                            $value->lang = $property['value']['xml:lang'];\n                        }\n                    }\n                }\n\n                // return title from titleHelper\n                $value->title = $titleHelper->getTitle($currentUri);\n\n                if ($currentUri == EF_RDF_TYPE) {\n                    switch ($workingMode) {\n                        case 'resource':\n                            /* fallthrough */\n                        case 'clone':\n                            $value->value = $currentValue;\n                            break;\n                        case 'edit':\n                            $value->value = $currentValue;\n                            break;\n                        case 'class':\n                            $value->value = $parameter;\n                            break;\n                    }\n\n                    $value->type = $currentType;\n                } else { // $currentUri != EF_RDF_TYPE\n                    if (($workingMode == 'clone') || ($workingMode == 'edit')) {\n                        $value->value = $currentValue;\n                        $value->type  = $currentType;\n                    }\n                    if ($workingMode == 'class') {\n                        $value->value = '';\n                        $value->type  = $currentType;\n                    }\n                }\n\n                // deal with multiple values of a property\n                if (isset($newProperties->$currentUri)) {\n                    $tempProperty               = $newProperties->$currentUri;\n                    $tempProperty[]             = $value;\n                    $newProperties->$currentUri = $tempProperty;\n                } else {\n                    $newProperties->$currentUri = array($value);\n                }\n            } // foreach\n            $output->$resourceUri = $newProperties;\n        } else {\n            // empty sparql results -> start with a plain resource\n            if ($workingMode == 'class') {\n                // for classes, add the rdf:type property\n                $value               = new stdClass();\n                $value->value        = $parameter;\n                $value->type         = 'uri';\n                $value->hidden       = true;\n                $uri                 = EF_RDF_TYPE;\n                $newProperties->$uri = array($value);\n            }\n\n            $value                = new stdClass();\n            $value->type          = 'literal';\n            $value->title         = 'label';\n            $uri                  = EF_RDFS_LABEL;\n            $newProperties->$uri  = array($value);\n            $output->$resourceUri = $newProperties;\n        }\n\n        // send the response\n        $response->setHeader('Content-Type', 'application/json');\n        $response->setBody(json_encode($output));\n    }\n\n    protected function _findStatementsForObjectsWithHashes($graphUri, $indexWithHashedObjects, $hashFunc = 'md5')\n    {\n        $queryOptions = array(\n            'result_format' => 'extended'\n        );\n        $result       = array();\n        foreach ($indexWithHashedObjects as $subject => $predicates) {\n            foreach ($predicates as $predicate => $hashedObjects) {\n                $query    = \"SELECT ?o FROM <$graphUri> WHERE {<$subject> <$predicate> ?o .}\";\n                $queryObj = Erfurt_Sparql_SimpleQuery::initWithString($query);\n\n                if ($queryResult = $this->_owApp->erfurt->getStore()->sparqlQuery($queryObj, $queryOptions)) {\n                    $bindings = $queryResult['results']['bindings'];\n\n                    for ($i = 0, $max = count($bindings); $i < $max; $i++) {\n                        $currentObject = $bindings[$i]['o'];\n\n                        $objectString = Erfurt_Utils::buildLiteralString(\n                            $currentObject['value'],\n                            isset($currentObject['datatype']) ? $currentObject['datatype'] : null,\n                            isset($currentObject['xml:lang']) ? $currentObject['xml:lang'] : null\n                        );\n\n                        $hash = $hashFunc($objectString);\n                        if (in_array($hash, $hashedObjects)) {\n                            // add current statement to result\n                            if (!isset($result[$subject])) {\n                                $result[$subject] = array();\n                            }\n                            if (!isset($result[$subject][$predicate])) {\n                                $result[$subject][$predicate] = array();\n                            }\n\n                            $objectSpec = array(\n                                'value' => $currentObject['value'],\n                                'type'  => str_replace('typed-', '', $currentObject['type'])\n                            );\n                            if (isset($currentObject['datatype'])) {\n                                $objectSpec['datatype'] = $currentObject['datatype'];\n                            } else {\n                                if (isset($currentObject['xml:lang'])) {\n                                    $objectSpec['lang'] = $currentObject['xml:lang'];\n                                }\n                            }\n\n                            array_push($result[$subject][$predicate], $objectSpec);\n                        }\n                    }\n                }\n            }\n        }\n\n        return $result;\n    }\n\n    /**\n     * Removes all statements whose object has an empty URI.\n     *\n     * Seems as if these kind of statements are sometimes provided by the RDFAuthor editor.\n     *\n     * @param array(string=>array(string=>array(string=>string))) $statements\n     * @return array(string=>array(string=>array(string=>string)))\n     */\n    protected function sanitizeStatements(array $statements)\n    {\n        foreach (array_keys($statements) as $subject) {\n            /* @var $subject string */\n            foreach (array_keys($statements[$subject]) as $predicate) {\n                /* @var $predicate string */\n                foreach ($statements[$subject][$predicate] as $index => $objectSpec) {\n                    /* @var $index integer */\n                    /* @var $objectSpec array(string=>string) */\n                    if ($objectSpec['type'] === 'uri' && empty($objectSpec['value'])) {\n                        // Empty URIs are not allowed, remove this statement from the list.\n                        unset($statements[$subject][$predicate][$index]);\n                    }\n                }\n            }\n        }\n        return $statements;\n    }\n}\n"
  },
  {
    "path": "application/scripts/README-Vagrant.md",
    "content": "Getting Started\n---------------\n\n1. Install VirtualBox [1] + Vagrant [2]\n2. Install vbguest plugin for Vagrant: `vagrant gem install vagrant-vbguest`\n3. Add the following to your `/etc/hosts` file\n\n    192.168.33.10 ontowiki.local\n    192.168.33.10 phpmyadmin.ontowiki.local\n\n4. Run `make vagrant` (only the first time) afterwards use `vagrant up`\n\n- [1] https://www.virtualbox.org\n- [2] http://vagrantup.com\n\n5. Just type `http://192.168.33.10` into your browser\n\n"
  },
  {
    "path": "application/scripts/clearCache.php",
    "content": "#!/usr/bin/env php\n<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki bootstrap file.\n *\n * @category OntoWiki\n * @author Norman Heino <norman.heino@gmail.com>\n */\n\n/*\n * error handling for the very first includes etc.\n * http://stackoverflow.com/questions/1241728/\n */\nfunction errorHandler ($errno, $errstr, $errfile, $errline, array $errcontext)\n{\n    // error was suppressed with the @-operator\n    if (0 === error_reporting()) {\n        return false;\n    }\n    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);\n}\n\n/*\n * method to get evironment variables which are prefixed with \"REDIRECT_\"\n * in some configurations Apache prefixes the environment variables on each rewrite walkthrough\n * e.g. under centos\n */\nfunction getEnvVar ($key)\n{\n    $prefix = \"REDIRECT_\";\n    if (isset($_SERVER[$key])) {\n        return $_SERVER[$key];\n    }\n    foreach ($_SERVER as $k => $v) {\n        if (substr($k, 0, strlen($prefix)) == $prefix) {\n            if (substr($k, -(strlen($key))) == $key) {\n                return $v;\n            }\n        }\n    }\n    return null;\n}\n\nfunction initApp(){\n    /* Profiling */\n    define('REQUEST_START', microtime(true));\n\n    set_error_handler('errorHandler');\n       /**\n     * Bootstrap constants\n     * @since 0.9.5\n     */\n    if (!defined('__DIR__')) {\n        define('__DIR__', dirname(__FILE__));\n    } // fix for PHP < 5.3.0\n    define('BOOTSTRAP_FILE', basename(__FILE__));\n    define('ONTOWIKI_ROOT', rtrim(dirname(dirname(__DIR__)), '/\\\\') . DIRECTORY_SEPARATOR);\n    define('APPLICATION_PATH', ONTOWIKI_ROOT . 'application'.DIRECTORY_SEPARATOR);\n    define('CACHE_PATH', ONTOWIKI_ROOT . 'cache'.DIRECTORY_SEPARATOR);\n\n    /**\n     * Old constants for < 0.9.5 backward compatibility\n     * @deprecated 0.9.5\n     */\n    define('_OWBOOT', BOOTSTRAP_FILE);\n    define('_OWROOT', ONTOWIKI_ROOT);\n    define('OW_SHOW_MAX', 5);\n\n    // PHP environment settings\n    ini_set('max_execution_time', 240);\n\n    if ((int)substr(ini_get('memory_limit'), 0, -1) < 256) {\n        ini_set('memory_limit', '256M');\n    }\n\n    /*\n     * include path preparation\n     */\n    // init with local path in order to prefer these over system paths\n    $includePath = ONTOWIKI_ROOT . 'libraries/' . PATH_SEPARATOR;\n    // append local Erfurt include path\n    if (file_exists(ONTOWIKI_ROOT . 'libraries/Erfurt/Erfurt/App.php')) {\n        $includePath .= ONTOWIKI_ROOT . 'libraries/Erfurt/' . PATH_SEPARATOR;\n    } else if (file_exists(ONTOWIKI_ROOT . 'libraries/Erfurt/library/Erfurt/App.php')) {\n        $includePath .= ONTOWIKI_ROOT . 'libraries/Erfurt/library' . PATH_SEPARATOR;\n    }\n    // append system include paths\n    $includePath .= get_include_path() . PATH_SEPARATOR;\n    // set the include path\n    set_include_path($includePath);\n\n    // use default timezone from php.ini or let PHP guess it\n    date_default_timezone_set(@date_default_timezone_get());\n\n    // determine wheter rewrite engine works\n    // and redirect to a URL that doesn't need rewriting\n    // TODO: check for AllowOverride All\n    $rewriteEngineOn = false;\n    define('ONTOWIKI_REWRITE', $rewriteEngineOn);\n\n    /** check/include Zend_Application */\n    try {\n        // use include, so we can catch it with the error handler\n        require_once 'Zend/Application.php';\n    } catch (Exception $e) {\n        header('HTTP/1.1 500 Internal Server Error');\n        echo 'Fatal Error: Could not load Zend library.<br />' . PHP_EOL\n             . 'Maybe you need to install it with apt-get or with \"make zend\"?' . PHP_EOL;\n        exit;\n    }\n\n    // create application\n    $application = new Zend_Application(\n        'default',\n        ONTOWIKI_ROOT . 'application/config/application.ini'\n    );\n\n    /** check/include OntoWiki */\n    try {\n        // use include, so we can catch it with the error handler\n        require_once 'OntoWiki.php';\n    } catch (Exception $e) {\n        print('Fatal Error: Could not load the OntoWiki Application Framework classes.' . PHP_EOL);\n        print('Your installation directory seems to be screwed.' . PHP_EOL);\n        exit;\n    }\n\n    /* check/include Erfurt_App */\n    try {\n        // use include, so we can catch it with the error handler\n        require_once 'Erfurt/App.php';\n    } catch (Exception $e) {\n        print('Fatal Error: Could not load the Erfurt Framework classes.' . PHP_EOL);\n        print('Maybe you should install it with apt-get or with \"make deploy\"?' . PHP_EOL);\n        exit;\n    }\n\n    // restore old error handler\n    restore_error_handler();\n\n    // bootstrap\n    try {\n        $application->bootstrap();\n    } catch (Exception $e) {\n        print('Error on bootstrapping application: ' . $e->getMessage() . PHP_EOL);\n        exit;\n    }\n    return $application;\n}\nchdir (\"../..\");\n\ninitApp();\n\n$erfurt = Erfurt_App::getInstance();\n$erfurt->getCache()->clean();\n$erfurt->getQueryCache()->cleanUpCache(array('mode' => 'uninstall'));\n\n#if (Zend_Translate::hasCache()) {\n#    Zend_Translate::clearCache();\n#}\n"
  },
  {
    "path": "application/scripts/extensions-ini2n3.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Script to convert extensions ini configuration to the new N3 format\n *\n * @category OntoWiki\n * @package OntoWiki_Scripts\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass INI {\n    /**\n     *  WRITE\n     */\n    static function write($filename, $ini) {\n        $string = '';\n        foreach(array_keys($ini) as $key) {\n            $string .= '['.$key.\"]\\n\";\n            $string .= INI::write_get_string($ini[$key], '').\"\\n\";\n        }\n        file_put_contents($filename, $string);\n    }\n    /**\n     *  write get string\n     */\n    static function write_get_string(& $ini, $prefix) {\n        $string = '';\n        ksort($ini);\n        foreach($ini as $key => $val) {\n            if (is_array($val)) {\n                $string .= INI::write_get_string($ini[$key], $prefix.$key.'.');\n            } else {\n                $string .= $prefix.$key.' = '.str_replace(\"\\n\", \"\\\\\\n\", INI::set_value($val)).\"\\n\";\n            }\n        }\n        return $string;\n    }\n    /**\n     *  manage keys\n     */\n    static function set_value($val) {\n        if ($val === true) { return 'true'; }\n        else if ($val === false) { return 'false'; }\n        return $val;\n    }\n    /**\n     *  READ\n     */\n    static function read($filename) {\n        $ini = array();\n        $lines = file($filename);\n        $section = 'default';\n        $multi = '';\n        foreach($lines as $line) {\n            if (substr($line, 0, 1) !== ';') {\n                $line = str_replace(\"\\r\", \"\", str_replace(\"\\n\", \"\", $line));\n                $line = preg_replace('/\"(\\s*);(.*)$/', '\"', $line); //remove comment after value\n                $line = preg_replace('/\\'(\\s*);(.*)$/', '\\'', $line); //remove comment after value\n                \n                if (preg_match('/^\\[(.*)\\]/', $line, $m)) {\n                    $section = $m[1];\n                } else if ($multi === '' && preg_match('/^([a-z0-9_.\\[\\]-]+)\\s*=\\s*(.*)$/i', $line, $m)) {\n                    $key = $m[1];\n                    $val = $m[2];\n                    if (substr($val, -1) !== \"\\\\\") {\n                        $val = trim($val);\n                        INI::manage_keys($ini[$section], $key, $val);\n                        $multi = '';\n                    } else {\n                        $multi = substr($val, 0, -1).\"\\n\";\n                    }\n                } else if ($multi !== '') {\n                    if (substr($line, -1) === \"\\\\\") {\n                        $multi .= substr($line, 0, -1).\"\\n\";\n                    } else {\n                        INI::manage_keys($ini[$section], $key, $multi.$line);\n                        $multi = '';\n                    }\n                }\n            }\n        }\n        \n        return $ini;\n    }\n    /**\n     *  manage keys\n     */\n    static function get_value($val) {\n        if (preg_match('/^-?[0-9]*$/i', $val)) { return intval($val); } \n        else if (strtolower($val) === 'yes') { return true; }\n        else if (strtolower($val) === 'true') { return true; }\n        else if (strtolower($val) === 'no') { return false; }\n        else if (strtolower($val) === 'false') { return false; }\n        else if (preg_match('/^\"(.*)\"$/i', $val, $m)) { return $m[1]; }\n        else if (preg_match('/^\\'(.*)\\'$/i', $val, $m)) { return $m[1]; }\n        \n        //unquoted string, remove comments and trim\n        $cPos = strpos($val, ';');\n        if($cPos === false ){\n            return trim($val);\n        } else {\n            return trim(substr($val, 0, $cPos));\n        }\n    }\n    /**\n     *  manage keys\n     */\n    static function get_key($val) {\n        if (preg_match('/^[0-9]$/i', $val)) { return intval($val); }\n        return $val;\n    }\n    /**\n     *  manage keys\n     */\n    static function manage_keys(& $ini, $key, $val) {\n        if (preg_match('/^([a-z0-9_-]+)\\.(.*)$/i', $key, $m)) {\n            INI::manage_keys($ini[$m[1]], $m[2], $val);\n        } else if (preg_match('/^([a-z0-9_-]+)\\[(.*)\\]$/i', $key, $m)) {\n            if ($m[2] !== '') {\n                $ini[$m[1]][INI::get_key($m[2])] = INI::get_value($val);\n            } else {\n                $ini[$m[1]][] = INI::get_value($val);\n            }\n        } else {\n            $ini[INI::get_key($key)] = INI::get_value($val);\n        }\n    }\n    /**\n     *  replace utility\n     */\n    static function replace_consts(& $item, $key, $consts) {\n        if (is_string($item)) {\n            $item = strtr($item, $consts);\n        }\n    }\n}\n\nclass ExtensionSerializer\n{\n      private $_map = array(\n        'name'          => array(\n                            'type'=>'literal',\n                            'property'=>'rdfs:label'\n                        ),\n        'enabled'       =>array(\n                            'type'=>'literal',\n                            'property'=>'owconfig:enabled',\n                            'datatype' => 'boolean'\n                        ),\n        'author'        =>array(\n                            'type'=>'literal',\n                            'property'=>'owconfig:authorLabel'\n                        ),\n        'templates'     =>array(\n                            'type'=>'literal',\n                            'property'=>'owconfig:templates'\n                        ),\n        'languages'     =>array(\n                            'type'=>'literal',\n                            'property'=>'owconfig:languages'\n                        ),\n        'helpers'        =>array(\n                            'type'=>'literal',\n                            'property'=>'owconfig:helpers'\n                        ),\n        'caching'   =>array(\n                            'type'=>'literal',\n                            'property'=>'owconfig:caching',\n                            'datatype' => 'boolean'\n                        ),\n        'priority'   =>array(\n                            'type'=>'literal',\n                            'property'=>'owconfig:priority'\n                        ),\n        'description'   =>array(\n                            'type'=>'literal',\n                            'property'=>'doap:description'\n                        ),\n        'contexts'   =>array(\n                            'type'=>'literal',\n                            'property'=>'owconfig:context'\n                        ),\n        'title'   =>array(\n                            'type'=>'literal',\n                            'property'=>'rdfs:label'\n                        ),\n        'classes'   =>array(\n                            'type'=>'literal',\n                            'property'=>'owconfig:class'\n                        ),\n        'action'   =>array(\n                            'type'=>'literal',\n                            'property'=>'owconfig:defaultAction'\n                        ), \n        'authorUrl'     =>array(\n                            'type'=>'uri',\n                            'property'=>'doap:maintainer',\n\n                        )\n    );\n    private $_lastSubject = null;\n    private $_bnCounter = 0;\n    private $_parent = null;\n    private $_depth = 0;\n\n    function resetLastSubject()\n    {\n        echo ' .'.PHP_EOL;\n        $this->_lastSubject = null;\n    }\n\n    function addBN($subj, $prop)\n    {\n        $bn = $this->_bnCounter++;\n        $bn = '_:'.$bn;\n        //echo \"start bn for \".$prop.\" bn=\".$bn.PHP_EOL;\n        $this->printStatement($subj, $prop, '[');\n        $this->_parent = $this->_lastSubject;\n        $this->_lastSubject = $bn;\n        $this->_depth++;\n        return $bn;\n    }\n\n    function endBN($uri = null)\n    {\n        /*if($uri != null){\n            if($uri != $this->_lastSubject){\n                return; //do not end this, this is not what you wanted to end\n            }\n        }*/\n        //$this->flush();\n        $this->_depth--;\n        $i = str_repeat('    ', $this->_depth);\n        echo PHP_EOL.$i.']';\n        $this->_lastSubject = $this->_parent;\n    }\n\n    function getObject($property, $value)\n    {\n        if (is_string($value)) {\n            $value = addslashes($value);\n        }\n        if ((isset($this->_map[$property]) && $this->_map[$property]['type'] == 'uri') || Erfurt_Uri::check($value)) {\n             $object =  '<'.$value.'>';\n        } else if (is_bool($value)) {\n             $object =  '\"'.($value ? 'true' : 'false').'\"^^xsd:boolean';\n        } else if (is_string($value) && $value == 'true' || $value == 'false') {\n             $object =  '\"'.($value == 'true' ? 'true' : 'false').'\"^^xsd:boolean'; //why?\n        } else if (isset($this->_map[$property]['datatype']) && $this->_map[$property]['datatype'] == 'boolean') {\n             $object =  '\"'.((bool)$value ? 'true' : 'false').'\"^^xsd:boolean';\n        } else {\n             $object =  '\"'.$value.'\"';\n        }\n        return $object;\n    }\n    \n    function getPredicate($property, $sectionname)\n    {\n        return ( \n            (!isset($this->_map[$property]) || $sectionname == 'private') ? \n            ':'.$property :\n            $this->_map[$property]['property']\n        );\n    }\n\n    function printStatement($s, $p, $o)\n    {\n        //indent\n        $i = str_repeat('    ', $this->_depth);\n        /*if (substr($this->_lastSubject, 0, 2) == '_:' && substr($s, 0, 2) != '_:') {\n            //echo substr($s, 0, 2).PHP_EOL;\n            //echo \"end bn implicitly. old: \".$this->_lastSubject. \" s: $s p: $p o:$o\".PHP_EOL;\n            $this->endBN($this->_lastSubject);\n        }*/\n        if ($this->_lastSubject == null) {\n            $this->_lastSubject = $s;\n            echo $i.$s.' '. $p .' '.$o;\n        } else if ($this->_lastSubject == $s) {\n            echo ' ;'.PHP_EOL.$i.'  '. $p .' '.$o; \n        } else {\n            $this->_lastSubject = $s;\n            echo ' .'.PHP_EOL.$i.$s.' '. $p .' '.$o; \n        }\n    }\n    function __destruct() \n    {\n       $this->flush();\n    }\n\n    function flush() \n    {\n       echo ' .'.PHP_EOL;\n    }\n}\n\nclass NestedPropertyAndModuleHandler\n{\n                            \n    public $modules = array();\n    public $properties = array();\n\n    /**\n     *\n     * @var ExtensionSerializer \n     */\n    private $_printer = null;\n\n    private $_subject = null;\n\n    private $_parent = null;\n\n    function __construct(ExtensionSerializer $_printer, $_subj)\n    {\n        $this->_printer = $_printer;\n        $this->_subject = $_subj;\n    }\n\n    function printProperty($name, $value)\n    {\n        $this->_parent = $this->_subject;\n        $bnUri = $this->_printer->addBN($this->_subject, 'owconfig:config');\n        $this->_subject = $bnUri;\n        $this->_printer->printStatement($bnUri, 'a', 'owconfig:Config;');\n        $this->_printer->printStatement($bnUri, 'owconfig:id', '\"'.$name.'\";');\n        //$this->_printer->printStatement($bnUri, 'rdfs:comment', '\"fixme\";');\n        \n        foreach ($value as $subKey => $subValue) {  \n            if (!is_array($subValue)) {\n                $this->_printer->printStatement(\n                    $bnUri, \n                    $this->_printer->getPredicate($subKey, ''), \n                    $this->_printer->getObject($subKey, $subValue)\n                );\n            } else {\n                if (!self::is_numeric($subValue)) {\n                    $this->printProperty($subKey, $subValue);\n                } else {\n                    foreach ($subValue as $subSubKey => $subSubValue) {\n                        if (!is_array($subSubValue)) {\n                            $this->_printer->printStatement(\n                                $bnUri, \n                                $this->_printer->getPredicate($subKey, ''), //omit the $subSubKey here!\n                                $this->_printer->getObject($subKey, $subSubValue)\n                            );\n                        } else {\n                            $this->printProperty($subKey, $subValue);\n                        }\n                    }\n                }\n            }\n        } \n        \n        $this->_printer->endBN($bnUri);\n    }\n    \n    static private function is_assoc ($arr) \n    {\n        return (is_array($arr) && count(array_filter(array_keys($arr), 'is_string')) == count($arr));\n    }\n    \n    static private function is_numeric ($arr) \n    {\n        return (is_array($arr) && count(array_filter(array_keys($arr), 'is_int')) == count($arr));\n    }\n\n    function printN3()\n    {\n        foreach ($this->modules as $name => $config) {\n            //print a module\n            $moduleUri = ':'.ucfirst($name);\n            $this->_printer->printStatement($this->_subject, 'owconfig:hasModule', $moduleUri);\n            $this->_printer->printStatement($moduleUri, 'a', 'owconfig:Module');\n            if (!isset($config['title'])) {\n                $this->_printer->printStatement($moduleUri, 'rdfs:label', '\"'.ucfirst($name).'\"');\n            }\n            foreach ($config as $prop => $val) {\n                if (!is_array(($val))) {\n                    $this->_printer->printStatement(\n                        $moduleUri, \n                        $this->_printer->getPredicate($prop, ''), \n                        $this->_printer->getObject($prop, $val)\n                    );\n                } else {\n                    foreach ($val as $subval) { //recursion is not needed (?)\n                        $this->_printer->printStatement(\n                            $moduleUri, \n                            $this->_printer->getPredicate($prop, ''), \n                            $this->_printer->getObject($prop, $subval)\n                        );\n                    }\n                }\n            }\n            $this->_printer->resetLastSubject();\n        }\n\n        if (is_array($this->properties)) {\n            foreach ($this->properties as $name => $value) {\n                if (is_array($value)) {\n                    if (self::is_numeric($value)) {\n                       foreach ($value as $subval) {\n                           $this->_printer->printStatement(\n                               $this->_subject, \n                               $this->_printer->getPredicate($name, 'private'), \n                               $this->_printer->getObject($name, $subval)\n                           );\n                       } \n                    } else {\n                        $this->printProperty($name, $value, 1, null);\n                    }\n                } else {\n                    $this->_printer->printStatement(\n                        $this->_subject, \n                        $this->_printer->getPredicate($name, 'private'), \n                        $this->_printer->getObject($name, $value)\n                    );\n                }\n            }\n        } \n    }\n\n}\n\nclass Converter\n{\n    static function convert($iniPath, $extension)\n    {\n        ob_start();\n        $privNS = \"https://github.com/AKSW/$extension/raw/master/doap.n3#\";\n        //!!!!REMOVE THIS LINE AFTER YOU HAVE REVIEWED/FIXED THIS FILE!!!!\n        echo <<<EOT\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <$privNS> .\n\n\nEOT;\n        require_once __DIR__.'/../../libraries/Zend/Config.php';\n        require_once __DIR__.'/../../libraries/Zend/Config/Ini.php';\n        $config = INI::read($iniPath);\n        //var_dump($config);\n        if(!isset($config['default'])){\n            $config['default'] = array();\n        }\n        foreach ($config as $sectionname => $sectionconf) {\n            if(!in_array($sectionname, array('default','events', 'private'))){\n                $config['default'][$sectionname]  = $sectionconf;\n                unset($config[$sectionname]);\n            }\n        }\n        //var_dump($config); exit;\n\n        $subject = ':'.$extension;\n        $es = new ExtensionSerializer();\n        $es->printStatement('<>', 'foaf:primaryTopic', $subject);\n        $es->printStatement($subject, 'a', 'doap:Project');\n        $es->printStatement($subject, 'doap:name', '\"'.$extension.'\"');\n        $es->printStatement($subject, 'owconfig:privateNamespace', '<'.$privNS.'>');\n        \n        $mp = new NestedPropertyAndModuleHandler($es, $subject);\n\n        foreach ($config as $sectionname => $sectionconf) {\n            if ($sectionname == 'private') {\n                $mp->properties = $sectionconf;\n                continue;\n            } \n            if (is_array($sectionconf)) {\n                foreach ($sectionconf as $property => $value) {\n                    if ($property == 'modules') {\n                        $mp->modules = array_merge_recursive($mp->modules, $value);\n                        continue;\n                    } else if ($property == 'priority' || $property == 'contexts' \n                            || $property == 'caching' || $property == 'title') {\n                        $mp->modules = array_merge_recursive(\n                            $mp->modules, \n                            array('default'=>(array($property=>$value)))\n                        );\n                    } else if ($sectionname == 'default' && $property == 'helperEvents') {\n                        $predicate = 'owconfig:helperEvent';\n                        if(is_array($value)){\n                            foreach ($value as $v){\n                                $object = 'event:'.$v;\n                                $es->printStatement($subject, $predicate, $object);\n                            }\n                        } else {\n                            $object = 'event:'.$value;\n                            $es->printStatement($subject, $predicate, $object);\n                        }\n                    } else if ($sectionname == 'events') {\n                        $predicate = 'owconfig:pluginEvent';\n                        if(is_array($value)){\n                            foreach ($value as $v){\n                                $object = 'event:'.$v;\n                                $es->printStatement($subject, $predicate, $object);\n                            }\n                        } else {\n                            $object = 'event:'.$value;\n                            $es->printStatement($subject, $predicate, $object);\n                        }\n                    } else {\n                        //this is not in global section and not in events\n                        $predicate = $es->getPredicate($property, $sectionname);\n                        if (is_array($value)) {\n                            //should never happen\n                        } else {\n                            $object = $es->getObject($property, $value);\n                            $es->printStatement($subject, $predicate, $object);\n                        }\n                    }\n                }\n            } else {\n                //parsing a property that has no section -> global section (the first lines until the first section)\n                $property = $sectionname;\n                $value = $sectionconf;\n\n                $predicate = $es->getPredicate($property, $sectionname);\n                $object = $es->getObject($property, $value);\n                $es->printStatement($subject, $predicate, $object);\n            }\n        }\n\n        $mp->printN3();\n        \n        $version = ':v1-0';\n        $es->printStatement($subject, 'doap:release', $version);\n        $es->printStatement($version, 'a', 'doap:Version');\n        $es->printStatement($version, 'doap:revision', '\"1.0\"');\n        \n        //make sure the destructors are called\n        $es = null;\n        $mp = null;\n        \n        $res = ob_get_clean();\n\n        //some wtf fixes :)\n        $res = str_replace(\";;\", \";\", $res);\n        $res = str_replace(\"[;\", \"[\", $res);\n        $res = str_replace(\"; ;\", \";\", $res);\n        $res = str_replace(\"[ ;\", \"[\", $res);\n        $res = preg_replace(\"/\\\\]\\s*\\.?\\n\\s*_:[0-9]*/\", \"];\\n\", $res);\n        $res = preg_replace(\"/.\\n\\s*_:[0-9]*/\", \";\\n\", $res);\n        return $res;\n    }\n}\n\n//script\n$path = realpath(__DIR__.'/../../libraries/');\nset_include_path(get_include_path() . PATH_SEPARATOR . $path);\nrequire_once realpath(__DIR__.'/../../libraries/Erfurt/library/Erfurt/Uri.php');\n\nif ($argc > 4) {\n    echo 'usage: extensions-ini2n3.sh [<extension-name>]'.PHP_EOL; exit(-1);\n} else {\n    if ($argc==2) {\n        echo Converter::convert(__DIR__.'/../../extensions/'.$argv[1].'/default.ini', $argv[1]);\n    } else if ($argc==4) {\n        $in = $argv[1];\n        $out = $argv[2];\n        $name = $argv[3];\n        $newContent = Converter::convert($in, $name);\n        file_put_contents($out, $newContent);\n    } else {\n        $dir = realpath(__DIR__.'/../../extensions/');\n        if ($handle = opendir($dir)) {\n            while (false !== ($file = readdir($handle))) {\n                $fullPath = realpath($dir.DIRECTORY_SEPARATOR.$file);\n                if (\n                        $file != \".\" && $file != \"..\" && $file != \"themes\" && \n                        $file != \"translations\" && is_dir($fullPath) && is_writable($fullPath)\n                ) {\n                    //echo $file.PHP_EOL;\n                    $origIni = realpath($fullPath.DIRECTORY_SEPARATOR.'default.ini');\n                    if (file_exists($origIni) && is_readable($origIni)) {\n                        $newFile = $fullPath.\"/doap.n3\";\n                        echo \"write \".$newFile.PHP_EOL;\n                        file_put_contents($newFile, Converter::convert($origIni, $file));\n                    } else {\n                        echo 'no default.ini in '.$fullPath.PHP_EOL;\n                    }\n                } else {\n                    echo 'skipping non-extension dir '.$fullPath.PHP_EOL;\n                }\n            }\n            closedir($handle);\n        }\n    }\n}\n"
  },
  {
    "path": "application/scripts/makeBackup.sh",
    "content": "#!/bin/sh\n\nfor model in `owcli -l`\ndo\n    filename=`echo \"$model\" | md5sum | cut -d \" \" -f 1`\n    owcli -m \"$model\" -e model:export >$filename.rdf\ndone\n"
  },
  {
    "path": "application/scripts/makeRelease.sh",
    "content": "#!/bin/bash\n# @(#) Creates an OntoWiki Release ZIP File\n\nparameter=\"$1\"\nif [ \"$parameter\" == \"\" ]\nthen\n        echo \"No Version Parameter (e.g. 0.9.5)!\"\n        exit 1;\nfi\n\nreleaseDirBase=\"ontowiki-$parameter\"\nreleaseZIP=\"./$releaseDirBase.zip\"\nreleaseDir=\"/tmp/$releaseDirBase\"\n\nOWHG=\"https://ontowiki.googlecode.com/hg/\"\n\nif [ -e \"$releaseDir\" ]\nthen\n  echo \"There exists a Directory $releaseDir\"\n  echo \"Delete by hand and start again ...\"\n  exit 1\nfi\n\nif [ ! -e \"$releaseDir\" ]\nthen\n  echo \"Checkout $OWHG to $releaseDir\"\n  hg --config web.cacerts= clone $OWHG $releaseDir || exit\nelse\n  echo \"Try to update $releaseDir (or exit on failure)\"\n  hg --config web.cacerts= pull $releaseDir || exit\nfi\n\ncd $releaseDir\necho \"update to OntoWiki-$parameter\"\nhg --config web.cacerts= update OntoWiki-$parameter || exit\nmake update\n\necho \"Delete unwanted files and directories in $releaseDir\"\n#rm -rf `find $releaseDir -name '.svn'`\nrm -rf $releaseDir/.hg\nrm -rf $releaseDir/extensions.ext\n\necho \"Create and copy additional files and directories in $releaseDir\"\nmkdir $releaseDir/cache $releaseDir/logs $releaseDir/uploads\nchmod 777 $releaseDir/cache $releaseDir/logs $releaseDir/uploads\nchmod 777 extensions\n\necho \"Download and unpack a Zend Framework\"\ncd $releaseDir && make zend\n\necho \"Create the ZIP ~/$releaseDirBase.zip\"\ncd $releaseDir/.. && zip -q -9 -r ~/$releaseDirBase.zip $releaseDirBase\n\necho \"Create the tar.gz ~/$releaseDirBase.tar.gz\"\ncd $releaseDir/.. && tar czf ~/$releaseDirBase.tar.gz $releaseDirBase\n\necho \"Create the 7zip ~/$releaseDirBase.7z\"\ncd $releaseDir/.. && 7zr a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on ~/$releaseDirBase.7z $releaseDirBase >/dev/null\n\necho \"Create the ZIP ~/$releaseDirBase-without-Zend.zip\"\nrm -rf $releaseDir/libraries/Zend/ && cd $releaseDir/.. && zip -q -9 -r ~/$releaseDirBase-without-Zend.zip $releaseDirBase\n\necho \"Delete the release dir\"\nrm -rf $releaseDir\n\n"
  },
  {
    "path": "application/scripts/mod-auth-external/ontowiki.php",
    "content": "#!/usr/bin/env php5\n<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki mod-auth-external Authenticator\n *\n * This is an authenticator script for usage in a mod-auth-external pipe\n * configuration.\n *\n * @copyright  Copyright (c) 2009-2010 {@link http://aksw.org AKSW}\n * @license    http://www.gnu.org/licenses/gpl.txt  GNU GENERAL PUBLIC LICENSE v2\n * @link       http://code.google.com/p/mod-auth-external/\n */\n\n// you can use this script as a copy outside the ontowiki tree but you need\n// provide a valid ONTOWIKI_ROOT for this\n//define('ONTOWIKI_ROOT', '/path/to/ontowiki/');\ndefine('ONTOWIKI_ROOT', rtrim(dirname(__FILE__), '/\\\\') . '/../../../');\ndefine('APPLICATION_PATH', ONTOWIKI_ROOT . 'application/');\n\n// add libraries to include path\n$includePath = get_include_path() . PATH_SEPARATOR;\n$includePath .= ONTOWIKI_ROOT . 'libraries/' . PATH_SEPARATOR;\n$includePath .= ONTOWIKI_ROOT . 'libraries/Erfurt/' . PATH_SEPARATOR;\nset_include_path($includePath);\n\n// init the autoloader (so we do not need require_once anymore)\nrequire_once 'Zend/Loader/Autoloader.php';\n$loader = Zend_Loader_Autoloader::getInstance();\n$loader->registerNamespace('Erfurt_');\n\n// session is needed for authentication\n$session = new Zend_Session_Namespace('OntoWiki_mod-auth-external_Authenticator');\n\n// Parse the OntoWiki configuration\n$config = new Zend_Config_Ini(ONTOWIKI_ROOT . 'config.ini', 'private');\n\n// start the Erfurt engine (with a specific config)\n$app = Erfurt_App::getInstance(false);\n$app->start($config);\n\n// grab the user/pass from php://stdin\n$stdin = file_get_contents ( 'php://stdin');\n\n// split the input by EOL\n$userpass = explode( PHP_EOL, $stdin);\n\n// set and check username\nif ( (isset($userpass[0])) && ($userpass[0] != '') ) {\n    $user = $userpass[0];\n} else {\n    echo \"No user given\" . PHP_EOL;\n    exit (1);    \n}\n\n// set password\nif ( isset($userpass[1]) ) {\n    $pass = $userpass[1];\n} else {\n    $pass = '';\n}\n\n// Try to authenticate the user\n// http://files.zend.com/help/Zend-Framework/zend.auth.html#zend.auth.introduction.results\n$authResult = $app->authenticate($user, $pass);\n\n// return 0 or 1 (message output on error)\nif ($authResult->getCode() == Zend_Auth_Result::SUCCESS) {\n    exit (0);\n} else {\n    foreach ($authResult->getMessages() as $message) {\n        echo \"(User: $user) $message\" . PHP_EOL;\n    }\n    exit (1);\n}\n"
  },
  {
    "path": "application/scripts/odbctest.php",
    "content": "#! /usr/bin/env php\n<?php\n// Check for odbc extension\nif (!extension_loaded('odbc')) {\n    echo 'ODBC exenstion needs to be available! Try to install e.g. via ' .\n         '\"sudo apt-get install php5-odbc\"' . PHP_EOL;\n    exit;\n}\n\n// Check for config.ini\n$confiDirPath =  dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR;\n\n$dsn      = null;\n$username = null;\n$password = null;\n\n$customConfigPath  = $confiDirPath . 'config.ini';\n$defaultConfigPath = $confiDirPath . 'config.ini.dist';\n$config = null;\nif (file_exists($customConfigPath)) {\n    $config = parse_ini_file($customConfigPath);\n} else if (file_exists($defaultConfigPath)) {\n    // If not found try config.ini.dist (default settings)\n    $config = parse_ini_file($defaultConfigPath);\n}\nif (is_array($config)) {\n    if (isset($config['store.virtuoso.dsn'])) {\n        $dsn = $config['store.virtuoso.dsn'];\n    }\n    if (isset($config['store.virtuoso.username'])) {\n        $username = $config['store.virtuoso.username'];\n    }\n    if (isset($config['store.virtuoso.password'])) {\n        $password = $config['store.virtuoso.password'];\n    }\n}\n\nif (null === $dsn) {\n    // ask\n    echo 'DSN: ';\n    $dsn = trim(fgets(STDIN));\n}\nif (null === $username) {\n    // ask\n    echo 'Username: ';\n    $username = trim(fgets(STDIN));\n}\nif (null === $password) {\n    // ask\n    echo 'Password: ';\n    $password = trim(fgets(STDIN));\n}\n\n$conn = @odbc_connect($dsn, $username, $password);\nif (!$conn) {\n    echo 'Connection failed - Something is wrong with your configuration.' . PHP_EOL;\n    echo 'Used connection parameters:' . PHP_EOL;\n    echo '    - DSN:      ' . $dsn . PHP_EOL;\n    echo '    - Username: ' . $username . PHP_EOL;\n    echo '    - Password: ' . $password . PHP_EOL . PHP_EOL;\n    echo 'Error message: ' . odbc_errormsg() . PHP_EOL;\n    exit;\n}\n\n$query  = 'SELECT DISTINCT ?g WHERE {GRAPH ?g { ?s ?p ?o . }}';\n$result = @odbc_exec($conn, 'CALL DB.DBA.SPARQL_EVAL(\\'' . $query . '\\', NULL, 0)');\nif (!$result) {\n    echo 'Query failed - Something is wrong with your configuration.' . PHP_EOL;\n    echo 'Used connection parameters:' . PHP_EOL;\n    echo '    - DSN:      ' . $dsn . PHP_EOL;\n    echo '    - Username: ' . $username . PHP_EOL;\n    echo '    - Password: ' . $password . PHP_EOL . PHP_EOL;\n    echo 'Error message: ' . odbc_errormsg() . PHP_EOL;\n    @odbc_close($conn);\n    exit;\n}\n\necho 'Your connection to Virtuoso seems to work fine:' . PHP_EOL;\n\nwhile (@odbc_fetch_row($result)) {\n     echo '    - ' . @odbc_result($result, 1) . PHP_EOL;\n}\n\nif ($conn) {\n    @odbc_close($conn);\n}\n\n"
  },
  {
    "path": "application/scripts/owadmin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\ndefine('SCRIPT_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);\n\nif (!defined('APPLICATION_PATH')) {\n    define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));\n}\nset_include_path(implode(PATH_SEPARATOR, array(\n    APPLICATION_PATH . '/../libraries',\n    get_include_path(),\n)));\nrequire_once 'Zend/Loader/Autoloader.php';\nZend_Loader_Autoloader::getInstance();\n\n// Define some CLI options\n$getopt = new Zend_Console_Getopt(array(\n    'virtload'  => 'Import files in data directory into Virtuoso',\n    'virtclear' => 'Clear a specified graph',\n    'help|h'   => 'Help -- usage message',\n));\ntry {\n    $getopt->parse();\n} catch (Zend_Console_Getopt_Exception $e) {\n    // Bad options passed: report usage\n    echo $e->getUsageMessage();\n    return false;\n}\n\n// If help requested, report usage message\nif ($getopt->getOption('h')) {\n    echo $getopt->getUsageMessage();\n    return true;\n} else if ($getopt->getOption('virtload')) {\n    return _importData();\n} else if ($getopt->getOption('virtclear')) {\n    return _clearGraph();\n} else {\n    echo $getopt->getUsageMessage();\n    return true;\n}\n\n\nreturn true;\n\n/* Functions */\n\nfunction _clearGraph()\n{\n    $graph = _chooseGraph();\n    if (!$graph) {\n        return false;\n    }\n    $command = \"isql VERBOSE=OFF \\\"EXEC=sparql DELETE FROM <$graph> {?s ?p ?o} WHERE {?s ?p ?o}\\\" 2>&1 1> /dev/null\";\n    $output = shell_exec($command);\n    if (null !== $output) {\n        return false;\n    }\n    \n    echo \"DONE!\" . PHP_EOL;\n    return true;\n}\n\nfunction _importData()\n{\n    // Check for files\n    $importFiles = array();\n    $files = scandir(SCRIPT_DIR . 'data');\n    foreach ($files as $file) {\n        if ($file[0] === '.') {\n            continue;\n        }\n        $importFiles[$file] = SCRIPT_DIR . 'data' . DIRECTORY_SEPARATOR . $file;\n    }\n    \n    $failed = false;\n    $failReason = '';\n    foreach ($importFiles as $file=>$fullPath) {\n        $ending = substr($file, -4);\n        switch ($ending) {\n            case '.ttl':\n                break;\n            case '.owl':\n            case '.rdf':\n                $newPath = SCRIPT_DIR . 'tmp' . DIRECTORY_SEPARATOR . 'sourceNtriples.ttl';\n                $cmd = \"rapper -gqo ntriples '$fullPath' 2>&1 1> /dev/null > '$newPath'\";\n                $output = shell_exec($cmd);\n                if (null !== $output) {\n                    echo 'Error while converting source file to TTL.';\n                    return;\n                }\n                $fullPath = $newPath;\n                break;\n            default: \n                continue;\n        }\n        \n        \n        \n        echo \"Preparing import of file $file now.\" . PHP_EOL;\n        $graph = _chooseGraph();\n        if (!$graph) {\n            $failed = true;\n            $failReason = 'Invalid Graph!';\n            break;\n        }\n        echo \"Will import data into graph <$graph>.\" . PHP_EOL;\n        \n        $splitFiles = _splitFiles($fullPath);\n        $count = count($splitFiles);\n        foreach ($splitFiles as $i=>$splitFile) {\n            $progress = round(($i/$count)*100.0);\n            echo \"\\rImporting $file now: $progress%\";\n            if (!$failed) {\n                $result = _importFile($splitFile, $graph);\n            }\n            unlink($splitFile);\n            if (!$result) {\n                $failed = true;\n                $failReason = 'Import failed';\n            }\n        }\n        \n        // Move file to done dir!\n        if (!$failed) {\n            copy($fullPath, SCRIPT_DIR.'done'.DIRECTORY_SEPARATOR.$file);\n            unlink($fullPath);\n        }\n        \n        echo PHP_EOL;\n    }\n    \n    if ($failed) {\n        echo $failReason . PHP_EOL;\n    } else {\n        echo 'DONE!' . PHP_EOL;\n    }\n    return true;\n}\n\nfunction _splitFiles($fullPath)\n{\n    $splitFiles = array();\n    \n    $fHandle = fopen($fullPath, 'r');\n    $fileCount = 0;\n    $i = 0;\n    $currentContent = '';\n    if ($fHandle) {\n        while ($line = fgets($fHandle)) {\n            $currentContent .= $line;\n            \n            $i++;\n            if ($i === 10000) {\n                $tmp = SCRIPT_DIR . 'tmp' . DIRECTORY_SEPARATOR . $fileCount++;\n                file_put_contents($tmp, $currentContent);\n                $splitFiles[] = $tmp;\n                $i = 0;\n                $currentContent = '';\n            }\n        }\n        if ($currentContent !== '') {\n            $tmp = SCRIPT_DIR . 'tmp' . DIRECTORY_SEPARATOR . $fileCount++;\n            file_put_contents($tmp, $currentContent);\n            $splitFiles[] = $tmp;\n        }\n    }\n    fclose($fHandle);\n    \n    return $splitFiles;\n}\n\nfunction _chooseGraph()\n{\n    $command = 'isql VERBOSE=OFF \"EXEC=SELECT ID_TO_IRI(REC_GRAPH_IID) AS GRAPH FROM DB.DBA.RDF_EXPLICITLY_CREATED_GRAPH\"';\n    \n    $output = shell_exec($command);\n    $outputLines = explode(\"\\n\", $output);\n    \n    $startReached = false;\n    $graphs = array();\n    foreach ($outputLines as $line) {\n        $trimmedLine = trim($line);\n        if ($trimmedLine === '') {\n            continue;\n        }\n        if (strpos($trimmedLine, '______________________________') !== false) {\n            $startReached = true;\n            continue;\n        }\n        if ($startReached) {\n            $graphs[] = $line;\n        }\n    }\n    \n    echo \"Choose a graph:\\n\";\n    foreach ($graphs as $i=>$g) {\n        echo \"    ($i) $g\" . PHP_EOL;\n    }\n    echo \"Just type in the number: \";\n    $input = intval(trim(fgets(STDIN)));\n    \n    if (isset($graphs[$input])) {\n        return $graphs[$input];\n    }\n    \n    return false;\n}\n\nfunction _importFile($file, $graph)\n{\n    $command = \"isql 1111 dba dba \\\"EXEC=TTLP(file_to_string_output('$file'), '', '$graph', 255)\\\" 2>&1 1> /dev/null\";\n    $output = shell_exec($command);\n    if (null !== $output) {\n        var_dump($output);return;\n        return false;\n    }\n    \n    return true;\n}\n"
  },
  {
    "path": "application/scripts/runExtensionTests.sh",
    "content": "#!/bin/bash\n\nextensionName=\"$1\"\nif [ \"$extensionName\" == \"\" ]\nthen\n    echo \"No extension name provided\"\n    exit 1;\nfi\n\nextensionDir=\"./extensions/$extensionName\"\nif [ ! -e \"$extensionDir\" ]\nthen\n  echo \"The extension $extensionDir does not exist ...\"\n  exit 1\nfi\n\nphpunit --bootstrap application/tests/Bootstrap.php $extensionDir\n"
  },
  {
    "path": "application/scripts/travis/README.md",
    "content": "- `install-services.sh` to handle the install of additional services\n\n## SPARQL services\n\nThis file and scripts are taken form the SemanticMediaWiki repo and only selected files where copied for running tests with virtuoso.\nIt is taken as of commit 721a63d3a73400300f73e0a088196a6ed0fe5afd from https://github.com/SemanticMediaWiki/SemanticMediaWiki.\nThe unsupported services are marked with *Enabled* \"No\".\n\n<table>\n\t<tr>\n\t\t<th>Enabled</th>\n\t\t<th>Service</th>\n\t\t<th>Connector</th>\n\t\t<th>QueryEndPoint</th>\n\t\t<th>UpdateEndPoint</th>\n\t\t<th>DataEndpoint</th>\n\t\t<th>DefaultGraph</th>\n\t\t<th>Comments</th>\n\t</tr>\n\t<tr>\n\t\t<th>No</th>\n\t\t<th>Fuseki (mem)<sup>1</sup></th>\n\t\t<td>Fuseki</td>\n\t\t<td>http://localhost:3030/db/query</td>\n\t\t<td>http://localhost:3030/db/update</td>\n\t\t<td>''</td>\n\t\t<td>''</td>\n\t\t<td>fuseki-server --update --port=3030 --mem /db</td>\n\t</tr>\n\t<tr>\n\t\t<th>No</th>\n\t\t<th>Fuseki (memTDB)</th>\n\t\t<td>Fuseki</td>\n\t\t<td>http://localhost:3030/db/query</td>\n\t\t<td>http://localhost:3030/db/update</td>\n\t\t<td>''</td>\n\t\t<td>http://example.org/myFusekiGraph</td>\n\t\t<td>fuseki-server --update --port=3030 --memTDB --set tdb:unionDefaultGraph=true /db</td>\n\t</tr>\n\t<tr>\n\t\t<th>Yes</th>\n\t\t<th>Virtuoso opensource</th>\n\t\t<td>Virtuoso</td>\n\t\t<td>http://localhost:8890/sparql</td>\n\t\t<td>http://localhost:8890/sparql</td>\n\t\t<td>''</td>\n\t\t<td>http://example.org/myVirtuosoGraph</td>\n\t\t<td>sudo apt-get install virtuoso-opensource</td>\n\t</tr>\n\t<tr>\n\t\t<th>No</th>\n\t\t<th>4store<sup>2</sup></th>\n\t\t<td>4store</td>\n\t\t<td>http://localhost:8088/sparql/</td>\n\t\t<td>http://localhost:8088/update/</td>\n\t\t<td>''</td>\n\t\t<td>http://example.org/myFourGraph</td>\n\t\t<td>apt-get install 4store</td>\n\t</tr>\n\t<tr>\n\t\t<th>No</th>\n\t\t<th>Sesame</th>\n\t\t<td>Custom</td>\n\t\t<td>http://localhost:8080/openrdf-sesame/repositories/test-smw</td>\n\t\t<td>http://localhost:8080/openrdf-sesame/repositories/test-smw/statements</td>\n\t\t<td>''</td>\n\t\t<td>`test-smw` is specifed as native in-memory store</td>\n\t\t<td></td>\n\t</tr>\n\n</table>\n\n<sup>1</sup> When running integration tests with [Jena Fuseki][fuseki] it is suggested that the `in-memory` option is used to avoid potential loss of production data during test execution.\n\n<sup>2</sup> Currently, Travis-CI doesn't support `4Store` (1.1.4-2) as service but the following configuration has been sucessfully tested with the available test suite. ([issue #110](https://github.com/garlik/4store/issues/110) )\n\n[fuseki]: https://jena.apache.org/\n[virtuoso]: https://github.com/openlink/virtuoso-opensource\n[4store]: https://github.com/garlik/4store\n"
  },
  {
    "path": "application/scripts/travis/install-extensions.sh",
    "content": "#!/bin/bash\n\necho $TRAVIS_PHP_VERSION\n\n# skip hhvm\nif [[ $TRAVIS_PHP_VERSION = \"hhv\"* ]]; then\n    exit 0\nfi\n\n# get build dependencies\nsudo apt-get install -y unixodbc-dev\n\nPHPVERSION=$( php -v | head -n1 | sed \"s|^PHP \\([0-9][0-9\\.]*\\).*$|\\1|\" | tr -d '\\n' )\n\nls ~/.phpenv/versions/\necho \"PHPVERSION: \" $PHPVERSION\necho \"LOADED CONFIG: \" `php --ini | grep \"Loaded Configuration\" | sed -e \"s|.*:\\s*||\"`\n\n# get php sources\nwget https://github.com/php/php-src/archive/php-$PHPVERSION.tar.gz\nls\ntar -xzf php-$PHPVERSION.tar.gz\n\n# build odbc extension\ncd php-src-php-$PHPVERSION/ext/odbc/\nphpize\n# use fix from https://github.com/docker-library/php/issues/103\nsed -ri 's@^ *test +\"\\$PHP_.*\" *= *\"no\" *&& *PHP_.*=yes *$@#&@g' configure\n./configure --with-unixODBC=shared,/usr\nmake\nmake install\n\n# enable odbc\necho \"extension=odbc.so\" >> `php --ini | grep \"Loaded Configuration\" | sed -e \"s|.*:\\s*||\"`\n\n# build pdo_odbc\ncd ../pdo_odbc/\nphpize\n./configure --with-pdo-odbc=unixODBC,/usr\nmake\nmake install\n\n#enable pdo_odbc\necho \"extension=pdo_odbc.so\" >> `php --ini | grep \"Loaded Configuration\" | sed -e \"s|.*:\\s*||\"`\nphp -m\n"
  },
  {
    "path": "application/scripts/travis/install-services.sh",
    "content": "#!/bin/bash\nset -ex\nBASE_PATH=$(pwd)\nE_UNREACHABLE=86\n\n# skip hhvm\nif [[ $TRAVIS_PHP_VERSION = \"hhv\"* ]]; then\n    exit 0\nfi\n\nif [ \"$FOURSTORE\" != \"\" ] || [ \"$VIRTUOSO\" != \"\" ] || [ \"$SESAME\" != \"\" ] || [[ \"$FUSEKI\" == \"2.\"* ]]\nthen\n\tsudo apt-get update -qq\nfi\n\n# Version 1.1.0 is available and testable on Travis/SMW\nif [ \"$FUSEKI\" != \"\" ]\nthen\n\t# Archive\n\t# http://archive.apache.org/dist/jena/binaries/jena-fuseki-$FUSEKI-distribution.tar.gz\n\t# http://www.eu.apache.org/dist/jena/binaries/jena-fuseki-$FUSEKI-distribution.tar.gz\n\n\t# Avoid ERROR 503: Service Unavailable\n\t# wget http://archive.apache.org/dist/jena/binaries/jena-fuseki-$FUSEKI-distribution.tar.gz\n\n\tif [[ \"$FUSEKI\" == \"2.\"* ]]\n\tthen\n\n\t\t# Fuseki requires Java8 for Fuseki2 v2.3.0 onwards\n\t\tsudo apt-get install oracle-java8-installer\n\n\t\texport JAVA_HOME=\"/usr/lib/jvm/java-8-oracle\";\n\t\texport PATH=\"$PATH:/usr/lib/jvm/java-8-oracle/bin\";\n\t\texport java_path=\"/usr/lib/jvm/java-8-oracle/jre/bin/java\";\n\n\t\twget https://github.com/mwjames/travis-support/raw/master/fuseki/$FUSEKI/apache-jena-fuseki-$FUSEKI.tar.gz\n\n\t\t# option z caused \"gzip: stdin: not in gzip format\"\n\t\ttar -xf apache-jena-fuseki-$FUSEKI.tar.gz\n\t\tmv apache-jena-fuseki-$FUSEKI fuseki\n\telse\n\t\twget https://github.com/mwjames/travis-support/raw/master/fuseki/$FUSEKI/jena-fuseki-$FUSEKI-distribution.tar.gz\n\n\t\ttar -zxf jena-fuseki-$FUSEKI-distribution.tar.gz\n\t\tmv jena-fuseki-$FUSEKI fuseki\n\tfi\n\n\tcd fuseki\n\n\t## Start fuseki in-memory as background\n\tbash fuseki-server --update --mem /db &>/dev/null &\nfi\n\nif [ \"$SESAME\" != \"\" ]\nthen\n\tTOMCAT_VERSION=tomcat6\n\tsudo java -version\n\n\tsudo apt-get install $TOMCAT_VERSION\n\n\tCATALINA_BASE=/var/lib/$TOMCAT_VERSION\n\tCATALINA_HOME=/usr/share/$TOMCAT_VERSION\n\n\tsudo chown $USER -R $CATALINA_BASE/\n\tsudo chmod g+rw -R $CATALINA_BASE/\n\n\tsudo mkdir -p $CATALINA_HOME/.aduna\n\tsudo chown -R $TOMCAT_VERSION:$TOMCAT_VERSION $CATALINA_HOME\n\n\t# One method to get the war files\n\t# wget http://search.maven.org/remotecontent?filepath=org/openrdf/sesame/sesame-http-server/$SESAME/sesame-http-server-$SESAME.war -O openrdf-sesame.war\n\t# wget http://search.maven.org/remotecontent?filepath=org/openrdf/sesame/sesame-http-workbench/$SESAME/sesame-http-workbench-$SESAME.war -O openrdf-workbench.war\n\t# cp *.war /var/lib/tomcat6/webapps/\n\n\t# http://sourceforge.net/projects/sesame/\n\t# Unreliable sourceforge.net download\n\t# wget http://downloads.sourceforge.net/project/sesame/Sesame%202/$SESAME/openrdf-sesame-$SESAME-sdk.zip\n\twget https://github.com/mwjames/travis-support/raw/master/sesame/$SESAME/openrdf-sesame-$SESAME-sdk.zip\n\n\t# tar caused a lone zero block, using zip instead\n\tunzip -q openrdf-sesame-$SESAME-sdk.zip\n\tcp openrdf-sesame-$SESAME/war/*.war $CATALINA_BASE/webapps/\n\n\tsudo service $TOMCAT_VERSION restart\n\tps -ef | grep tomcat\n\n\tsleep 5\n\n\tif curl --output /dev/null --silent --head --fail \"http://localhost:8080/openrdf-sesame\"\n\t#if curl --output /dev/null --silent --head --fail \"http://localhost:8080/openrdf-sesame/home/overview.view\"\n\tthen\n\t\techo \"openrdf-sesame service url is reachable\"\n\telse\n\t\techo \"openrdf-sesame service url is not reachable\"\n\t\tsudo cat $CATALINA_BASE/logs/*.log &\n\t\tsudo cat $CATALINA_BASE/logs/catalina.out &\n\t\texit $E_UNREACHABLE\n\tfi\n\n\t./openrdf-sesame-$SESAME/bin/console.sh < $BASE_PATH/scripts/travis/openrdf-sesame-memory-repository.txt\nfi\n\n# Version 1.1.4-1 is available but has a problem\n# https://github.com/garlik/4store/issues/110\n# 4STORE can not be used as variable name therefore FOURSTORE\nif [ \"$FOURSTORE\" != \"\" ]\nthen\n\n\tsudo mkdir /var/lib/4store/\n\tsudo mkdir /var/lib/4store/db\n\tsudo chown $USER -R /var/lib/4store/\n\tsudo chmod g+rw -R /var/lib/4store/\n\n\tsudo apt-get install 4store=$FOURSTORE\n\n\t## Disabling the firewall\n\tsudo iptables -F\n\n\t4s-backend-setup db\n\t4s-backend db\n\n\t## Output the current process table\n\tps auwwx | grep 4s-\n\n\t## -D only used to check the status of the 4store instance\n\t## 4s-httpd -D -p 8088 db\n\n\t4s-httpd -p 8088 db\nfi\n\n# We build all Virtuoso version from scratch\nif [[ \"$VIRTUOSO\" != \"\" ]]\nthen\n\tsudo apt-get install libssl-dev -q\n\tsudo apt-get install autoconf automake bison flex gawk gperf libtool -q\n\n\tif [[ -f virtuoso-opensource/$VIRTUOSO/binsrc/virtuoso/virtuoso-t ]]\n\tthen\n\t\techo \"use cached virtuoso-opensource\"\n\t\tcd virtuoso-opensource/$VIRTUOSO\n\telse\n\t\t#git clone git://github.com/openlink/virtuoso-opensource.git\n\t\t#cd virtuoso-opensource\n\t\t#git pull origin stable/7\n\t\twget --no-check-certificate -q https://github.com/openlink/virtuoso-opensource/archive/v$VIRTUOSO.zip -O virtuoso-opensource.zip\n\n\t\tunzip -q virtuoso-opensource.zip\n\t\trm -r virtuoso-opensource/$VIRTUOSO || true\n\t\tmv virtuoso-opensource-$VIRTUOSO virtuoso-opensource/$VIRTUOSO\n\n\t\tcd virtuoso-opensource/$VIRTUOSO\n\t\t./autogen.sh\n\n\t\t# --disable-all-vads: This parameter disables building all the VAD packages (tutorials, demos, etc.).\n\t\t# --with-readline: This parameter is used so that the system Readline library is used\n\t\t# --program-transform-name: Both Virtuoso and unixODBC install a program named isql. Use this parameter to rename virtuosos program to isql-v\n\n\t\t./configure --program-transform-name=\"s/isql/isql-v/\" --with-readline --disable-all-vads |& tee #configure.log\n\n\t\t# Only output error and warnings\n\t\tmake > /dev/null\n\tfi\n\n\t# Build tree to start the automated test suite\n\t# make check\n\n\tsudo make install\n\n\t## For Virtuoso\n\t#export PATH=$PATH:/usr/local/virtuoso-opensource/bin\n\n\tsudo /usr/local/virtuoso-opensource/bin/virtuoso-t -f -c /usr/local/virtuoso-opensource/var/lib/virtuoso/db/virtuoso.ini &\n\t#sudo /usr/local/virtuoso-opensource/bin/virtuoso-t -f &\n\n\tsleep 15\n\n\tsudo /usr/local/virtuoso-opensource/bin/isql-v 1111 dba dba $BASE_PATH/application/scripts/travis/virtuoso-sparql-permission.sql\n\n\t# configure datasource name for ODBC connection\n\techo \"[VOS_TEST]\" | sudo tee -a /etc/odbc.ini > /dev/null\n\techo \"Driver=/usr/local/virtuoso-opensource/lib/virtodbc.so\" | sudo tee -a /etc/odbc.ini > /dev/null\n\techo \"Description=Virtuoso OpenSource Edition\" | sudo tee -a /etc/odbc.ini > /dev/null\n\techo \"Address=localhost:1111\" | sudo tee -a /etc/odbc.ini > /dev/null\nfi\n\n#@see  http://wiki.blazegraph.com/wiki/index.php/NanoSparqlServer\nif [ \"$BLAZEGRAPH\" != \"\" ]\nthen\n\t#sudo apt-get install tomcat6\n\n\t#sudo chown $USER -R /var/lib/tomcat6/\n\t#sudo chmod g+rw -R /var/lib/tomcat6/\n\n\t#sudo mkdir -p /usr/share/tomcat6/.aduna\n\t#sudo chown -R tomcat6:tomcat6 /usr/share/tomcat6\n\n\t# http://sourceforge.net/projects/bigdata/\n\t#wget http://downloads.sourceforge.net/project/bigdata/bigdata/$BLAZEGRAPH/bigdata.war\n\n\t#cp bigdata.war /var/lib/tomcat6/webapps/\n\t#export JAVA_OPTS=\"-server -Xmx2g -Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile=\"$BASE_PATH/scripts/travis/blazegraph-store.properties\n\n\t#sudo service tomcat6 restart\n\t#sleep 3\n\n\t#Using the jar\n\t# Unreliable sourceforge.net download\n\t# wget http://downloads.sourceforge.net/project/bigdata/bigdata/$BLAZEGRAPH/bigdata-bundled.jar\n\twget https://github.com/mwjames/travis-support/raw/master/blazegraph/$BLAZEGRAPH/bigdata-bundled.jar\n\n\tjava -server -Xmx4g -Dbigdata.propertyFile=$BASE_PATH/scripts/travis/blazegraph-store.properties -jar bigdata-bundled.jar &>/dev/null &\n\tsleep 5\n\n\tif curl --output /dev/null --silent --head --fail \"http://localhost:9999/bigdata\"\n\tthen\n\t\techo \"blazegraph service url is reachable\"\n\telse\n\t\techo \"blazegraph service url is not reachable\"\n\t\texit $E_UNREACHABLE\n\tfi\n\nfi\n"
  },
  {
    "path": "application/scripts/travis/virtuoso-sparql-permission.sql",
    "content": "GRANT EXECUTE ON DB.DBA.SPARQL_INSERT_DICT_CONTENT TO \"SPARQL\";\nGRANT EXECUTE ON DB.DBA.SPARQL_DELETE_DICT_CONTENT TO \"SPARQL\";\nGRANT EXECUTE ON SPARQL_DELETE_DICT_CONTENT to \"SPARQL\";\nGRANT EXECUTE ON SPARQL_DELETE_DICT_CONTENT to SPARQL_UPDATE;\nGRANT SPARQL_UPDATE to \"SPARQL\";\nGRANT SPARQL_SPONGE to \"SPARQL\";"
  },
  {
    "path": "application/scripts/vad/README.txt",
    "content": "\n1. configure variables at top of prepare.sh script\n2. running ./prepare.sh will checkout an OW into /tmp/ontowiki and run a virtuoso with the vad.ini config file (in /tmp/virtuoso)\n3. open a new shell \n3. type: \npath/to/isql 9999 dba dba 'DB.PACK.VAD.isql'\n\n"
  },
  {
    "path": "application/scripts/vad/ow_vad_sticker_template.xml",
    "content": "<?xml version=\"1.0\" encoding=\"ASCII\"?>\n<!DOCTYPE sticker SYSTEM \"vad_sticker.dtd\"[]>\n<sticker version=\"0.9.0\" xml:lang=\"en-US\">\n  <caption>\n    <name package=\"OntoWiki\">\n      <prop name=\"Title\" value=\"OntoWiki\" />\n      <prop name=\"Developer\" value=\"AKSW, Uni Leipzig\" />\n      <prop name=\"Copyright\" value=\"\" />\n      <prop name=\"Download\" value=\"http://ontowiki.net\" />\n      <prop name=\"Download\" value=\"http://code.google.com/p/ontowiki\" />\n    </name>\n    <version package=\"0.9.0\">\n      <prop name=\"Release Date\" value=\"2009-07-24 13:59\" />\n      <prop name=\"Build\" value=\"Beta test\" />\n    </version>\n  </caption>\n  <dependencies />\n  <procedures uninstallation=\"supported\" />\n  <ddls>\n<sql purpose=\"pre-install\"><![CDATA[\n\n  if (lt (sys_stat ('st_dbms_ver'), '05.11.3038')) {\n\tresult ('ERROR', 'The Onto Wiki package requires server version 05.11.3038 or greater');\n\tsignal ('FATAL', 'The Onto Wiki package requires server version 05.11.3038 or greater');\n   }\n\n]]></sql>\n\n<sql purpose=\"post-install\"><![CDATA[\n\nDB.DBA.VHOST_REMOVE (\n\t lhost=>'*ini*',\n\t vhost=>'*ini*',\n\t lpath=>'/OntoWiki'\n);\n\nDB.DBA.VHOST_DEFINE (\n\t lhost=>'*ini*',\n\t vhost=>'*ini*',\n\t lpath=>'/OntoWiki',\n\t ppath=>'/vad/vsp/ontowiki/',\n\t is_dav=>0,\n\t def_page=>'index.php',\n\t vsp_user=>'dba',\n\t ses_vars=>0,\n\t opts=>vector ('browse_sheet', '', 'url_rewrite', 'http_rule_list_2'),\n\t is_default_host=>0\n);\n\nDB.DBA.URLREWRITE_CREATE_RULELIST ( \n'http_rule_list_2', 1, \n  vector ('http_rule_4', 'http_rule_5'));\n\nDB.DBA.URLREWRITE_CREATE_REGEX_RULE ( \n'http_rule_4', 1, \n  '/OntoWiki/(.*)$', \nvector (), \n0, \n'/OntoWiki/index.php', \nvector (), \nNULL, \nNULL, \n0, \n0, \n'' \n);\n\nDB.DBA.URLREWRITE_CREATE_REGEX_RULE ( \n'http_rule_5', 1, \n  '/OntoWiki/(extensions|application|libraries)(.*).(js|ico|gif|jpg|png|css|php|swf)(.*)$', \nvector ('par_1', 'par_2', 'par_3', 'par_4'), \n4, \n'/OntoWiki/%s%s.%s%s', \nvector ('par_1', 'par_2', 'par_3', 'par_4'), \nNULL, \nNULL, \n0, \n0, \n'' \n);\n\n\n ]]></sql>\n <sql purpose=\"pre-uninstall\" />\n<sql purpose=\"post-uninstall\" />\n  </ddls>\n  <resources>\n\n"
  },
  {
    "path": "application/scripts/vad/ow_vad_sticker_template.xml_not_working",
    "content": "<?xml version=\"1.0\" encoding=\"ASCII\"?>\n<!DOCTYPE sticker SYSTEM \"vad_sticker.dtd\"[]>\n<sticker version=\"0.9.0\" xml:lang=\"en-US\">\n  <caption>\n    <name package=\"OntoWiki\">\n      <prop name=\"Title\" value=\"OntoWiki\" />\n      <prop name=\"Developer\" value=\"AKSW, Uni Leipzig\" />\n      <prop name=\"Copyright\" value=\"\" />\n      <prop name=\"Download\" value=\"http://ontowiki.net\" />\n      <prop name=\"Download\" value=\"http://code.google.com/p/ontowiki\" />\n    </name>\n    <version package=\"0.9.0\">\n      <prop name=\"Release Date\" value=\"2009-07-24 13:59\" />\n      <prop name=\"Build\" value=\"Beta test\" />\n    </version>\n  </caption>\n  <dependencies />\n  <procedures uninstallation=\"supported\" />\n  <ddls>\n<sql purpose=\"pre-install\"><![CDATA[\n\n  if (lt (sys_stat ('st_dbms_ver'), '05.11.3038')) {\n\tresult ('ERROR', 'The Onto Wiki package requires server version 05.11.3038 or greater');\n\tsignal ('FATAL', 'The Onto Wiki package requires server version 05.11.3038 or greater');\n   }\n\n]]></sql>\n\n<sql purpose=\"post-install\"><![CDATA[\n\nDB.DBA.USER_CREATE (\n        'OntoWikiAdmin',\n        uuid (),\n        vector ('LOGIN_QUALIFIER', 'OntoWiki',\n                'SQL_ENABLE', 1,\n                'DAV_ENABLE', 0,\n                'FULL_NAME', 'OntoWiki Administrator')\n);\n\ngrant SPARQL_SELECT to OntoWikiAdmin;\ngrant SPARQL_UPDATE to OntoWikiAdmin;\n\n\n// copied out of conductor ui\n\nDB.DBA.VHOST_REMOVE (\n\t lhost=>'*ini*',\n\t vhost=>'*ini*',\n\t lpath=>'/OntoWiki'\n);\n\nDB.DBA.VHOST_DEFINE (\n\t lhost=>'*ini*',\n\t vhost=>'*ini*',\n\t lpath=>'/OntoWiki',\n\t ppath=>'/vad/vsp/ontowiki/',\n\t is_dav=>0,\n\t def_page=>'index.php',\n\t vsp_user=>'OntoWikiAdmin',\n\t ses_vars=>0,\n\t opts=>vector ('browse_sheet', '', 'url_rewrite', 'http_rule_list_2'),\n\t is_default_host=>0\n);\n\nDB.DBA.URLREWRITE_CREATE_RULELIST ( \n'http_rule_list_2', 1, \n  vector ('http_rule_4', 'http_rule_5'));\n\nDB.DBA.URLREWRITE_CREATE_REGEX_RULE ( \n'http_rule_4', 1, \n  '/OntoWiki/(.*)$', \nvector (), \n0, \n'/OntoWiki/index.php', \nvector (), \nNULL, \nNULL, \n0, \n0, \n'' \n);\n\nDB.DBA.URLREWRITE_CREATE_REGEX_RULE ( \n'http_rule_5', 1, \n  '/OntoWiki/(extensions|application|libraries)(.*).(js|ico|gif|jpg|png|css|php|swf)(.*)$', \nvector ('par_1', 'par_2', 'par_3', 'par_4'), \n4, \n'/OntoWiki/%s%s.%s%s', \nvector ('par_1', 'par_2', 'par_3', 'par_4'), \nNULL, \nNULL, \n0, \n0, \n'' \n);\n\n\n ]]></sql>\n <sql purpose=\"pre-uninstall\" />\n<sql purpose=\"post-uninstall\" />\n  </ddls>\n  <resources>\n\n"
  },
  {
    "path": "application/scripts/vad/prepare.sh",
    "content": "#!/bin/bash\n\n\nVIRTTMP=/tmp/virtuoso\nSTICKERBEGIN=ow_vad_sticker_template.xml\nSTICKER=ow_vad_sticker.xml\nRESULTFILE=ontowiki_fs.vad\nISQLFILE=DB.PACK.VAD.isql\nVIRTUOSO_T=\"/opt/vos-6.1.2/bin/virtuoso-t -c vad.ini -f\"\nCURRENT=$PWD\n#do not change this below:\nBUILDPATH=/tmp/ontowiki\n\necho \"DB.DBA.VAD_PACK ('\"$PWD/$STICKER\"'  , ''  ,  '\"$PWD\"/\"$RESULTFILE\"'  );\nshutdown;  \" > $ISQLFILE\n\necho \"deleting \"$BUILDPATH\nrm -r $BUILDPATH\necho \"deleting \"$VIRTTMP\nrm -r $VIRTTMP\n\n\n\necho \"checking out ontowiki\"\nhg clone https://ontowiki.googlecode.com/hg/ $BUILDPATH\n\ncd $BUILDPATH\nmake zend\ncd $CURRENT\n\necho \"setting options in \"$BUILDPATH/config.ini\":\"\n\necho \"[private]\nstore.backend =  virtuoso\nstore.virtuoso.dsn = Local Virtuoso \nstore.virtuoso.username    = dba\nstore.virtuoso.password    = dba\nlanguages.locale = \\\"en\\\"\ndebug = on\ncache.query.enable = 0\n\" > $BUILDPATH/config.ini\n\necho \"*****************verify:\"\ncat $BUILDPATH/config.ini\necho \"*****************\"\n\nmkdir -v $BUILDPATH/logs\nchmod 777 $BUILDPATH/logs\nmkdir -v $BUILDPATH/cache\nchmod 777 $BUILDPATH/cache\n\n\necho \"vad sticker is assembled from \"$STICKERBEGIN\ncat $STICKERBEGIN >$STICKER\nfind $BUILDPATH -name \".hg\" | xargs rm -r\ncd /tmp\nfor onefile in `find ontowiki -type f | grep -v ' '`\ndo \necho \"<file type=\\\"http\\\" overwrite=\\\"yes\\\" source=\\\"http\\\" target_uri=\\\"\"$onefile\"\\\" makepath=\\\"yes\\\" />\" >> $CURRENT/$STICKER\ndone\ncd $CURRENT\necho \"</resources><registry /></sticker>\" >> $STICKER\necho \"sticker created at \"$STICKER\n\necho \"copying ontowiki where virtuoso expects it\"\n\nmkdir $VIRTTMP\nmkdir $VIRTTMP/vad\nmkdir $VIRTTMP/vad/vsp\ncp -r $BUILDPATH $VIRTTMP/vad/vsp\ncp vad.ini $VIRTTMP\ncd $VIRTTMP\n\n#Error 42VAD: [Virtuoso Driver][Virtuoso Server]Inexistent file resource (./vad/vsp//tmp/ontowiki/favicon.png)\n\n\n\n\n$VIRTUOSO_T\ncd $CURRENT\n"
  },
  {
    "path": "application/scripts/vad/vad.ini",
    "content": ";\n;  virtuoso.ini\n;\n;  Configuration file for the OpenLink Virtuoso VDBMS Server\n;\n;  To learn more about this product, or any other product in our\n;  portfolio, please check out our web site at:\n;\n;      http://virtuoso.openlinksw.com/\n;\n;  or contact us at:\n;\n;      general.information@openlinksw.com\n;\n;  If you have any technical questions, please contact our support\n;  staff at:\n;\n;      technical.support@openlinksw.com\n;\n;\n;  Database setup\n[Database]\nDatabaseFile       = /tmp/virtuoso/virtuoso.db\nErrorLogFile       = /tmp/virtuoso/virtuoso.log\nLockFile           = /tmp/virtuoso/virtuoso.lck\nTransactionFile    = /tmp/virtuoso/virtuoso.trx\nxa_persistent_file = /tmp/virtuoso/virtuoso.pxa\nErrorLogLevel      = 7\nFileExtend         = 200\nMaxCheckpointRemap = 2000\nStriping           = 0\nTempStorage        = TempDatabase\n\n[TempDatabase]\nDatabaseFile       = /tmp/virtuoso/virtuoso-temp.db\nTransactionFile    = /tmp/virtuoso/virtuoso-temp.trx\nMaxCheckpointRemap = 2000\nStriping           = 0\n\n;\n;  Server parameters\n;\n[Parameters]\nServerPort               = 9999\nLiteMode                 = 0\nDisableUnixSocket        = 1\nDisableTcpSocket         = 0\n;SSLServerPort\t\t\t= 2111\n;SSLCertificate\t\t\t= cert.pem\n;SSLPrivateKey\t\t\t= pk.pem\n;X509ClientVerify\t\t= 0\n;X509ClientVerifyDepth\t\t= 0\n;X509ClientVerifyCAFile\t\t= ca.pem\nServerThreads            = 20\nCheckpointInterval       = 60\nO_DIRECT                 = 0\nNumberOfBuffers          = 20000\nMaxDirtyBuffers          = 12000\nCaseMode                 = 2\nMaxStaticCursorRows      = 5000\nCheckpointAuditTrail     = 0\nAllowOSCalls             = 0\nSchedulerInterval        = 10\nDirsAllowed              = .,/, /tmp , /tmp/virtuoso\nThreadCleanupInterval    = 0\nThreadThreshold          = 10\nResourcesCleanupInterval = 0\nFreeTextBatchSize        = 100000\nSingleCPU                = 0\nVADInstallDir            = /tmp/virtuoso/share/virtuoso/vad/\nPrefixResultNames        = 0\nRdfFreeTextRulesSize     = 100\nIndexTreeMaps            = 256\n\n[HTTPServer]\nServerPort                  = 9998\nServerRoot                  = /tmp/virtuoso/var/lib/virtuoso/vsp\nServerThreads               = 20\nDavRoot                     = DAV\nEnabledDavVSP               = 0\nHTTPProxyEnabled            = 0\nTempASPXDir                 = 0\nDefaultMailServer           = localhost:25\nServerThreads               = 10\nMaxKeepAlives               = 10\nKeepAliveTimeout            = 10\nMaxCachedProxyConnections   = 10\nProxyConnectionCacheTimeout = 15\nHTTPThreadSize              = 280000\nHttpPrintWarningsInOutput   = 0\nCharset                     = UTF-8\nHTTPLogFile                 = /tmp/virtuoso/tmp/httplog20102010.log\n\n[AutoRepair]\nBadParentLinks = 0\n\n[Client]\nSQL_PREFETCH_ROWS  = 100\nSQL_PREFETCH_BYTES = 16000\nSQL_QUERY_TIMEOUT  = 0\nSQL_TXN_TIMEOUT    = 0\n;SQL_NO_CHAR_C_ESCAPE\t\t= 1\n;SQL_UTF8_EXECS\t\t\t= 0\n;SQL_NO_SYSTEM_TABLES\t\t= 0\n;SQL_BINARY_TIMESTAMP\t\t= 1\n;SQL_ENCRYPTION_ON_PASSWORD\t= -1\n\n[VDB]\nArrayOptimization           = 0\nNumArrayParameters          = 10\nVDBDisconnectTimeout        = 1000\nKeepConnectionOnFixedThread = 0\n\n[Replication]\nServerName   = db-UL\nServerEnable = 1\nQueueMax     = 50000\n\n;\n;  Striping setup\n;\n;  These parameters have only effect when Striping is set to 1 in the\n;  [Database] section, in which case the DatabaseFile parameter is ignored.\n;\n;  With striping, the database is spawned across multiple segments\n;  where each segment can have multiple stripes.\n;\n;  Format of the lines below:\n;    Segment<number> = <size>, <stripe file name> [, <stripe file name> .. ]\n;\n;  <number> must be ordered from 1 up.\n;\n;  The <size> is the total size of the segment which is equally divided\n;  across all stripes forming  the segment. Its specification can be in\n;  gigabytes (g), megabytes (m), kilobytes (k) or in database blocks\n;  (b, the default)\n;\n;  Note that the segment size must be a multiple of the database page size\n;  which is currently 8k. Also, the segment size must be divisible by the\n;  number of stripe files forming  the segment.\n;\n;  The example below creates a 200 meg database striped on two segments\n;  with two stripes of 50 meg and one of 100 meg.\n;\n;  You can always add more segments to the configuration, but once\n;  added, do not change the setup.\n;\n[Striping]\nSegment1 = 100M, db-seg1-1.db, db-seg1-2.db\nSegment2 = 100M, db-seg2-1.db\n;...\n;[TempStriping]\n;Segment1\t\t\t= 100M, db-seg1-1.db, db-seg1-2.db\n;Segment2\t\t\t= 100M, db-seg2-1.db\n;...\n;[Ucms]\n;UcmPath\t\t\t= <path>\n;Ucm1\t\t\t\t= <file>\n;Ucm2\t\t\t\t= <file>\n;...\n\n[Zero Config]\nServerName = virtuoso (UL)\n;ServerDSN\t\t\t= ZDSN\n;SSLServerName\t\t\t=\n;SSLServerDSN\t\t\t=\n\n[Mono]\n;MONO_TRACE\t\t\t= Off\n;MONO_PATH\t\t\t= <path_here>\n;MONO_ROOT\t\t\t= <path_here>\n;MONO_CFG_DIR\t\t\t= <path_here>\n;virtclr.dll\t\t\t=\n\n[URIQA]\nDynamicLocal = 1\nDefaultHost  = localhost:8890\n\n[SPARQL]\n;ExternalQuerySource\t\t= 1\n;ExternalXsltSource \t\t= 1\n;DefaultGraph      \t\t= http://localhost:8890/dataspace\n;ImmutableGraphs    \t\t= http://localhost:8890/dataspace\nResultSetMaxRows           = 10000\nMaxQueryCostEstimationTime = 400\t; in seconds\nMaxQueryExecutionTime      = 60\t; in seconds\nDefaultQuery               = select distinct ?Concept where {[] a ?Concept}\nDeferInferenceRulesInit    = 1\t; controls inference rules loading\n;PingService       \t\t= http://rpc.pingthesemanticweb.com/\n\n[Plugins]\nLoadPath = /tmp/virtuoso/lib/virtuoso/hosting\nLoad1    = plain, wikiv\nLoad2    = plain, mediawiki\nLoad3    = plain, creolewiki\nLoad4    = plain, im\n;Load5\t\t= plain, wbxml2\n;Load6\t\t\t= plain, hslookup\nLoad7    = attach, libphp5.so\nLoad8    = Hosting, hosting_php.so\n;Load9\t\t\t= Hosting,hosting_perl.so\n;Load10\t\t= Hosting,hosting_python.so\n;Load11\t\t= Hosting,hosting_ruby.so\n;Load12\t\t\t\t= msdtc,msdtc_sample\n"
  },
  {
    "path": "application/shell.worker.client.php",
    "content": "#!/usr/bin/env php\n<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki bootstrap file.\n *\n * @category OntoWiki\n * @author Norman Heino <norman.heino@gmail.com>\n */\n\n/**\n * error handling for the very first includes etc.\n * http://stackoverflow.com/questions/1241728/\n */\nfunction errorHandler($errno, $errstr, $errfile, $errline, array $errcontext)\n{\n    // error was suppressed with the @-operator\n    if (0 === error_reporting()) {\n        return false;\n    }\n    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);\n}\n\n/*\n * method to get evironment variables which are prefixed with \"REDIRECT_\"\n * in some configurations Apache prefixes the environment variables on each rewrite walkthrough\n * e.g. under centos\n */\nfunction getEnvVar($key)\n{\n    $prefix = \"REDIRECT_\";\n    if (isset($_SERVER[$key])) {\n        return $_SERVER[$key];\n    }\n    foreach ($_SERVER as $k => $v) {\n        if (substr($k, 0, strlen($prefix)) == $prefix) {\n            if (substr($k, -(strlen($key))) == $key) {\n                return $v;\n            }\n        }\n    }\n    return null;\n}\n\n/**\n *  Capsuled main script returning initializes application object\n *  @return     Zend_Application\n */\nfunction initApp()\n{\n    /* Profiling */\n    define('REQUEST_START', microtime(true));\n\n    set_error_handler('errorHandler');\n\n    /**\n     * Bootstrap constants\n     * @since 0.9.5\n     */\n    if (!defined('__DIR__')) {\n        define('__DIR__', dirname(__FILE__));\n    } // fix for PHP < 5.3.0\n    define('BOOTSTRAP_FILE', basename(__FILE__));\n    define('ONTOWIKI_ROOT', rtrim(dirname(__DIR__), '/\\\\') . DIRECTORY_SEPARATOR);\n    define('APPLICATION_PATH', ONTOWIKI_ROOT . 'application'.DIRECTORY_SEPARATOR);\n    define('CACHE_PATH', ONTOWIKI_ROOT . 'cache'.DIRECTORY_SEPARATOR);\n\n    /**\n     * Old constants for < 0.9.5 backward compatibility\n     * @deprecated 0.9.5\n     */\n    define('_OWBOOT', BOOTSTRAP_FILE);\n    define('_OWROOT', ONTOWIKI_ROOT);\n    define('OW_SHOW_MAX', 5);\n\n    // PHP environment settings\n    ini_set('max_execution_time', 240);\n\n    if ((int)substr(ini_get('memory_limit'), 0, -1) < 256) {\n        ini_set('memory_limit', '256M');\n    }\n\n    /*\n     * include path preparation\n     */\n    // init with local path in order to prefer these over system paths\n    $includePath = ONTOWIKI_ROOT . 'libraries/' . PATH_SEPARATOR;\n    // append local Erfurt include path\n    if (file_exists(ONTOWIKI_ROOT . 'libraries/Erfurt/Erfurt/App.php')) {\n        $includePath .= ONTOWIKI_ROOT . 'libraries/Erfurt/' . PATH_SEPARATOR;\n    } else if (file_exists(ONTOWIKI_ROOT . 'libraries/Erfurt/library/Erfurt/App.php')) {\n        $includePath .= ONTOWIKI_ROOT . 'libraries/Erfurt/library' . PATH_SEPARATOR;\n    }\n    // append system include paths\n    $includePath .= get_include_path() . PATH_SEPARATOR;\n    // set the include path\n    set_include_path($includePath);\n\n    // use default timezone from php.ini or let PHP guess it\n    date_default_timezone_set(@date_default_timezone_get());\n\n    // determine wheter rewrite engine works\n    // and redirect to a URL that doesn't need rewriting\n    // TODO: check for AllowOverride All\n    $rewriteEngineOn = false;\n    define('ONTOWIKI_REWRITE', $rewriteEngineOn);\n\n    /** check/include Zend_Application */\n    try {\n        // use include, so we can catch it with the error handler\n        require_once 'Zend/Application.php';\n    } catch (Exception $e) {\n        header('HTTP/1.1 500 Internal Server Error');\n        echo 'Fatal Error: Could not load Zend library.<br />' . PHP_EOL\n             . 'Maybe you need to install it with apt-get or with \"make zend\"?' . PHP_EOL;\n        return false;\n    }\n\n    // create application\n    $application = new Zend_Application(\n        'default',\n        ONTOWIKI_ROOT . 'application/config/application.ini'\n    );\n\n    /** check/include OntoWiki */\n    try {\n        // use include, so we can catch it with the error handler\n        require_once 'OntoWiki.php';\n    } catch (Exception $e) {\n        echo 'Fatal Error: Could not load the OntoWiki Application Framework classes.' . PHP_EOL;\n        echo 'Your installation directory seems to be screwed.' . PHP_EOL;\n        return false;\n    }\n\n    /* check/include Erfurt_App */\n    try {\n        // use include, so we can catch it with the error handler\n        require_once 'Erfurt/App.php';\n    } catch (Exception $e) {\n        echo 'Fatal Error: Could not load the Erfurt Framework classes.' . PHP_EOL;\n        echo 'Maybe you should install it with apt-get or with \"make deploy\"?' . PHP_EOL;\n        return false;\n    }\n\n    // restore old error handler\n    restore_error_handler();\n\n    // bootstrap\n    try {\n        $application->bootstrap();\n    } catch (Exception $e) {\n        echo 'Error on bootstrapping application: ' . $e->getMessage() . PHP_EOL;\n        return false;\n    }\n    return $application;\n}\n\n$application = initApp();\nif ($application === false) {\n    return 1;\n}\n\n$ontowiki    = OntoWiki::getInstance();\necho $ontowiki->config->version->label . ' ' . $ontowiki->config->version->number . PHP_EOL;\n\n$timeStart = microtime(true);\n\n/*  -- EXAMPLE JOB CALL --------------------------------------------------  */\n$ontowiki->callJob(\"test\", array('repeat' => 10));\n\n// initialize the cron job\n$ontowiki->callJob(\"cron\");\n\n//$workload   = array(\n    //'receiver'  => \"\",\n    //'sender'    => \"me@example.tld\",\n    //'subject'   => \"Test @ \".time(),\n    //'body'      => \"This is just a test...\"\n//);\n//if(empty($workload['receiver']))\n    //die(\"Please set receiver to run this example!\");\n//$client->call( \"testMail\", $workload );\n\n/*  -- END OF EXAMPLE --------------------------------------------------  */\n\necho \"done in \" . round((microtime(true) - $timeStart) * 1000, 2) . \"ms\" . PHP_EOL;\n"
  },
  {
    "path": "application/shell.worker.php",
    "content": "#!/usr/bin/env php\n<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki bootstrap file.\n *\n * @category OntoWiki\n * @author Norman Heino <norman.heino@gmail.com>\n */\n\n/*\n * error handling for the very first includes etc.\n * http://stackoverflow.com/questions/1241728/\n */\nfunction errorHandler($errno, $errstr, $errfile, $errline, array $errcontext)\n{\n    // error was suppressed with the @-operator\n    if (0 === error_reporting()) {\n        return false;\n    }\n    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);\n}\n\n/*\n * method to get evironment variables which are prefixed with \"REDIRECT_\"\n * in some configurations Apache prefixes the environment variables on each rewrite walkthrough\n * e.g. under centos\n */\nfunction getEnvVar($key)\n{\n    $prefix = \"REDIRECT_\";\n    if (isset($_SERVER[$key])) {\n        return $_SERVER[$key];\n    }\n    foreach ($_SERVER as $k => $v) {\n        if (substr($k, 0, strlen($prefix)) == $prefix) {\n            if (substr($k, -(strlen($key))) == $key) {\n                return $v;\n            }\n        }\n    }\n    return null;\n}\n\nfunction initApp()\n{\n    /* Profiling */\n    define('REQUEST_START', microtime(true));\n\n    set_error_handler('errorHandler');\n       /**\n     * Bootstrap constants\n     * @since 0.9.5\n     */\n    if (!defined('__DIR__')) {\n        define('__DIR__', dirname(__FILE__));\n    } // fix for PHP < 5.3.0\n    define('BOOTSTRAP_FILE', basename(__FILE__));\n    define('ONTOWIKI_ROOT', rtrim(dirname(__DIR__), '/\\\\') . DIRECTORY_SEPARATOR);\n    define('APPLICATION_PATH', ONTOWIKI_ROOT . 'application'.DIRECTORY_SEPARATOR);\n    define('CACHE_PATH', ONTOWIKI_ROOT . 'cache'.DIRECTORY_SEPARATOR);\n\n    /**\n     * Old constants for < 0.9.5 backward compatibility\n     * @deprecated 0.9.5\n     */\n    define('_OWBOOT', BOOTSTRAP_FILE);\n    define('_OWROOT', ONTOWIKI_ROOT);\n    define('OW_SHOW_MAX', 5);\n\n    // PHP environment settings\n    ini_set('max_execution_time', 240);\n\n    if ((int)substr(ini_get('memory_limit'), 0, -1) < 256) {\n        ini_set('memory_limit', '256M');\n    }\n\n    /*\n     * include path preparation\n     */\n    // init with local path in order to prefer these over system paths\n    $includePath = ONTOWIKI_ROOT . 'libraries/' . PATH_SEPARATOR;\n    // append local Erfurt include path\n    if (file_exists(ONTOWIKI_ROOT . 'libraries/Erfurt/Erfurt/App.php')) {\n        $includePath .= ONTOWIKI_ROOT . 'libraries/Erfurt/' . PATH_SEPARATOR;\n    } else if (file_exists(ONTOWIKI_ROOT . 'libraries/Erfurt/library/Erfurt/App.php')) {\n        $includePath .= ONTOWIKI_ROOT . 'libraries/Erfurt/library' . PATH_SEPARATOR;\n    }\n    // append system include paths\n    $includePath .= get_include_path() . PATH_SEPARATOR;\n    // set the include path\n    set_include_path($includePath);\n\n    // use default timezone from php.ini or let PHP guess it\n    date_default_timezone_set(@date_default_timezone_get());\n\n    // determine wheter rewrite engine works\n    // and redirect to a URL that doesn't need rewriting\n    // TODO: check for AllowOverride All\n    $rewriteEngineOn = false;\n    define('ONTOWIKI_REWRITE', $rewriteEngineOn);\n\n    /** check/include Zend_Application */\n    try {\n        // use include, so we can catch it with the error handler\n        require_once 'Zend/Application.php';\n    } catch (Exception $e) {\n        header('HTTP/1.1 500 Internal Server Error');\n        echo 'Fatal Error: Could not load Zend library.<br />' . PHP_EOL\n             . 'Maybe you need to install it with apt-get or with \"make zend\"?' . PHP_EOL;\n        return false;\n    }\n\n    // create application\n    $application = new Zend_Application(\n        'default',\n        ONTOWIKI_ROOT . 'application/config/application.ini'\n    );\n\n    /** check/include OntoWiki */\n    try {\n        // use include, so we can catch it with the error handler\n        require_once 'OntoWiki.php';\n    } catch (Exception $e) {\n        echo 'Fatal Error: Could not load the OntoWiki Application Framework classes.' . PHP_EOL;\n        echo 'Your installation directory seems to be screwed.' . PHP_EOL;\n        return false;\n    }\n\n    /* check/include Erfurt_App */\n    try {\n        // use include, so we can catch it with the error handler\n        require_once 'Erfurt/App.php';\n    } catch (Exception $e) {\n        echo 'Fatal Error: Could not load the Erfurt Framework classes.' . PHP_EOL;\n        echo 'Maybe you should install it with apt-get or with \"make deploy\"?' . PHP_EOL;\n        return false;\n    }\n\n    // restore old error handler\n    restore_error_handler();\n\n    // bootstrap\n    try {\n        $application->bootstrap();\n    } catch (Exception $e) {\n        echo 'Error on bootstrapping application: ' . $e->getMessage() . PHP_EOL;\n        return false;\n    }\n    return $application;\n}\n\n$application    = initApp();\nif ($application === false) {\n    return 1;\n}\n\n$bootstrap      = $application->getBootstrap();\n$ontoWiki       = OntoWiki::getInstance();\n$extManager     = $ontoWiki->extensionManager;\n$extensions     = $extManager->getExtensions();\n\necho $ontoWiki->config->version->label . ' ' . $ontoWiki->config->version->number . PHP_EOL;\n\n// create a worker registry\n$workerRegistry = Erfurt_Worker_Registry::getInstance();\n\n// trigger event to let extensions add their jobs\n$event = new Erfurt_Event('onAnnounceWorker');\n$event->bootstrap   = $bootstrap;\n$event->registry    = $workerRegistry;\n$event->trigger();\nif (!count($workerRegistry->getJobs())) {\n    echo 'No jobs registered - nothing to do or wait for.' . PHP_EOL;\n    return;\n}\n\n// register  jobs manually\n// key name, class file, class name, config\n\n// test job\n$workerRegistry->registerJob(\n    'test',\n    'libraries/Erfurt/library/Erfurt/Worker/TestJob.php',\n    'Erfurt_Worker_TestJob',\n    array()\n);\n\n// cron job\n$workerRegistry->registerJob(\n    'cron',\n    'application/classes/OntoWiki/Jobs/Cron.php',\n    'OntoWiki_Jobs_Cron',\n    array()\n);\n\n\n//  create a new worker backend with filled worker registry\n$worker = new Erfurt_Worker_Backend($workerRegistry);\n//  set worker and Gearman worker to listen mode and wait\n$worker->listen();\n"
  },
  {
    "path": "application/tests/Bootstrap.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/*\n * Set error reporting to the level to which Erfurt code must comply.\n */\nerror_reporting(E_ALL | E_STRICT);\n\n/*\n * Default timezone in order to prevent warnings\n */\ndate_default_timezone_set('Europe/Berlin');\n\n/*\n * Check for minimum supported PHPUnit version\n */\n$phpUnitVersion = PHPUnit_Runner_Version::id();\nif ('@package_version@' !== $phpUnitVersion && version_compare($phpUnitVersion, '3.5.0', '<')) {\n    echo 'This version of PHPUnit (' . PHPUnit_Runner_Version::id() . ') is not supported in OntoWiki unit tests.' .\n        PHP_EOL;\n    exit(1);\n}\nunset($phpUnitVersion);\n\ndefine('BOOTSTRAP_FILE', basename(__FILE__));\ndefine('ONTOWIKI_ROOT', realpath(dirname(__FILE__) . '/../..') . '/');\ndefine('APPLICATION_PATH', ONTOWIKI_ROOT . 'application/');\ndefine('APPLICATION_ENV', 'unittesting');\ndefine('ONTOWIKI_REWRITE', false);\ndefine('CACHE_PATH', ONTOWIKI_ROOT . 'cache' . DIRECTORY_SEPARATOR);\n\n// path to tests\nif (!defined('_TESTROOT')) {\n    define('_TESTROOT', rtrim(dirname(__FILE__), '/') . '/');\n}\n\n// path to OntoWiki\ndefine('_OWROOT', ONTOWIKI_ROOT);\n\nrequire_once ONTOWIKI_ROOT . '/vendor/autoload.php';\n\n// start dummy session before any PHPUnit output\n$session = new Zend_Session_Namespace('OntoWiki_Test');\n\n\n// Access Erfurt app for constant loading etc.\nErfurt_App::getInstance(false);\n"
  },
  {
    "path": "application/tests/BootstrapExtensions.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/*\n * Set error reporting to the level to which Erfurt code must comply.\n */\nerror_reporting(E_ALL | E_STRICT);\n\n/*\n * Default timezone in order to prevent warnings\n */\ndate_default_timezone_set('Europe/Berlin');\n\ndefine('BOOTSTRAP_FILE', basename(__FILE__));\ndefine('ONTOWIKI_ROOT', realpath(dirname(__FILE__) . '/../..') . '/');\ndefine('APPLICATION_PATH', ONTOWIKI_ROOT . 'application/');\ndefine('APPLICATION_ENV', 'unittesting');\ndefine('ONTOWIKI_REWRITE', false);\ndefine('CACHE_PATH', ONTOWIKI_ROOT . 'cache' . DIRECTORY_SEPARATOR);\n\n// path to tests\nif (!defined('_TESTROOT')) {\n    define('_TESTROOT', rtrim(dirname(__FILE__), '/') . '/');\n}\n\n// path to OntoWiki\ndefine('_OWROOT', ONTOWIKI_ROOT);\n\nrequire_once ONTOWIKI_ROOT . '/vendor/autoload.php';\n\n// start dummy session before any PHPUnit output\n$session = new Zend_Session_Namespace('OntoWiki_Test');\n\n// Access Erfurt app for constant loading etc.\nErfurt_App::getInstance(false);\n"
  },
  {
    "path": "application/tests/CodeSniffer/Standards/Ontowiki/Sniffs/Classes/ClassFilePathSniff.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Ontowiki_Sniffs_Classes_ClassFilePathSniff.\n *\n * PHP version 5\n *\n * @category  PHP\n * @package   PHP_CodeSniffer\n * @author    Lars Eidam <lars.eidam@googlemail.com>\n * @link      http://code.google.com/p/ontowiki/\n */\n\n/**\n * Ontowiki_Sniffs_Classes_ClassFilePathSniff.\n *\n * Tests that the filepath correspond to the classname for php Files in\n * the application/classes Folder\n *\n * @category  PHP\n * @package   PHP_CodeSniffer\n * @author    Lars Eidam <lars.eidam@googlemail.com>\n * @link      http://code.google.com/p/ontowiki/\n */\nclass Ontowiki_Sniffs_Classes_ClassFilePathSniff implements PHP_CodeSniffer_Sniff\n{\n\n\n    /**\n     * Returns an array of tokens this test wants to listen for.\n     *\n     * @return array\n     */\n    public function register()\n    {\n        return array(T_CLASS);\n\n    }\n\n    //end register()\n\n\n    /**\n     * Processes this test, when one of its tokens is encountered.\n     *\n     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.\n     * @param int                  $stackPtr  The position of the current token in the\n     *                                        stack passed in $tokens.\n     *\n     * @return void\n     */\n    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n    {\n        $tokens       = $phpcsFile->getTokens();\n        $decName      = $phpcsFile->findNext(T_STRING, $stackPtr);\n        $fullPath     = $phpcsFile->getFilename();\n        $longFileName = basename($fullPath);\n        $fileName     = substr($longFileName, 0, strrpos($longFileName, '.'));\n\n        // if the file is under the application/classes folder the class has the path in the name\n        // application/classes/Ontowiki/Utils/TestClass.php -> Classname=Ontowiki_Utils_TestClass\n        if (stristr($fullPath, 'application/classes') !== false) {\n            $partedPath = substr($fullPath, strrpos($fullPath, 'classes'), strlen($fullPath));\n            $partedPath = substr($partedPath, 0, strrpos($partedPath, '.'));\n\n            $classNameArray = explode(\"_\", $tokens[$decName]['content']);\n            $filepathArray  = explode(\"/\", $partedPath);\n            if (1 == count($filepathArray)) {\n                $filepathArray = explode(\"\\\\\", $partedPath);\n            }\n\n            $notFound = true;\n            foreach ($classNameArray as $index => $classNamePart) {\n                if ($classNamePart != $filepathArray[$index + 1]) {\n                    $notFound = false;\n                    break;\n                }\n            }\n            array_shift($filepathArray);\n            if (false === $notFound) {\n                $error = '%s name doesn\\'t match filepath; expected \"%s %s\"';\n                $data  = array(\n                    ucfirst($tokens[$stackPtr]['content']),\n                    $tokens[$stackPtr]['content'],\n                    implode('_', $filepathArray),\n                );\n                $phpcsFile->addError($error, $stackPtr, 'NoMatch', $data);\n            }\n        }\n    }\n    //end process()\n\n\n}\n\n//end class\n\n?>\n"
  },
  {
    "path": "application/tests/CodeSniffer/Standards/Ontowiki/Sniffs/Commenting/FileCommentSniff.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Parses and verifies the TYPO3 copyright notice.\n * PHP version 5\n *\n * @category  PHP\n * @package   TYPO3SniffPool\n * @author    Stefano Kowalke <blueduck@mailbox.org>\n * @copyright 2015 Stefano Kowalke\n * @license   http://www.gnu.org/copyleft/gpl.html GNU Public License\n * @link      https://github.com/typo3-ci/TYPO3SniffPool\n */\n\nclass Ontowiki_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff\n{\n    /**\n     * The file comment in TYPO3 CMS must be the copyright notice.\n     *\n     * @var array\n     */\n    protected $_copyright = array(\n        1  => \"/**\\n\",\n        2  => \" * This file is part of the {@link http://ontowiki.net OntoWiki} project.\\n\",\n        3  => \" *\\n\",\n        4  => \"\",\n        5  => \" * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\\n\",\n        6  => \" */\",\n    );\n\n    /**\n     * Returns an array of tokens this test wants to listen for.\n     *\n     * @return array\n     */\n    public function register()\n    {\n        return array(T_OPEN_TAG);\n\n    }//end register()\n\n\n    /**\n     * Processes this test, when one of its tokens is encountered.\n     *\n     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.\n     * @param int                  $stackPtr  The position of the current token\n     *                                        in the stack passed in $tokens.\n     *\n     * @return int\n     */\n    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n    {\n        $tokens = $phpcsFile->getTokens();\n        // Find the next non whitespace token.\n        $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);\n        if ($commentStart === false) {\n            $phpcsFile->addError('Not file level comment given', $commentStart, 'NoFileLevelCommentFound');\n            return;\n        }\n\n        $noGit = true;\n        if (count($tokens) > ($commentStart + 14)) {\n            preg_match(\"/ ([0-9]{4})(-[0-9]{4})?/\", $tokens[$commentStart + 15]['content'], $nonGitYear);\n        }\n\n        //test if a git exists to get the years from 'git log'\n        exec('([ -d .git ] && echo .git) || git rev-parse --git-dir 2> /dev/null', $gitTest);\n        if (!empty($gitTest)) {\n            $output = array();\n            exec('git ls-files --error-unmatch ' . $phpcsFile->getFilename() . ' 2> /dev/null', $output, $returnValue);\n            if ($returnValue == 0) {\n                $noGit = false;\n            }\n        }\n\n        if (!$noGit) {\n            //test if a git entry exists to get the years from 'git log'\n            exec('git log --reverse ' . $phpcsFile->getFilename() . ' | head -4', $outputCreationYear);\n                preg_match(\"/( )[0-9]{4}( )/\", $outputCreationYear[2], $gitOldYearArray);\n                if (empty($gitOldYearArray) && count($outputCreationYear) > 3) {\n                    preg_match(\"/( )[0-9]{4}( )/\", $outputCreationYear[3], $gitOldYearArray);\n                }\n                $gitYearOld = str_replace(' ', '', $gitOldYearArray[0]);\n                if (isset($nonGitYear) && isset($nonGitYear[1]) && $gitYearOld > $nonGitYear[1]) {\n                    $gitYearOld = $nonGitYear[1];\n                }\n                exec('git log -1 ' . $phpcsFile->getFilename(), $outputLastEditYear);\n                preg_match(\"/( )[0-9]{4}( )/\", $outputLastEditYear[2], $gitNewYearArray);\n                if (empty($gitNewYearArray) && count($outputLastEditYear) > 3) {\n                    preg_match(\"/( )[0-9]{4}( )/\", $outputLastEditYear[3], $gitNewYearArray);\n                }\n                $gitYearNew = str_replace(' ', '', $gitNewYearArray[0]);\n                if (strcmp($gitYearOld, $gitYearNew) != 0) {\n                    $gitYearOld .= '-';\n                    $gitYearOld .= $gitYearNew;\n                }\n                $year = \" * @copyright Copyright (c) \" . $gitYearOld . \", {@link http://aksw.org AKSW}\\n\";\n                $this->_copyright[4] = $year;\n        } else {\n            //tests if the file has no year/wrong editing and the year can't be found\n            if (!empty($nonGitYear)) {\n                $year = str_replace(' ', '', $nonGitYear[0]);\n                $copyright = \" * @copyright Copyright (c) \" . $year . \", {@link http://aksw.org AKSW}\\n\";\n                $this->_copyright[4] = $copyright;\n            }\n        }\n\n        $tokenizer = new PHP_CodeSniffer_Tokenizers_Comment();\n        $expectedString = implode($this->_copyright);\n        $expectedTokens = $tokenizer->tokenizeString($expectedString, PHP_EOL, 0);\n        // Allow namespace statements at the top of the file.\n        if ($tokens[$commentStart]['code'] === T_NAMESPACE) {\n            $semicolon    = $phpcsFile->findNext(T_SEMICOLON, ($commentStart + 1));\n            $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($semicolon + 1), null, true);\n        }\n\n        if ($tokens[$commentStart]['code'] !== T_DOC_COMMENT_OPEN_TAG) {\n            $fix = $phpcsFile->addFixableError(\n                'Copyright notice must start with /**; but /* was found!',\n                $commentStart,\n                'WrongStyle'\n            );\n\n            if ($fix === true) {\n                $phpcsFile->fixer->replaceToken($commentStart, \"/**\");\n            }\n            return;\n        }\n\n        $commentEnd = ($phpcsFile->findNext(T_WHITESPACE, ($commentStart + 1)) - 1);\n        if ($tokens[$commentStart]['code'] !== T_DOC_COMMENT_OPEN_TAG) {\n            $phpcsFile->addError('Copyright notice missing', $commentStart, 'NoCopyrightFound');\n\n            return;\n        }\n        $commentEndLine = $tokens[$commentEnd]['line'];\n        $commentStartLine = $tokens[$commentStart]['line'];\n        if ((($commentEndLine - $commentStartLine) + 1) < count($this->_copyright)) {\n            $phpcsFile->addError(\n                'Copyright notice too short',\n                $commentStart,\n                'CommentTooShort'\n            );\n            return;\n        } else if ((($commentEndLine - $commentStartLine) + 1) > count($this->_copyright)) {\n            $phpcsFile->addError(\n                'Copyright notice too long',\n                $commentStart,\n                'CommentTooLong'\n            );\n            return;\n        }\n        $j = 0;\n        for ($i = $commentStart; $i <= $commentEnd; $i++) {\n            if ($tokens[$i]['content'] !== $expectedTokens[$j][\"content\"]) {\n                $error = 'Found wrong part of copyright notice. Expected \"%s\", but found \"%s\"';\n                $data  = array(\n                          $expectedTokens[$j][\"content\"],\n                          $tokens[$i]['content'],\n                         );\n                $fix   = $phpcsFile->addFixableError($error, $i, 'WrongText', $data);\n\n                if ($fix === true) {\n                    $phpcsFile->fixer->replaceToken($i, $expectedTokens[$j][\"content\"]);\n                }\n            }\n            $j++;\n        }\n    }//end process()\n\n\n}//end class\n"
  },
  {
    "path": "application/tests/CodeSniffer/Standards/Ontowiki/Sniffs/Functions/ForbiddenFunctionsSniff.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Ontowiki_Sniffs_Function_ForbiddenFunctionsSniff.\n *\n * Test for forbidden functions\n *\n * PHP version 5\n *\n * @category  PHP\n * @package   PHP_CodeSniffer_Sniff\n * @author    Lars Eidam <lars.eidam@googlemail.com>\n * @link      http://code.google.com/p/ontowiki/\n */\n\n/**\n * Ontowiki_Sniffs_Function_ForbiddenFunctionsSniff.\n * Check for functions, they are not allowed.\n *\n * @category  PHP\n * @package   PHP_CodeSniffer_Sniff\n * @author    Lars Eidam <lars.eidam@googlemail.com>\n * @link      http://code.google.com/p/ontowiki/\n */\nclass Ontowiki_Sniffs_Functions_ForbiddenFunctionsSniff\n    extends Generic_Sniffs_PHP_ForbiddenFunctionsSniff\n{\n    /**\n     * A list of forbidden functions with their alternatives.\n     *\n     * @var array(string => string|null)\n     */\n    public $forbiddenFunctions\n        = array(\n            'var_dump'  => null,\n            'error_log' => null,\n            'exit'      => 'return',\n            'die'       => 'return'\n        );\n\n    /**\n     * Returns an array of tokens this test wants to listen for.\n     *\n     * @return array\n     */\n    public function register()\n    {\n        $tokens   = parent::register();\n        $tokens[] = T_EXIT;\n\n        return $tokens;\n    }\n    //end register()\n\n}\n\n//end class\n\n?>\n"
  },
  {
    "path": "application/tests/CodeSniffer/Standards/Ontowiki/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Generic_Sniffs_Functions_FunctionCallArgumentSpacingSniff.\n *\n * PHP version 5\n *\n * @category  PHP\n * @package   PHP_CodeSniffer\n * @author    Greg Sherwood <gsherwood@squiz.net>\n * @author    Marc McIntyre <mmcintyre@squiz.net>\n * @copyright 2006-2011 Squiz Pty Ltd (ABN 77 084 670 600)\n * @license   http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence\n * @link      http://pear.php.net/package/PHP_CodeSniffer\n */\n\n/**\n * Generic_Sniffs_Functions_FunctionCallArgumentSpacingSniff.\n *\n * Checks that calls to methods and functions are spaced correctly.\n *\n * @category  PHP\n * @package   PHP_CodeSniffer\n * @author    Greg Sherwood <gsherwood@squiz.net>\n * @author    Marc McIntyre <mmcintyre@squiz.net>\n * @copyright 2006-2011 Squiz Pty Ltd (ABN 77 084 670 600)\n * @license   http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence\n * @version   Release: 1.3.2\n * @link      http://pear.php.net/package/PHP_CodeSniffer\n */\n\n/**\n * Little changes for Ontowiki requirements:\n * After commas in function calls must at least one space but it can also be\n * more to be able to align the code.\n *\n * @author    Lars Eidam <larseidam@googlemail.com>\n */\nclass Ontowiki_Sniffs_Functions_FunctionCallArgumentSpacingSniff implements PHP_CodeSniffer_Sniff\n{\n\n\n    /**\n     * Returns an array of tokens this test wants to listen for.\n     *\n     * @return array\n     */\n    public function register()\n    {\n        return array(T_STRING);\n\n    }\n\n    //end register()\n\n\n    /**\n     * Processes this test, when one of its tokens is encountered.\n     *\n     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.\n     * @param int                  $stackPtr  The position of the current token in the\n     *                                        stack passed in $tokens.\n     *\n     * @return void\n     */\n    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n    {\n        $tokens = $phpcsFile->getTokens();\n\n        // Skip tokens that are the names of functions or classes\n        // within their definitions. For example:\n        // function myFunction...\n        // \"myFunction\" is T_STRING but we should skip because it is not a\n        // function or method *call*.\n        $functionName    = $stackPtr;\n        $ignoreTokens    = PHP_CodeSniffer_Tokens::$emptyTokens;\n        $ignoreTokens[]  = T_BITWISE_AND;\n        $functionKeyword = $phpcsFile->findPrevious($ignoreTokens, ($stackPtr - 1), null, true);\n        if ($tokens[$functionKeyword]['code'] === T_FUNCTION\n            || $tokens[$functionKeyword]['code'] === T_CLASS\n        ) {\n            return;\n        }\n\n        // If the next non-whitespace token after the function or method call\n        // is not an opening parenthesis then it cant really be a *call*.\n        $openBracket = $phpcsFile->findNext(\n            PHP_CodeSniffer_Tokens::$emptyTokens,\n            ($functionName + 1),\n            null,\n            true\n        );\n        if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) {\n            return;\n        }\n\n        $closeBracket = $tokens[$openBracket]['parenthesis_closer'];\n\n        $nextSeperator = $openBracket;\n        while (($nextSeperator = $phpcsFile->findNext(\n            array(T_COMMA, T_VARIABLE),\n            ($nextSeperator + 1),\n            $closeBracket\n        )) !== false) {\n            // Make sure the comma or variable belongs directly to this function call,\n            // and is not inside a nested function call or array.\n            $brackets    = $tokens[$nextSeperator]['nested_parenthesis'];\n            $lastBracket = array_pop($brackets);\n            if ($lastBracket !== $closeBracket) {\n                continue;\n            }\n\n            if ($tokens[$nextSeperator]['code'] === T_COMMA) {\n                if ($tokens[($nextSeperator - 1)]['code'] === T_WHITESPACE) {\n                    $error = 'Space found before comma in function call';\n                    $phpcsFile->addError($error, $stackPtr, 'SpaceBeforeComma');\n                }\n\n                if ($tokens[($nextSeperator + 1)]['code'] !== T_WHITESPACE) {\n                    $error = 'No space found after comma in function call';\n                    $phpcsFile->addError($error, $stackPtr, 'NoSpaceAfterComma');\n                }\n            } else {\n                // Token is a variable.\n                $nextToken = $phpcsFile->findNext(\n                    PHP_CodeSniffer_Tokens::$emptyTokens,\n                    ($nextSeperator + 1),\n                    $closeBracket, true\n                );\n                if ($nextToken !== false) {\n                    if ($tokens[$nextToken]['code'] === T_EQUAL) {\n                        if (($tokens[($nextToken - 1)]['code']) !== T_WHITESPACE) {\n                            $error = 'Expected 1 space before = sign of default value';\n                            $phpcsFile->addError($error, $stackPtr, 'NoSpaceBeforeEquals');\n                        }\n\n                        if ($tokens[($nextToken + 1)]['code'] !== T_WHITESPACE) {\n                            $error = 'Expected 1 space after = sign of default value';\n                            $phpcsFile->addError($error, $stackPtr, 'NoSpaceAfterEquals');\n                        }\n                    }\n                }\n            }\n            //end if\n        }\n        //end while\n\n    }\n    //end process()\n\n\n}\n\n//end class\n\n?>\n"
  },
  {
    "path": "application/tests/CodeSniffer/Standards/Ontowiki/Sniffs/PHP/GetRequestDataSniff.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Ontowiki_Sniffs_PHP_GetRequestDataSniff.\n *\n * Ensures that no super globals are used.\n *\n * PHP version 5\n *\n * @category  PHP\n * @package   PHP_CodeSniffer_MySource\n * @author    Lars Eidam <lars.eidam@googlemail.com>\n * @link      http://code.google.com/p/ontowiki/\n */\n\n/**\n * Ontowiki_Sniffs_PHP_GetRequestDataSniff.\n * Ensures that getRequestData() is used to access super globals.\n *\n * @category  PHP\n * @package   PHP_CodeSniffer\n * @author    Lars Eidam <lars.eidam@googlemail.com>\n * @link      http://code.google.com/p/ontowiki/\n */\nclass Ontowiki_Sniffs_PHP_GetRequestDataSniff implements PHP_CodeSniffer_Sniff\n{\n\n\n    /**\n     * Returns an array of tokens this test wants to listen for.\n     *\n     * @return array\n     */\n    public function register()\n    {\n        return array(T_VARIABLE);\n\n    }\n\n    //end register()\n\n\n    /**\n     * Processes this sniff, when one of its tokens is encountered.\n     *\n     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.\n     * @param int                  $stackPtr  The position of the current token in\n     *                                        the stack passed in $tokens.\n     *\n     * @return void\n     */\n    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n    {\n        $tokens = $phpcsFile->getTokens();\n\n        $varName = $tokens[$stackPtr]['content'];\n        if ($varName !== '$_REQUEST'\n            && $varName !== '$_GET'\n            && $varName !== '$_POST'\n            && $varName !== '$_FILES'\n        ) {\n            return;\n        }\n\n        $type  = 'SuperglobalAccessed';\n        $error = 'The %s super global must not be accessed directly;' .\n            'use Zend_Controller_Front::getInstance()->getRequest() instead';\n        $data  = array($varName);\n\n        $phpcsFile->addError($error, $stackPtr, $type, $data);\n\n    }\n    //end process()\n\n\n}\n\n//end class\n\n?>\n"
  },
  {
    "path": "application/tests/CodeSniffer/Standards/Ontowiki/ruleset.xml",
    "content": "<?xml version=\"1.0\"?>\n<ruleset name=\"OntoWiki\">\n    <description>Ontowiki's additiona sniffs for the coding standard.</description>\n</ruleset>\n"
  },
  {
    "path": "application/tests/config.ini.dist",
    "content": "[private]\n\n;;----------------------------------------------------------------------------;;\n;; Database Connection Settings                                               ;;\n;;----------------------------------------------------------------------------;;\n\nstore.backend = zenddb ; zenddb, virtuoso, multi\n\nstore.zenddb.dbname   = ow_TEST ; needs to end with _TEST\nstore.zenddb.username = php\nstore.zenddb.password = php\nstore.zenddb.dbtype   = mysql     ; mysql\nstore.zenddb.host     = localhost ; default is localhost\n\nstore.virtuoso.dsn      = VOS_TEST ; needs to end with _TEST\nstore.virtuoso.username = dba\nstore.virtuoso.password = dba\n"
  },
  {
    "path": "application/tests/config.ini.dist.travis",
    "content": "[private]\n\n;;----------------------------------------------------------------------------;;\n;; Database Connection Settings                                               ;;\n;;----------------------------------------------------------------------------;;\n\nstore.backend = zenddb ; zenddb, virtuoso, multi\n\nstore.zenddb.dbname   = ontowiki_TEST ; needs to end with _TEST\nstore.zenddb.username = travis\nstore.zenddb.password = \nstore.zenddb.dbtype   = mysql     ; mysql\nstore.zenddb.host     = localhost ; default is localhost\n\nstore.virtuoso.dsn      = VOS_TEST ; needs to end with _TEST\nstore.virtuoso.username = dba\nstore.virtuoso.password = dba\n"
  },
  {
    "path": "application/tests/integration/OntoWiki/Extension/ManagerIntegrationTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * It tests the behavior of Ontowiki_Model_Instances\n *\n * @author Jonas Brekle <jonas.brekle@gmail.com>\n */\nclass ManagerIntegrationTest extends Erfurt_TestCase\n{\n    protected $_resourcesDirectory = null;\n    protected $_bootstrap = null;\n\n    protected function setUp()\n    {\n        $this->_resourcesDirectory = realpath(dirname(__FILE__)) . '/_files/';\n\n        $this->markTestNeedsDatabase();\n\n        $this->_bootstrap = new Zend_Application(\n            'integration_testing',\n            ONTOWIKI_ROOT . 'application/config/application.ini'\n        );\n\n        // bootstrap\n        try {\n            $this->_bootstrap->bootstrap();\n        } catch (Exception $e) {\n            echo 'Error on bootstrapping application: ';\n            echo $e->getMessage();\n\n            return;\n        }\n\n        $this->authenticateDbUser();\n    }\n\n    /**\n     * @medium\n     */\n    public function testScan()\n    {\n        Erfurt_App::getInstance(false)->getCache()->clean();\n\n        // clear cache, since otherwise the extension manager may have the real extensions loaded\n        if (function_exists('apc_clear_cache')) {\n            apc_clear_cache('user');\n        }\n\n        $em = new OntoWiki_Extension_Manager($this->_resourcesDirectory, CACHE_PATH . 'extensions_test.json');\n        $ex = $em->getExtensions();\n\n        $this->assertCount(2, $ex);\n        $this->assertArrayHasKey('test1', $ex);\n        $this->assertArrayHasKey('test2', $ex);\n        //test local ini\n        $this->assertFalse((bool)$ex['test2']->private->sub->b);\n    }\n}\n"
  },
  {
    "path": "application/tests/integration/OntoWiki/Extension/_files/test1/MoreModule.php",
    "content": "<?php\n"
  },
  {
    "path": "application/tests/integration/OntoWiki/Extension/_files/test1/Test1Controller.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nclass Test1Controller extends OntoWiki_Controller_Component\n{\n\n}\n"
  },
  {
    "path": "application/tests/integration/OntoWiki/Extension/_files/test1/TestModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nclass TestModule extends OntoWiki_Module\n{\n    public function init()\n    {\n\n    }\n\n    /**\n     * Returns the title of the module\n     *\n     * @return string\n     */\n    public function getTitle()\n    {\n        return 'Test';\n    }\n\n    public function shouldShow()\n    {\n        return true;\n    }\n\n    /**\n     * Returns the menu of the module\n     *\n     * @return string\n     */\n    public function getMenu()\n    {\n        return OntoWiki_Menu_Registry::getInstance()->getMenu('application');\n    }\n\n    public function getContents()\n    {\n        return '';\n    }\n\n    public function allowCaching()\n    {\n        // no caching\n        return false;\n    }\n}\n\n\n"
  },
  {
    "path": "application/tests/integration/OntoWiki/Extension/_files/test1/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/test/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :test .\n:test a doap:Project ;\n  doap:name \"test1\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/account/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Some Extension 1\" ;\n  doap:description \"provides a login module and a recover action.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:templates \"templates\" ;\n  owconfig:languages \"languages\" ;\n  owconfig:hasModule :Test ;\n  owconfig:hasModule :More ;\n  doap:release :v1-0 .\n:Test a owconfig:Module ;\n    rdfs:label \"Test Module\" ;\n    owconfig:caching \"true\"^^xsd:boolean ;\n    owconfig:priority \"30\" ;\n    owconfig:context \"main.sidewindows\" ;\n    :prop \"val2\" .\n:More a owconfig:Module ;\n  rdfs:label \"More Module\" ;\n  owconfig:caching \"false\"^^xsd:boolean ;\n  owconfig:priority \"40\" ;\n  owconfig:context \"main.sidewindows\" ;\n  :prop \"val1\" .\n\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "application/tests/integration/OntoWiki/Extension/_files/test2/Test2Plugin.php",
    "content": "<?php\n"
  },
  {
    "path": "application/tests/integration/OntoWiki/Extension/_files/test2/Test2Wrapper.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n"
  },
  {
    "path": "application/tests/integration/OntoWiki/Extension/_files/test2/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/test/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :test2 .\n:test2 a doap:Project ;\n  doap:name \"test2\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/account/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Some Extension 2\" ;\n  doap:description \"provides a login module and a recover action.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:templates \"templates\" ;\n  owconfig:languages \"languages\" .\n\n:test2 owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"sub\";\n      :b \"true\"^^xsd:boolean\n] ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "application/tests/integration/OntoWiki/Extension/_files/test2.ini",
    "content": "\n\n[private]\nsub.b = false"
  },
  {
    "path": "application/tests/integration/OntoWiki/Model/InstancesIntegrationTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * It tests the behavior of Ontowiki_Model_Instances\n * while using the database backend\n *\n * @author Jonas Brekle <jonas.brekle@gmail.com>\n */\nclass OntoWiki_Model_InstancesIntegrationTest extends Erfurt_TestCase\n{\n    /**\n     *\n     * @var OntoWiki_Model_Instances\n     */\n    protected $_instances = null;\n\n    protected $_modelUri = 'http://example.org/test/';\n\n    /**\n     *\n     * @var Erfurt_Store\n     */\n    protected $_store = null;\n\n    public function setUp()\n    {\n        $this->markTestNeedsDatabase();\n        $this->authenticateDbUser();\n\n        $this->_store = $this->getStore();\n\n        //create model\n        $model = $this->_store->getNewModel($this->_modelUri, '', Erfurt_Store::MODEL_TYPE_OWL, false);\n\n        $this->_instances = new OntoWiki_Model_Instances(\n            $this->_store,\n            new Erfurt_Rdf_Model($this->_modelUri, null, $this->_store)\n        );\n\n        $this->addTestData();\n\n        $this->_instances->getResources();\n\n        parent::setUp();\n    }\n\n    private $_class = 'http://model.org/model#className1';\n\n    public function addTestData()\n    {\n        $this->authenticateDbUser();\n        $turtleString\n            = '<http://model.org/model#i1> a\n                            <' . $this->_class . '> ;\n                            <http://www.w3.org/2000/01/rdf-schema#label> \"instance1\";\n                            <http://model.org/prop> \"val1\", \"val2\" .\n                        <http://model.org/model#i2> a\n                            <' . $this->_class . '> ;\n                            <http://www.w3.org/2000/01/rdf-schema#label> \"instance2\" ;\n                            <http://model.org/prop> \"val3\" .';\n\n        $this->_store->importRdf(\n            $this->_modelUri,\n            $turtleString,\n            'turtle',\n            Erfurt_Syntax_RdfParser::LOCATOR_DATASTRING, false\n        );\n    }\n\n    public function getStore()\n    {\n        return Erfurt_App::getInstance()->getStore();\n    }\n\n    /**\n     * @medium\n     */\n    public function testResources()\n    {\n        //two instances and a triple for the graph\n        $this->assertCount(3, $this->_instances->getResources());\n    }\n\n    /**\n     * @medium\n     */\n    public function testTypeFilter()\n    {\n        $id = $this->_instances->addTypeFilter($this->_class);\n        $this->assertCount(2, $this->_instances->getResources());\n        $this->_instances->removeFilter($id);\n        $this->_instances->addTypeFilter('http://other');\n        $this->assertEmpty($this->_instances->getResources());\n    }\n\n    /**\n     * @medium\n     */\n    public function testGetValues()\n    {\n        $v = $this->_instances->getValues();\n        $this->assertCount(3, $v);\n        $this->assertArrayHasKey('http://model.org/model#i1', $v);\n        $this->assertArrayHasKey('http://model.org/model#i2', $v);\n\n        // the __TYPE\n        $this->assertCount(1, $v['http://model.org/model#i1']);\n        $this->assertArrayHasKey('__TYPE', $v['http://model.org/model#i1']);\n        $this->assertContains($this->_class, self::_onlyValues($v['http://model.org/model#i1']['__TYPE']));\n    }\n\n    /**\n     * @medium\n     */\n    public function testAddShownProperties()\n    {\n        //add properties\n        $this->_instances->addShownProperty('http://model.org/prop');\n        $v = $this->_instances->getValues();\n        //count values\n        $this->assertCount(2, $v['http://model.org/model#i1']);\n        //test variable creation\n        $this->assertArrayHasKey('prop', $v['http://model.org/model#i1']);\n\n        //test values\n        $this->assertCount(2, $v['http://model.org/model#i1']['prop']);\n        $this->assertContains(\"val1\", self::_onlyValues($v['http://model.org/model#i1']['prop']));\n        $this->assertContains(\"val2\", self::_onlyValues($v['http://model.org/model#i1']['prop']));\n\n        //another one\n        $this->_instances->addShownProperty('http://www.w3.org/2000/01/rdf-schema#label');\n        $v = $this->_instances->getValues();\n        $this->assertCount(3, $v['http://model.org/model#i1']);\n        $this->assertArrayHasKey('label', $v['http://model.org/model#i1']);\n    }\n\n    /**\n     * @medium\n     */\n    public function testGetProperties()\n    {\n        $p = $this->_instances->getAllProperties();\n        $this->assertCount(3, $p);\n        $ovp = self::_onlyValues($p);\n        $this->assertContains(\"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\", $ovp);\n        $this->assertContains(\"http://model.org/prop\", $ovp);\n        $this->assertContains(\"http://www.w3.org/2000/01/rdf-schema#label\", $ovp);\n    }\n\n    /**\n     * @medium\n     */\n    public function testGetPossibleValues()\n    {\n        $v = $this->_instances->getPossibleValues(\"http://model.org/prop\");\n        $this->assertCount(3, $v);\n        $ovv = self::_onlyValues($v);\n        $this->assertContains(\"val1\", $ovv);\n        $this->assertContains(\"val2\", $ovv);\n        $this->assertContains(\"val3\", $ovv);\n    }\n\n    /**\n     * @medium\n     */\n    public function testAddFilter()\n    {\n        $id = $this->_instances->addFilter(\"http://model.org/prop\", false, 'prop', 'equals', 'val1', null, 'literal');\n        $this->assertCount(1, $this->_instances->getResources());\n        $this->_instances->removeFilter($id);\n        $this->assertCount(3, $this->_instances->getResources());\n    }\n\n    /**\n     * @medium\n     */\n    public function testLimitOffset()\n    {\n        $this->_instances->orderByUri();\n        $this->_instances->addTypeFilter($this->_class);\n        $this->assertCount(2, $this->_instances->getResources());\n        $this->_instances->setLimit(1);\n        $this->assertCount(1, $this->_instances->getResources());\n        $this->_instances->setLimit(0);\n        $this->assertCount(2, $this->_instances->getResources());\n        $this->_instances->setOffset(1);\n        $this->assertCount(1, $this->_instances->getResources());\n    }\n\n    /**\n     * @medium\n     */\n    public function testOrderProperty()\n    {\n        $this->_instances->addTypeFilter($this->_class);\n        $this->assertCount(2, $this->_instances->getResources());\n        $this->_instances->setOrderProperty(\"http://model.org/prop\", true);\n        $r = $this->_instances->getResources();\n        $this->assertEquals($r[0]['uri'], 'http://model.org/model#i1');\n        $this->_instances->setOrderProperty(\"http://model.org/prop\", false);\n        $r = $this->_instances->getResources();\n        $this->assertEquals($r[0]['uri'], 'http://model.org/model#i2');\n    }\n\n    /**\n     * @medium\n     */\n    public function testOrderURI()\n    {\n        $this->_instances->addTypeFilter($this->_class);\n        $this->assertCount(2, $this->_instances->getResources());\n        $this->_instances->orderByUri(true);\n        $r = $this->_instances->getResources();\n        $this->assertEquals($r[0]['uri'], 'http://model.org/model#i1');\n        $this->_instances->orderByUri(false);\n        $r = $this->_instances->getResources();\n        $this->assertEquals($r[0]['uri'], 'http://model.org/model#i2');\n    }\n\n    /**\n     *\n     */\n    public function testShownPropertiesAddTitles()\n    {\n        //add\n        $r = $this->_instances->addShownProperty(\"http://abc\");\n        //test chaining\n        $this->assertSame($this->_instances, $r);\n        //verify triple in value query\n        $propertiesWithTitles = $this->_instances->getShownProperties();\n        $this->assertCount(2, $propertiesWithTitles);\n    }\n\n    protected static function _onlyValues($arr)\n    {\n        $r = array();\n        foreach ($arr as $a) {\n            if (isset($a['origvalue'])) {\n                $r[] = $a['origvalue'];\n            } else {\n                if (isset($a['uri'])) {\n                    $r[] = $a['uri'];\n                } else {\n                    $r[] = $a['value'];\n                }\n            }\n        }\n\n        return $r;\n    }\n}\n"
  },
  {
    "path": "application/tests/integration/OntoWiki/Model/TitleHelperIntegrationTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n *\n * @author Philipp Frischmuth <pfrischmuth@gmail.com>\n */\nclass OntoWiki_Model_TitleHelperIntegrationTest extends Erfurt_TestCase\n{\n    /** @var Erfurt_Store_Adapter_test */\n    private $_storeAdapter = null;\n\n    /** @var Erfurt_Store */\n    private $_store = null;\n\n    private $_erfurtApp = null;\n\n    public function setUp()\n    {\n        $this->markTestNeedsTestConfig();\n        $this->markTestNeedsDatabase();\n        $this->_erfurtApp = Erfurt_App::getInstance();\n        $this->_store = $this->_erfurtApp->getStore();\n        $this->authenticateDbUser();\n        $this->_modelUri = 'http://example.org/graph123/';\n        $this->_addTestData();\n        parent::setUp();\n    }\n\n    private function _addTestData()\n    {\n        $model = $this->_store->getNewModel(\n            $this->_modelUri, '', Erfurt_Store::MODEL_TYPE_OWL, false\n        );\n        $this->authenticateDbUser();\n        $turtleString\n            = '<http://purl.org/dc/terms/title> '\n            . '<http://www.w3.org/2000/01/rdf-schema#label> \"testABC_en\"@en .'\n            . '<http://example.org/resourceXYZ> '\n            . '<http://www.w3.org/2004/02/skos/core#prefLabel> \"testABC_noLang\" ;'\n            . '                                 '\n            . '<http://www.w3.org/2000/01/rdf-schema#label> \"testABC_de\"@de .'\n            . '<http://example.org/graph123/resourceABC> '\n            . '<http://www.w3.org/2000/01/rdf-schema#label> \"testABC\" ;'\n            . '                                          '\n            . '<http://ns.ontowiki.net/SysOnt/Site/menuLabel> \"testMenuLabel\" .';\n\n        $this->_store->importRdf(\n            $this->_modelUri,\n            $turtleString,\n            'turtle',\n            Erfurt_Syntax_RdfParser::LOCATOR_DATASTRING, false\n        );\n    }\n\n    public function testMultipleAddResourceGetTitleCallsGithubIssue65()\n    {\n        $graph      = new Erfurt_Rdf_Model($this->_modelUri);\n        $properties = array(\n            'testABC_en@en'                                   => 'http://purl.org/dc/terms/title',\n            'testABC_de@de'                                   => 'http://example.org/resourceXYZ',\n            'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'\n        );\n\n        $config = array(\n            'titleHelper' => array(\n                'properties' => array(\n                    'skosPlabel' => 'http://www.w3.org/2004/02/skos/core#prefLabel',\n                    'dcTitle'    => 'http://purl.org/dc/elements/1.1/title',\n                    'dcTitle2'   => 'http://purl.org/dc/terms/title',\n                    'swrcTitle'  => 'http://swrc.ontoware.org/ontology#title',\n                    'foafName'   => 'http://xmlns.com/foaf/0.1/name',\n                    'doapName'   => 'http://usefulinc.com/ns/doap#name',\n                    'siocName'   => 'http://rdfs.org/sioc/ns#name',\n                    'tagName'    => 'http://www.holygoat.co.uk/owl/redwood/0.1/tags/name',\n                    'lgeodName'  => 'http://linkedgeodata.org/vocabulary#name',\n                    'geoName'    => 'http://www.geonames.org/ontology#name',\n                    'goName'     => 'http://www.geneontology.org/dtds/go.dtd#name',\n                    'rdfsLabel'  => 'http://www.w3.org/2000/01/rdf-schema#label'\n                ),\n                'searchMode' => 'language'\n            )\n        );\n\n        $titleHelper = new OntoWiki_Model_TitleHelper($graph, $this->_store, $config);\n        foreach ($properties as $expected => $property) {\n            $resource      = $property;\n            $lang          = null;\n            $expectedTitle = $expected;\n            if (strpos($expected, '@') !== false) {\n                $parts         = explode('@', $expected);\n                $expectedTitle = $parts[0];\n                $lang          = $parts[1];\n            }\n\n            $titleHelper->addResource($resource);\n            $title = $titleHelper->getTitle($property, $lang);\n            $this->assertEquals($expectedTitle, $title);\n        }\n    }\n\n    public function testPrependTitlePropertyDifferentInstances()\n    {\n        $config = array(\n            'titleHelper' => array(\n                'properties' => array(\n                    'skosPlabel' => 'http://www.w3.org/2004/02/skos/core#prefLabel',\n                    'dcTitle'    => 'http://purl.org/dc/elements/1.1/title',\n                    'dcTitle2'   => 'http://purl.org/dc/terms/title',\n                    'swrcTitle'  => 'http://swrc.ontoware.org/ontology#title',\n                    'foafName'   => 'http://xmlns.com/foaf/0.1/name',\n                    'doapName'   => 'http://usefulinc.com/ns/doap#name',\n                    'siocName'   => 'http://rdfs.org/sioc/ns#name',\n                    'tagName'    => 'http://www.holygoat.co.uk/owl/redwood/0.1/tags/name',\n                    'lgeodName'  => 'http://linkedgeodata.org/vocabulary#name',\n                    'geoName'    => 'http://www.geonames.org/ontology#name',\n                    'goName'     => 'http://www.geneontology.org/dtds/go.dtd#name',\n                    'rdfsLabel'  => 'http://www.w3.org/2000/01/rdf-schema#label'\n                ),\n                'searchMode' => 'language'\n            )\n        );\n\n        $graph    = new Erfurt_Rdf_Model($this->_modelUri);\n        $resource = 'http://example.org/graph123/resourceABC';\n\n        $titleHelper = new OntoWiki_Model_TitleHelper($graph, $this->_store, $config);\n        $titleHelper->addResource($resource);\n        $title = $titleHelper->getTitle($resource);\n        $this->assertEquals('testABC', $title);\n\n        // now prepend a property\n        $titleHelper = new OntoWiki_Model_TitleHelper($graph, $this->_store, $config);\n        $titleHelper->prependTitleProperty('http://ns.ontowiki.net/SysOnt/Site/menuLabel');\n        $titleHelper->addResource($resource);\n        $title = $titleHelper->getTitle($resource);\n        $this->assertEquals('testMenuLabel', $title);\n    }\n\n    public function testPrependTitlePropertySameInstances()\n    {\n        $config = array(\n            'titleHelper' => array(\n                'properties' => array(\n                    'skosPlabel' => 'http://www.w3.org/2004/02/skos/core#prefLabel',\n                    'dcTitle'    => 'http://purl.org/dc/elements/1.1/title',\n                    'dcTitle2'   => 'http://purl.org/dc/terms/title',\n                    'swrcTitle'  => 'http://swrc.ontoware.org/ontology#title',\n                    'foafName'   => 'http://xmlns.com/foaf/0.1/name',\n                    'doapName'   => 'http://usefulinc.com/ns/doap#name',\n                    'siocName'   => 'http://rdfs.org/sioc/ns#name',\n                    'tagName'    => 'http://www.holygoat.co.uk/owl/redwood/0.1/tags/name',\n                    'lgeodName'  => 'http://linkedgeodata.org/vocabulary#name',\n                    'geoName'    => 'http://www.geonames.org/ontology#name',\n                    'goName'     => 'http://www.geneontology.org/dtds/go.dtd#name',\n                    'rdfsLabel'  => 'http://www.w3.org/2000/01/rdf-schema#label'\n                ),\n                'searchMode' => 'language'\n            )\n        );\n\n        $graph    = new Erfurt_Rdf_Model('http://example.org/graph123/');\n        $resource = 'http://example.org/graph123/resourceABC';\n\n        $titleHelper = new OntoWiki_Model_TitleHelper($graph, $this->_store, $config);\n        $title       = $titleHelper->getTitle($resource);\n        $this->assertEquals('testABC', $title);\n\n        // now prepend a property\n        $titleHelper->prependTitleProperty('http://ns.ontowiki.net/SysOnt/Site/menuLabel');\n        $title = $titleHelper->getTitle($resource);\n        $this->assertEquals('testMenuLabel', $title);\n    }\n}\n"
  },
  {
    "path": "application/tests/integration/controller/ModelControllerTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2017, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * This test class comtains tests for the OntoWiki service controller.\n *\n * @category   OntoWiki\n * @package    controlers\n * @subpackage IntegrationTests\n * @copyright  Copyright (c) 2017, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2 (GPLv2)\n * @author     Fabian Niehoff <niehoff.fabian@web.de>\n */\nclass ModelControllerTest extends OntoWiki_Test_ControllerTestCase\n{\n    public function setUp()\n    {\n        $this->setUpIntegrationTest();\n        //this is necessary to allow the dispatch to create a model (ac)\n        $this->frontEndLogin();\n    }\n\n    /**\n     * @dataProvider uriProvider\n     */\n    public function testCreateActionFiltersOnlyIncorrectUris($uri, $correctUri)\n    {\n        $this->dispatch('/service/auth');\n\n        $this->request->setPost(\n            array(\n                'title' => 'test',\n                'modeluri' => $uri,\n                'importOptions' => 'import-empty'\n            )\n        );\n        $this->dispatch('/model/create');\n        $this->assertController('model');\n        $this->assertAction('create');\n        //when the URI is correct expect the model in the store\n        $store = OntoWiki::getInstance()->erfurt->getStore();\n        if ($correctUri) {\n            $this->assertTrue($store->isModelAvailable($uri, true));\n        } else {\n            $this->assertFalse($store->isModelAvailable($uri, true));\n        }\n    }\n\n    public function uriProvider()\n    {\n        return [\n            ['ftp://ftp.is.co.za.example.org/ontowiki/ontowiki.txt', true],\n            ['gopher://spinaltap.micro.umn.example.edu/00/Weather/California/Los%20Angeles', true],\n            ['http://www.ontowiki.aksw.no.example.net/faq/ontowiki-faq/part1.html', true],\n            ['mailto:aksw@ifi.unizh.example.gov', true],\n            ['news:comp.aksw.www.servers.unix', true],\n            ['telnet://melvyl.ucop.example.edu/', true],\n            ['http://www.ietf.org/rfc/rfc2396.txt', true],\n            ['ldap://[2001:db8::7]/c=GB?objectClass?one', true],\n            ['mailto:AKSW.L@example.com', true],\n            ['telnet://192.0.2.16:80/', true],\n            ['urn:oasis:names:specification:docbook:dtd:xml:4.1.2', true],\n            ['https://www.aksw.org/faq', true],\n            ['ptth://www.aksw.org', true],\n            ['\\\\äüö', false],\n            ['plainText', false],\n            ['noProtocol.de', false],\n            ['http://www.äß', false],\n            ['http://www.⺅⺔.com', false]\n        ];\n    }\n}\n"
  },
  {
    "path": "application/tests/integration/controller/ServiceControllerTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * This test class comtains tests for the OntoWiki service controller.\n *\n * @category   OntoWiki\n * @package    controlers\n * @subpackage UnitTests\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2 (GPLv2)\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n * @author     Konrad Abicht <k.abicht@googlemail.com>\n */\nclass ServiceControllerTest extends OntoWiki_Test_ControllerTestCase\n{\n    public function setUp()\n    {\n        $this->setUpIntegrationTest();\n    }\n\n    // ------------------------------------------------------------------------\n    // Auth Action\n    // ------------------------------------------------------------------------\n\n    public function testCallWithoutActionShouldPullFromIndexAction()\n    {\n        $this->dispatch('/service');\n\n        // We expect the error controller with error action here, since there is\n        // no default index action for this controller.\n        $this->assertController('error');\n        $this->assertAction('error');\n    }\n\n    public function testAuthActionGetNotAllowed()\n    {\n        $config                          = OntoWiki::getInstance()->config;\n        $config->service->auth->allowGet = false;\n\n        $this->dispatch('/service/auth');\n\n        $this->assertController('service');\n        $this->assertAction('auth');\n\n        // TODO: Remove the @ again, when the ZF issue is resolved\n        // Currently there is a interface mismatch between PHPUnit >= 3.6 and ZF 1.x\n        @$this->assertResponseCode(405);\n        $this->assertHeaderContains('allow', 'POST');\n    }\n\n    /**\n     * We enable GET authentication and test that we do not get a\n     * 405 Method No Allowed response.\n     */\n    public function testAuthActionGetAllowed()\n    {\n        $config                        = OntoWiki::getInstance()->config;\n        $config->service->allowGetAuth = true;\n\n        $this->dispatch('/service/auth');\n\n        $this->assertController('service');\n        $this->assertAction('auth');\n        $this->assertResponseCode(400);\n    }\n\n    public function testAuthActionNoParams()\n    {\n        $this->request->setMethod('POST');\n\n        $this->dispatch('/service/auth');\n\n        $this->assertController('service');\n        $this->assertAction('auth');\n        $this->assertResponseCode(400);\n    }\n\n    public function testAuthActionLogoutTrue()\n    {\n        $this->request->setMethod('POST')->setPost(\n            array(\n                 'logout' => 'true'\n            )\n        );\n\n        $this->dispatch('/service/auth');\n\n        $this->assertController('service');\n        $this->assertAction('auth');\n        $this->assertResponseCode(200);\n    }\n\n    public function testAuthActionLogoutInvalidValue()\n    {\n        $this->request->setMethod('POST')->setPost(\n            array(\n                 'logout' => 'xyz'\n            )\n        );\n\n        $this->dispatch('/service/auth');\n\n        $this->assertController('service');\n        $this->assertAction('auth');\n        $this->assertResponseCode(400);\n    }\n\n    public function testAuthActionAnonymousUserNoPasswordSuccess()\n    {\n        $this->request->setMethod('POST')->setPost(\n            array(\n                 'u' => 'Anonymous'\n            )\n        );\n\n        $this->dispatch('/service/auth');\n\n        $this->assertController('service');\n        $this->assertAction('auth');\n        $this->assertResponseCode(200);\n    }\n\n    public function testAuthActionAnonymousUserPasswordSetSuccess()\n    {\n        $this->request->setMethod('POST')->setPost(\n            array(\n                 'u' => 'Anonymous',\n                 'p' => ''\n            )\n        );\n\n        $this->dispatch('/service/auth');\n        $this->assertController('service');\n        $this->assertAction('auth');\n        $this->assertResponseCode(200);\n    }\n\n    public function testAuthActionInvalidUser()\n    {\n        $this->request->setMethod('POST')->setPost(\n            array(\n                 'u' => 'xyz',\n                 'p' => '123'\n            )\n        );\n\n        $this->dispatch('/service/auth');\n\n        $this->assertController('service');\n        $this->assertAction('auth');\n        $this->assertResponseCode(401);\n    }\n\n    // ------------------------------------------------------------------------\n    // SPARQL Action\n    // ------------------------------------------------------------------------\n\n    /**\n     * No parameter, no action!\n     *\n     * @test\n     */\n    public function sparqlNoParameter()\n    {\n        $this->request->setMethod('POST');\n\n        $this->dispatch('/service/sparql');\n\n        $this->assertController('service');\n        $this->assertAction('sparql');\n        $this->assertResponseCode(200);\n    }\n\n    /**\n     * No authentification, but with a query. OW should use Anonymous.\n     *\n     * @test\n     */\n    public function sparqlNoAuthWithInvalidQuery()\n    {\n        // Send invalid query\n        $this->request->setMethod('POST')->setPost(\n            array('query' => '123')\n        );\n\n        $this->dispatch('/service/sparql');\n\n        $code = $this->_response->getHttpResponseCode();\n\n        $this->assertController('service');\n        $this->assertAction('sparql');\n        $this->assertResponseCode(400, \"$code returned instead\");\n    }\n\n    // ------------------------------------------------------------------------\n    // Update Action\n    // ------------------------------------------------------------------------\n\n    public function testUpdateDoesNothingWithEmptyParameters()\n    {\n        $this->request->setMethod('POST')\n            ->setPost(array('insert' => '{}', 'delete' => '{}'));\n\n        $this->dispatch('/service/update');\n\n        $this->assertController('service');\n        $this->assertAction('update');\n        $this->assertResponseCode(200);\n    }\n}\n"
  },
  {
    "path": "application/tests/integration/phpunit.xml.dist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<phpunit bootstrap=\"../Bootstrap.php\" colors=\"false\" backupGlobals=\"false\" backupStaticAttributes=\"false\" strict=\"true\" verbose=\"true\">\n    <testsuite name=\"OntoWiki Integration Test Suite\">\n        <directory suffix=\"IntegrationTest.php\">.</directory>\n    </testsuite> \n        \n    <logging>\n        <log type=\"coverage-clover\" target=\"../../../build/logs/clover-integration.xml\"/>\n        <log type=\"coverage-html\" target=\"../../../build/coverage-integration\" title=\"Erfurt Integration Tests\"/>\n        <log type=\"junit\" target=\"../../../build/logs/junit-integration.xml\"/>\n    </logging>\n\n    <filter>\n        <whitelist addUncoveredFilesFromWhitelist=\"true\"> \n            <directory suffix=\".php\">../../../application</directory>\n\n            <exclude>\n                <directory>../../../application/scripts</directory>\n                <directory>../../../application/tests</directory>\n                <directory>../../../application/shell.worker.client.php</directory>\n                <directory>../../../application/shell.worker.php</directory>\n            </exclude>\n        </whitelist>\n    </filter>\n</phpunit>\n"
  },
  {
    "path": "application/tests/unit/OntoWiki/Extension/ManagerTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * It tests the behavior of Ontowiki_Model_Instances\n *\n * @author Jonas Brekle <jonas.brekle@gmail.com>\n */\nclass ManagerTest extends PHPUnit_Framework_TestCase\n{\n\n    public function testTriple2ConfigArray()\n    {\n        $triples = array(\n            'file:///home/jonas/programming/php-workspace/ow/extensions/account/' => array(\n                'http://xmlns.com/foaf/0.1/primaryTopic' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'https://github.com/AKSW/account/raw/master/doap.n3#account',\n                    ),\n                ),\n            ),\n            'https://github.com/AKSW/account/raw/master/doap.n3#account'          => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'                => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://usefulinc.com/ns/doap#Project',\n                    ),\n                ),\n                'http://usefulinc.com/ns/doap#name'                              => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'account',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/privateNamespace' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'https://github.com/AKSW/account/raw/master/doap.n3#',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/enabled'          => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'http://www.w3.org/2000/01/rdf-schema#label'                     => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'Login Module',\n                    ),\n                ),\n                'http://usefulinc.com/ns/doap#description'                       => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'provides a login module and a recover action.',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/authorLabel'      => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'AKSW',\n                    ),\n                ),\n                'http://usefulinc.com/ns/doap#maintainer'                        => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://aksw.org',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/templates'        => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'templates',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/languages'        => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'languages',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/hasModule'        => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'https://github.com/AKSW/account/raw/master/doap.n3#Default',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/config'           => array(\n                    0 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node1',\n                    ),\n                ),\n                'http://usefulinc.com/ns/doap#release'                           => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'https://github.com/AKSW/account/raw/master/doap.n3#v1-0',\n                    ),\n                ),\n            ),\n            'https://github.com/AKSW/account/raw/master/doap.n3#Default'          => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'        => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Module',\n                    ),\n                ),\n                'http://www.w3.org/2000/01/rdf-schema#label'             => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'Default',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/caching'  => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/priority' => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => '40',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/context'  => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'main.sidewindows',\n                    ),\n                ),\n            ),\n            '_:node1'                                                             => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'           => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'          => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'allow',\n                    ),\n                ),\n                'https://github.com/AKSW/account/raw/master/doap.n3#local'  => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/account/raw/master/doap.n3#webid'  => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'false',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/account/raw/master/doap.n3#openid' => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n            ),\n            'https://github.com/AKSW/account/raw/master/doap.n3#v1-0'             => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://usefulinc.com/ns/doap#Version',\n                    ),\n                ),\n                'http://usefulinc.com/ns/doap#revision'           => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => '1.0',\n                    ),\n                ),\n            ),\n        );\n        $base    = 'file:///home/jonas/programming/php-workspace/ow/extensions/account/';\n        $conf    = OntoWiki_Extension_Manager::triples2configArray($triples, \"test\", $base, \"file:///tmp/test\");\n\n        $this->assertEquals('account', $conf['name']);\n        $this->assertEquals('Login Module', $conf['title']);\n        $this->assertTrue($conf['private']['allow']['openid']);\n        $this->assertFalse($conf['private']['allow']['webid']);\n    }\n\n\n    public function testTriple2ConfigArray2()\n    {\n        $triples = array(\n            'file:///home/jonas/programming/php-workspace/ow/extensions/navigation/' => array(\n                'http://xmlns.com/foaf/0.1/primaryTopic' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'https://github.com/AKSW/navigation/raw/master/doap.n3#navigation',\n                    ),\n                ),\n            ),\n            'https://github.com/AKSW/navigation/raw/master/doap.n3#navigation'       => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'                => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://usefulinc.com/ns/doap#Project',\n                    ),\n                ),\n                'http://usefulinc.com/ns/doap#name'                              => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'navigation',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/privateNamespace' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'https://github.com/AKSW/navigation/raw/master/doap.n3#',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/enabled'          => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'http://www.w3.org/2000/01/rdf-schema#label'                     => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'Navigation Module',\n                    ),\n                ),\n                'http://usefulinc.com/ns/doap#description'                       => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'an extensible and highly customizable module to navigate in knowledge bases ' .\n                            'via tree-based information (e.g. classes)',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/authorLabel'      => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'AKSW',\n                    ),\n                ),\n                'http://usefulinc.com/ns/doap#maintainer'                        => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://aksw.org',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/templates'        => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'templates',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/languages'        => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'languages',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/hasModule'        => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'https://github.com/AKSW/navigation/raw/master/doap.n3#Default',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/config'           => array(\n                    0 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node1',\n                    ),\n                    1 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node2',\n                    ),\n                    2 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node4',\n                    ),\n                ),\n                'http://usefulinc.com/ns/doap#release'                           => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'https://github.com/AKSW/navigation/raw/master/doap.n3#v1-0',\n                    ),\n                ),\n            ),\n            'https://github.com/AKSW/navigation/raw/master/doap.n3#Default'          => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'        => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Module',\n                    ),\n                ),\n                'http://www.w3.org/2000/01/rdf-schema#label'             => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'Default',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/context'  => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'main.sidewindows',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/priority' => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => '30',\n                    ),\n                ),\n            ),\n            '_:node1'                                                                => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'                  => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'                 => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'defaults',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#config'     => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'classes',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#limit'      => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => '10',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#checkTypes' => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#showMenu'   => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n            ),\n            '_:node2'                                                                => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'      => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'     => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'sorting',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/config' => array(\n                    0 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node3',\n                    ),\n                ),\n            ),\n            '_:node3'                                                                => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'            => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'           => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'label',\n                    ),\n                ),\n                'http://www.w3.org/2000/01/rdf-schema#label'                 => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'By Label',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#type' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2000/01/rdf-schema#label',\n                    ),\n                ),\n            ),\n            '_:node4'                                                                => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'      => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'     => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/config' => array(\n                    0 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node5',\n                    ),\n                    1 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node9',\n                    ),\n                    2 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node13',\n                    ),\n                    3 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node16',\n                    ),\n                    4 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node19',\n                    ),\n                    5 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node22',\n                    ),\n                    6 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node25',\n                    ),\n                    7 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node28',\n                    ),\n                ),\n            ),\n            '_:node5'                                                                => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'                            => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'                           => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'classes',\n                    ),\n                ),\n                'http://www.w3.org/2000/01/rdf-schema#label'                                 => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'Classes',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#cache'                => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'false',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#titleMode'            => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'titleHelper',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#checkVisibility'      => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'false',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#hierarchyTypes'       => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2002/07/owl#Class',\n                    ),\n                    1 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2000/01/rdf-schema#Class',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/config'                       => array(\n                    0 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node6',\n                    ),\n                    1 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node7',\n                    ),\n                    2 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node8',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#hiddenNS'             => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',\n                    ),\n                    1 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2000/01/rdf-schema#',\n                    ),\n                    2 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2002/07/owl#',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#hiddenRelation'       => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/hidden',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#showImplicitElements' => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#showEmptyElements'    => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#showCounts'           => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'false',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#checkSub'             => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#hideDefaultHierarchy' => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'false',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n            ),\n            '_:node6'                                                                => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'          => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'         => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'hierarchyRelations',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#in' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2000/01/rdf-schema#subClassOf',\n                    ),\n                ),\n            ),\n            '_:node7'                                                                => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'           => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'          => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'instanceRelation',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#out' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type',\n                    ),\n                ),\n            ),\n            '_:node8'                                                                => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'              => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'             => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'list',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#config' => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => '{|filter|:[{|rdfsclass|:|%resource%|,|mode|:|rdfsclass|}]}',\n                    ),\n                ),\n            ),\n            '_:node9'                                                                => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'                            => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'                           => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'properties',\n                    ),\n                ),\n                'http://www.w3.org/2000/01/rdf-schema#label'                                 => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'Properties',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#titleMode'            => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'titleHelper',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#hierarchyTypes'       => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#Property',\n                    ),\n                    1 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2002/07/owl#DatatypeProperty',\n                    ),\n                    2 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2002/07/owl#ObjectProperty',\n                    ),\n                    3 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2002/07/owl#AnnotationProperty',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/config'                       => array(\n                    0 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node10',\n                    ),\n                    1 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node11',\n                    ),\n                    2 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node12',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#showImplicitElements' => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'false',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#showEmptyElements'    => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#showCounts'           => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'false',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#hideDefaultHierarchy' => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'false',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#checkSub'             => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n            ),\n            '_:node10'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'          => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'         => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'hierarchyRelations',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#in' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2000/01/rdf-schema#subPropertyOf',\n                    ),\n                ),\n            ),\n            '_:node11'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'           => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'          => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'instanceRelation',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#out' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2000/01/rdf-schema#subPropertyOf',\n                    ),\n                ),\n            ),\n            '_:node12'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'              => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'             => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'list',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#config' => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => '{|shownProperties|:[{|uri|:|%resource%|,|label|:|Label 1|,|action|:|add|,' .\n                            '|inverse|:false}],|filter|:[{|property|:|%resource%|,|filter|:|bound|}]}',\n                    ),\n                ),\n            ),\n            '_:node13'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'                      => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'                     => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'spatial',\n                    ),\n                ),\n                'http://www.w3.org/2000/01/rdf-schema#label'                           => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'Spatial',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#hierarchyTypes' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.aksw.org/spatialHierarchy/SpatialArea',\n                    ),\n                    1 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.aksw.org/spatialHierarchy/Planet',\n                    ),\n                    2 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.aksw.org/spatialHierarchy/Continent',\n                    ),\n                    3 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.aksw.org/spatialHierarchy/Country',\n                    ),\n                    4 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.aksw.org/spatialHierarchy/Province',\n                    ),\n                    5 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.aksw.org/spatialHierarchy/District',\n                    ),\n                    6 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.aksw.org/spatialHierarchy/City',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/config'                 => array(\n                    0 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node14',\n                    ),\n                    1 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node15',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#titleMode'      => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'titleHelper',\n                    ),\n                ),\n            ),\n            '_:node14'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'          => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'         => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'hierarchyRelations',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#in' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.aksw.org/spatialHierarchy/isLocatedIn',\n                    ),\n                ),\n            ),\n            '_:node15'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'           => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'          => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'instanceRelation',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#out' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.aksw.org/addressFeatures/physical/country',\n                    ),\n                    1 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.aksw.org/addressFeatures/physical/city',\n                    ),\n                ),\n            ),\n            '_:node16'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'                      => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'                     => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'faun',\n                    ),\n                ),\n                'http://www.w3.org/2000/01/rdf-schema#label'                           => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'Faunistics',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#hierarchyTypes' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://purl.org/net/faunistics#Family',\n                    ),\n                    1 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://purl.org/net/faunistics#Genus',\n                    ),\n                    2 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://purl.org/net/faunistics#Species',\n                    ),\n                    3 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://purl.org/net/faunistics#Order',\n                    ),\n                    4 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://purl.org/net/faunistics#SubOrder',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/config'                 => array(\n                    0 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node17',\n                    ),\n                    1 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node18',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#titleMode'      => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'titleHelper',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#checkSub'       => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n            ),\n            '_:node17'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'          => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'         => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'hierarchyRelations',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#in' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://purl.org/net/faunistics#subTaxonOf',\n                    ),\n                ),\n            ),\n            '_:node18'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'           => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'          => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'instanceRelation',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#out' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://purl.org/net/faunistics#identifiesAs',\n                    ),\n                ),\n            ),\n            '_:node19'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'                      => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'                     => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'skos',\n                    ),\n                ),\n                'http://www.w3.org/2000/01/rdf-schema#label'                           => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'SKOS',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#hierarchyTypes' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2004/02/skos/core#Concept',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/config'                 => array(\n                    0 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node20',\n                    ),\n                    1 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node21',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#titleMode'      => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'titleHelper',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#showCounts'     => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'false',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n            ),\n            '_:node20'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'           => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'          => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'hierarchyRelations',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#in'  => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2004/02/skos/core#broader',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#out' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2004/02/skos/core#narrower',\n                    ),\n                ),\n            ),\n            '_:node21'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'           => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'          => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'instanceRelation',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#in'  => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2004/02/skos/core#narrower',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#out' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.w3.org/2004/02/skos/core#broader',\n                    ),\n                ),\n            ),\n            '_:node22'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'                      => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'                     => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'org',\n                    ),\n                ),\n                'http://www.w3.org/2000/01/rdf-schema#label'                           => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'Groups',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#hierarchyTypes' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://xmlns.com/foaf/0.1/Group',\n                    ),\n                    1 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://xmlns.com/foaf/0.1/Organization',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/config'                 => array(\n                    0 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node23',\n                    ),\n                    1 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node24',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#titleMode'      => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'titleHelper',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#showCounts'     => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n            ),\n            '_:node23'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'           => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'          => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'hierarchyRelations',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#out' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/subGroup',\n                    ),\n                ),\n            ),\n            '_:node24'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'           => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'          => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'instanceRelation',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#in'  => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://xmlns.com/foaf/0.1/member',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#out' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://xmlns.com/foaf/0.1/member_of',\n                    ),\n                ),\n            ),\n            '_:node25'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'                            => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'                           => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'go',\n                    ),\n                ),\n                'http://www.w3.org/2000/01/rdf-schema#label'                                 => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'Gene Ontology',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#hierarchyTypes'       => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.geneontology.org/dtds/go.dtd#term',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/config'                       => array(\n                    0 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node26',\n                    ),\n                    1 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node27',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#titleMode'            => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'titleHelper',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#showCounts'           => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'false',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#checkSub'             => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#hideDefaultHierarchy' => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'false',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n            ),\n            '_:node26'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'          => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'         => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'hierarchyRelations',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#in' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.geneontology.org/dtds/go.dtd#is_a',\n                    ),\n                ),\n            ),\n            '_:node27'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'             => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'            => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'list',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#query' => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'SELECT DISTINCT ?resourceUri WHERE { ?resourceUri <http://www.geneontology.org/' .\n                            'GO.format.gaf-2_0.shtml#go_id> <%resource%> }',\n                    ),\n                ),\n            ),\n            '_:node28'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'                      => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'                     => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'checklist',\n                    ),\n                ),\n                'http://www.w3.org/2000/01/rdf-schema#label'                           => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'Checklist',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#titleMode'      => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'titleHelper',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#hierarchyTypes' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.mindswap.org/2003/owl/geo/geoFeatures.owl#Country',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/config'                 => array(\n                    0 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node29',\n                    ),\n                    1 => array(\n                        'type'  => 'bnode',\n                        'value' => '_:node30',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#checkSub'       => array(\n                    0 => array(\n                        'type'     => 'literal',\n                        'value'    => 'true',\n                        'datatype' => 'http://www.w3.org/2001/XMLSchema#boolean',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#rootName'       => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'Caucasus Spiders',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#rootURI'        => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://db.caucasus-spiders.info/Area/152',\n                    ),\n                ),\n            ),\n            '_:node29'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'          => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'         => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'hierarchyRelations',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#in' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://www.mindswap.org/2003/owl/geo/geoFeatures.owl#within',\n                    ),\n                ),\n            ),\n            '_:node30'                                                               => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'                       => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/Config',\n                    ),\n                ),\n                'http://ns.ontowiki.net/SysOnt/ExtensionConfig/id'                      => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'list',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#shownProperties' => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => '{|uri|:|http://purl.org/net/faunistics#citationSuffix|,|label|:|citation suffix|' .\n                            ',|action|:|add|,|inverse|:false}',\n                    ),\n                ),\n                'https://github.com/AKSW/navigation/raw/master/doap.n3#query'           => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => 'SELECT DISTINCT ?resourceUri ?famUri WHERE { ?recUri <http://purl.org/net/' .\n                            'faunistics#recordedAtLocation> ?resourceLocation OPTIONAL{ ?resourceLocation ' .\n                            '<http://www.mindswap.org/2003/owl/geo/geoFeatures.owl#within> ?l1. OPTIONAL{ ' .\n                            '?l1 <http://www.mindswap.org/2003/owl/geo/geoFeatures.owl#within> ?l2. ' .\n                            'OPTIONAL{ ?l2 <http://www.mindswap.org/2003/owl/geo/geoFeatures.owl#within> ?l3. ' .\n                            '}}} ?recUri <http://purl.org/net/faunistics#identifiesAs> ?resourceUri . ' .\n                            '?resourceUri <http://purl.org/net/faunistics#subTaxonOf> ?genUri . ?genUri ' .\n                            '<http://purl.org/net/faunistics#subTaxonOf> ?famUri . FILTER' .\n                            '( sameTerm(?resourceLocation, <%resource%>) || sameTerm(?l1, <%resource%>) || ' .\n                            'sameTerm(?l2, <%resource%>) || sameTerm(?l3, <%resource%>)) }',\n                    ),\n                ),\n            ),\n            'https://github.com/AKSW/navigation/raw/master/doap.n3#v1-0'             => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' => array(\n                    0 => array(\n                        'type'  => 'uri',\n                        'value' => 'http://usefulinc.com/ns/doap#Version',\n                    ),\n                ),\n                'http://usefulinc.com/ns/doap#revision'           => array(\n                    0 => array(\n                        'type'  => 'literal',\n                        'value' => '1.0',\n                    ),\n                ),\n            ),\n        );\n        $base    = 'file:///home/jonas/programming/php-workspace/ow/extensions/navigation/';\n        $conf    = OntoWiki_Extension_Manager::triples2configArray($triples, \"navigation\", $base, \"file:///tmp/test\");\n        $this->assertArrayHasKey('private', $conf);\n    }\n}\n"
  },
  {
    "path": "application/tests/unit/OntoWiki/Extension/_files/test-doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/test/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :test .\n:test a doap:Project ;\n  doap:name \"test\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/account/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Some Extension\" ;\n  doap:description \"provides a login module and a recover action.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:templates \"templates\" ;\n  owconfig:languages \"languages\" ;\n  owconfig:hasModule :Default .\n:Default a owconfig:Module ;\n  rdfs:label \"Default\" ;\n  owconfig:caching \"true\"^^xsd:boolean ;\n  owconfig:priority \"40\" ;\n  owconfig:context \"main.sidewindows\" .\n  :prop \"val\"\n:test owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"sub\";\n      :bool \"true\"^^xsd:boolean ;\n      :int \"5\"^^xsd:int ;\n      :float \"0.5\"^^xsd:float\n] ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "application/tests/unit/OntoWiki/MenuTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nclass OntoWiki_MenuTest extends PHPUnit_Framework_TestCase\n{\n    private $_menu = null;\n\n    public function setUp()\n    {\n        $this->_menu = new OntoWiki_Menu();\n    }\n\n    public function testSetEntryString()\n    {\n        $this->_menu->setEntry('Entry 1', 'Value 1');\n\n        $this->assertEquals($this->_menu->toArray(), array('Entry 1' => 'Value 1'));\n    }\n\n    public function testSetEntryObject()\n    {\n        $subMenuA = new OntoWiki_Menu();\n        $subMenuA->setEntry('Sub Entry 1', 'Sub Value 1');\n\n        $this->_menu->setEntry('Sub Menu 1', $subMenuA);\n\n        $this->assertEquals($this->_menu->toArray(), array('Sub Menu 1' => array('Sub Entry 1' => 'Sub Value 1')));\n\n    }\n\n    public function testReplaceEntry()\n    {\n        $this->_menu->setEntry('Entry 1', 'Old Value')\n            ->setEntry('Entry 1', 'New Value');\n\n        $this->assertEquals($this->_menu->toArray(), array('Entry 1' => 'New Value'));\n    }\n\n    public function testToArray()\n    {\n        $subMenuA = new OntoWiki_Menu();\n        $subMenuA->setEntry('Sub Entry 1', 'Sub Value 1');\n\n        $subMenuB = new OntoWiki_Menu();\n        $subMenuB->setEntry('Sub Entry 2', 'Old Sub Value 2')\n            ->setEntry('Sub Entry 2', 'New Sub Value 2');\n\n        $this->_menu->setEntry('Entry 1', 'Value 1')\n            ->setEntry('Sub Menu 1', $subMenuA)\n            ->setEntry('Sub Menu 2', $subMenuB);\n\n        $expected = array(\n            'Entry 1'    => 'Value 1',\n            'Sub Menu 1' => array('Sub Entry 1' => 'Sub Value 1'),\n            'Sub Menu 2' => array('Sub Entry 2' => 'New Sub Value 2')\n        );\n        $this->assertEquals($this->_menu->toArray(), $expected);\n\n        $this->_menu->setEntry('Sub Menu 1', 'Replaced Sub Menu Entry');\n        $expected = array(\n            'Entry 1'    => 'Value 1',\n            'Sub Menu 1' => 'Replaced Sub Menu Entry',\n            'Sub Menu 2' => array('Sub Entry 2' => 'New Sub Value 2')\n        );\n        $this->assertEquals($this->_menu->toArray(), $expected);\n    }\n\n    public function testToJson()\n    {\n        $subMenuA = new OntoWiki_Menu();\n        $subMenuA->setEntry('Sub Entry 1', 'Sub Value 1');\n\n        $subMenuB = new OntoWiki_Menu();\n        $subMenuB->setEntry('Sub Entry 2', 'Old Sub Value 2')\n            ->setEntry('Sub Entry 2', 'New Sub Value 2');\n\n        $this->_menu->setEntry('Entry 1', 'Value 1')\n            ->setEntry('Sub Menu 1', $subMenuA)\n            ->setEntry('Sub Menu 2', $subMenuB);\n\n        $expected = '{\"Entry 1\":\"Value 1\",\"Sub Menu 1\":{\"Sub Entry 1\":\"Sub Value 1\"},' .\n            '\"Sub Menu 2\":{\"Sub Entry 2\":\"New Sub Value 2\"}}';\n        $this->assertEquals($expected, $this->_menu->toJson(false));\n\n        $this->_menu->setEntry('Sub Menu 1', 'Replaced Sub Menu Entry');\n        $expected = '{\"Entry 1\":\"Value 1\",\"Sub Menu 1\":\"Replaced Sub Menu Entry\",\"Sub Menu 2\":' .\n            '{\"Sub Entry 2\":\"New Sub Value 2\"}}';\n        $this->assertEquals($expected, $this->_menu->toJson(false));\n    }\n\n    /**\n     * @expectedException OntoWiki_Exception\n     */\n    public function testWrongKey()\n    {\n        $this->_menu->setEntry(null, 'Bar');\n    }\n\n    /**\n     * @expectedException OntoWiki_Exception\n     */\n    public function testContentError()\n    {\n        $this->_menu->setEntry('Foo', 12345);\n    }\n\n    /**\n     * @expectedException OntoWiki_Exception\n     */\n    public function testReplaceError()\n    {\n        $this->_menu->setEntry('Existing Key', 'Bar');\n        $this->_menu->setEntry('Existing Key', 'Baz', false);\n    }\n}\n"
  },
  {
    "path": "application/tests/unit/OntoWiki/MessageTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * This test class comtains tests for the OntoWiki index controller.\n *\n * @category   OntoWiki\n * @package    OntoWiki\n * @subpackage UnitTests\n * @copyright  Copyright (c) 2006-2010, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2 (GPLv2)\n * @author     Norman Heino <norman.heino@gmail.com>\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass OntoWiki_MessageTest extends PHPUnit_Framework_TestCase\n{\n    public function testMessageGetTypeDefaultInfo()\n    {\n        $msg = new OntoWiki_Message('ttt');\n        $this->assertEquals($msg->getType(), OntoWiki_Message::INFO);\n    }\n\n    public function testMessageGetTypeSuccess()\n    {\n        $msg = new OntoWiki_Message('ttt', OntoWiki_Message::SUCCESS);\n        $this->assertEquals($msg->getType(), OntoWiki_Message::SUCCESS);\n    }\n\n    public function testMessageGetTypeInfo()\n    {\n        $msg = new OntoWiki_Message('ttt', OntoWiki_Message::INFO);\n        $this->assertEquals($msg->getType(), OntoWiki_Message::INFO);\n    }\n\n    public function testMessageGetTypeWarning()\n    {\n        $msg = new OntoWiki_Message('ttt', OntoWiki_Message::WARNING);\n        $this->assertEquals($msg->getType(), OntoWiki_Message::WARNING);\n    }\n\n    public function testMessageGetTypeError()\n    {\n        $msg = new OntoWiki_Message('ttt', OntoWiki_Message::ERROR);\n        $this->assertEquals($msg->getType(), OntoWiki_Message::ERROR);\n    }\n\n    public function testMessageGetText()\n    {\n        $msg = new OntoWiki_Message('The test string for the message object.', OntoWiki_Message::SUCCESS);\n        $this->assertEquals($msg->getText(), 'The test string for the message object.');\n    }\n}\n"
  },
  {
    "path": "application/tests/unit/OntoWiki/Model/InstancesTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * It tests the behavior of Ontowiki_Model_Instances\n *\n * @author Jonas Brekle <jonas.brekle@gmail.com>\n */\nclass OntoWiki_Model_InstancesTest extends Erfurt_TestCase\n{\n    /**\n     *\n     * @var OntoWiki_Model_Instances\n     */\n    protected $_instances = null;\n\n    /**\n     *\n     * @var Erfurt_Store_Adapter\n     */\n    protected $_storeAdapter = null;\n\n    /**\n     *\n     * @var Erfurt_Store\n     */\n    protected $_store = null;\n\n    public function setUp()\n    {\n        $this->markTestNeedsTestConfig();\n\n        $this->_storeAdapter = new Erfurt_Store_Adapter_Test();\n\n        $this->_store = new Erfurt_Store(\n            array(\n                 'adapterInstance' => $this->_storeAdapter\n            ),\n            'Test'\n        );\n\n        $this->_store->setAc(new Erfurt_Ac_Test());\n\n        $this->_instances = new OntoWiki_Model_Instances(\n            $this->_store,\n            new Erfurt_Rdf_Model('http://graph.com/123/', null, $this->_store)\n        );\n\n    }\n\n    public function testGetResourceQuery()\n    {\n        $this->assertInstanceOf('Erfurt_Sparql_Query2', $this->_instances->getResourceQuery());\n    }\n\n    public function testSerialization()\n    {\n        ob_start();\n        $this->_instances = unserialize(serialize($this->_instances));\n        $output           = ob_get_contents();\n        ob_end_clean();\n        $this->assertTrue(empty($o)); //no warnings\n    }\n\n\n    public function testSetStore()\n    {\n        $adapter = new Erfurt_Store_Adapter_Test();\n        $store   = new Erfurt_Store(array('adapterInstance' => $adapter), 'Test');\n        $this->assertNotSame($this->_instances->getStore(), $store);\n        $this->_instances->setStore($store);\n        $this->assertSame($this->_instances->getStore(), $store);\n\n        try {\n            $this->_instances->setStore(null);\n            $this->fail(\"No Exception was thrown in setStore(null)\");\n        } catch (Exception $e) {\n            $this->assertTrue(true); //increase assertion count :)\n        }\n    }\n\n    public function testAllTriple()\n    {\n        $this->assertTrue(\n            in_array(\n                $this->_instances->getAllTriple(), $this->_instances->getResourceQuery()->getWhere()->getElements()\n            )\n        );\n        $this->_instances->removeAllTriple();\n        $this->assertTrue(\n            !in_array(\n                $this->_instances->getAllTriple(), $this->_instances->getResourceQuery()->getWhere()->getElements()\n            )\n        );\n        $this->_instances->addAllTriple();\n        $this->assertTrue(\n            in_array(\n                $this->_instances->getAllTriple(), $this->_instances->getResourceQuery()->getWhere()->getElements()\n            )\n        );\n    }\n\n    public function testGetQuery()\n    {\n        $this->assertInstanceOf('Erfurt_Sparql_Query2', $this->_instances->getQuery());\n    }\n\n    public function testGetResourceVar()\n    {\n        $this->assertInstanceOf('Erfurt_Sparql_Query2_Var', $this->_instances->getResourceVar());\n    }\n\n    public function testOffsetLimit()\n    {\n        //default values\n        $this->assertEquals(10, $this->_instances->getLimit());\n        $this->assertEquals(0, $this->_instances->getOffset());\n        //test setting\n        $this->_instances->setOffset(1);\n        $this->_instances->setLimit(1);\n        $this->assertEquals(1, $this->_instances->getLimit());\n        $this->assertEquals(1, $this->_instances->getOffset());\n        //test repeated set\n        $this->_instances->setOffset(1);\n        $this->_instances->setLimit(1);\n        //test negative set (minus interpreted as plus)\n        $this->_instances->setOffset(-1);\n        $this->_instances->setLimit(-1);\n        $this->assertEquals(1, $this->_instances->getLimit());\n        $this->assertEquals(1, $this->_instances->getOffset());\n    }\n\n    public function testNoCache()\n    {\n        $instances = new OntoWiki_Model_Instances(\n            $this->_store,\n            new Erfurt_Rdf_Model('http://graph.com/123/', null, $this->_store),\n            array(Erfurt_Store::USE_CACHE => false)\n        );\n        $this->assertInstanceOf('OntoWiki_Model_Instances', $instances);\n    }\n\n\n    public function testSerialize()\n    {\n        $vqA = $this->_instances->getQuery()->getSparql();\n        $rqA = $this->_instances->getResourceQuery()->getSparql();\n        $q   = unserialize(serialize($this->_instances));\n        $vqB = $this->_instances->getQuery()->getSparql();\n        $rqB = $this->_instances->getResourceQuery()->getSparql();\n        $this->assertEquals($vqA, $vqB);\n        $this->assertEquals($rqA, $rqB);\n\n        $c   = clone $this->_instances;\n        $vqB = $c->getQuery()->getSparql();\n        $rqB = $c->getResourceQuery()->getSparql();\n        $this->assertEquals($vqA, $vqB);\n        $this->assertEquals($rqA, $rqB);\n        $this->assertNotSame($this->_instances, $c);\n    }\n\n    public function testCallMagic()\n    {\n        //redirect from methods to both query objects\n        $from = new Erfurt_Sparql_Query2_GraphClause(\n            new Erfurt_Sparql_Query2_IriRef(\"http://abc\")\n        );\n        $this->_instances->addFrom($from);\n        $this->assertContains($from, $this->_instances->getFroms()); //redirected to resource query\n        $this->assertContains($from, $this->_instances->getQuery()->getFroms());\n\n        //check undefined exception\n        try {\n            $r = $this->_instances->undef();\n            $this->fail(\"no exception when calling undefined method on instances object. see __call\");\n        } catch (Exception $exc) {\n            $this->assertTrue(true); //increase assertion count :)\n        }\n    }\n\n    /**\n     * number of triples that are in an \"empty\" value query\n     *\n     * @var int\n     */\n    private $_valueQueryDefaultTriples = 3;\n\n    public function testShownPropertiesEmpty()\n    {\n        //test default state\n        $this->assertNoShownProperties($this->_instances);\n    }\n\n    public function testShownPropertiesAdd()\n    {\n        //add\n        $r = $this->_instances->addShownProperty(\"http://abc\");\n        //test chaining\n        $this->assertSame($this->_instances, $r);\n\n        return $this->_instances;\n    }\n\n    /**\n     *\n     * @depends testShownPropertiesAdd\n     */\n    public function testShownPropertiesAddPlain(OntoWiki_Model_Instances $i)\n    {\n        $psDef = $i->getShownPropertiesPlain();\n        $this->assertCount(2, $psDef);\n    }\n\n    /**\n     *\n     * @depends testShownPropertiesAdd\n     */\n    public function testShownPropertiesAddTriple(OntoWiki_Model_Instances $i)\n    {\n        //verify two triple in value query, alltriple (?resourceuri ?p ?o), filter(isuri) and the optional triple\n        $triples = $i->getValueQuery()->getElements();\n        $this->assertCount(1 + $this->_valueQueryDefaultTriples, $triples);\n    }\n\n    /**\n     *\n     */\n    public function testShownPropertiesCustomAddTriple()\n    {\n        $var     = new Erfurt_Sparql_Query2_Var(\"sp\");\n        $triples = array(\n            new Erfurt_Sparql_Query2_Triple(\n                $this->_instances->getResourceVar(),\n                new Erfurt_Sparql_Query2_IriRef('http://ex.com/'),\n                $var\n            )\n        );\n        $r       = $this->_instances->addShownPropertyCustom($triples, $var);\n        //verify two triple in value query, alltriple (?resourceuri ?p ?o), filter(isuri) and the optional triple\n        $triplesQuery = $this->_instances->getValueQuery()->getElements();\n\n        $this->assertCount(1 + $this->_valueQueryDefaultTriples, $triplesQuery);\n    }\n\n    public function testtShownPropertiesRemove()\n    {\n        //add\n        $p = \"http://abc\";\n        $this->_instances->addShownProperty($p);\n        //result of add is checked in testShownPropertiesAdd1\n        $rA = $this->_instances->removeShownProperty($p, false);\n        $this->assertNoShownProperties($this->_instances);\n        $this->assertTrue($rA);\n        //remove non existing\n        $rB = $this->_instances->removeShownProperty($p, false);\n        $this->assertFalse($rB);\n    }\n\n    private function assertNoShownProperties(OntoWiki_Model_Instances $i)\n    {\n        //only __TYPE\n        $psDef = $i->getShownPropertiesPlain();\n        $this->assertCount(1, $psDef);\n        $triples = $i->getValueQuery()->getElements();\n        $this->assertCount($this->_valueQueryDefaultTriples, $triples);\n    }\n\n    public function testFilterEmpty()\n    {\n        $fDef = $this->_instances->getFilter();\n        $this->assertEmpty($fDef);\n    }\n\n    public function testFilterAddBound()\n    {\n        //test add\n        $this->_instances->addFilter(\"http://abc\", false, \"abc\", \"bound\");\n        $this->assertCount(1, $this->_instances->getFilter());\n    }\n\n    public function testFilterAddContains()\n    {\n        $this->_instances->addFilter(\"http://abc\", false, \"abc\", \"contains\", \"xyz\");\n        $this->assertCount(1, $this->_instances->getFilter());\n    }\n\n    public function testFilterAddEquals()\n    {\n        $this->_instances->addFilter(\"http://abc\", false, \"abc\", \"equals\", \"xyz\");\n        $this->assertCount(1, $this->_instances->getFilter());\n    }\n\n    public function testFilterAddLarger()\n    {\n        $this->_instances->addFilter(\"http://abc\", false, \"abc\", \"larger\", 4);\n        $this->assertCount(1, $this->_instances->getFilter());\n    }\n\n    public function testFilterAddSmaller()\n    {\n        $this->_instances->addFilter(\"http://abc\", false, \"abc\", \"smaller\", 4);\n        $this->assertCount(1, $this->_instances->getFilter());\n    }\n\n    public function testFilterAddBetween()\n    {\n        $this->_instances->addFilter(\"http://abc\", false, \"abc\", \"between\", 5, 6);\n        $this->assertCount(1, $this->_instances->getFilter());\n    }\n\n    public function testFilterAddType()\n    {\n        $this->_instances->addTypeFilter(\"http://class.com\");\n        $this->assertCount(1, $this->_instances->getFilter());\n    }\n\n    public function testFilterAddSearch()\n    {\n        $this->_instances->addSearchFilter(\"term\");\n        $this->assertCount(1, $this->_instances->getFilter());\n    }\n\n    public function testFilterAddTriples()\n    {\n        $triples = array(\n            new Erfurt_Sparql_Query2_Triple(\n                $this->_instances->getResourceVar(),\n                new Erfurt_Sparql_Query2_IriRef('http://ex.com/'),\n                new Erfurt_Sparql_Query2_Var(\"sp\")\n            )\n        );\n        $this->_instances->addTripleFilter($triples);\n        //verify two triple in value query, alltriple (?resourceuri ?p ?o), filter(isuri) and the optional triple\n        $triplesQuery = $this->_instances->getResourceQuery()->getElements();\n        $this->assertContains($triples[0], $triplesQuery);\n        $this->assertCount(1, $this->_instances->getFilter());\n    }\n\n    public function testFilterAddUndef()\n    {\n        //text unknown filter type\n        try {\n            $this->_instances->addFilter(\"http://abc\", false, \"abc\", \"undef\");\n            $this->fail(\"no exception when calling filter method with unsupported filter type.\");\n        } catch (Exception $exc) {\n            $this->assertTrue(true); //increase assertion count :)\n        }\n\n        //verify triple in value query\n    }\n\n    public function testFilterRemove()\n    {\n        //add\n        $id   = $this->_instances->addFilter(\"http://abc\", false, \"abc\", \"bound\");\n        $fDef = $this->_instances->getFilter();\n        $this->assertCount(1, $fDef);\n        $this->_instances->removeFilter($id);\n        $fDefAfter = $this->_instances->getFilter();\n        $this->assertEmpty($fDefAfter);\n    }\n\n    public function testSetTitleHelper()\n    {\n        $newTH = new OntoWiki_Model_TitleHelper(null, $this->_store);\n        $this->_instances->setTitleHelper($newTH);\n        $this->assertSame($newTH, $this->_instances->getTitleHelper());\n    }\n\n    public function testGetProperties()\n    {\n        $p = $this->_instances->getAllProperties();\n        $this->assertEmpty($p); //on a stub store, there should be no results\n    }\n\n    public function testGetPropertiesQuery()\n    {\n        $q = $this->_instances->getAllPropertiesQuery();\n        $this->assertInstanceOf('Erfurt_Sparql_Query2', $q);\n    }\n\n    public function testGetValues()\n    {\n        $v = $this->_instances->getValues();\n        $this->assertEmpty($v); //on a stub store, there should be no results\n    }\n\n    public function testResults()\n    {\n        $r = $this->_instances->getResults();\n        $this->assertArrayHasKey('results', $r);\n        $this->assertArrayHasKey('bindings', $r['results']);\n        $this->assertEmpty($r['results']['bindings']); //on a stub store, there should be no results\n    }\n\n    public function testPossibleValues()\n    {\n        $v = $this->_instances->getPossibleValues(\"http://abc\");\n        $this->assertEmpty($v); //on a stub store, there should be no results\n    }\n\n\n}\n"
  },
  {
    "path": "application/tests/unit/OntoWiki/Module/RegistryTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nclass OntoWiki_Module_RegistryTest extends PHPUnit_Framework_TestCase\n{\n    protected $_registry;\n\n    public function setUp()\n    {\n        $this->_registry = OntoWiki_Module_Registry::getInstance();\n    }\n\n    public function tearDown()\n    {\n        $this->_registry->resetInstance();\n    }\n\n    public function testRegisterModuleEnabled()\n    {\n        $moduleName = 'test';\n        $this->_registry->register($moduleName, 'TestModule.php');\n\n        $this->assertEquals(true, $this->_registry->isModuleEnabled($moduleName));\n    }\n\n    public function testRegisterModuleDisabled()\n    {\n        $moduleName = 'test';\n        $this->_registry->register(\n            $moduleName, 'TestModule.php', OntoWiki_Module_Registry::DEFAULT_CONTEXT, array('enabled' => false)\n        );\n\n        $this->assertEquals(false, $this->_registry->isModuleEnabled($moduleName));\n    }\n\n    public function testDisableModule()\n    {\n        $moduleName = 'test';\n        $this->_registry->register($moduleName, 'TestModule.php');\n\n        $this->assertEquals(true, $this->_registry->isModuleEnabled($moduleName));\n        $this->_registry->disableModule($moduleName);\n        $this->assertEquals(false, $this->_registry->isModuleEnabled($moduleName));\n    }\n\n    public function testGetModulesReturnesAllModules()\n    {\n        $this->_registry->register('enabledmodule1', 'Enabledmodule1Module.php');\n        $this->assertEquals(true, $this->_registry->isModuleEnabled('enabledmodule1'));\n\n        $this->_registry->register(\n            'disabledmodule', 'DisabledmoduleModule.php', OntoWiki_Module_Registry::DEFAULT_CONTEXT,\n            array('enabled' => false)\n        );\n        $this->assertEquals(false, $this->_registry->isModuleEnabled('disabledmodule'));\n\n        $this->_registry->register('enabledmodule2', 'Enabledmodule2Module.php');\n        $this->assertEquals(true, $this->_registry->isModuleEnabled('enabledmodule2'));\n\n        $expected = array(\n            'enabledmodule1' => array(\n                'enabled'       => true,\n                'id'            => 'enabledmodule1',\n                'classes'       => '',\n                'name'          => 'Enabledmodule1',\n                'extensionName' => 'enabledmodule1',\n                'private'       => array()\n            ),\n            'enabledmodule2' => array(\n                'enabled'       => true,\n                'name'          => 'Enabledmodule2',\n                'id'            => 'enabledmodule2',\n                'classes'       => '',\n                'extensionName' => 'enabledmodule2',\n                'private'       => array()\n            ),\n            'disabledmodule' => array(\n                'enabled'       => false,\n                'name'          => 'Disabledmodule',\n                'id'            => 'disabledmodule',\n                'classes'       => '',\n                'extensionName' => 'disabledmodule',\n                'private'       => array()\n            )\n        );\n\n        $actualModules = $this->_registry->getModules();\n        $this->assertTrue(isset($actualModules['enabledmodule1']));\n        $this->assertTrue(isset($actualModules['enabledmodule2']));\n        $this->assertTrue(isset($actualModules['disabledmodule']));\n        $this->assertEquals($expected['enabledmodule1'], $actualModules['enabledmodule1']->toArray());\n        $this->assertEquals($expected['enabledmodule2'], $actualModules['enabledmodule2']->toArray());\n        $this->assertEquals($expected['disabledmodule'], $actualModules['disabledmodule']->toArray());\n    }\n\n    public function testGetModulesReturnesAllOptions()\n    {\n        $optionsA = array(\n            'enabled'       => true,\n            'class'         => 'foo-class',\n            'id'            => 'bar-id',\n            'name'          => 'foo',\n            'classes'       => '',\n            'extensionName' => 'disabledmodule',\n            'private'       => array()\n        );\n        $this->_registry->register('foo', 'FooModule.php', OntoWiki_Module_Registry::DEFAULT_CONTEXT, $optionsA);\n\n        $optionsB = array(\n            'enabled'       => false,\n            'class'         => 'fuu-class',\n            'id'            => 'baz-id',\n            'name'          => 'foo',\n            'classes'       => '',\n            'extensionName' => 'disabledmodule',\n            'private'       => array()\n        );\n        $this->_registry->register('bar', 'BarModule.php', OntoWiki_Module_Registry::DEFAULT_CONTEXT, $optionsB);\n\n        $actualModules = $this->_registry->getModules();\n        $this->assertTrue(isset($actualModules['foo']));\n        $this->assertTrue(isset($actualModules['bar']));\n        $this->assertEquals($optionsA, $actualModules['foo']->toArray());\n        $this->assertEquals($optionsB, $actualModules['bar']->toArray());\n    }\n}\n"
  },
  {
    "path": "application/tests/unit/OntoWiki/NavigationTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nclass OntoWiki_NavigationTest extends PHPUnit_Framework_TestCase\n{\n    private $_ontoWikiNavigation = null;\n\n    public function setUp()\n    {\n        $this->_ontoWikiNavigation = new OntoWiki_Navigation();\n    }\n\n    public function testRegisterKeyEmptyOptions()\n    {\n        $this->_ontoWikiNavigation->register('foo', array(), false);\n\n        $check = array('foo' => array(\n            'route'      => null,\n            'controller' => null,\n            'action'     => null,\n            'name'       => 'foo',\n            'active'     => 'active'\n        ));\n\n        $this->assertEquals($check, $this->_ontoWikiNavigation->getNavigation());\n    }\n\n    public function testRegisterKeyDefaultOptions()\n    {\n        $this->_ontoWikiNavigation->register(\n            'foo',\n            array(\n                 'route'      => null,\n                 'controller' => null,\n                 'action'     => null,\n                 'name'       => 'foo'\n            ),\n            false\n        );\n\n        $check = array('foo' => array(\n            'route'      => null,\n            'controller' => null,\n            'action'     => null,\n            'name'       => 'foo',\n            'active'     => 'active'\n        ));\n\n        $this->assertEquals($check, $this->_ontoWikiNavigation->getNavigation());\n    }\n\n    /**\n     * @expectedException OntoWiki_Exception\n     */\n    public function testRegisterAlreadyUsedKeyDefaultOptions()\n    {\n        $this->_ontoWikiNavigation->register(\n            'foo',\n            array(\n                 'route'      => null,\n                 'controller' => null,\n                 'action'     => null,\n                 'name'       => 'foo'\n            ),\n            false\n        );\n\n        $this->_ontoWikiNavigation->register(\n            'foo',\n            array(\n                 'route'      => null,\n                 'controller' => null,\n                 'action'     => null,\n                 'name'       => 'foo'\n            ),\n            false\n        );\n    }\n\n    /**\n     * @expectedException OntoWiki_Exception\n     */\n    public function testRegisterAlreadyUsedKeyFilledOptions()\n    {\n        $this->_ontoWikiNavigation->register(\n            'foo',\n            array(\n                 'route'      => 'foo',\n                 'controller' => 'bar',\n                 'action'     => 'bar',\n                 'name'       => 'foo'\n            ),\n            false\n        );\n\n        $this->_ontoWikiNavigation->register(\n            'foo',\n            array(\n                 'route'      => 'foo',\n                 'controller' => 'bar',\n                 'action'     => 'bar',\n                 'name'       => 'foo'\n            ),\n            false\n        );\n    }\n\n    /**\n     * @expectedException OntoWiki_Exception\n     */\n    public function testRegisterNoKey()\n    {\n        $this->_ontoWikiNavigation->register('', array(), false);\n    }\n\n    /**\n     * @expectedException OntoWiki_Exception\n     */\n    public function testRegisterNullKey()\n    {\n        $this->_ontoWikiNavigation->register(null, array(), false);\n    }\n\n    /**\n     * @expectedException OntoWiki_Exception\n     */\n    public function testRegisterNumberKey()\n    {\n        $this->_ontoWikiNavigation->register(0, array(), false);\n    }\n\n    /**\n     * @expectedException OntoWiki_Exception\n     */\n    public function testSetActiveNoKey()\n    {\n        $this->_ontoWikiNavigation->setActive('');\n    }\n\n    /**\n     * @expectedException OntoWiki_Exception\n     */\n    public function testSetActiveNullKey()\n    {\n        $this->_ontoWikiNavigation->setActive(null);\n    }\n\n    public function testSetActiveKey()\n    {\n        $this->_ontoWikiNavigation->register('foo', array(), false);\n        $this->_ontoWikiNavigation->setActive('foo');\n\n        $activeItem = $this->_ontoWikiNavigation->getActive();\n        $this->assertEquals('foo', $activeItem['name']);\n    }\n\n    public function testNoSetActiveKeyCheckActive()\n    {\n        $this->_ontoWikiNavigation->register('foo', array(), false);\n\n        $activeItem = $this->_ontoWikiNavigation->getActive();\n        $this->assertEquals('foo', $activeItem['name']);\n    }\n\n    public function testNoSetActiveKeyCheckNotActiveMultipleItems()\n    {\n        $this->_ontoWikiNavigation->register('foo', array(), false);\n        $this->_ontoWikiNavigation->register('bar', array(), false);\n\n        $activeItem = $this->_ontoWikiNavigation->getActive();\n        $this->assertNotEquals('bar', $activeItem['name']);\n    }\n\n    public function testSetActiveKeyChangeActive()\n    {\n        $this->_ontoWikiNavigation->register('foo', array(), false);\n        $this->_ontoWikiNavigation->register('oldActive', array(), false);\n        $this->_ontoWikiNavigation->setActive('oldActive');\n        $this->_ontoWikiNavigation->setActive('foo');\n\n        $activeItem = $this->_ontoWikiNavigation->getActive();\n        $this->assertEquals('foo', $activeItem['name']);\n    }\n}\n"
  },
  {
    "path": "application/tests/unit/OntoWiki/UtilsTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * This test class comtains tests for the OntoWiki Utils.\n *\n * @category   OntoWiki\n * @package    OntoWiki\n * @subpackage UnitTests\n * @copyright  Copyright (c) 2016, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2 (GPLv2)\n * @author     Natanael Arndt <arndtn@gmail.com>\n */\nclass OntoWiki_UtilsTest extends PHPUnit_Framework_TestCase\n{\n    public function testMatchMimetypeFromRequest()\n    {\n        $request = new Zend_Controller_Request_HttpTestCase();\n        $request->setHeader(\"Accept\", \"text/*\");\n        $support = array(\n            \"text/ttl\",\n            \"application/rdf+xml\"\n        );\n        $mime = OntoWiki_Utils::matchMimetypeFromRequest($request, $support);\n        $this->assertEquals($mime, \"text/ttl\");\n    }\n}\n"
  },
  {
    "path": "application/tests/unit/OntoWikiTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * This test class comtains tests for the OntoWiki index controller.\n *\n * @category   OntoWiki\n * @package    OntoWiki\n * @subpackage UnitTests\n * @copyright  Copyright (c) 2006-2010, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2 (GPLv2)\n * @author     Norman Heino <norman.heino@gmail.com>\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass OntoWikiTest extends PHPUnit_Framework_TestCase\n{\n    protected $_application;\n\n    public function setUp()\n    {\n        $this->_application = OntoWiki::getInstance();\n    }\n\n    public function testGetInstance()\n    {\n        $newInstance = OntoWiki::getInstance();\n\n        $this->assertSame($this->_application, $newInstance);\n    }\n\n    public function testSetValue()\n    {\n        $this->_application->foo = 'bar';\n\n        $this->assertEquals($this->_application->foo, 'bar');\n    }\n\n    public function testIssetValue()\n    {\n        $this->assertEquals(isset($this->_application->anotherFoo), false);\n    }\n\n    public function testGetValue()\n    {\n        $this->assertEquals($this->_application->YetAnotherFoo, null);\n\n        $this->_application->YetAnotherFoo = 'bar';\n\n        $this->assertEquals($this->_application->YetAnotherFoo, 'bar');\n    }\n}\n"
  },
  {
    "path": "application/tests/unit/controller/IndexControllerTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * This test class comtains tests for the OntoWiki index controller.\n *\n * @category   OntoWiki\n * @package    controlers\n * @subpackage UnitTests\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2 (GPLv2)\n * @author     Norman Heino <norman.heino@gmail.com>\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass IndexControllerTest extends OntoWiki_Test_ControllerTestCase\n{\n    public function setUp()\n    {\n        $this->setUpUnitTest();\n    }\n\n    public function testNoControllerAndActionDefaultToNewsAction()\n    {\n        $this->dispatch('/');\n\n        $this->assertController('index');\n        $this->assertAction('news');\n    }\n\n\n    public function testInvalidActionNoDefaultActionDefaultsToNewsAction()\n    {\n        $config = OntoWiki::getInstance()->config;\n        unset($config->index->default->controller);\n        unset($config->index->default->action);\n\n        $this->dispatch('/index/actionXYZNotExisting');\n\n        $this->assertController('index');\n        $this->assertAction('news');\n    }\n\n    public function testInvalidActionDefaultsToConfiguredDefaultAction()\n    {\n        $config                             = OntoWiki::getInstance()->config;\n        $config->index->default->controller = 'index';\n        $config->index->default->action     = 'empty';\n\n        $this->dispatch('/index/actionXYZNotExisting');\n\n        $this->assertController('index');\n        $this->assertAction('empty');\n    }\n\n\n    public function testInvalidActionWithMessagesDefaultsToMessagesAction()\n    {\n        $owApp = OntoWiki::getInstance();\n        $owApp->appendMessage(new OntoWiki_Message('Test Message'));\n\n        $this->dispatch('/index/actionXYZNotExisting');\n\n        $this->assertController('index');\n        $this->assertAction('messages');\n\n        $this->assertQueryContentContains('p.messagebox', 'Test Message');\n    }\n\n    public function testEmptyAction()\n    {\n        $this->dispatch('/index/');\n\n        $this->assertController('index');\n        $this->assertAction('news');\n        $this->assertQuery('div.section-mainwindows');\n        $this->assertQuery('div.section-sidewindows');\n    }\n\n    public function testMessagesActionNoMessages()\n    {\n        $this->dispatch('/index/messages');\n\n        $this->assertController('index');\n        $this->assertAction('messages');\n    }\n\n    public function testMessagesActionSingleMessage()\n    {\n        $owApp = OntoWiki::getInstance();\n        $owApp->appendMessage(new OntoWiki_Message('Test Message 123', OntoWiki_Message::INFO));\n\n        $this->dispatch('/index/messages');\n\n        $this->assertController('index');\n        $this->assertAction('messages');\n        $this->assertQueryContentContains('p.messagebox.info', 'Test Message 123');\n    }\n\n    public function testMessagesActionMultipleMessages()\n    {\n        $owApp = OntoWiki::getInstance();\n\n        $owApp->appendMessage(new OntoWiki_Message('Test Message 123', OntoWiki_Message::INFO));\n        $owApp->appendMessage(new OntoWiki_Message('Error Message 456', OntoWiki_Message::ERROR));\n\n        $this->dispatch('/index/messages');\n        $this->assertController('index');\n        $this->assertAction('messages');\n        $this->assertQueryContentContains('p.messagebox.info', 'Test Message 123');\n        $this->assertQueryContentContains('p.messagebox.error', 'Error Message 456');\n    }\n\n\n    public function testNewsActionSuccess()\n    {\n        $adapter = new Zend_Http_Client_Adapter_Test();\n        Zend_Feed::setHttpClient(new Zend_Http_Client(null, array('adapter' => $adapter)));\n        $adapter->setResponse(\n            new Zend_Http_Response(\n                200,\n                array(),\n                file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'aksw.rss')\n            )\n        );\n\n        $this->dispatch('/index/news');\n        $this->assertController('index');\n        $this->assertAction('news');\n        $this->assertQueryContentContains('h1.title', 'News');\n        $this->assertQueryCount('div.messagebox.feed', 5);\n    }\n\n\n    public function testNewsActionFail()\n    {\n        $adapter = new Zend_Http_Client_Adapter_Test();\n        $adapter->setNextRequestWillFail(true);\n        Zend_Feed::setHttpClient(new Zend_Http_Client(null, array('adapter' => $adapter)));\n\n        $this->dispatch('/');\n\n        $this->assertController('index');\n        $this->assertAction('news');\n        $this->assertQueryContentContains('h1.title', 'News');\n        $this->assertQuery('p.messagebox.warning');\n\n    }\n\n    public function testNewsshortActionSuccess()\n    {\n        $adapter = new Zend_Http_Client_Adapter_Test();\n        Zend_Feed::setHttpClient(new Zend_Http_Client(null, array('adapter' => $adapter)));\n        $adapter->setResponse(\n            new Zend_Http_Response(\n                200,\n                array(),\n                file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'aksw.rss')\n            )\n        );\n\n        $this->dispatch('/index/newsshort');\n        $this->assertController('index');\n        $this->assertAction('newsshort');\n        $this->assertQueryCount('div.messagebox.feed', 3);\n    }\n\n    public function testNewsshortActionFail()\n    {\n        $adapter = new Zend_Http_Client_Adapter_Test();\n        $adapter->setNextRequestWillFail(true);\n        Zend_Feed::setHttpClient(new Zend_Http_Client(null, array('adapter' => $adapter)));\n\n        $this->dispatch('/index/newsshort');\n\n        $this->assertController('index');\n        $this->assertAction('newsshort');\n        $this->assertQuery('p.messagebox.warning');\n    }\n\n}\n"
  },
  {
    "path": "application/tests/unit/controller/ResourceControllerTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * This test class comtains tests for the OntoWiki service controller.\n *\n * @category   OntoWiki\n * @package    controlers\n * @subpackage UnitTests\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2 (GPLv2)\n * @author     Jonas Brekle <jonas.brekle@gmail.com>\n */\nclass ResourceControllerTest extends OntoWiki_Test_ControllerTestCase\n{\n    public function setUp()\n    {\n        $this->setUpUnitTest();\n    }\n\n    public function testExportActionReturnsCorrectContentTypeForTurtle()\n    {\n        $r = 'http://example.org/resource1';\n        $m = 'http://example.org/model1/';\n        $this->_storeAdapter->createModel($m);\n\n        $this->request->setParam('r', $r);\n        $this->request->setParam('m', $m);\n        $this->request->setParam('f', 'turtle');\n        $this->dispatch('/resource/export');\n\n        $this->assertController('resource');\n        $this->assertAction('export');\n        $this->assertResponseCode(200);\n        $this->assertHeaderContains('Content-Type', 'text/turtle');\n    }\n}\n"
  },
  {
    "path": "application/tests/unit/controller/_files/aksw.rss",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- generator=\"wordpress/2.1\" -->\n<rss version=\"2.0\"\n\txmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\n\txmlns:wfw=\"http://wellformedweb.org/CommentAPI/\"\n\txmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n\t>\n\n<channel>\n\t<title>blog.aksw.org</title>\n\t<link>http://blog.aksw.org</link>\n\t<description>The shared AKSW blog about our projects and the Semantic Web.</description>\n\t<pubDate>Tue, 14 Dec 2010 16:02:49 +0000</pubDate>\n\t<generator>http://wordpress.org/?v=2.1</generator>\n\t<language>en</language>\n\t\t\t<item>\n\t\t<title>AKSW presents four papers at ISWC in Shanghai and wins Best Paper award</title>\n\t\t<link>http://blog.aksw.org/2010/aksw-presents-four-papers-at-iswc-in-shanghai-and-wins-best-paper-award/</link>\n\t\t<comments>http://blog.aksw.org/2010/aksw-presents-four-papers-at-iswc-in-shanghai-and-wins-best-paper-award/#comments</comments>\n\t\t<pubDate>Thu, 11 Nov 2010 10:16:10 +0000</pubDate>\n\t\t<dc:creator>Sören Auer</dc:creator>\n\t\t\n\t<dc:subject>Announcements</dc:subject>\n\t<dc:subject>OntoWiki</dc:subject>\n\t<dc:subject>Papers</dc:subject>\n\t<dc:subject>Erfurt</dc:subject>\n\t<dc:subject>ORE</dc:subject>\n\t\t<guid isPermaLink=\"false\">http://blog.aksw.org/2010/aksw-presents-four-papers-at-iswc-in-shanghai-and-wins-best-paper-award/</guid>\n\t\t<description><![CDATA[The AKSW research group is represented in the main ISWC conference programme this year with four papers. International Semantic Web Conference (ISWC) is the major international forum where the latest research results and technical innovations on all aspects of the Semantic Web are presented. Acceptance rates for the main conference programme were this year 20% [...]]]></description>\n\t\t\t<content:encoded><![CDATA[<p>The AKSW research group is represented in the main ISWC conference programme this year with four papers. <a href=\"http://iswc2010.semanticweb.org/\">International Semantic Web Conference (ISWC)</a> is the major international forum where the latest research results and technical innovations on all aspects of the Semantic Web are presented. Acceptance rates for the main conference programme were this year 20% for the research track and 26% for the In-Use track. AKSW&#8217;s presentations at ISWC in Shanghai include:</p>\n<ul>\n<li>Christoph Rie&#223;, Norman Heino, Sebastian Tramp, S&#246;ren Auer: <a href=\"http://svn.aksw.org/papers/2010/ISWC_Evolution/public.pdf\">EvoPat - Pattern-Based Evolution and Refactoring of RDF Knowledge Bases.</a></li>\n<li>Jens Lehmann and Lorenz B&#252;hmann: <a href=\"http://svn.aksw.org/papers/2010/ORE/public.pdf\">ORE - A Tool for Repairing and Enriching Knowledge Bases.</a> </li>\n<li>S&#246;ren Auer, Matthias Weidl, Jens Lehmann, Amrapali J. Zaveri, Key-Sun Choi: <a href=\"http://svn.aksw.org/papers/2010/ISWC_I18n/public.pdf\">I18n of Semantic Web Applications.</a></li>\n<li>Thomas Riechert, Ulf Morgenstern, S&#246;ren Auer, Sebastian Tramp, Michael Martin: <a href=\"http://svn.aksw.org/papers/2010/ISWC_CP/public.pdf\">Knowledge Engineering for Historians on the Example of the Catalogus Professorum Lipsiensis.</a></li>\n</ul>\n<p>The paper titled <a href=\"http://svn.aksw.org/papers/2010/ISWC_CP/public.pdf\">Knowledge Engineering for Historians on the Example of the Catalogus Professorum Lipsiensis</a> was awarded the best In-Use track paper award.</p>\n]]></content:encoded>\n\t\t\t<wfw:commentRss>http://blog.aksw.org/2010/aksw-presents-four-papers-at-iswc-in-shanghai-and-wins-best-paper-award/feed/</wfw:commentRss>\n\t\t</item>\n\t\t<item>\n\t\t<title>OntoWiki 0.9.5 Available</title>\n\t\t<link>http://blog.aksw.org/2010/ontowiki-095-available/</link>\n\t\t<comments>http://blog.aksw.org/2010/ontowiki-095-available/#comments</comments>\n\t\t<pubDate>Mon, 14 Jun 2010 14:55:47 +0000</pubDate>\n\t\t<dc:creator>Sebastian Tramp</dc:creator>\n\t\t\n\t<dc:subject>Software Releases</dc:subject>\n\t<dc:subject>OntoWiki</dc:subject><dc:subject>OntoWiki</dc:subject><dc:subject>Release</dc:subject>\n\t\t<guid isPermaLink=\"false\">http://blog.aksw.org/2010/ontowiki-095-available/</guid>\n\t\t<description><![CDATA[The AKSW research group is pleased to announce that OntoWiki 0.9.5 is now available for download.\nOntoWiki is a web-application enabling the collaborative creation and (linked data) publication of RDF knowledge bases.\nMore information about OntoWiki can be found at http://ontowiki.net. You can download OntoWiki in our google code file section.\nEnhancements in this release include:\n\nSupport for Semantic [...]]]></description>\n\t\t\t<content:encoded><![CDATA[<p>The <a href=\"http://aksw.org\">AKSW research group</a> is pleased to announce that OntoWiki 0.9.5 is now available <a href=\"http://code.google.com/p/ontowiki/downloads/list\">for download</a>.</p>\n<blockquote><p>OntoWiki is a web-application enabling the collaborative creation and (linked data) publication of RDF knowledge bases.</p></blockquote>\n<p>More information about OntoWiki can be found at <a href=\"http://ontowiki.net\">http://ontowiki.net</a>. You can download OntoWiki in our <a href=\"http://code.google.com/p/ontowiki/downloads/list\">google code file section</a>.</p>\n<p>Enhancements in this release include:</p>\n<ul>\n<li>Support for <a href=\"http://aksw.org/Projects/SemanticPingBack\">Semantic Pingback</a>, a protocol which enables OntoWiki to communicate named links from linked data resources or blog systems like WordPress.</li>\n<li>Support for the publication of provenance information via Linked Data.</li>\n<li>A new navigation module which support the configuration and usage of arbitrary navigation hierarchies (e.g. based on classes, SKOS elements, geospatial entities or FOAF groups).</li>\n<li>A bookmarklet for collecting RDFa-based information into a specific OntoWiki knowledge base.</li>\n<li>More editing widgets, e.g. for phone number and mailto: resources.</li>\n<li>A new mapping module for the resource visualisation and filtering based on maps.</li>\n<li>Attribute / Tag clouds based on selected RDF properties.</li>\n<li>A GUI for complex SPARQL filter (contains, larger, smaller, between and bound)</li>\n<li>A JSON/RPC server as an additional interface (e.g. for the <a href=\"http://code.google.com/p/ontowiki/wiki/CommandLineInterface\">command line client</a>)</li>\n<li>A plugin to create nice URIs based on the content of a new resource.</li>\n</ul>\n<p>A detailed log of the over 200 enhancements and bug fixes of this release is available at our <a href=\"http://code.google.com/p/ontowiki/issues/list?can=1&#038;q=milestone=OntoWiki-0.9.5\">issue tracker</a>.</p>\n<p>Many thanks to the contributors of this OntoWiki release (in alphabetical order): Atanas Alexandrov, Christian Maier, Christoph Riess, Jonas Brekle, Marvin Frommhold, Michael Haschke, Michael Martin, Michael Niederst&#228;tter, Natanael Arndt, Norman Heino, Philipp Frischmuth and Tim Ermilov</p>\n<p>best regards</p>\n<p>Sebastian Tramp</p>\n]]></content:encoded>\n\t\t\t<wfw:commentRss>http://blog.aksw.org/2010/ontowiki-095-available/feed/</wfw:commentRss>\n\t\t</item>\n\t\t<item>\n\t\t<title>owcli 0.3 released</title>\n\t\t<link>http://blog.aksw.org/2010/owcli-03-released/</link>\n\t\t<comments>http://blog.aksw.org/2010/owcli-03-released/#comments</comments>\n\t\t<pubDate>Fri, 09 Apr 2010 12:49:10 +0000</pubDate>\n\t\t<dc:creator>Sebastian Tramp</dc:creator>\n\t\t\n\t<dc:subject>Software Releases</dc:subject>\n\t<dc:subject>OntoWiki</dc:subject>\n\t\t<guid isPermaLink=\"false\">http://blog.aksw.org/2010/owcli-03-released/</guid>\n\t\t<description><![CDATA[We’ve released the third version of our OntoWiki Command Line Interface (owcli). owcli is a php-based command line tool to administrate and manipulate OntoWiki Knowledge Bases. The release is a complete remake as an JSON/RPC client in order are save for future extensions at the OntoWiki RPC server base. owcli can be downloaded at the [...]]]></description>\n\t\t\t<content:encoded><![CDATA[<p>We’ve released the third version of our <a href=\"http://code.google.com/p/ontowiki/wiki/CommandLineInterface\">OntoWiki Command Line Interface (owcli)</a>. owcli is a php-based command line tool to administrate and manipulate OntoWiki Knowledge Bases. The release is a complete remake as an JSON/RPC client in order are save for future extensions at the OntoWiki RPC server base. owcli can be downloaded at the <a href=\"http://code.google.com/p/ontowiki/downloads/list?q=label:owcli\">google code download page</a> and is featured in detail at this <a href=\"http://code.google.com/p/ontowiki/wiki/CommandLineInterface\">wiki page</a>.</p>\n]]></content:encoded>\n\t\t\t<wfw:commentRss>http://blog.aksw.org/2010/owcli-03-released/feed/</wfw:commentRss>\n\t\t</item>\n\t\t<item>\n\t\t<title>Linked Opend Data Project of the Faculty of Mathematics and Computer Science at Leipzig University</title>\n\t\t<link>http://blog.aksw.org/2010/linked-opend-data-project-of-the-faculty-of-mathematics-and-computer-science-at-leipzig-university/</link>\n\t\t<comments>http://blog.aksw.org/2010/linked-opend-data-project-of-the-faculty-of-mathematics-and-computer-science-at-leipzig-university/#comments</comments>\n\t\t<pubDate>Fri, 09 Apr 2010 11:35:53 +0000</pubDate>\n\t\t<dc:creator>ThomasRiechert</dc:creator>\n\t\t\n\t<dc:subject>Announcements</dc:subject>\n\t<dc:subject>Projects</dc:subject>\n\t<dc:subject>OntoWiki</dc:subject>\n\t\t<guid isPermaLink=\"false\">http://blog.aksw.org/2010/linked-opend-data-project-of-the-faculty-of-mathematics-and-computer-science-at-leipzig-university/</guid>\n\t\t<description><![CDATA[From this summer term onwards the Faculty of Mathematics and Computer Science at Leipzig University provides structured information about academia such aslectures, tutors, rooms and timetables as Linked Open Data. The platform http://od.fmi.uni-leipzig.de, which is based on the OntoWiki framework, provides a vocabulary and an ontology. Apart from the possibility of the direct linking of [...]]]></description>\n\t\t\t<content:encoded><![CDATA[<p><font size=\"3\"><font face=\"Times New Roman, serif\">From this summer term onwards the Faculty of Mathematics and Computer Science at Leipzig University provides structured information about academia such aslectures, tutors, rooms and timetables as Linked Open Data. The platform <a href=\"http://od.fmi.uni-leipzig.de\" title=\"http://od.fmi.uni-leipzig.de\" target=\"_blank\">http://od.fmi.uni-leipzig.de</a>, which is based on the OntoWiki framework, provides a vocabulary and an ontology. Apart from the possibility of the direct linking of resources in the semantic web, this platformn offers a SPARQL endpoint. The accessible information provides a basis for the integration into E-Learning platforms or personal knowledge management applications.</font></font></p>\n]]></content:encoded>\n\t\t\t<wfw:commentRss>http://blog.aksw.org/2010/linked-opend-data-project-of-the-faculty-of-mathematics-and-computer-science-at-leipzig-university/feed/</wfw:commentRss>\n\t\t</item>\n\t\t<item>\n\t\t<title>AKSW Publications on this Year&#8217;s Leipzig Book Fair</title>\n\t\t<link>http://blog.aksw.org/2010/aksw-publications-on-this-years-leipzig-book-fair/</link>\n\t\t<comments>http://blog.aksw.org/2010/aksw-publications-on-this-years-leipzig-book-fair/#comments</comments>\n\t\t<pubDate>Thu, 18 Mar 2010 11:45:06 +0000</pubDate>\n\t\t<dc:creator>ThomasRiechert</dc:creator>\n\t\t\n\t<dc:subject>Announcements</dc:subject>\n\t<dc:subject>Projects</dc:subject>\n\t<dc:subject>OntoWiki</dc:subject>\n\t<dc:subject>Events</dc:subject>\n\t<dc:subject>SoftWiki</dc:subject>\n\t\t<guid isPermaLink=\"false\">http://blog.aksw.org/2010/aksw-publications-on-this-years-leipzig-book-fair/</guid>\n\t\t<description><![CDATA[At this year&#8217;s book fair in Leipzig (18/03 - 21/03) two books resulting from current project work of the AKSW research group [1,2] are displayed within the scope of scientific publications from the University of Leipzig. One of the editors, Thomas Riechert, will be present on 19th March from 10 to 12 o&#8217;clock at booth [...]]]></description>\n\t\t\t<content:encoded><![CDATA[<p>At this year&#8217;s <a href=\"http://www.leipziger-buchmesse.de/\" title=\"book fair in Leipzig\">book fair in Leipzig</a> (18/03 - 21/03) two books resulting from current project work of the AKSW research group [1,2] are displayed within the scope of scientific publications from the University of Leipzig. One of the editors, Thomas Riechert, will be present on 19th March from 10 to 12 o&#8217;clock at booth G201/H200 (hall 3).</p>\n<p>[1] Agiles Requirements Engineering f&#252;r Softwareprojekte mit einer gro&#223;en Anzahl verteilter Stakeholder. S&#246;ren Auer, Kim Lauenroth, Steffen Lohmann and Thomas Riechert (Eds.),<br />\n2009, Leipziger Informatik Verbund (LIV), <a href=\"http://softwiki.de/buch\" target=\"_blank\">http://softwiki.de/buch</a></p>\n<p>[2] Catalogus Professorum Lipsiensis - Konzeption, technische Umsetzung und Anwendungen f&#252;r Professorenkataloge im Semantic Web.<br />\nUlf Morgenstern and Thomas Riechert (Eds.), 2010, Leipziger Informatik Verbund (LIV), <a href=\"http://catalogus-professorum.org/buch\" target=\"_blank\">http://catalogus-professorum.org/buch</a></p>\n]]></content:encoded>\n\t\t\t<wfw:commentRss>http://blog.aksw.org/2010/aksw-publications-on-this-years-leipzig-book-fair/feed/</wfw:commentRss>\n\t\t</item>\n\t</channel>\n</rss>\n"
  },
  {
    "path": "application/tests/unit/phpunit.xml.dist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<phpunit bootstrap=\"../Bootstrap.php\" colors=\"false\" backupGlobals=\"false\" backupStaticAttributes=\"false\" strict=\"true\" verbose=\"true\">\n        <testsuite name=\"OntoWiki Unit Tests\">\n            <directory suffix=\"Test.php\">.</directory>\n        </testsuite> \n        \n        <logging>\n            <log type=\"coverage-clover\" target=\"../../../build/logs/clover.xml\"/>\n            <log type=\"coverage-html\" target=\"../../../build/coverage\" title=\"OntoWiki\"/>\n            <log type=\"junit\" target=\"../../../build/logs/junit.xml\"/>\n        </logging>\n\n        <filter>\n            <whitelist addUncoveredFilesFromWhitelist=\"true\"> \n                <directory suffix=\".php\">../../../application</directory>\n                \n                <exclude>\n                    <directory>../../../application/scripts</directory>\n                    <directory>../../../application/tests</directory>\n                    <directory>../../../application/shell.worker.client.php</directory>\n                    <directory>../../../application/shell.worker.php</directory>\n                </exclude>\n            </whitelist>\n        </filter>\n</phpunit>\n"
  },
  {
    "path": "application/views/templates/application/about.phtml",
    "content": "<?php\n/**\n * OntoWiki about template\n */\n\n?>\n<?php foreach ($this->data as $name => $section): ?>\n<h2 class=\"clearfloat\"><?php echo $name ?></h2>\n    <table class=\"separated-vertical\">\n        <?php foreach ($section as $name => $value): ?>\n            <tr>\n                <td width=\"35%\"><?php echo $name ?></td>\n                <td><?php echo $value ?></td>\n            </tr>\n        <?php endforeach; ?>\n    </table>\n<?php endforeach; ?>\n\n"
  },
  {
    "path": "application/views/templates/application/openid.phtml",
    "content": "<?php\n\n/**\n * OntoWiki openid details template\n *\n * @author Philipp Frischmuth <pfrischmuth@googlemail.com>\n * @version $Id: $\n */\n\n?>\n\n<script type=\"text/javascript\">\n//<![CDATA[\n\n$(document).ready(function() {\n\n    $('a.openidreg-cancel').click(function() {\n        window.location = urlBase + 'application/openidreg';\n    });\n});\n\n//]]>\n</script>\n\n<div class=\"openid_logo\">\n</div>\n\n<fieldset>\n    <input type=\"hidden\" name=\"step\" value=\"<?php echo $this->step ?>\" />\n    <div>\n        <label for=\"openid_url\"><?php echo $this->_('OpenID') ?></label>\n        <input class=\"text\" id=\"openid_url\" type=\"text\" name=\"openid_url\" <?php echo $this->readonly ?> value=\"<?php echo (string)$this->openid ?>\" />\n        <?php if (isset($this->checked)): ?>\n            <span class='success_icon'></span>\n        <?php endif; ?>\n        <br class=\"clearall\" />\n    </div>\n    <div>\n        <label for=\"label-input\"><?php echo $this->_('Label') ?></label>\n        <input class=\"text\" id=\"label-input\" type=\"text\" name=\"label\" value=\"<?php echo $this->label ?>\" />\n        <span>You can leave this blank.</span>\n        <br class=\"clearall\" />\n    </div>\n    <div>\n        <label for=\"email-input\"><?php echo $this->_('Email Address') ?></label>\n        <input class=\"text\" id=\"email-input\" type=\"text\" name=\"email\" value=\"<?php echo $this->email ?>\" />\n        <span>You can leave this blank.</span>\n        <br class=\"clearall\" />\n    </div>\n    <div class=\"clearall\"></div>\n</fieldset>\n"
  },
  {
    "path": "application/views/templates/application/register.phtml",
    "content": "<?php\n\n/**\n * OntoWiki user details template\n *\n * @author Norman Heino <norman.heino@gmail.com>\n * @author Philipp Frischmuth <pfrischmuth@googlemail.com>\n * @version $Id: userdetails.phtml 2917 2009-04-21 12:13:33Z norman.heino $\n */\n\n?>\n<fieldset>\n    <div>\n        <label for=\"name-input\"><?php echo $this->_('Username') ?></label>\n        <input class=\"text\" id=\"name-input\" type=\"text\" name=\"username\" <?php echo $this->readonly ?> value=\"<?php echo $this->username ?>\" />\n        <br class=\"clearall\" />\n    </div>\n    <div>\n        <label for=\"email-input\"><?php echo $this->_('Email Address') ?></label>\n        <input class=\"text\" id=\"email-input\" type=\"text\" name=\"email\" value=\"<?php echo $this->email ?>\" />\n        <br class=\"clearall\" />\n    </div>\n    <div>\n        <label for=\"pw1-input\"><?php echo $this->_('Password') ?></label>\n        <input class=\"text\" id=\"pw1-input\" type=\"password\" name=\"password\" />\n        <br class=\"clearall\" />\n    </div>\n    <div>\n        <label for=\"pw2-input\"><?php echo $this->_('Password (repeat)') ?></label>\n        <input class=\"text\" id=\"pw2-input\" type=\"password\" name=\"password2\" />\n        <br class=\"clearall\" />\n    </div>\n    <div class=\"clearall\"></div>\n</fieldset>\n"
  },
  {
    "path": "application/views/templates/application/search.phtml",
    "content": "<?php\n\n/**\n * OntoWiki search message template\n * Search results are displayed within instances list now.\n * This template is only for information on exceptions for given search input\n *\n * @author Norman Heino <norman.heino@gmail.com>\n * @version $Id$\n */\n\n?>\n<p class=\"messagebox info\">\n<?php echo str_replace(': ',':<br/>',$this->errorMsg); ?>\n</p>"
  },
  {
    "path": "application/views/templates/application/userdetails.phtml",
    "content": "<?php\n\n/**\n * OntoWiki user details template\n *\n * @author Norman Heino <norman.heino@gmail.com>\n * @author Philipp Frischmuth <pfrischmuth@googlemail.com>\n * @version $Id: userdetails.phtml 3378 2009-06-24 14:09:30Z pfrischmuth $\n */\n\n?>\n<fieldset>\n    <?php if (isset($this->isOpenIdUser) && $this->isOpenIdUser): ?>\n        <div>\n            <label for=\"openid-input\"><?php echo $this->_('OpenID') ?></label>\n            <input class=\"text\" id=\"openid-input\" type=\"text\" name=\"openid\" readonly=\"readonly\" value=\"<?php echo $this->openid ?>\"/>\n            <br class=\"clearall\" />\n        </div>\n    <?php endif; ?>\n    \n    <div>\n        <label for=\"name-input\"><?php echo $this->_('Username') ?></label>\n        <input class=\"text\" id=\"name-input\" type=\"text\" name=\"username\" <?php echo $this->userReadonly ?> value=\"<?php echo $this->username ?>\" />\n        <br class=\"clearall\" />\n    </div>\n    <div>\n        <label for=\"email-input\"><?php echo $this->_('Email Address') ?></label>\n        <input class=\"text\" id=\"email-input\" type=\"text\" name=\"email\" value=\"<?php echo $this->email ?>\" />\n        <br class=\"clearall\" />\n    </div>\n    <div>\n        <label for=\"pw1-input\"><?php echo $this->_('New Password') ?></label>\n        <input class=\"text\" id=\"pw1-input\" type=\"password\" name=\"password1\" />\n        <br class=\"clearall\" />\n    </div>\n    <div>\n        <label for=\"pw2-input\"><?php echo $this->_('New Password (repeat)') ?></label>\n        <input class=\"text\" id=\"pw2-input\" type=\"password\" name=\"password2\" />\n        <br class=\"clearall\" />\n    </div>\n    <div>\n        <label for=\"pwchange-input\"></label>\n        <input class=\"checkbox\" id=\"pwchange-input\" type=\"checkbox\" name=\"changepassword\" value=\"1\" />\n        <?php echo $this->_('Change Password?') ?>\n        <br class=\"clearall\" />\n    </div>\n    <div class=\"clearall\"></div>\n</fieldset>\n"
  },
  {
    "path": "application/views/templates/application/webid.phtml",
    "content": "<?php\n\n/**\n * OntoWiki openid details template\n *\n * @author Philipp Frischmuth <pfrischmuth@googlemail.com>\n * @version $Id: $\n */\n\n?>\n\n<script type=\"text/javascript\">\n//<![CDATA[\n\n$(document).ready(function() {\n\n    $('a.openidreg-cancel').click(function() {\n        window.location = urlBase + 'application/webidreg';\n    });\n});\n\n//]]>\n</script>\n\n<fieldset>\n<p class=\"messagebox info\">Here is a <a href=\"http://esw.w3.org/topic/foaf%2Bssl/services\">list of FOAF+SSL services</a> where you can create FOAF+SSL compliant certificates.</p>\n    <div>\n        <label for=\"openid_url\"><?php echo $this->_('WebID') ?></label>\n        <input class=\"text\" id=\"webid_url\" type=\"text\" name=\"webid_url\" readonly=\"readonly\" value=\"<?php echo (string)$this->webid ?>\" />\n        <?php if (isset($this->checked)): ?>\n            <span class='success_icon'></span>\n        <?php endif; ?>\n        <br class=\"clearall\" />\n    </div>\n    <div>\n        <label for=\"label-input\"><?php echo $this->_('Label') ?></label>\n        <input class=\"text\" id=\"label-input\" type=\"text\" name=\"label\" value=\"<?php echo $this->label ?>\" />\n        <br class=\"clearall\" />\n    </div>\n    <div>\n        <label for=\"email-input\"><?php echo $this->_('Email Address') ?></label>\n        <input class=\"text\" id=\"email-input\" type=\"text\" name=\"email\" value=\"<?php echo $this->email ?>\" />\n        <br class=\"clearall\" />\n    </div>\n    <div class=\"clearall\"></div>\n</fieldset>\n"
  },
  {
    "path": "application/views/templates/error/404.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki error template\n *\n * @author Norman Heino <norman.heino@gmail.com>\n */\n?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<title>404: Resource not found</title>\n<style type=\"text/css\">\nbody {\n    font-family: sans-serif;\n    line-height: 1.5;\n    background-color: #eff9ff;\n}\n\nh1 {\n    font-size: 100%\n}\n</style>\n</head>\n<body>\n<h1>Resource not found</h1>\n<p>\nThe resource <code><?php echo $this->requestedUrl; ?></code> you are trying to reach does not exist.<br />\nDo you want to <a href=\"<?php echo $this->createUrl; ?>\">create it</a>?<br />\nOtherwise, try to <a href\"<?php echo $this->urlBase; ?>\">go back</a>.\n</p>\n</body>\n</html>\n"
  },
  {
    "path": "application/views/templates/error/500.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki internal server error template\n */\n?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<title>500: Internal Server Error</title>\n<style type=\"text/css\">\nbody {\n    font-family: sans-serif;\n    line-height: 1.5;\n    background-color: #eff9ff;\n}\n\nh1 {\n    font-size: 100%\n}\n</style>\n</head>\n<body>\n<h1>Internal Server Error</h1>\n<p>\nWe're sorry, but something went wrong (e.g. configuration).<br />\nPlease inform your system administrator.<br />\nDetails are logged and debug mode can be turned on.\n</p>\n<p>\n<a href=\"<?php echo $this->urlBase; ?>\">go back</a>\n</p>\n</body>\n</html>\n"
  },
  {
    "path": "application/views/templates/error/error.phtml",
    "content": "<?php\n\n/**\n * OntoWiki error template\n *\n * @author Norman Heino <norman.heino@gmail.com>\n * @version $Id: error.phtml 3331 2009-06-16 19:25:43Z norman.heino $\n */\n\n?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<title><?php echo $this->heading ?></title>\n<style type=\"text/css\">\nbody {\n    font-family: sans-serif;\n    line-height: 1.5;\n    background-color: #eff9ff;\n}\n\n.info {\n    margin: 0.5% 10%;\n    border: 1px solid #aaa;\n    padding: 1%;\n    background-color: #f9f9f9;\n}\n\n.error {\n    margin: 0.5% 10%;\n    border: 1px solid #f00;\n    padding: 1%;\n    background-color: #fcc;\n}\n</style>\n</head>\n<body>\n<div class=\"<?php echo $this->errorType ?>\">\n<h1><?php echo $this->heading ?>\n<?php if (isset($this->code)): ?>\n (<?php echo $this->code ?>)\n<?php endif; ?>\n</h1>\n<details>\n<summary><?php echo $this->escape($this->errorText) ?></summary>\n<?php if (isset($this->exceptionType)): ?>\n<p><code><?php echo $this->exceptionType ?></code></p>\n<?php endif; ?>\n<p>\n<?php if (isset($this->exceptionFile)): ?>\n<code><?php echo $this->exceptionFile ?></code>\n<?php endif; ?>\n<?php if (isset($this->stacktrace)): ?>\n<br/ ><code><?php echo $this->stacktrace ?></code>\n<?php endif; ?>\n</p>\n</details>\n<p>\n<?php if(isset($_SERVER['HTTP_REFERER'])){ ?>\n     <a href=\"<?php echo $_SERVER['HTTP_REFERER']; ?>\">back</a>&nbsp;\n<?php } ?>\n<a href=\"<?php echo $this->urlBase; ?>\">home</a>\n</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "application/views/templates/index/index.phtml",
    "content": "<?php\n\n/**\n * OntoWiki index template\n *\n * @author Norman Heino <norman.heino@gmail.com>\n * @version $Id: index.phtml 2327 2008-05-26 15:47:55Z norman.heino $\n */\n\n?>\n<?php $this->headTitle()->append($this->_(' - Added by a Template With no Acces to <head>')) ?>\n<p><?php echo $this->_('Bla bla, blub!') ?></p>\n<p><?php echo sprintf($this->_('I am %1$s years old.'), $this->age) ?></p>\n<a href=\"<?php echo $this->url() ?>foo/bar\"><?php echo $this->_('Click me!') ?></a>\n"
  },
  {
    "path": "application/views/templates/index/news.phtml",
    "content": "<?php foreach ($this->feed as $feedItem): ?>\n    <div class=\"messagebox feed\">\n        <h2><a href=\"<?php echo $feedItem->link() ?>\"><?php echo $feedItem->title() ?></a></h2>\n        <p><?php echo $feedItem->description() ?></p>\n    </div>\n<?php endforeach; ?>"
  },
  {
    "path": "application/views/templates/index/newsshort.phtml",
    "content": "<?php foreach ($this->rssData as $feedItem): ?>\n    <div class=\"messagebox feed\">\n        <h4><a href=\"<?php echo $feedItem['link'] ?>\"><?php echo $feedItem['title'] ?></a></h4>\n        <p><?php echo $feedItem['description'] ?></p>\n    </div>\n<?php endforeach; ?>"
  },
  {
    "path": "application/views/templates/layouts/layout.phtml",
    "content": "<?php\n\n/**\n * OntoWiki layout template\n *\n * @author  Norman Heino <norman.heino@gmail.com>\n * @author  Michael Haschke\n * @version $Id: layout.phtml 4308 2009-10-14 15:13:51Z jonas.brekle@gmail.com $\n */\n\n?>\n<?php echo $this->doctype('XHTML1_STRICT') ?>\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head xmlns:update=\"http://ns.aksw.org/update/\">\n    <?php echo $this->headTitle() ?>\n    <?php echo $this->headMeta() ?>\n    <?php echo $this->headLink() ?>\n\n    <?php echo $this->partial('partials/meta.phtml') ?>\n\n    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"<?php echo $this->staticUrlBase;?>favicon.png\" />\n\n    <?php if ($this->has('jsonVars')): ?>\n        <script type=\"text/javascript\">\n            <?php echo $this->jsonVars ?>\n        </script>\n    <?php endif; ?>\n\n    <?php if ($this->has('metaDescription')){ ?>\n        <meta name=\"Description\" content=\"<?php echo $this->metaDescription ?>\" />\n    <?php }  ?>\n    <?php if ($this->has('metaKeywords')){ ?>\n        <meta name=\"Keywords\" content=\"<?php echo $this->metaKeywords ?>\" />\n    <?php }  ?>\n\n    <!-- ontowiki stylesheets -->\n    <link rel=\"stylesheet\" href=\"<?php echo $this->themeUrlBase ?>styles/default.css\" type=\"text/css\" media=\"screen\" />\n    <link rel=\"stylesheet\" href=\"<?php echo $this->themeUrlBase ?>styles/clickmenu.css\" type=\"text/css\" media=\"screen\" />\n    <link rel=\"stylesheet\" href=\"<?php echo $this->themeUrlBase ?>styles/jquery-ui.css\" type=\"text/css\" media=\"screen\" />\n\n    <!-- additional ontowiki stylesheets -->\n    <?php foreach($this->themeExtraStyles as $stylesheet_extra): ?>\n        <link rel=\"stylesheet\" href=\"<?php echo $this->themeUrlBase ?>../<?php echo trim($stylesheet_extra); ?>/styles/default.css\" type=\"text/css\" media=\"screen\" />\n    <?php endforeach; ?>\n\n    <?php if (defined('_OWDEBUG')): ?>\n    <!-- developer styles, e.g. for deprecated and legacy gui elements -->\n    <link rel=\"stylesheet\" href=\"<?php echo $this->themeUrlBase ?>styles/default.dev.css\" type=\"text/css\" media=\"screen\" />\n    <link rel=\"stylesheet\" href=\"<?php echo $this->themeUrlBase ?>styles/deprecated.dev.css\" type=\"text/css\" media=\"screen\" />\n    <?php endif; ?>\n\n    <!-- dynamic styles -->\n    <?php echo $this->headStyle() ?>\n\n    <!-- jQuery -->\n    <script type=\"text/javascript\" src=\"<?php echo $this->themeUrlBase ?>scripts/libraries/jquery-1.9.1.js\"></script>\n    <script type=\"text/javascript\" src=\"<?php echo $this->themeUrlBase ?>scripts/libraries/jquery-migrate-1.3.0.js\"></script>\n    <script type=\"text/javascript\" src=\"<?php echo $this->themeUrlBase ?>scripts/libraries/jquery-ui-1.8.22.js\"></script>\n\n    <!-- included js libraries -->\n    <script type=\"text/javascript\" src=\"<?php echo $this->themeUrlBase ?>scripts/libraries/jquery.json.js\"></script>\n    <script type=\"text/javascript\" src=\"<?php echo $this->themeUrlBase ?>scripts/libraries/jquery.livequery.js\"></script>\n    <script type=\"text/javascript\" src=\"<?php echo $this->themeUrlBase ?>scripts/libraries/jquery.clickmenu.js\"></script>\n    <script type=\"text/javascript\" src=\"<?php echo $this->themeUrlBase ?>scripts/libraries/jquery.simplemodal.js\"></script>\n    <script type=\"text/javascript\" src=\"<?php echo $this->themeUrlBase ?>scripts/libraries/jquery.tablesorter.js\"></script>\n    <script type=\"text/javascript\" src=\"<?php echo $this->themeUrlBase ?>scripts/libraries/jquery.rdfquery.rdfa-1.0.js\"></script>\n\n    <!-- ontowiki js -->\n    <script type=\"text/javascript\" src=\"<?php echo $this->themeUrlBase ?>scripts/main.js\"></script>\n    <script type=\"text/javascript\" src=\"<?php echo $this->themeUrlBase ?>scripts/support.js\"></script>\n    <script type=\"text/javascript\" src=\"<?php echo $this->themeUrlBase ?>scripts/jquery.ontowiki.js\"></script>\n\n    <!-- dynamic js -->\n    <?php echo $this->headScript() ?>\n\n</head>\n\n<body class=\"javascript-off\" xmlns:update=\"http://ns.aksw.org/update/\">\n\n    <script type=\"text/javascript\">\n        // get body element\n        var body = document.body;\n        var bodyClass = body.className;\n        // set javascript = on\n        bodyClass = bodyClass.replace(/javascript-off/g, \"javascript-on\");\n        // set application in processing state\n        bodyClass = bodyClass + \" is-processing\";\n        // process changes\n        body.setAttribute(\"class\", bodyClass, 0);\n    </script>\n\n    <?php echo $this->inlineScript() ?>\n\n    <div class=\"section-mainwindows <?php echo $this->placeholder('main.window.additionalclasses') ?>\">\n        <div class=\"window<?php echo (OntoWiki::getInstance()->getNavigation()->isDisabled() ? '' : ' tabbed') ?>\">\n            <?php\n                /**\n                 * @trigger onDisplayMainWindowTitle\n                 */\n                $event = new Erfurt_Event('onDisplayMainWindowTitle');\n                $event->setDefault($this->placeholder('main.window.title'));\n                $title = $event->trigger();\n            ?>\n            <h1 class=\"title\"><?php echo $title ?></h1>\n            <div class=\"slidehelper\">\n                <?php if (isset($this->preTabsContent)): ?>\n                    <div id=\"pre_tabs_content\">\n                        <?php echo $this->preTabsContent; ?>\n                    </div>\n                <?php endif; ?>\n                <?php echo $this->partial('partials/navigation.phtml', array('navigation' => OntoWiki::getInstance ()->getNavigation()->toArray())) ?>\n\n                <?php if ($this->has('main.window.innerwindows')): ?>\n                    <div class=\"content has-innerwindows\">\n                        <?php if ($this->has('formActionUrl') and $this->has('formMethod')): ?>\n                            <form action=\"<?php echo $this->formActionUrl ?>\"\n                                  method=\"<?php echo $this->formMethod ?>\"\n                                  <?php if ($this->has('formName')) echo 'name=\"' . $this->formName . '\"' ?>\n                                  <?php if ($this->has('formId')) echo 'id=\"' . $this->formId . '\"' ?>\n                                  <?php if ($this->has('formEncoding')) echo 'enctype=\"' . $this->formEncoding . '\"' ?>\n                                  <?php if ($this->has('formClass')) echo 'class=\"' . $this->formClass . '\"' ?>>\n                                  <?php if ($this->has('redirectUrl')): ?>\n                                      <input type=\"hidden\" name=\"redirect\" value=\"<?php echo $this->redirectUrl ?>\"/>\n                                  <?php endif; ?>\n                        <?php endif;?>\n\n                        <?php if ($this->has('main.window.toolbar')): ?>\n                            <div class=\"messagebox\"><?php echo $this->placeholder('main.window.toolbar') ?></div>\n                        <?php endif; ?>\n\n                        <div class=\"innercontent\">\n                            <?php foreach (OntoWiki::getInstance()->drawMessages() as $message): ?>\n                                <?php echo $this->partial('partials/message.phtml', array('message' => $message)) ?>\n                            <?php endforeach; ?>\n\n                            <?php echo $this->layout()->content ?>\n                        </div><!-- .innercontent -->\n\n                        <?php if ($this->has('formActionUrl')): ?>\n                            </form>\n                        <?php endif;?>\n\n                        <div class=\"innerwindows\">\n                            <?php echo $this->placeholder('main.window.innerwindows') ?>\n                        </div><!-- .innerwindows -->\n\n                    </div><!-- .content .has-innerwindows -->\n                <?php else: ?>\n                    <div class=\"content\">\n                        <?php if ($this->has('formActionUrl') and $this->has('formMethod')): ?>\n                            <form action=\"<?php echo $this->formActionUrl ?>\"\n                                  method=\"<?php echo $this->formMethod ?>\"\n                                  <?php if ($this->has('formName')) echo 'name=\"' . $this->formName . '\"' ?>\n                                  <?php if ($this->has('formEncoding')) echo 'enctype=\"' . $this->formEncoding . '\"' ?>\n                                  <?php if ($this->has('formClass')) echo 'class=\"' . $this->formClass . '\"' ?>>\n                        <?php endif;?>\n\n                        <?php if ($this->has('main.window.toolbar')): ?>\n                            <div class=\"messagebox\"><?php echo $this->placeholder('main.window.toolbar') ?></div>\n                        <?php endif; ?>\n\n                        <?php foreach (OntoWiki::getInstance()->drawMessages() as $message): ?>\n                            <?php echo $this->partial('partials/message.phtml', array('message' => $message)) ?>\n                        <?php endforeach; ?>\n\n                        <?php echo $this->layout()->content ?>\n                        <?php if ($this->has('formActionUrl')): ?>\n                            </form>\n                        <?php endif;?>\n                    </div><!-- .content -->\n                <?php endif; ?>\n\n                <?php if ($this->has('main.window.menu')): ?>\n                    <ul class=\"menu\">\n                        <?php echo $this->partial('partials/menu.phtml', array('menu' => $this->placeholder('main.window.menu')->getValue())) ?>\n                    </ul>\n                <?php endif; ?>\n\n                <?php echo $this->partial('partials/statusbar.phtml', array('statusbar' => $this->placeholder('main.window.statusbar'))) ?>\n            </div><!-- .slidehelper -->\n        </div><!-- .window -->\n    </div><!-- .section-mainwindows -->\n\n    <div class=\"section-sidewindows\">\n        <?php echo $this->placeholder('main.sidewindows') ?>\n    </div><!-- .section-sidewindows -->\n    <?php if (defined('REQUEST_START')) {\n        $queryCount = OntoWiki::getInstance()->erfurt->getStore()->getQueryCount();\n        $time       = (microtime(true) - REQUEST_START) * 1000;\n    ?><!-- <?php echo sprintf($this->_('Rendered in %1$d ms using %2$d SPARQL queries.'), $time, $queryCount) ?> --><?php } ?>\n</body>\n</html>\n"
  },
  {
    "path": "application/views/templates/model/config.phtml",
    "content": "<?php\n\n/**\n * OntoWiki model config template\n *\n * @author Philipp Frischmuth <pfrischmuth@googlemail.com>\n * @version $Id: $\n */\n\n?>\n\n<?php\n\nif (!isset($this->modeluri)) {\n    // this is the case e.g. when the model is not writable\n    return;\n}\n\n?>\n\n\n<fieldset>\n    <legend><?php echo $this->_('Model Properties') ?></legend>\n    <input type=\"hidden\" name=\"m\" value=\"<?php echo $this->modeluri ?>\" />\n    <div>\n        <label for=\"modeluri\"><?php echo $this->_('Model URI') ?></label>\n        <input class=\"text\" id=\"modeluri\" type=\"text\" name=\"modeluri\" <?php echo $this->readonly ?> value=\"<?php echo $this->modeluri ?>\" />\n        <br class=\"clearall\" />\n    </div>\n    <div>\n        <label for=\"baseuri\"><?php echo $this->_('Base URI') ?></label>\n        <input class=\"text\" id=\"baseuri\" type=\"text\" name=\"baseuri\" <?php echo $this->readonly ?> value=\"<?php echo $this->baseuri ?>\" />\n        <br class=\"clearall\" />\n    </div>\n    <div class=\"clearall\"></div>\n</fieldset>\n\n<fieldset>\n    <div>\n        <label for=\"ishidden\"><?php echo $this->_('Hide Knowledge Base') ?></label>\n        <input id=\"is-hidden-input\" class=\"checkbox\" type=\"checkbox\" <?php echo $this->isHidden ?> value=\"ishidden\" name=\"ishidden\"/>\n    </div>\n     <div>\n        <label for=\"isLarge\"><?php echo $this->_('is large (disable counting and add limits)') ?></label>\n        <input id=\"is-large-input\" class=\"checkbox\" type=\"checkbox\" <?php echo $this->isLarge ?> value=\"isLarge\" name=\"isLarge\"/>\n    </div>\n    <div>\n        <label for=\"usesysbase\"><?php echo $this->_('Use SysBase model') ?></label>\n        <input id=\"use-sysbase-input\" class=\"checkbox\" type=\"checkbox\" <?php echo $this->useSysBase ?> <?php echo $this->useSysBaseDisabled ?> value=\"usesysbase\" name=\"usesysbase\"/>\n    </div>\n    <div class=\"clearall\"></div>\n</fieldset>\n\n\n<fieldset>\n    <legend><?php echo $this->_('Namespaces and Prefixes') ?></legend>\n\t<div>\n\t\t<div name=\"editprefix\">\n<table class=\"separated-vertical\">\n\t\t<tr>\n\t\t\t\t<th>Prefix</th>\n\t\t\t\t<th>Namespace</th>\n\t\t\t\t<th></th>\n\t\t</tr>\n\t\t<tr id=\"newPrefix\">\n\t\t\t<td> <input class=\"text\" type=\"text\" name=\"new_prefix_prefix\" /> </td>\n\t\t\t<td> <input class=\"text\" type=\"text\" name=\"new_prefix_namespace\" /> </td>\n\t\t\t<td class=\"selector\"> </td>\n\t\t</tr>\n\t<?php foreach ($this->prefixes as $prefix): ?>\n\t\t<tr>\n\t\t\t<td><?php echo $this->escape($prefix[0]) ?></td>\n\t\t\t<td><?php echo $this->escape($prefix[1]) ?></td>\n<?php\n        $deleteUrl = new OntoWiki_Url(array('controller' => 'model', 'action' => 'config'), array('m'));\n        $deleteUrl->setParam('delete_prefix', $prefix[0], true);\n?>\n\t\t\t<td class=\"selector\">\n\t\t\t\t<a href=\"<?php echo $deleteUrl ?>\"><img alt=\"tonne\" src=\"<?php echo $this->themeUrlBase ?>/images/icon-delete.png\"/></a>\n\t\t\t</td>\n\t\t</tr>\n\t<?php endforeach; ?>\n</table>\n\t\t</div>\n\t</div>\n\t<div class=\"clearall\"></div>\n</fieldset>\n"
  },
  {
    "path": "application/views/templates/model/create.phtml",
    "content": "<?php\n\n/**\n * OntoWiki create and add model template\n */\n\n?>\n<?php if ($this->formName == 'createmodel') : ?>\n<fieldset>\n<legend><?php echo $this->_('Basic information'); ?></legend>\n    <div>\n        <label><?php echo $this->_('Title') .' '. $this->_('(leave blank if your import provides the name)') ?></label>\n        <input type=\"text\" class=\"text\" name=\"title\" />\n    </div>\n    <div>\n        <label><?php echo $this->_('URI (leave blank for auto creation)') ?></label>\n        <input type=\"text\" class=\"text\" name=\"modeluri\" />\n        <br class=\"clearall\" />\n    </div>\n        <input type=\"hidden\" class=\"text\" name=\"importOptions\" />\n</fieldset>\n\n<?php endif; ?>\n\n<?php if (count($this->importActions) > 0) : ?>\n<fieldset>\n    <legend><?php echo $this->_('Data import actions'); ?></legend>\n    <div>\n    <p id=\"importAction-desc\" class=\"messagebox info\"><?php echo $this->_('Please use one of these options to import data from various sources or with different tranformations:') ?></p>\n<?php foreach ($this->importActions as $key => $action) : ?>\n        <label class=\"checkboxradio\" for=\"import-<?php echo $key ?>\">\n            <input\n                type=\"radio\" class=\"radio importAction\" name=\"importAction\"\n                id=\"import-<?php echo $key ?>\" value=\"<?php echo $key ?>\"\n                <?php echo (isset($action['parameter']) ? $action['parameter'] : '' ) ?>\n                <?php echo (isset($action['description']) ? 'data-desc=\"' . $action['description'] .'\"' : '' ) ?>\n            />\n            <?php echo $this->_($action['label']) ?>\n        </label>\n        <br class=\"clearall\" />\n<?php endforeach; ?>\n    </div>\n    <script type=\"text/javascript\">\n        $(document).ready(function() {\n            $('input.importAction').change(function() {\n                data=$(this).data('desc');\n                $('#importAction-desc').text(data);\n            });\n        });\n    </script>\n</fieldset>\n<?php endif; ?>\n\n"
  },
  {
    "path": "application/views/templates/model/info.phtml",
    "content": "<?php $values = isset($this->values[$this->graphIri]) ? $this->values[$this->graphIri] : array(); ?>\n\n<h2><?php echo $this->modelTitle ?></h2>\n\n<h3><?php echo $this->_('Comments, Descriptions and Notes') ?></h3>\n<?php if ($this->has('infoPredicates')): ?>\n    <?php foreach ($this->infoPredicates as $uri => $predicate): ?>\n        <?php foreach ($values[$uri] as $entry): ?>\n            <p class=\"messagebox info\"><?php echo trim($entry['object']) ?></p>\n        <?php endforeach; ?>\n    <?php endforeach; ?>\n<?php else: ?>\n    <p class=\"messagebox warning\"><?php echo $this->_('There are no comments, descriptions or notes on this knowledge base.') ?></p>\n<?php endif; ?>\n\n<?php //include the resource/properties view\n//hand over all nessesary variables\necho $this->partial('resource/properties.phtml',array(\n    'graphs' => $this->graphs,\n    'editableFlags' => $this->editableFlags,\n    'values' => $this->values,\n    'predicates' => $this->predicates,\n    'resourceUri' => $this->resourceIri, \n    'graphUri' => $this->graphIri,\n    'graphBaseUri' => $this->graphBaseIri,\n    'editable' => false, \n    'namespacePrefixes' => $this->namespacePrefixes\n));\n//notice: ModelController (and the rest of this template) want Iri, \n//but ResourceController (and its template) want Uri\n?>\n\n\n<div class=\"messagebox\">\n<h4><?php echo $this->_('Actions') ?></h4>\n<?php\nif($this->has('showFoafLink') && $this->showFoafLink){\n    ?><a href=\"<?php echo $this->foafLink; ?>\">open FOAF viewer</a><br/><?php\n}\n?>\n<a href=\"<?php echo $this->resourcesUrl; ?>\"> <?php echo $this->_('view all resources') ?></a>&nbsp;|&nbsp;\n\n<a onclick=\"$('#location_bar_container').toggle()\" > <?php echo $this->_('Jump to resource') ?></a>\n\n<div id=\"location_bar_container\" style=\"display: none; padding: 10px 0px 10px 20px; border-top: 1px dotted #ababab;\">\n  <h5><?php echo $this->_('Jump to resource') ?></h5>\n  <input id=\"location_bar_input\" class=\"text width75\" type=\"text\" value=\"\" name=\"l\" />\n  <a id=\"location_open\" class=\"minibutton\" style=\"float: none\"> <?php echo $this->_('View Resource') ?> </a>\n</div>\n\n\n</div>\n"
  },
  {
    "path": "application/views/templates/partials/contextmenu.phtml",
    "content": "<?php\n/**\n * OntoWiki context menu partial template\n *\n * @author  Norman Heino <norman.heino@gmail.com>\n * @author  Michael Haschke\n */\n?>\n<ul>\n    <?php foreach ($this->contextmenu as $menuKey => $menuItem): ?>\n        <?php if ($menuItem === OntoWiki_Menu::SEPARATOR): ?>\n            </ul>\n                <hr />\n            <ul>\n        <?php elseif (is_string($menuItem)): ?>\n            <li><a href=\"<?php echo $menuItem ?>\"><?php echo $this->_($menuKey) ?></a></li>\n        <?php else: ?>\n            <li>\n                <?php if (isset($menuItem['url'])): ?>\n                    <a href=\"<?php echo $menuItem['url'] ?>\"\n                <?php else: ?>\n                    <a\n                <?php endif; ?>\n\n                   <?php echo (isset($menuItem['class']) ? 'class=\"' . $menuItem['class'] . '\"' : '') ?>\n                   <?php echo (isset($menuItem['id']) ? 'id=\"' . $menuItem['id'] . '\"' : '') ?>>\n                   <?php echo $this->_($menuKey) ?>\n                </a>\n            </li>\n        <?php endif; ?>\n    <?php endforeach; ?>\n</ul>\n"
  },
  {
    "path": "application/views/templates/partials/hierarchy_list.phtml",
    "content": "<?php\n/**\n * OntoWiki hierarchy module children list template\n */\n?>\n<?php if ($this->open): ?>\n    <ul class=\"bullets-none separated hierarchy\">\n<?php else: ?>\n    <ul style=\"display:none\" class=\"bullets-none separated hierarchy\">\n<?php endif; ?>\n    <?php foreach ($this->classes as $child): ?>\n        <li>\n            <?php if ($child['has_children']): ?>\n                <?php if ($child['open']): ?>\n                    <a class=\"hierarchy-toggle open\"></a>\n                <?php else: ?>\n                    <a class=\"hierarchy-toggle closed\"></a>\n                <?php endif; ?>\n            <?php endif; ?>\n            <a class=\"Class <?php echo $child['classes'] ?>\" href=\"<?php echo $child['url'] ?>\" about=\"<?php echo $child['uri'] ?>\">\n                <?php echo $child['title'] ?>\n            </a>\n            <?php if (!empty($child['children'])): ?>\n                <?php echo $this->partial('partials/hierarchy_list.phtml', array('classes' => $child['children'], 'open' => $child['open'])) ?>\n            <?php endif; ?>\n        </li>\n    <?php endforeach; ?>\n</ul>\n\n"
  },
  {
    "path": "application/views/templates/partials/list.phtml",
    "content": "<?php\n$start = microtime(true);\n$instances = $this->instances;\n\n$graph = $this->instances->getGraph();\n$store = $this->instances->getStore();\n\n// prepare namespaces\ntry{\n    $namespacePrefixes = $graph->getNamespacePrefixes();\n} catch (Exception $e){\n    $namespacePrefixes = array();\n}\n$graphBase  = $graph->getBaseUri();\nif (!array_key_exists(OntoWiki_Utils::DEFAULT_BASE, $namespacePrefixes)) {\n    $namespacePrefixes[OntoWiki_Utils::DEFAULT_BASE] = $graphBase;\n}\n\n//data for filter module\n$filter = $instances->getFilter();\n$filter_js = json_encode(is_array($filter) ? $filter : array());\n\nif (OntoWiki::getInstance()->extensionManager->isExtensionRegistered('filter')) {\n    $this->headScript()->prependFile(\n        OntoWiki::getInstance()->extensionManager->getComponentUrl('filter') .'resources/FilterAPI.js'\n    );\n}\n\nif ($instances->hasData()) {\n    $instanceInfo = $instances->getResources();\n    if(!isset($this->other->disableValueQuery) || !$this->other->disableValueQuery){\n        $instanceData = $instances->getValues();\n    } else {\n         $instanceData = array();\n    }\n\n    if (!isset($this->other->statusBar) || $this->other->statusBar) {\n        $statusBar = $this->placeholder('main.window.statusbar');\n    } else {\n        $statusBar = null;\n    }\n\n    $itemsOnPage = count($instanceData);\n\n    $propertyInfo = $instances->getShownProperties();\n\n    $time = (microtime(true) - $start) * 1000;\n\n    $start     = $instances->getOffset() + 1;\n    $translate = OntoWiki::getInstance()->translate;\n\n    $limit = $instances->getLimit();\n    $offset = $instances->getOffset();\n    if($limit != 0) {\n        $page = ($offset / $limit) +1;\n    } else {\n        $page = 1;\n    }\n    $config = Erfurt_App::getInstance()->getConfig();\n\n    if($graph->getOption($config->sysont->properties->isLarge)) {\n        if ($statusBar !== null) {\n            $statusBar->append(OntoWiki_Pager::get( Erfurt_Store::COUNT_NOT_SUPPORTED, $limit, $itemsOnPage, $page, $this->listName));\n        }\n    } else {\n        $query = clone $instances->getResourceQuery();\n\n        $where = 'WHERE '.$query->getWhere();\n\n        try {\n            $count = $store->countWhereMatches($graph->getModelIri(), $where, '?resourceUri', true);\n        } catch (Erfurt_Store_Exception $e) {\n            $count = Erfurt_Store::COUNT_NOT_SUPPORTED;\n        }\n        if ($statusBar !== null) {\n            $statusBar->append(OntoWiki_Pager::get($count, $limit, $itemsOnPage, $page, $this->listName));\n            if ($count != Erfurt_Store::COUNT_NOT_SUPPORTED) {\n                $results = $count > 1 ? $translate->translate('results') : $translate->translate('result');\n                $statusBar->append(sprintf($translate->translate('Search returned %1$d %2$s.'), $count, $results));\n            }\n        }\n    }\n    if(!isset($count) || $count > 10 ){\n        if ($statusBar !== null) {\n            $thisActionUrl = new OntoWiki_Url().'/';\n            $listLimit = $limit;\r\n            \r\n            $limit = '<ul>';\r\n            for($i = 10; $i <= 50; $i+=10){\r\n            \t$additionalClass = ($i == $listLimit)? 'selected ': '';\r\n            \tif($i == 10){\r\n            \t\t$limit .= '<li> Show me: ';\r\n            \t}else{\r\n            \t\t$limit .= '<li>';\r\n            \t}\r\n            \t$limit .= '<a class=\"'.$additionalClass.'minibutton\" href=\"'. $thisActionUrl.'list/'.$this->listName.'/limit/'.$i.'\">'.$i.'</a></li>';\r\n            \r\n            }\r\n            $limit .= '</ul>';\n            $statusBar->append($limit);\n        }\n    }\n\n    if (defined('_OWDEBUG')) {\n        if ($statusBar !== null) {\n            $statusBar->append(sprintf($translate->translate('Query execution took %1$d ms.'), $time));\n        }\n    }\n} else {\n    $instanceData = array();\n    $instanceInfo = array();\n    $propertyInfo = array();\n}\n\n$this->headScript()->prependScript(\n        'var reloadUrl = \"'.\n        new OntoWiki_Url(array()). // url to reload -> without config params\n        '\";\n            var filtersFromSession = ' . $filter_js.';\n            var listName = \"'.$this->listName.'\";'\n        );\n//other contains template specific data\n$other = $this->other;\n$other->namespacePrefixes = $namespacePrefixes;\n$other->graphbase = $graphBase;\n\n//call the requested template\necho $this->partial('partials/'.$this->mainTemplate.'.phtml',\n    array(\n        'instances'     => $instances,\n        'instanceData'  => $instanceData,\n        'instanceInfo'  => $instanceInfo,\n        'propertyInfo'  => $propertyInfo,\n        'other'         => $other,\n        'listName'      => $this->listName,\n        'start'         => $start\n    )\n);\n"
  },
  {
    "path": "application/views/templates/partials/list_std_element.phtml",
    "content": "<?php\n//url will be used to generate links to related lists (show properties as list)\n$url = new OntoWiki_Url(array('controller' => 'resource','action' => 'instances'));\n$url->setParam('init', true);\n\n// viewUrl will be used to generate links to object resources\n$viewUrl = new OntoWiki_Url(array('controller' => 'resource','action' => 'properties'));\n?>\n<tr class=\"<?php echo $this->odd ? 'odd' : 'even'; ?>\">\n        <td class=\"enumeration\"><label for=\"selector-<?php echo $this->i ?>\"><?php echo $this->i ?>.</label></td>\n        <td>\n            <?php if($this->instance['type'] == 'uri'){\n            //first table cell in row - instance title/label\n            ?>\n            <a class=\"hasMenu expandable\"\n               about=\"<?php echo $this->instanceUri ?>\"\n                           <?php if(isset($this->instanceData[$this->instanceUri]['__TYPE'])) : ?>\n                         <?php $count = count($this->instanceData[$this->instanceUri]['__TYPE']); $j=0; $typeof = ''?>\n                         <?php foreach ($this->instanceData[$this->instanceUri]['__TYPE'] as $type ): ?>\n                             <?php $typeof = $typeof . $this->curie($type['origvalue']) . ($count > ++$j ? ' ' : ''); /* dont use the titlehelper generated value*/ ?>\n                         <?php endforeach; echo 'typeof=\"' . $typeof . '\"'; ?>\n                               <?php endif; ?>\n               href=\"<?php echo $this->instance['url']?>\">\n                        <?php echo $this->instance['title'] ?>\n            </a>\n            <br/>\n                <?php if (isset($this->instanceData[$this->instanceUri]) && isset($this->instanceData[$this->instanceUri]['__TYPE'])):\n                //print the types/classes this instance belongs to\n                ?>\n                    <?php if (count($this->instanceData[$this->instanceUri]['__TYPE']) > 1): ?>\n                        <?php $j = 0;\n                        $count = count($this->instanceData[$this->instanceUri]['__TYPE']) ?>\n                        <?php foreach ($this->instanceData[$this->instanceUri]['__TYPE'] as $type): ?>\n                            <span typeof=\"rdfs:Class\" about=\"<?php echo $type['origvalue']; ?>\" property=\"rdfs:label\"><?php echo $type['value'] . ($count > ++$j ? '</span>, ' : '</span>') ?>\n                        <?php endforeach; ?>\n                    <?php else: ?>\n                        <?php $about = $this->instanceData[$this->instanceUri]['__TYPE'][0]['origvalue']; ?>\n                        <?php $type = $this->instanceData[$this->instanceUri]['__TYPE'][0]['value']; /* title helper replaces the uri with a label here*/ ?>\n                        <?php echo '<span typeof=\"rdfs:Class\" about=\"'. $about .'\" property=\"rdfs:label\">' . $type . '</span>'; ?>\n                    <?php endif; ?>\n                <?php endif; ?>\n            <?php } else { ?>\n                <?php echo $this->instance['title'] ?><br/>\n                Literal\n            <?php } ?>\n        </td>\n            <?php foreach ($this->propertyInfo as $property):\n                if($property['hidden']){continue;}\n                //print all properties of that instance, each in a table cell\n                ?><td>\n                <?php if (array_key_exists($this->instanceUri, $this->instanceData) &&\n                          array_key_exists($property['varName'], $this->instanceData[$this->instanceUri]) &&\n                          !empty($this->instanceData[$this->instanceUri][$property['varName']])):\n\n                        if(count($this->instanceData[$this->instanceUri][$property['varName']]) > 1): ?>\n                    <ul class=\"bullets-none has-contextmenu-area\">\n                        <?php $i=0;\n                        //print all values of that property\n                        foreach ($this->instanceData[$this->instanceUri][$property['varName']] as $value): ?>\n                            <?php $i++; if($i==OW_SHOW_MAX+1) {\n                                // show a \"...\" after 5(configurable) values\n                                ?>&hellip;<?php\n                                //break; don't leave foreach, >OW_SHOW_MAX won't show\n                            }\n                            if($i==2){\n                                //if there is more than one value, show the \"show as list\" link (looks like this is printed between the first and second value, but its hidden and shown as a context menu)\n                            ?>\n                                <div class=\"contextmenu\">\n                                    <?php if (!$property['inverse']): ?>\n                                    <a class=\"item rdfauthor-edit-property\" onclick=\"editPropertyListmode(event)\">\n                                        <span class=\"icon icon-edit\" title=\"Edit Values\">\n                                            <span>Show as List</span>\n                                        </span>\n                                    </a>\n                                    <?php endif; ?>\n                                    <a class=\"item\"\n                                       href=\"<?php $url->setParam('instancesconfig', json_encode(array('filter'=>array(array(\n                                           'id'=>'moreValues','action'=>'add','mode'=>'box',\n                                           'property'=>$property['uri'],\n                                           'isInverse'=> !$property['inverse'],\n                                           'filter' => 'equals',\n                                           'value1' => $this->instanceUri,\n                                           'valuetype'=>'uri'\n                                           )))));\n                                        echo $url; ?>\">\n                                    <span class=\"icon icon-list\" title=\"Show as List\">\n                                        <span>Show as List</span>\n                                     </span>\n                                    </a>\n                                </div>\n                                <?php\n                            }\n                            //print the value itself until OW_SHOW_MAX\n                            if (isset($value['url']) && $value['url'] !== null && $i<OW_SHOW_MAX+1): //show uris until OW_SHOW_MAX ?>\n                                <li>\n                                    <a about=\"<?php echo $this->instanceUri ?>\"\n                                       class=\"hasMenu\"\n                                       rel=\"<?php echo $this->curie($property['uri']) ?>\"\n                                       href=\"<?php echo $value['url'] ?>\"\n                                       resource=\"<?php echo $value['uri'] ?>\">\n                                           <?php echo $value['value']; ?>\n                                    </a>\n                                </li>\n                            <?php elseif (isset($value['url']) && $value['url'] !== null): //don't show uri value, which are > OW_SHOW_MAX ?>\n                                <li>\n                                    <a about=\"<?php echo $this->instanceUri ?>\"\n                                       style=\"display: none;\"\n                                       class=\"hasMenu\"\n                                       rel=\"<?php echo $this->curie($property['uri']) ?>\"\n                                       href=\"<?php echo $value['url'] ?>\"\n                                       resource=\"<?php echo $value['uri'] ?>\">\n                                           <?php echo $value['value']; ?>\n                                    </a>\n                                </li>\n                            <?php elseif ($value['url'] == null && $i < OW_SHOW_MAX+1): //show literals until OW_SHOW_MAX ?>\n                                <li>\n                                    <span about=\"<?php echo $this->instanceUri ?>\"\n                                       property=\"<?php echo $this->curie($property['uri']) ?>\"\n                                       content=\"<?php echo $value['uri'] ?>\">\n                                           <?php echo $value['value']; ?>\n                                    </a>\n                                </li>\n                            <?php elseif ($value['url'] == null): //don't show literal values, which are > OW_SHOW_MAX ?>\n                                <li>\n                                    <span about=\"<?php echo $this->instanceUri ?>\"\n                                       style=\"display: none;\"\n                                       property=\"<?php echo $this->curie($property['uri']) ?>\"\n                                       content=\"<?php echo $value['uri'] ?>\">\n                                           <?php echo $value['value']; ?>\n                                    </span>\n                                </li>\n                            <?php endif; ?>\n                        <?php endforeach;?>\n                    </ul>\n\n                    <?php else: ?>\n                        <?php if (isset($this->instanceData[$this->instanceUri][$property['varName']]) && $this->instanceData[$this->instanceUri][$property['varName']][0]['url']): ?>\n                        <?php /*inverse properties section*/ ?>\n                        <div class=\"has-contextmenu-area\">\n                            <?php if (!$property['inverse']): ?>\n                            <div class=\"contextmenu\">\n                                <a class=\"item rdfauthor-edit-property\" onclick=\"editPropertyListmode(event)\">\n                                    <span class=\"icon icon-edit\" title=\"Edit Values\">\n                                        <span>Show as List</span>\n                                    </span>\n                                </a>\n                            </div>\n                            <?php endif; ?>\n                            <?php\n                                // setup the viewUrl to be rendered as a link\n                                // to the objects properties page\n                                $viewUrl->setParam(\n                                    'r',\n                                    $this->instanceData[$this->instanceUri][$property['varName']][0]['uri']\n                                );\n                            ?>\n                            <a about=\"<?php echo $this->instanceUri ?>\"\n                                href=\"<?php echo $viewUrl ?>\"\n                               class=\"hasMenu\"\n                               rel=\"<?php echo $this->curie($property['uri']) ?>\"\n                               resource=\"<?php echo $this->instanceData[$this->instanceUri][$property['varName']][0]['uri'] ?>\">\n                                            <?php echo $this->instanceData[$this->instanceUri][$property['varName']][0]['value'] ?>\n                            </a>\n                        </div>\n                        <?php else: ?>\n                        <div class=\"has-contextmenu-area\">\n                            <div class=\"contextmenu\">\n                                <a class=\"item rdfauthor-edit-property\" onclick=\"editPropertyListmode(event)\">\n                                    <span class=\"icon icon-edit\" title=\"Edit Values\">\n                                        <span>Show as List</span>\n                                    </span>\n                                </a>\n                            </div>\n                            <span about=\"<?php echo $this->instanceUri ?>\" property=\"<?php echo $this->curie($property['uri']) ?>\" content=\"<?php echo $this->escape($this->instanceData[$this->instanceUri][$property['varName']][0]['uri']) ?>\">\n                                            <?php echo $this->instanceData[$this->instanceUri][$property['varName']][0]['value'] ?>\n                            </span>\n                        </div>\n                        <?php endif; ?>\n                        <?php endif; ?>\n                    <?php endif; ?>\n            </td>\n            <?php endforeach; ?>\n    </tr>\n"
  },
  {
    "path": "application/views/templates/partials/list_std_main.phtml",
    "content": "<?php $odd = true;\n\n// build menu\n$actionMenu = new OntoWiki_Menu();\n$actionMenu->setEntry('Toggle show Permalink', \"javascript:showPermaLink()\");\n$actionMenu->setEntry('Toggle show Resource Query', \"javascript:showresQuery()\");\n$actionMenu->setEntry('Toggle show Value Query', \"javascript:showvalQuery()\");\n$actions = new OntoWiki_Menu();\n$actions->setEntry('View', $actionMenu);\n$this->placeholder('main.window.menu')->set($actions->toArray());\n\n$instances = $this->instances;\n// get queries\n$resourceQuery =  $instances->getResourceQuery();\n$valueQuery = $instances->getQuery();\n$permalink = $instances->getPermalink($this->listName);\n$config = Erfurt_App::getInstance()->getConfig();\n$urlBase = $config->urlBase;\n\n$this->headScript()->prependScript(\n    'function showPermaLink(){$(\"#permalink\").slideToggle(400);}\n    function showresQuery(){$(\"#resQuery\").slideToggle(400);}\n    function showvalQuery(){$(\"#valQuery\").slideToggle(400);}\n    function changeSorting(n){\n        var mainInnerContent = $(n).parents(\".innercontent\");\n        mainInnerContent.addClass(\"is-processing\");\n        mainInnerContent.load(\n            reloadUrl+\"\",\n            {\"instancesconfig\": $.toJSON({ sort : {\n                \"uri\" : $(n).attr(\"p\"),\n                \"asc\" : $(n).hasClass(\"up\")\n            }}), \"list\":listName},\n            function(){\n                mainInnerContent.removeClass(\"is-processing\");\n                $(\".statustool li a\").removeClass(\"selected\");\n                $(\"body\").trigger(\"ontowiki.resource-list.reloaded\");\n        });\n    }'\n);\n?>\n<div id=\"permalink\" class=\"messagebox\" style=\"display:none\"><?php echo $permalink; ?></div>\n<div id=\"resQuery\" class=\"messagebox\" style=\"display:none\"><?php echo htmlentities($resourceQuery); ?><br><a href=\"<?php echo $urlBase; ?>queries/editor/?query=<?php echo urlencode($resourceQuery)?>\">Open in editor</a></div>\n<div id=\"valQuery\" class=\"messagebox\" style=\"display:none\"><?php echo htmlentities($valueQuery); ?><br><a href=\"<?php echo $urlBase; ?>queries/editor/?query=<?php echo urlencode($valueQuery)?>\">Open in editor</a></div>\n<?php\n    if ($this->instances->hasData()):\n        ?>\n<table class=\"resource-list separated-vertical\"\n        <?php foreach ($this->other->namespacePrefixes as $prefix => $namespace): ?>\n                   <?php echo ' xmlns:' . $prefix . '=\"' . $namespace . '\"' ?>\n                   <?php endforeach; ?>>\n        <?php if (!empty($this->propertyInfo)): ?>\n    <tr>\n        <?php /* column for the numbers*/?>\n        <th></th>\n        <?php /* column for the instance title/label*/?>\n        <th></th>\n        <?php /* a column for each property */\n        foreach ($this->propertyInfo as $property): if($property['hidden']){continue;}?>\n        <th>\n            <a class=\"hasMenu Property\"\n               about=\"<?php echo $property['uri'] ?>\"\n               href=\"<?php echo $property['url'] ?>\"><?php echo $property['title']; ?></a>\n                <?php if ($property['inverse']){ ?><sup>-1</sup><?php } ?>\n                <a class=\"tablesort up small\" p=\"<?php echo $property['uri'] ?>\" onclick=\"javascript:changeSorting(this)\">&#9650;</a>\n                <a class=\"tablesort down small\" p=\"<?php echo $property['uri'] ?>\" onclick=\"javascript:changeSorting(this)\">&#9660;</a>\n        </th>\n        <?php endforeach; ?>\n    </tr>\n            <?php endif; ?>\n            <?php $i = $this->start ?>\n        <?php foreach ($this->instanceInfo as $instance){\n            //call subtemplate in a loop (for each instance a row)\n            echo $this->partial('partials/list_std_element.phtml',\n                array(\n                    'instanceUri'  => $instance['uri'],\n                    'instance'     => $instance,\n                    'instanceData' => $this->instanceData,\n                    'instanceInfo' => $this->instanceInfo,\n                    'propertyInfo' => $this->propertyInfo,\n                    'other'        => $this->other,\n                    'odd'          => $odd,\n                    'i'            => $i\n                )\n             );\n            $odd = !$odd;\n            $i++;\n        } ?>\n</table>\n    <?php else: ?>\n<p class=\"messagebox info\"><?php echo $this->_('No matches.') ?></p>\n    <?php endif; ?>\n"
  },
  {
    "path": "application/views/templates/partials/menu.phtml",
    "content": "<?php\n/**\n * OntoWiki menu partial template\n *\n * @author  Norman Heino <norman.heino@gmail.com>\n * @author  Michael Haschke\n */\n?>\n<?php foreach ($this->menu as $name => $menu): ?>\n    <?php if (is_array($menu)): ?>\n        <li><?php echo $this->_($name) ?>\n            <ul>\n                <?php foreach ($menu as $itemName => $itemContent): ?>\n                    <?php if ($itemContent === OntoWiki_Menu::SEPARATOR): ?>\n                        <!-- TODO: this is invalid XHTML -->\n                        <hr class=\"menusep\"/>\n                    <?php elseif ($itemContent instanceof OntoWiki_Menu): ?>\n                        <?php echo $this->partial('partials/menu.phtml', array('menu' => array($itemName => $itemContent->toArray(false, false)))) ?>\n                    <?php elseif (is_string($itemContent)): ?>\n                        <li><a href=\"<?php echo $itemContent ?>\"><?php echo $this->_($itemName) ?></a></li>\n                    <?php else: ?>\n                        <li>\n                            <?php if (isset($itemContent['url'])): ?>\n                                <a href=\"<?php echo $itemContent['url'] ?>\"\n                            <?php else: ?>\n                                <a\n                            <?php endif; ?>\n                                <?php echo (isset($itemContent['about']) ? 'about=\"' . $itemContent['about'] . '\"' : '') ?>\n                                <?php echo (isset($itemContent['class']) ? 'class=\"' . $itemContent['class'] . '\"' : '') ?>\n                                <?php echo (isset($itemContent['id']) ? 'id=\"' . $itemContent['id'] . '\"' : '') ?>>\n                                <?php echo $this->_($itemName) ?>\n                            </a>\n                        </li>\n                    <?php endif; ?>\n                <?php endforeach; ?>\n            </ul>\n        </li>\n    <?php elseif ($menu instanceof OntoWiki_Menu): ?>\n        <?php echo $this->partial('partials/menu.phtml', array('menu' => array($name => $menu->toArray(false, false)))) ?>\n    <?php elseif ($menu): ?>\n        <li><a href=\"<?php echo $menu ?>\"><?php echo $this->_($name) ?></a></li>\n    <?php endif; ?>\n<?php endforeach; ?>\n"
  },
  {
    "path": "application/views/templates/partials/message.phtml",
    "content": "<?php\n/**\n * OntoWiki message partial template\n *\n * @author  Norman Heino <norman.heino@gmail.com>\n * @author  Michael Haschke\n */\n?>\n<p class=\"messagebox <?php echo $this->message->getType() ?>\">\n    <?php echo $this->_($this->message->getText()) ?>\n</p>\n"
  },
  {
    "path": "application/views/templates/partials/meta.phtml",
    "content": "<?php if ($this->has('update')): ?>\n    <?php foreach ($this->placeholder('update') as $update): ?>\n        <?php if (isset($update['sourceGraph'])): ?>\n            <link about=\"\" rel=\"update:sourceGraph\" href=\"<?php echo $update['sourceGraph'] ?>\"/>\n            <?php $graph = $update['sourceGraph'] ?>\n        <?php elseif (isset($update['defaultGraph'])): ?>\n            <link about=\"\" rel=\"update:defaultGraph\" href=\"<?php echo $update['defaultGraph'] ?>\"/>\n            <?php $graph = $update['defaultGraph'] ?>\n        <?php endif; ?>\n        <link about=\"<?php echo $graph ?>\" rel=\"update:updateEndpoint\" href=\"<?php echo $update['updateEndpoint'] ?>\"/>\n        <link about=\"<?php echo $graph ?>\" rel=\"update:queryEndpoint\" href=\"<?php echo $update['queryEndpoint'] ?>\"/>\n    <?php endforeach; ?>\n<?php endif; ?>\n\n"
  },
  {
    "path": "application/views/templates/partials/module.phtml",
    "content": "<?php\n/**\n * OntoWiki window partial template\n *\n * @author  Norman Heino <norman.heino@gmail.com>\n * @author  Michael Haschke\n */\n?>\n<div class=\"module<?php echo ' ' . $this->cssClasses ?>\"<?php echo ($this->cssId ? ' id=\"' . $this->cssId . '\"' : '') ?>>\n\n    <?php if (is_array($this->content)): ?>\n        <?php foreach ($this->content as $key => $value): ?>\n            <div class=\"content\" id=\"<?php echo $key ?>\">\n                <?php echo $value ?>\n            </div>\n        <?php endforeach; ?>\n    <?php else: ?>\n        <div class=\"content\">\n            <?php echo $this->content ?>\n        </div><!-- .window .content -->\n    <?php endif; ?>\n\n</div><!-- .module -->\n"
  },
  {
    "path": "application/views/templates/partials/navigation.phtml",
    "content": "<?php\n/**\n * OntoWiki navigation partial template\n *\n * @author  Norman Heino <norman.heino@gmail.com>\n * @author  Michael Haschke\n */\n?>\n<?php $i = 0; ?>\n<?php if ($this->has('navigation')): ?>\n    <ol class=\"tabs\">\n        <?php foreach ($this->navigation as $key => $config): ?>\n            <li id=\"<?php echo $key ?>\" class=\"<?php echo isset($config['active']) ? $config['active'] : 'inactive' ?>\">\n                <a href=\"<?php echo $config['url'] ?>\"><?php echo $this->_($config['name']) ?></a>\n            </li>\n        <?php endforeach; ?>\n    </ol>\n<?php endif; ?>\n"
  },
  {
    "path": "application/views/templates/partials/resultset.phtml",
    "content": "<?php\n/**\n * OntoWiki resultset partial template\n *\n * @author  Jonas Brekle <jonas.brekle@gmail.com>\n */\n\n$resultCounter = 1;\n?>\n<?php if(!empty($this->data)){ ?>\n<table class=\"separated-vertical\" <?php if (isset($this->cssid)) echo \"id=\\\"\".$this->cssid.\"\\\"\" ?>>\n    <?php if ($this->has('caption')): ?>\n        <caption><?php echo $this->caption;?></caption>\n    <?php endif; ?>\n\n    <?php if (!$this->has('header')) $this->header = array_keys($this->data[0]); ?>\n        <tr>\n            <th style=\"width: 1em\">#</th>\n            <?php foreach ($this->header as $headerField): ?>\n                <th><?php echo $headerField ?></th>\n            <?php endforeach; ?>\n        </tr>\n\n    <?php\n        $odd = true;\n        foreach ($this->data as $row): ?>\n        <tr class=\"<?php echo $odd ? \"odd\" : \"even\" ?>\">\n            <td><?php echo $resultCounter++ . \".\"?></td>\n            <?php foreach ($row as $field): ?>\n                <td>\n                <?php\n                if(!is_array($field)){\n                    if(substr($field,0,4)==\"http\"){\n                        $shorturl = OntoWiki_Utils::contractNamespace($field);\n\n                        $localpart = OntoWiki_Utils::getUriLocalPart($field);\n                        ?><a class=\"hasMenu expandable Resource\" about=\"<?php echo $field;?>\"  href=\"<?php echo $this->urlBase.\"/view/?r=\".urlencode($field);?>\"><?php echo $shorturl;?></a><?php\n                    } else {\n                        echo $this->escape($field); //literal\n                    }\n                } else { $localpart = OntoWiki_Utils::getUriLocalPart($field[\"uri\"]); ?>\n                    <a class=\"hasMenu expandable Resource\" about=\"<?php echo $field[\"uri\"];?>\"  href=\"<?php echo $this->urlBase.\"/view/?r=\".urlencode($field); ?>\"><?php echo $field[\"title\"];?></a>\n                <?php } ?>\n                </td>\n            <?php endforeach; $odd = !$odd; ?>\n        </tr>\n    <?php endforeach; ?>\n</table>\n<?php } else {\n    ?><p class=\"messagebox info\"><?php echo $this->_('No matches.') ?></p><?php\n}  ?>\n"
  },
  {
    "path": "application/views/templates/partials/statusbar.phtml",
    "content": "<?php\n/**\n * OntoWiki menu partial template\n *\n * @author  Norman Heino <norman.heino@gmail.com>\n * @author  Michael Haschke\n */\n?>\n<?php if ($this->has('statusbar')): ?>\n    <div class=\"messagebox statusbar\">\n        <?php foreach ($this->statusbar as $statusElement): ?>\n            <div class=\"statustool\"><?php echo $statusElement ?></div>\n        <?php endforeach; ?>\n    </div>\n<?php endif; ?>\n"
  },
  {
    "path": "application/views/templates/partials/table.phtml",
    "content": "<?php\n/**\n * OntoWiki table template partial\n *\n * possible view parameter:\n * - tableClass, rowClass, itemClass: css class strings\n * - caption: caption string\n * - header: array of th items\n * - data: array of (tr) items, which are arrays of (td) items\n * - querylink: output resource enabled query links where possible\n * - noodds: do not output odd even class\n *\n * @author Sebastian Tramp <mail@sebastian.tramp.name>\n */\n\nif ($this->has('tableClass')) {\n    echo '<table class=\"separated-vertical ' . $this->tableClass . '\">' . PHP_EOL;\n} else {\n    echo '<table class=\"separated-vertical\">' . PHP_EOL;\n}\n\nif ($this->has('caption')) {\n    echo \"<caption>$this->caption</caption>\" . PHP_EOL;\n}\nif ($this->has('header')) {\n    echo '<tr>' . PHP_EOL;\n    foreach ($this->header as $headerField) {\n        echo \"<th>$headerField</th>\" . PHP_EOL;\n    }\n    echo '</tr>' . PHP_EOL;\n}\n\n// row counter for data cell Ids\n$r = 0;\n$oddClass = 'even';\nforeach ($this->data as $row) {\n    // column counter for data cell Ids\n    $c = 0;\n\n    // swith odd/even class\n    $oddClass = ($oddClass == 'even') ? 'odd' : 'even';\n\n    // prepare classes of the tr element\n    $rowClassValue = '';\n    if ($this->has('rowClass')) {\n        $rowClassValue .= $this->rowClass;\n    }\n    if (!$this->has('noodds') || $this->noodds === false) {\n        $rowClassValue .= ' ' . $oddClass;\n    }\n    echo \"<tr class='$rowClassValue'>\" . PHP_EOL;\n\n    foreach ($row as $field) {\n        // data cell Id (r3-c12)\n        $id = 'r' . $r . '-c' . $c ;\n\n        if ($this->has('itemClass')) {\n            echo '<td id=\"' . $id . '\" class=\"' . $this->itemClass . '\">';\n        } else {\n            echo '<td id=\"' . $id . '\">';\n        }\n\n        // enhance data cell if value is an URI\n        // (and option is set)\n        if (\n            $this->has('querylink') &&\n            $this->querylink === true &&\n            Erfurt_URI::check($field)\n        ) {\n            // the query which is sent to the query editor\n            $query = \"SELECT ?predicate ?object\" . PHP_EOL .\n                \"WHERE {\" . PHP_EOL .\n                \"    <$field> ?predicate ?object .\" . PHP_EOL .\n                \"}\";\n\n            // the links href\n            $url = new OntoWiki_Url(\n                array(\n                    'controller' => 'queries',\n                    'action' => 'editor'\n                ),\n                array(),\n                array('query')\n            );\n            // append query parameter (setParam not used intentional here)\n            // reason: failes with the query part\n            $url = $url . '?query=' . urlencode($query);\n\n            // output the link\n            echo '<a class=\"hasMenu expandable Resource\"' .\n                ' about=\"' . $field . '\"' .\n                ' href=\"'. $url .'\"' .\n                '>' . $this->escape($field) . '</a>';\n        } else {\n            // output only the value\n            echo $this->escape($field);\n        }\n        echo '</td>' . PHP_EOL;\n        $c++;\n    }\n    echo '</tr>' . PHP_EOL;\n    $r++;\n}\necho '</table>';\n"
  },
  {
    "path": "application/views/templates/partials/toolbar.phtml",
    "content": "<?php\n/**\n * OntoWiki toolbar partial template\n *\n * @author  Norman Heino <norman.heino@gmail.com>\n * @author  Michael Haschke\n * @version $$\n */\n?>\n<div class=\"messagebox\">\n    <?php if (isset($this->lines)): ?>\n        <?php foreach ($this->lines as $line): ?>\n            <div class=\"statusline\"><?php echo $line ?></div>\n        <?php endforeach; ?>\n    <?php endif; ?>\n\n    <?php if (isset($this->tools)): ?>\n        <?php foreach ($this->tools as $tool): ?>\n            <div class=\"statustool\"><?php echo $tool ?></div>\n        <?php endforeach; ?>\n    <?php endif; ?>\n</div>\n"
  },
  {
    "path": "application/views/templates/partials/window.phtml",
    "content": "<?php\n/**\n * OntoWiki window partial template\n *\n * @author  Norman Heino <norman.heino@gmail.com>\n * @author  Michael Haschke\n */\n?>\n<div class=\"window<?php echo ' ' . $this->cssClasses ?>\"<?php echo ($this->cssId ? ' id=\"' . $this->cssId . '\"' : '') ?>>\n\n    <?php if ($this->has('headinglevel')): ?>\n        <h<?php echo $this->headinglevel ?> class=\"title\"><?php echo $this->_($this->title) ?></h<?php echo $this->headinglevel ?>>\n    <?php else: ?>\n        <h1 class=\"title\"><?php echo $this->_($this->title) ?></h1>\n    <?php endif; ?>\n\n    <div class=\"slidehelper\">\n        <?php if (!$this->has('innerwindows')): ?>\n            <?php if (isset($this->messages)): ?>\n                <?php foreach ($this->messages as $message): ?>\n                    <?php echo $this->partial('partials/message.phtml', array('message' => $message)) ?>\n                <?php endforeach; ?>\n            <?php endif; ?>\n        <?php endif; ?>\n\n        <?php if ($this->has('navigation')): ?>\n            <?php echo $this->partial('partials/navigation.phtml', array('navigation' => $this->navigation)) ?>\n        <?php endif; ?>\n\n        <?php if ($this->has('innerwindows')): ?>\n            <div class=\"content has-innerwindows\">\n                <div class=\"innercontent\">\n                    <?php if (isset($this->messages)): ?>\n                        <?php foreach ($this->messages as $message): ?>\n                            <?php echo $this->partial('partials/message.phtml', array('message' => $message)) ?>\n                        <?php endforeach; ?>\n                    <?php endif; ?>\n                    <?php echo $this->content ?>\n                </div><!-- .innercontent -->\n                <div class=\"innerwindows\">\n                    <?php echo $this->innerwindows ?>\n                </div><!-- .innerwindows -->\n            </div>\n        <?php else: ?>\n            <?php if (is_array($this->content)): ?>\n                <?php foreach ($this->content as $key => $value): ?>\n                    <div class=\"content\" id=\"<?php echo $key ?>\">\n                        <?php echo $value ?>\n                    </div>\n                <?php endforeach; ?>\n            <?php else: ?>\n                <div class=\"content\">\n                    <?php if (isset($this->tools)): ?>\n                        <?php echo $this->partial('partials/toolbar.phtml', $this->tools) ?>\n                    <?php endif; ?>\n                    <?php echo $this->content ?>\n                </div><!-- .window .content -->\n            <?php endif; ?>\n        <?php endif; ?>\n\n        <?php if ($this->has('menu')): ?>\n            <ul class=\"menu\">\n                <?php echo $this->partial('partials/menu.phtml', array('menu' => $this->menu)) ?>\n            </ul>\n        <?php endif; ?>\n\n        <?php if ($this->has('contextmenu')): ?>\n            <div class=\"contextmenu\">\n                <?php echo $this->partial('partials/contextmenu.phtml', array('contextmenu' => $this->contextmenu)) ?>\n            </div>\n        <?php endif; ?>\n\n    </div><!-- .slidehelper -->\n\n</div><!-- .window -->\n"
  },
  {
    "path": "application/views/templates/resource/instances.phtml",
    "content": "\n"
  },
  {
    "path": "application/views/templates/resource/properties.phtml",
    "content": "<?php if (isset($this->prePropertiesContent)): ?>\n    <div><?php echo $this->prePropertiesContent; ?></div>    \n<?php endif; ?>\n<?php $flag = false; ?>\n<span about=\"<?php echo $this->resourceUri ?>\" style=\"display:none\" class=\"about_span\"></span>\n<?php if ($this->has('predicates')): ?>\n<?php $odd = true; $current = 0; $graphCount = count($this->graphs) ?>\n<table class=\"separated-vertical rdfa\" about=\"<?php echo $this->resourceUri ?>\"\n    <?php foreach ($this->namespacePrefixes as $prefix => $namespace): ?>\n        <?php echo ' xmlns:' . $prefix . '=\"' . $namespace . '\"' ?>\n    <?php endforeach; ?>>\n    \n    <?php foreach ($this->predicates as $graph => $predicatesForGraph): ?>\n        <?php $current++; ?>\n        <?php if (count($this->predicates[$graph]) > 0): /* has resource predicates from graph at all? */ ?>\n            <?php $flag = true; ?>\n        <tbody update:from=\"<?php echo $graph ?>\" id=\"table-group-<?php echo $current ?>\">\n            <?php if (($graphCount > 1) || ($graph != $this->graphUri)): ?>\n                <?php /* show tbody caption only if statements from more than one graph or not from the selected graph */ ?>\n                <tr class=\"grouptitle\">\n                    <th colspan=\"2\">\n                        <a class=\"toggle\"></a>\n                        <?php echo ($graph != $this->graphUri) ? $this->_('Imported from ') : '' ?>\n                        <?php echo $this->graphs[$graph] ?>\n                    </th>\n                </tr>\n            <?php endif; ?>\n        <?php foreach ($predicatesForGraph as $uri => $predicate): ?>\n            <?php $currentPredicate = $this->predicates[$graph][$uri] ?>\n            <tr>\n                <td width=\"120\">\n                    <a class=\"hasMenu\" \n                       about=\"<?php echo $currentPredicate['uri'] ?>\" \n                       href=\"<?php echo $currentPredicate['url'] ?>\"><?php echo $currentPredicate['title'] ?></a>\n                </td>\n                <td>\n                    <?php // if there is at least one resource in this value list -> show list icon ?>\n                    <div class=\"has-contextmenu-area\">\n                        <div class=\"contextmenu\">\n                            <?php\n                                // if there is at least one resource in this value list -> show list icon\n                                $hasListLink = false;\n                                if (count($this->values[$graph][$uri]) > 1) {\n                                    foreach ($this->values[$graph][$uri] as $entry) {\n                                         if ($entry['url']) {\n                                             $hasListLink = true;\n                                         }\n                                    }\n                                }\n                            ?>\n                            <?php if ($hasListLink == true) : ?>\n                                <a class=\"item\"\n                                   href=\"<?php echo (isset($currentPredicate['has_more_link']) ? $currentPredicate['has_more_link'] : \"\") ?>\">\n                                    <span class=\"icon icon-list\" title=\"Show as List\">\n                                        <span>Show as List</span>\n                                    </span>\n                                </a>\n                            <?php endif ?>\n                            <?php if ($this->editableFlags[$graph] == true) : ?>\n                                <a class=\"item rdfauthor-edit-property\"\n                                   onclick=\"editProperty(event)\">\n                                    <span class=\"icon icon-edit\" title=\"Edit Values\">\n                                        <span>Show as List</span>\n                                    </span>\n                                </a>\n                            <?php endif ?>\n                        </div>\n                        <ul class=\"bullets-none\">\n                            <?php foreach ($this->values[$graph][$uri] as $entry): ?>\n                                <?php if ($entry['url']): ?>\n                                    <li>\n                                        <a resource=\"<?php echo $entry['uri'] ?>\" \n                                           rel=\"<?php echo $currentPredicate['curi'] ?>\" \n                                           class=\"expandable hasMenu\" href=\"<?php echo $entry['url'] ?>\"><?php echo $entry['object'] ?></a>\n                                    </li>\n                                <?php else: ?>\n                                    <li property=\"<?php echo $currentPredicate['curi']; ?>\" \n                                        data-object-hash=\"<?php echo $entry['object_hash']; ?>\"\n                                        content=\"<?php echo $this->escape(isset($entry['content']) ? $entry['content'] : $entry['object']); ?>\"\n                                        <?php if (isset($entry['lang']) && !empty($entry['lang'])): ?>\n                                            xml:lang=\"<?php echo $entry['lang']; ?>\"\n                                        <?php elseif (isset($entry['datatype']) && !empty($entry['datatype'])): ?>\n                                            datatype=\"<?php echo $entry['datatype'] ?>\"\n                                        <?php endif; ?>\n                                        ><?php \n                                        echo $entry['object']\n                                    ?></li>\n                                <?php endif; ?>\n                            <?php endforeach; ?>\n                            <?php if (isset($currentPredicate['has_more']) && $currentPredicate['has_more']): ?>\n                                <a href=\"<?php echo $currentPredicate['has_more_link'] ?>\">[<?php echo $this->_('more') ?>]</a>\n                            <?php endif; ?>\n                        </ul>\n                    </div>\n                </td>\n            </tr>\n        <?php endforeach; ?>\n    </tbody>\n    <?php endif; ?>\n    <?php endforeach; ?>\n</table>\n<?php endif; ?>\n<?php if (!$flag): ?>\n    <table class=\"separated-vertical rdfa hidden\" about=\"<?php echo $this->resourceUri ?>\"\n    <?php foreach ($this->namespacePrefixes as $prefix => $namespace): ?>\n        <?php echo ' xmlns:' . $prefix . '=\"' . $namespace . '\"' ?>\n    <?php endforeach; ?>>\n    <tbody></tbody></table>\n    <p class=\"messagebox info\"><?php echo $this->_('No predicates found.') ?></p>\n<?php endif; ?>\n"
  },
  {
    "path": "build/phpcs.xml",
    "content": "<?xml version=\"1.0\"?>\n\n<ruleset name=\"OntoWikiRuleSet\">\n<description>OntoWiki rule set for PHP_CodeSniffer</description>\n    <rule ref=\"Zend\" />\n</ruleset>"
  },
  {
    "path": "build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<project name=\"OntoWiki\" default=\"build\">\n    <target name=\"build-unit\" depends=\"prepare,lint,phpunit,phpdoc,phpcb\" />\n    <target name=\"build-ci\" depends=\"prepare,lint,phpcs-ci,phpunit-integration-virtuoso,phpunit-integration-mysql,phpdoc,pdepend,phpmd-ci,phpcpd,phploc,phpcb\" />\n\n    <target name=\"build\" depends=\"build-ci\"/>\n\n    <target name=\"clean\" description=\"Cleanup build artifacts\">\n        <delete dir=\"${basedir}/build/api\"/>\n        <delete dir=\"${basedir}/build/code-browser\"/>\n        <delete dir=\"${basedir}/build/coverage\"/>\n        <delete dir=\"${basedir}/build/logs\"/>\n        <delete dir=\"${basedir}/build/pdepend\"/>\n    </target>\n\n    <target name=\"prepare\" depends=\"clean\" description=\"Prepare for build\">\n        <mkdir dir=\"${basedir}/build/api\"/>\n        <mkdir dir=\"${basedir}/build/code-browser\"/>\n        <mkdir dir=\"${basedir}/build/coverage\"/>\n        <mkdir dir=\"${basedir}/build/logs\"/>\n        <mkdir dir=\"${basedir}/build/pdepend\"/>\n    </target>\n\n    <target name=\"lint\" description=\"Perform syntax check of sourcecode files\">\n        <apply executable=\"php\" failonerror=\"true\">\n            <arg value=\"-l\" />\n\n            <fileset dir=\"${basedir}/application\">\n                <include name=\"**/*.php\" />\n                <modified />\n            </fileset>\n\n            <fileset dir=\"${basedir}/extensions\">\n                <include name=\"**/*.php\" />\n                <modified />\n            </fileset>\n        </apply>\n    </target>\n\n    <target name=\"phploc\" description=\"Measure project size using PHPLOC\">\n        <exec executable=\"phploc\">\n            <arg value=\"--log-csv\" />\n            <arg value=\"${basedir}/build/logs/phploc.csv\" />\n            <arg path=\"${basedir}/application\" />\n            <arg path=\"${basedir}/extensions\" />\n        </exec>\n    </target>\n\n    <target name=\"pdepend\" description=\"Calculate software metrics using PHP_Depend\">\n        <exec executable=\"pdepend\">\n            <arg value=\"--jdepend-xml=${basedir}/build/logs/jdepend.xml\" />\n            <arg value=\"--jdepend-chart=${basedir}/build/pdepend/dependencies.svg\" />\n            <arg value=\"--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg\" />\n            <arg path=\"${basedir}/application,${basedir}/extensions\" />\n        </exec>\n    </target>\n\n    <target name=\"phpmd\"\n            description=\"Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.\">\n         <exec executable=\"phpmd\">\n             <arg path=\"${basedir}/application,${basedir}/extensions\" />\n             <arg value=\"text\" />\n             <arg value=\"${basedir}/build/phpmd.xml\" />\n         </exec>\n     </target>\n\n     <target name=\"phpmd-ci\"\n             description=\"Perform project mess detection using PHPMD creating a log file for the continuous integration server\">\n        <exec executable=\"phpmd\">\n            <arg path=\"${basedir}/application,${basedir}/extensions\" />\n            <arg value=\"xml\" />\n            <arg value=\"${basedir}/build/phpmd.xml\" />\n            <arg value=\"--reportfile\" />\n            <arg value=\"${basedir}/build/logs/pmd.xml\" />\n        </exec>\n    </target>\n\n    <target name=\"phpcs\"\n            description=\"Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.\">\n        <exec executable=\"phpcs\">\n            <arg value=\"--standard=${basedir}/application/tests/CodeSniffer/Standards/Ontowiki/ruleset.xml\" />\n            <arg value=\"--report=summary\" />\n            <arg value=\"--severity=6\" />\n            <arg value=\"-s\" />\n            <arg value=\"--ignore=libraries,extensions/exconf/pclzip.lib.php,extensions/exconf/Archive.php,application/scripts,extensions/markdown/parser/markdown.php,extensions/queries/lib,extensions/queries/old\" />\n            <arg value=\"--extensions=php\" />\n            <arg path=\"${basedir}/application\" />\n        </exec>\n    </target>\n\n    <target name=\"phpcs-ci\"\n            description=\"Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server\">\n        <exec executable=\"phpcs\">\n            <arg value=\"--standard=${basedir}/application/tests/CodeSniffer/Standards/Ontowiki/ruleset.xml\" />\n            <arg value=\"--report=checkstyle\" />\n            <arg value=\"--report-file=${basedir}/build/logs/checkstyle.xml\" />\n            <arg value=\"--severity=6\" />\n            <arg value=\"-s\" />\n            <arg value=\"--ignore=libraries,extensions/exconf/pclzip.lib.php,extensions/exconf/Archive.php,application/scripts,extensions/markdown/parser/markdown.php,extensions/queries/lib,extensions/queries/old\" />\n            <arg value=\"--extensions=php\" />\n            <arg path=\"${basedir}/application\" />\n        </exec>\n    </target>\n\n    <target name=\"phpcpd\" description=\"Find duplicate code using PHPCPD\">\n        <exec executable=\"phpcpd\">\n            <arg value=\"--log-pmd\" />\n            <arg value=\"${basedir}/build/logs/pmd-cpd.xml\" />\n            <arg path=\"${basedir}/application\" />\n            <arg path=\"${basedir}/extensions\" />\n        </exec>\n    </target>\n\n    <target name=\"phpdoc\" description=\"Create API doc using DocCreator\">\n        <exec dir=\"/opt/DocCreator/\" executable=\"php\">\n            <arg value=\"/opt/DocCreator/create.php5\" />\n            <arg value=\"--config-file=${basedir}/build/doc.ontowiki-erfurt.xml\" />\n            <arg value=\"--source-folder=${basedir}/\" />\n            <arg value=\"--target-folder=${basedir}/build/api/\" />\n        </exec>\n    </target>\n\n    <target name=\"directories\">\n        <exec executable=\"make\">\n            <arg value=\"test-directories\" />\n        </exec>\n    </target>\n\n    <target name=\"phpunit\" depends=\"directories\" description=\"Run unit tests with PHPUnit\">\n        <exec dir=\"${basedir}/application/tests/unit/\" executable=\"phpunit\" failonerror=\"true\" />\n    </target>\n\n    <target name=\"phpunit-integration-mysql\" depends=\"phpunit\" description=\"Run unit tests with PHPUnit\">\n        <exec dir=\"${basedir}/application/tests/integration/\" executable=\"phpunit\" failonerror=\"true\">\n            <env key=\"EF_STORE_ADAPTER\" value=\"zenddb\" />\n        </exec>\n    </target>\n\n    <target name=\"phpunit-integration-virtuoso\" depends=\"phpunit\" description=\"Run unit tests with PHPUnit\">\n        <exec dir=\"${basedir}/application/tests/integration/\" executable=\"phpunit\" failonerror=\"true\">\n            <env key=\"EF_STORE_ADAPTER\" value=\"virtuoso\" />\n        </exec>\n    </target>\n\n    <target name=\"phpcb\" description=\"Aggregate tool output with PHP_CodeBrowser\">\n        <exec executable=\"phpcb\">\n            <arg value=\"--log\" />\n            <arg path=\"${basedir}/build/logs\" />\n            <arg value=\"--source\" />\n            <arg path=\"${basedir}/application\" />\n            <arg value=\"--output\" />\n            <arg path=\"${basedir}/build/code-browser\" />\n        </exec>\n    </target>\n</project>\n"
  },
  {
    "path": "composer.json",
    "content": "{\n    \"name\": \"aksw/ontowiki\",\n    \"description\": \"Semantic data wiki as well as Linked Data publishing engine\",\n    \"type\": \"application\",\n    \"keywords\": [\"OntoWiki\", \"Linked Data\", \"Semantic Web\", \"RDF\", \"Triple Store\"],\n    \"license\": \"GPL-2.0\",\n    \"authors\": [\n        {\n            \"name\": \"Natanael Arndt\",\n            \"email\": \"arndtn@gmail.com\"\n        },\n        {\n            \"name\": \"AKSW\",\n            \"homepage\": \"http://aksw.org\"\n        }\n    ],\n    \"require\": {\n        \"php\": \">=5.4.0\",\n        \"mnsami/composer-custom-directory-installer\": \"1.1.*\",\n        \"aksw/erfurt\": \"1.8.*\",\n        \"bitworking/mimeparse\": \"2.1.*\",\n        \"zendframework/zendframework1\": \"1.*\",\n        \"aksw/rdfauthor\": \"dev-develop\",\n        \"composer/installers\": \">=1.3.0\"\n    },\n    \"require-dev\": {\n        \"phpunit/phpunit\": \"4.5.*\",\n        \"squizlabs/php_codesniffer\": \"dev-master\"\n    },\n    \"extra\": {\n        \"installer-paths\": {\n\t    \"./libraries/RDFauthor\": [\"aksw/rdfauthor\"]\n\t}\n    },\n    \"autoload\": {\n        \"classmap\": [\n            \"extensions/\",\n            \"application/Bootstrap.php\",\n            \"application/classes/\",\n            \"application/controllers/\"\n        ]\n    },\n    \"minimum-stability\": \"dev\",\n    \"prefer-stable\": true\n}\n"
  },
  {
    "path": "config.ini.dist",
    "content": ";;;;\n;; OntoWiki user config file\n;;\n;; Settings here will overwrite values from application/config/default.ini\n;;\n;; @package    application\n;; @subpackage config\n;; @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n;; @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n;;\n\n[private]\n\n;;;;\n;; Database setup\n;; In most cases you only need to change username, password\n;; and database name (dbname).\n\n;;;;\n;; Backend type:\n;; Possible values are zenddb (mysql), virtuoso, arc, comparer and sparql\n;;\nstore.backend = virtuoso\n\n;;;;\n;; ZendDB / MySQL backend specific options\n;;\nstore.zenddb.dbname   = \"ontowiki\"\nstore.zenddb.username = \"php\"\nstore.zenddb.password = \"php\"\nstore.zenddb.dbtype   = mysql\nstore.zenddb.host     = localhost\n\n;;;;\n;; Virtuoso backend specific options\n;;\nstore.virtuoso.dsn         = VOS\nstore.virtuoso.username    = \"dba\"\nstore.virtuoso.password    = \"dba\"\n;; affect the main search: searches <= 4 will be exact search (instead of bif:contains)\nstore.virtuoso.search_max_length_for_bifcontains = \"4\"\n;store.virtuoso.use_persistent_connection = true\n\n;;;;\n;; ARC2 backend specific options\n;;\nstore.arc.dbname = \"ontowiki_arc2\"\nstore.arc.username = \"ow\"\nstore.arc.password = \"ow\"\nstore.arc.host = \"localhost\"\nstore.arc.store = \"ef\"\n\n;store.sparql.serviceUrl = \"http://dbpedia.org/sparql\";\n;store.sparql.graphs[]   = \"http://dbpedia.org\"\n\n;;;;\n;; Comparer backend specific options\n;;\nstore.comparer.reference        = virtuoso\nstore.comparer.candidate        = zenddb\nstore.comparer.ignoredMethods[] = sparqlQuery\n\n;;;;\n;; Frontend language\n;;\nlanguages.locale = \"en\"             ; en, de, ru, zh (Chinese)\n\n;;;;\n;; Set this identifier to a unique value if you want to run multiple OntoWiki\n;; installations on one server\n;;\n;session.identifier = \"abc123\"\n\n;;;;\n;; Set some session cookie parameters\n;session.lifetime = \"3600\"\n;session.path = \"/\"\n;session.domain = \"\"\n;session.secure = 0\n;session.httpOnly = 0\n\n;;;;\n;; Email configuration\n;; You should set the host and localname for account recovery mails here\n;; appropriate values are necessary to guarantee correct function\n;;\nmail.hostname           = \"hostname.tld\"\nmail.localname.recovery = \"ontowiki-account-recovery\"\n\n;;;;\n;; Proxy configuration\n;; You can configure an optional proxy server for connections that OntoWiki internally opens.\n;; This is for example useful in situations, where you want to access Linked Data and your OntoWiki sits\n;; behind a firewall.\n;;\n;proxy.host = \"\"\n;proxy.port = 8080\n;proxy.username = \"\"\n;proxy.password = \"\"\n\n;; Virtual host configurations (optional, e.g. when OntoWiki is reachable via multiple domains)\n;vhosts[] = \"http://graph1.ontowiki.de\"\n;vhosts[] = \"http://graph2.ontowiki.de\"\n\n;;;;\n;; Uncomment this line to turn on the query and object cache (experimental)\n;;\n;cache.enable       = true\n;cache.query.enable = true\n\n\n;; Options for cache frontend (experimental)\n;cache.frontend.enable                              = true\n;cache.frontend.lifetime                            = 0\n;cache.frontend.logging                             = false\n;cache.frontend.write_control                       = true\n;cache.frontend.automatic_cleaning_factor           = 10\n;cache.frontend.ignore_user_abort                   = false\n;cache.frontend.cache_id_prefix                     = 'OW_'\n\n;; Cache backend options\n;; Available: file | memcached | database | sqlite | apc\n;; Recommended: memcached | file\n;cache.backend.type                                 = \"file\"\n\n;; Options for file cache backend\n;cache.backend.file.cache_dir                       = \"./cache/\"\n;cache.backend.file.file_locking                    = NULL\n\n;; Options for memcached cache backend\n;cache.backend.memcached.compression                = false\n;cache.backend.memcached.compatibility              = false\n;; You can define several servers: copy block, below and increase number and configure properly\n;cache.backend.memcached.servers.0.host             = \"localhost\"\n;cache.backend.memcached.servers.0.port             = 11211\n;cache.backend.memcached.servers.0.persistent       = true\n;cache.backend.memcached.servers.0.weight           = 1\n;cache.backend.memcached.servers.0.timeout          = 5\n;cache.backend.memcached.servers.0.retry_interval   = 15\n;cache.backend.memcached.servers.0.status           = 15\n\n;; Options for sqlite cache backend\ncache.backend.sqlite.cache_db_complete_path         = \"/tmp/ow_cache.sqlite\"\n;cache.backend.sqlite.automatic_vacuum_factor       = 10\n\n\n;; Options for Gearman/worker (experimental)\n;worker.enable\t= true\n\n;; Option for specifying the RSS/Atom feed loaded in the OntoWiki index actions \"News\" module\n;; set to \"false\" to completely disable the feed\n;news.feedUrl = \"http://blog.aksw.org/feed/?cat=5&client={{version.label}}&version={{version.number}}&suffix={{version.suffix}}\"\n\n;;;;\n;; uncomment this line if you need more information\n;;\n;debug = true\n"
  },
  {
    "path": "debian/Makefile/Makefile",
    "content": "\ndefault:\n\nprepare:\n\trm -rf ../../build*\n\trm -f ../../Makefile\n\trm -f ../../web.config\n\trm -rf ../../libraries/Erfurt\n\trm -rf ../../libraries/RDFauthor\n\trm -f ../../extensions/themes/silverblue/scripts/libraries/jquery.js\n\trm -f ../../extensions/exconf/pclzip.lib.php\n\trm -rf ../../extensions/markdown/parser\n\trm -f ../../extensions/queries/resources/codemirror/LICENSE\n\nclean:\n\trm -rf ../*.log\n\trm -rf ../ontowiki-common\n\trm -rf ../ontowiki-mysql\n\trm -rf ../ontowiki-virtuoso\n\trm -rf ../files\n\trm -rf ../*.substvars\n\npackage:\n\n"
  },
  {
    "path": "debian/changelog",
    "content": "ontowiki (0.9.11) lod2; urgency=low\n\n  * Improve model selection in linkeddataserver extension\n  * Extend cache clear script by support for query and translation cache\n  * Fix #60: Add script to clear cache via shell\n  * fix #201 - removed css classes for modal and set z-index of applicationbar to 999\n  * Fix 271. Fix Output Format of queries editor\n  * fix #201 - fixed z-index for modal-wrapper-propertyselector\n  * Merge pull request #268 from hknochi/feature/fix-extension-enabler\n  * Merge pull request #269 from hknochi/feature/fix-pagination\n  * fix issue #167 - invalidate extensionCache to distribute requested changes\n  * fix issue #261 - added limit-parameter to url\n  * improve cron job\n  * Add list-events target to Makefile\n  * remove log in about screen\n  * avoid broken feed URLs on version / names with spaces\n  * use configure name instead of hardcoded one\n  * fixed issue #201 - added css rules for modal-wrapper\n  * fixed issue #201 - added css rules for simplemodal-container and -overlay\n  * Fix build to ignore worker shell scripts\n  * Reorganize shell scripts to avoid build failure\n  * Cleanup mail extension job class by removing obsolete members\n  * Added console client and an example extension for testing Erfurts worker\n  * Add support for Erfurts background jobs\n  * add min-height to <span> in resource view\n  * Add hidden save and cancle buttons in listmode\n  * Reorganize some code in support.js\n  * Fix editProperty to work in extended mode (+)\n  * Allow configuration of session cookie parameters, such as session lifetime\n  * Fix #259. Write alle defined prefixes to RDFa output.\n  * Fix warning, when site redirect takes place. Fix #260.\n  * fix wrong server class includes (closes #256)\n  * initial version of SelectorModule\n  * Fix model creation if no title is specified\n  * move inner window modules outside of master form\n  * Add “View as Resource” entry to model menu. Fix #152\n  * fix wrong encoded query parameter\n  * add even/odd classes for row and noodds parameter\n  * use new querylink feature of table partial\n  * remake table partial, add query link enhancement\n  * Fix #152. Move menu creation to Menu_Registry. \u001b[34m(6 months ago by Natanael Arndt)\u001b[m\n  * add xdebug link\n  * Remove unused action service/entities\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Fri, 31 Jan 2014 15:46:49 +0100\n\nontowiki (0.9.10-1) lod2; urgency=low\n\n  * new model creation / add data procedure\n  * fixes in query editor\n  * performance issues in title helper\n  * unify CommentModule and LastcommentsModule, increase limit and set ordering\n  * +100 other commits\n  * depends on Erfurt 1.6\n  * depends on RDFauthor 0.9.6\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Wed, 10 Jul 2013 14:22:14 +0200\n\nontowiki (0.9.8-3) lod2; urgency=low\n\n  * fix cors header\n  * add doap:wiki to the weblink list (2 weeks ago by Sebastian Tramp)\n  * add head action to return the request header for given uri\n  * fix extensions setting page (toggleswitch) #179\n  * Fixing Sort functionality of the Navigation Box extension re-enabling the Sort Menue\n  * prevent open paranthesis bug while using the limit buttons (100 / all)\n  * Fix #172 - rewrite rules in .htaccess\n  * use getReadableGraphsUsingResource method on Store\n  * cleanup togglebutton changes\n  * fix toggle button for new jquery version (#167)\n  * depends on Erfurt 1.5\n  * depends on RDFauthor 0.9.5\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Wed, 30 Jan 2013 13:55:56 +0100\n\nontowiki (0.9.7-2) lod2; urgency=low\n\n  * GUI niceups\n  * lots of fixes\n  * https://github.com/AKSW/OntoWiki/issues?milestone=1&page=1&state=closed\n  * RDFauthor is now a separate package\n  * Add support for additonal vhosts\n  * increment RDFauthor dependency\n  * allow usage of virtuosos bd.ini if present\n  * add gnome desktop file\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Fri, 16 Nov 2012 08:30:27 -0800\n\nontowiki (0.9.6-21) lod2; urgency=low\n\n  * fix RDFauthor integration\n  * forward RDFauthor to b780680\n  * forward OntoWiki to 04b33fd\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Mon, 27 Feb 2012 10:42:49 +0100\n\nontowiki (0.9.6-20) lod2; urgency=low\n\n  * forward ontowiki to 4bcd852\n  * forward RDFauthor to 3072d23\n  * fix non-writable extension directory\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Fri, 24 Feb 2012 01:50:21 +0100\n\nontowiki (0.9.6-19) lod2; urgency=low\n\n  * merged new develop branches into debian package\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Wed, 25 Jan 2012 10:03:59 +0100\n\nontowiki (0.9.6-18) lod2; urgency=low\n\n  * Adds support for case-insensitive URI matching and trailing slashes tolerance.\n  * Add text/turtle to type mappings.\n  * remove patternmanager, tagging, csvimport, site and map extensions\n  * improve error messages on bootstrap\n  * build from moved github sources\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Tue, 04 Oct 2011 14:42:39 +0200\n\nontowiki (0.9.6-17) lod2; urgency=low\n\n  * removed detailed dependency information for more compatibility\n  * fixed CKAN link\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Fri, 02 Sep 2011 20:47:47 +0200\n\nontowiki (0.9.6-16) lod2; urgency=low\n\n  * fix: RDFauthor integration\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Thu, 01 Sep 2011 10:01:16 +0200\n\nontowiki (0.9.6-15) lod2; urgency=low\n\n  * feature: ckan registration for non localhost models\n  * fix: depends-on-essential-package-without-using-version (sed)\n  * fix: AllowDirs now for new erfurt position\n  * hack: virtuoso's dba acount used (this should be changed soon!)\n  * new dependency: libphp-pclzip for extension configuration\n  * new dependency: tinymce in RDFauthor\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Wed, 22 Jun 2011 05:45:00 +0200\n\nontowiki (0.9.6-14) lod2; urgency=low\n\n  * correct pwgen dependency \n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Mon, 20 Jun 2011 10:58:27 +0200\n\nontowiki (0.9.6-13) lod2; urgency=low\n\n  * now with liberfurt-php dependency\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Thu, 09 Jun 2011 12:35:20 +0200\n\nontowiki (0.9.6-12) lod2; urgency=low\n\n  * virtuoso autoexec.isql now on correct place?\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Thu, 09 Jun 2011 12:35:20 +0200\n\nontowiki (0.9.6-11) lod2; urgency=low\n\n  * configuration directory split\n  * virtuoso autoexec.isql test\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Thu, 09 Jun 2011 08:35:20 +0200\n\nontowiki (0.9.6-10) lod2; urgency=low\n\n  * correct Depends, Replaces, Provides and Breaks tags\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Thu, 09 Jun 2011 08:00:31 +0200\n\nontowiki (0.9.6-9) lod2; urgency=low\n\n  * split package structure into virtuoso, mysql and common (sub-)packages\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Wed, 08 Jun 2011 17:01:51 +0200\n\nontowiki (0.9.6-8) lod2; urgency=low\n\n  * hopefully fixes install problems\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Wed, 08 Jun 2011 17:01:21 +0200\n\nontowiki (0.9.6-7) lod2; urgency=low\n\n  * docu addons\n  * depends on libmarkdown-php now\n  * security fix: file permissions\n  * license fix for codemirror\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Thu, 24 Mar 2011 15:48:57 +0100\n\nontowiki (0.9.6-6) lod2; urgency=low\n\n  * jquery-ui dependency deleted\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Thu, 24 Mar 2011 15:18:59 +0100\n\nontowiki (0.9.6-5) lod2; urgency=low\n\n  * (manual) database creation \n  * depends on jquery-ui now\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Thu, 24 Mar 2011 08:48:17 +0100\n\nontowiki (0.9.6-4) lod2; urgency=low\n\n  * a2enmod env\n  * depends on zend framework\n  * logs under /var/log/ontowiki\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Wed, 23 Mar 2011 16:00:43 +0100\n\nontowiki (0.9.6-3) lod2; urgency=low\n\n  * fix: a2enmod rewrite in postinst\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Tue, 22 Mar 2011 16:33:32 +0100\n\nontowiki (0.9.6-2) lod2; urgency=low\n\n  * better postinst handling\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Tue, 22 Mar 2011 13:28:42 +0100\n\nontowiki (0.9.6-1) lod2; urgency=low\n\n  * Initial debian release\n\n -- Sebastian Tramp <tramp@informatik.uni-leipzig.de>  Wed, 02 Feb 2011 00:10:38 +0100\n\n"
  },
  {
    "path": "debian/compat",
    "content": "7\n"
  },
  {
    "path": "debian/conf/apache2/apache.conf",
    "content": "# OntoWiki Apache Configuration\n<Directory /usr/share/ontowiki>\n    # needed for following the config.ini\n    Options +FollowSymLinks\n\n    # Give all right the the htaccess\n    AllowOverride All\n</Directory>\n\nAlias /ontowiki /usr/share/ontowiki\n"
  },
  {
    "path": "debian/conf/gnome/ontowiki.desktop",
    "content": "[Desktop Entry]\nName=OntoWiki\nComment=A Semantic Data Wiki\nExec=gnome-www-browser http://localhost/ontowiki\nTerminal=false\nType=Application\nIcon=/usr/share/ontowiki/application/favicon.png\nCategories=Utility;Application\nStartupNotify=false\n"
  },
  {
    "path": "debian/conf/mysql/config.ini",
    "content": ";;\n; OntoWiki user config file\n;\n; Settings here will overwrite values\n; from default.ini.\n;\n; @package    application\n; @subpackage config\n; @copyright  Copyright (c) 2010, {@link http://aksw.org AKSW}\n; @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n;;\n\n[private]\n\n;;\n; Database setup\n; In most cases you only need to change username, password\n; and database name (dbname).\n\nstore.backend           = zenddb             ; zenddb, virtuoso, arc, comparer\n\nstore.zenddb.dbname     = \"ontowiki_deb\"\nstore.zenddb.username   = \"ontowiki_deb\"\nstore.zenddb.password   = \"usepwgenhere\"\nstore.zenddb.dbtype     = mysql             ; mysql\n;store.zenddb.host      = localhost          ; default is localhost\n\n;store.virtuoso.dsn         = vos505\n;store.virtuoso.username    = \"dba\"\n;store.virtuoso.password    = \"dba\"\n;store.virtuoso.use_persistent_connection = true\n\n;store.arc.dbname = \"ontowiki_arc2\"\n;store.arc.username = \"ow\"\n;store.arc.password = \"ow\"\n;store.arc.host = \"localhost\"\n;store.arc.store = \"ef\"\n\n;store.comparer.reference         = virtuoso\n;store.comparer.candidate         = zenddb\n;store.comparer.ignoredMethods[]   = sparqlQuery\n\n;;\n; Frontend language\n;;\nlanguages.locale = \"en\"             ; en, de, ru, zh (Chinese)\n\n\n;;\n; Set this identifier to a unique value if you want to run multiple OntoWiki\n; installations on one server\n;;\n;session.identifier = \"abc123\"\n\n\n;;\n; Email configuration\n; You should set the host and localname for account recovery mails here\n; appropriate values are necessary to guarantee correct function\n;;\nmail.hostname           = \"hostname.tld\"\nmail.localname.recovery = \"ontowiki-account-recovery\"\n\n;;\n; Proxy configuration\n; You can configure an optional proxy server for connections that OntoWiki internally opens.\n; This is for example useful in situations, where you want to access Linked Data and your OntoWiki sits\n; behind a firewall.\n;;\n;proxy.host = \"\"\n;proxy.port = 8080\n;proxy.username = \"\"\n;proxy.password = \"\"\n"
  },
  {
    "path": "debian/conf/virtuoso/config.ini",
    "content": ";;\n; OntoWiki user config file\n;\n; Settings here will overwrite values\n; from default.ini.\n;\n; @package    application\n; @subpackage config\n; @copyright  Copyright (c) 2010, {@link http://aksw.org AKSW}\n; @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n;;\n\n[private]\n\n;;\n; Database setup\n; In most cases you only need to change username, password\n; and database name (dbname).\n\nstore.backend           = virtuoso             ; zenddb, virtuoso, arc, comparer\n\n; since openlink can't help here at the moment, we use dba/dba\nstore.virtuoso.dsn         = \"%%DSN%%\"\nstore.virtuoso.username    = \"%%USERNAME%%\"\nstore.virtuoso.password    = \"%%PASSWORD%%\"\n;store.virtuoso.use_persistent_connection = true\n\n;;\n; Frontend language\n;;\nlanguages.locale = \"en\"             ; en, de, ru, zh (Chinese)\n\n\n;;\n; Set this identifier to a unique value if you want to run multiple OntoWiki\n; installations on one server\n;;\n;session.identifier = \"abc123\"\n\n\n;;\n; Email configuration\n; You should set the host and localname for account recovery mails here\n; appropriate values are necessary to guarantee correct function\n;;\nmail.hostname           = \"hostname.tld\"\nmail.localname.recovery = \"ontowiki-account-recovery\"\n\n;;\n; Proxy configuration\n; You can configure an optional proxy server for connections that OntoWiki internally opens.\n; This is for example useful in situations, where you want to access Linked Data and your OntoWiki sits\n; behind a firewall.\n;;\n;proxy.host = \"\"\n;proxy.port = 8080\n;proxy.username = \"\"\n;proxy.password = \"\"\n"
  },
  {
    "path": "debian/control",
    "content": "Source: ontowiki\nSection: web\nPriority: extra\nMaintainer: Sebastian Tramp <tramp@informatik.uni-leipzig.de>\nBuild-Depends: debhelper (>= 7.0.50~)\nStandards-Version: 3.9.3\nHomepage: http://ontowiki.net\nVcs-Git: git://github.com/AKSW/OntoWiki.git\nVcs-Browser: https://github.com/AKSW/OntoWiki\n\nPackage: ontowiki-virtuoso\nArchitecture: all\nDepends: ontowiki-common (>= 0.9.11), virtuoso-opensource-6.1 (>= 6.1.6), php5-odbc, ${misc:Depends}\nProvides: ontowiki\nConflicts: ontowiki, ontowiki-mysql\nReplaces: ontowiki (<< 0.9.6-10)\nBreaks: ontowiki (<< 0.9.6-10)\nDescription: Semantic Data Wiki enabling the publication of RDF data\n OntoWiki is a tool providing support for agile, distributed knowledge\n engineering scenarios. OntoWiki facilitates the visual presentation of\n a knowledge base as an information map, with different views on instance data.\n .\n It enables intuitive authoring of semantic content. It fosters social\n collaboration aspects by keeping track of changes, allowing to comment and\n discuss every single part of a knowledge base.\n .\n Other remarkable features are:\n  * OntoWiki is a Linked Data Server for you data as well as a Linked Data\n    client to fetch additional data from the web.\n  * OntoWiki is a Semantic Pingback Client in order to receive and send\n    back-linking request as known from the blogosphere.\n  * OntoWiki is backend independent, which means you can save your data in a\n    MySQL database as well as in a Virtuoso Triple Store.\n  * OntoWiki is easily extendible by you, since it features a sophisticated\n    Extension System.\n .\n This package will install a virtuoso-backended OntoWiki instance.\n .\n OntoWiki is part of the LOD2 Technology Stack.\n\nPackage: ontowiki-mysql\nArchitecture: all\nDepends: ontowiki-common (>= 0.9.11), mysql-server, php5-mysql | php5-mysqli, ${misc:Depends}\nProvides: ontowiki\nConflicts: ontowiki, ontowiki-virtuoso\nReplaces: ontowiki (<< 0.9.6-10)\nBreaks: ontowiki (<< 0.9.6-10)\nDescription: Semantic Data Wiki enabling the publication of RDF data\n OntoWiki is a tool providing support for agile, distributed knowledge\n engineering scenarios. OntoWiki facilitates the visual presentation of\n a knowledge base as an information map, with different views on instance data.\n .\n It enables intuitive authoring of semantic content. It fosters social\n collaboration aspects by keeping track of changes, allowing to comment and\n discuss every single part of a knowledge base.\n .\n Other remarkable features are:\n  * OntoWiki is a Linked Data Server for you data as well as a Linked Data\n    client to fetch additional data from the web.\n  * OntoWiki is a Semantic Pingback Client in order to receive and send\n    back-linking request as known from the blogosphere.\n  * OntoWiki is backend independent, which means you can save your data in a\n    MySQL database as well as in a Virtuoso Triple Store.\n  * OntoWiki is easily extendible by you, since it features a sophisticated\n    Extension System.\n .\n This package will install a mysql-backended OntoWiki instance.\n .\n OntoWiki is part of the LOD2 Technology Stack.\n\nPackage: ontowiki-common\nArchitecture: all\nDepends: liberfurt-php (>= 1.7), libjs-rdfauthor (>= 0.9.7), php5-curl, libmarkdown-php, libphp-pclzip, libjs-jquery (>= 1.7.1), tinymce, ${misc:Depends}\nSuggests: owcli\nDescription: Application sources for all ontowiki packages\n OntoWiki is a tool providing support for agile, distributed knowledge\n engineering scenarios. OntoWiki facilitates the visual presentation of\n a knowledge base as an information map, with different views on instance data.\n .\n This is the common data package of OntoWiki and part of the LOD2 Technology\n Stack.\n\n"
  },
  {
    "path": "debian/copyright",
    "content": "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/\nUpstream-Name: Erfurt\nSource: https://github.com/AKSW/Erfurt\n\nFiles: *\nCopyright:\n    2013 Christian Würker\n    2013 Christoph Rieß\n    2013 Daniel Gerber\n    2013 Jonas Brekle\n    2013 Konrad Abicht\n    2013 Michael Haschke\n    2013 Michael Martin\n    2013 Natanael Arndt\n    2013 Norman Heino\n    2013 Philipp Frischmuth\n    2013 Rolland Brunec\n    2013 Sebastian Tramp\n    2013 Tim Ermilov\nLicense: GPL-2+\n This program is free software; you can redistribute it\n and/or modify it under the terms of the GNU General Public\n License as published by the Free Software Foundation; either\n version 2 of the License, or (at your option) any later\n version.\n .\n This program is distributed in the hope that it will be\n useful, but WITHOUT ANY WARRANTY; without even the implied\n warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE.  See the GNU General Public License for more\n details.\n .\n You should have received a copy of the GNU General Public\n License along with this package; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor,\n Boston, MA  02110-1301 USA\n .\n On Debian systems, the full text of the GNU General Public\n License version 2 can be found in the file\n `/usr/share/common-licenses/GPL-2'.\n\nFiles: extensions/queries/resources/codemirror/*\nCopyright: 2013 Marijn Haverbeke\nLicense: MIT2\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n .\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n .\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\nFiles: debian/*\nCopyright: 2013 Sebastian Tramp\nLicense: GPL-2+\n This program is free software; you can redistribute it\n and/or modify it under the terms of the GNU General Public\n License as published by the Free Software Foundation; either\n version 2 of the License, or (at your option) any later\n version.\n .\n This program is distributed in the hope that it will be\n useful, but WITHOUT ANY WARRANTY; without even the implied\n warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE.  See the GNU General Public License for more\n details.\n .\n You should have received a copy of the GNU General Public\n License along with this package; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor,\n Boston, MA  02110-1301 USA\n .\n On Debian systems, the full text of the GNU General Public\n License version 2 can be found in the file\n `/usr/share/common-licenses/GPL-2'.\n\n"
  },
  {
    "path": "debian/ontowiki-common.dirs",
    "content": "var/cache/ontowiki\nvar/log/ontowiki\n"
  },
  {
    "path": "debian/ontowiki-common.install",
    "content": "index.php       usr/share/ontowiki\n.htaccess       usr/share/ontowiki\n\napplication/Bootstrap.php usr/share/ontowiki/application\napplication/classes usr/share/ontowiki/application\napplication/config usr/share/ontowiki/application\napplication/controllers usr/share/ontowiki/application\napplication/views usr/share/ontowiki/application\napplication/favicon.png usr/share/ontowiki/application\napplication/favicon.ico usr/share/ontowiki/application\n\nextensions      usr/share/ontowiki\n\nlibraries/ARC2 usr/share/ontowiki/libraries/\nlibraries/Mimeparse.php usr/share/ontowiki/libraries/\n\n"
  },
  {
    "path": "debian/ontowiki-common.links",
    "content": "/usr/share/php/libzend-framework-php/Zend /usr/share/ontowiki/libraries/Zend\n/usr/share/php/liberfurt-php /usr/share/ontowiki/libraries/Erfurt\n/usr/share/libjs-rdfauthor /usr/share/ontowiki/libraries/RDFauthor\n\n/usr/share/php/markdown.php /usr/share/ontowiki/extensions/markdown/parser/markdown.php\n/usr/share/javascript/jquery/jquery.min.js /usr/share/ontowiki/extensions/themes/silverblue/scripts/libraries/jquery.js\n\n/usr/share/php/libphp-pclzip/pclzip.lib.php /usr/share/ontowiki/extensions/exconf/pclzip.lib.php\n\n/var/log/ontowiki         /usr/share/ontowiki/logs\n/var/cache/ontowiki       /usr/share/ontowiki/cache\n"
  },
  {
    "path": "debian/ontowiki-common.postinst",
    "content": "#!/bin/sh -e\n# postinst script for ontowiki\n#\n# see: dh_installdeb(1)\n\necho \"---- starting postinst $@\"\n\nchown www-data:www-data /usr/share/ontowiki/extensions\nchown www-data:www-data /var/log/ontowiki\nchown www-data:www-data /var/cache/ontowiki\nchmod 770 /usr/share/ontowiki/extensions\nchmod 770 /var/log/ontowiki\nchmod 770 /var/cache/ontowiki\n\n# enable the rewrite base\nsed 's/#RewriteBase/RewriteBase/' -i /usr/share/ontowiki/.htaccess\n\n#DEBHELPER#\n\necho \"---- ending postinst $@\"\n"
  },
  {
    "path": "debian/ontowiki-mysql.install",
    "content": "debian/conf/apache2/* etc/ontowiki\ndebian/conf/mysql/*   etc/ontowiki\ndebian/sql/*          usr/share/dbconfig-common/data/ontowiki/\ndebian/conf/gnome/*   usr/share/applications\n\n"
  },
  {
    "path": "debian/ontowiki-mysql.links",
    "content": "/etc/ontowiki/config.ini  /usr/share/ontowiki/config.ini\n/etc/ontowiki/apache.conf /etc/apache2/conf.d/ontowiki\n\n"
  },
  {
    "path": "debian/ontowiki-mysql.postinst",
    "content": "#!/bin/sh -e\n# postinst script for ontowiki\n#\n# see: dh_installdeb(1)\n\necho \"---- starting postinst $@\"\n\nmysql_run=\"mysql --defaults-extra-file=/etc/mysql/debian.cnf\"\n\now_user=\"ontowiki_deb\"\now_db=\"$ow_user\"\n#ow_pass=`pwgen -1`\now_pass=\"usepwgenhere\"\n\n#service mysql start\necho \"create ontowiki user\"\necho \"CREATE USER '$ow_user'@'localhost' IDENTIFIED BY  '$ow_pass';\" | $mysql_run || echo \"user $ow_user already exist\"\n\necho \"grant usage for ontowiki user\"\necho \"GRANT USAGE ON * . * TO  '$ow_user'@'localhost' IDENTIFIED BY  '$ow_pass' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;\" | $mysql_run\n\necho \"create database\"\necho \"CREATE DATABASE IF NOT EXISTS  $ow_db ;\" | $mysql_run\n\necho \"grant privileges to ontowiki user\"\necho \"GRANT ALL PRIVILEGES ON $ow_db . * TO '$ow_user'@'localhost';\" | $mysql_run\n\necho \"flush privileges\"\necho \"FLUSH PRIVILEGES ;\" | $mysql_run\n\n### APACHE CONFIG\nchown www-data:www-data /etc/ontowiki/config.ini\nchmod 600 /etc/ontowiki/config.ini\n\na2enmod rewrite\na2enmod env\nservice apache2 restart\n\n#DEBHELPER#\n\necho \"---- ending postinst $@\"\n"
  },
  {
    "path": "debian/ontowiki-mysql.prerm",
    "content": "#!/bin/sh -e\n# prerm script for ontowiki\n#\n# see: dh_installdeb(1)\n\necho \"---- starting prerm $@\"\n\nrm -f $APACHECONF_TARGET\nservice apache2 restart\n\n#DEBHELPER#\n\necho \"---- ending prerm $@\"\n"
  },
  {
    "path": "debian/ontowiki-virtuoso.install",
    "content": "debian/conf/apache2/*  etc/ontowiki\ndebian/conf/virtuoso/* etc/ontowiki\ndebian/sql/*           usr/share/dbconfig-common/data/ontowiki/\ndebian/conf/gnome/*    usr/share/applications\n"
  },
  {
    "path": "debian/ontowiki-virtuoso.links",
    "content": "/etc/ontowiki/config.ini  /usr/share/ontowiki/config.ini\n/etc/ontowiki/apache.conf /etc/apache2/conf.d/ontowiki\n\n"
  },
  {
    "path": "debian/ontowiki-virtuoso.postinst",
    "content": "#!/bin/sh -e\n# postinst script for ontowiki-virtuoso\n#\n# see: dh_installdeb(1)\n\necho \"---- starting postinst $@\"\n\nvirtetc=\"/etc/virtuoso-opensource-6.1/\"\nvirtuosoini=\"$virtetc/virtuoso.ini\"\nvirtbdini=\"$virtetc/bd.ini\"\nodbcini=\"/etc/odbc.ini\"\nowini=\"/etc/ontowiki/config.ini\"\ndsn=\"OWVIRT\"\n\n# check if bd ini exists (a file with login credentials)\nif [ -e $virtbdini ]; then\n    username=`cat $virtbdini | grep \"^Username=\" | cut -d \"=\" -f 2-`\n    password=`cat $virtbdini | grep \"^Password=\" | cut -d \"=\" -f 2-`\n    driver=`cat $virtbdini   | grep \"^Driver=\"   | cut -d \"=\" -f 2-`\n    address=`cat $virtbdini  | grep \"^Address=\"  | cut -d \"=\" -f 2-`\nfi\n\n# if we do not have the values we assume dba/dba and other well know values\nif [ \"$username\" = \"\" ]; then\n    username=\"dba\"\nfi\nif [ \"$password\" = \"\" ]; then\n    password=\"dba\"\nfi\nif [ \"$driver\" = \"\" ]; then\n    driver=\"/usr/lib/odbc/virtodbc.so\"\nfi\nif [ \"$address\" = \"\" ]; then\n    address=\"localhost:1111\"\nfi\n\n### ODBC CONFIG\ntouch $odbcini\necho \"# OntoWiki dsn start\" >>$odbcini\necho \"[$dsn]\" >>$odbcini\necho Description=OntoWiki Virtuoso DSN >>$odbcini\necho Driver=$driver >>$odbcini\necho Address=$address >>$odbcini\necho \"# OntoWiki dsn end\" >>$odbcini\n\n### ONTOWIKI CONFIG\nchown www-data:www-data $owini\nchmod 600 $owini\nsed \"s/%%DSN%%/$dsn/\" -i $owini\nsed \"s/%%USERNAME%%/$username/\" -i $owini\nsed \"s/%%PASSWORD%%/$password/\" -i $owini\n\n### VIRTUOSO CONFIG\n# add ontowiki and erfurt directory to virtuoso.ini DirsAllowed\n# try to remove the addition first in order to avoid double entries\nsed 's/^\\(DirsAllowed.*\\)\\(, \\/usr\\/share\\/ontowiki\\)\\(.*\\)/\\1\\3/' -i $virtuosoini\nsed 's/^\\(DirsAllowed.*\\)/\\1, \\/usr\\/share\\/ontowiki/' -i $virtuosoini\nsed 's/^\\(DirsAllowed.*\\)\\(, \\/usr\\/share\\/php\\/liberfurt-php\\)\\(.*\\)/\\1\\3/' -i $virtuosoini\nsed 's/^\\(DirsAllowed.*\\)/\\1, \\/usr\\/share\\/php\\/liberfurt-php/' -i $virtuosoini\n\n### APACHE CONFIG\na2enmod rewrite\na2enmod env\nservice apache2 restart\n\n#DEBHELPER#\n\necho \"---- ending postinst $@\"\n\n"
  },
  {
    "path": "debian/rules",
    "content": "#!/usr/bin/make -f\n# -*- makefile -*-\n# Sample debian/rules that uses debhelper.\n# This file was originally written by Joey Hess and Craig Small.\n# As a special exception, when this file is copied by dh-make into a\n# dh-make output file, you may use that output file without restriction.\n# This special exception was added by Craig Small in version 0.37 of dh-make.\n\n# Uncomment this to turn on verbose mode.\n#export DH_VERBOSE=1\n\n%:\n\tdh $@ \n"
  },
  {
    "path": "debian/source/format",
    "content": "3.0 (native)\n"
  },
  {
    "path": "debian/sql/install/mysql",
    "content": ""
  },
  {
    "path": "debian/sql/install/virtuoso",
    "content": "USER_CREATE('ontowiki_deb', 'usepwgenhere', vector ('SQL_ENABLE',1));\nGRANT SELECT ON sys_rdf_schema TO ontowiki_deb;\nGRANT execute ON rdfs_rule_set TO ontowiki_deb;\nUSER_GRANT_ROLE('ontowiki_deb', 'SPARQL_SELECT', 0);\nUSER_GRANT_ROLE('ontowiki_deb', 'SPARQL_UPDATE', 0);\nUSER_GRANT_ROLE('ontowiki_deb', 'administrators', 0);\n"
  },
  {
    "path": "extensions/account/AccountController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Component controller for user account related stuff\n *\n * @category   OntoWiki\n * @package    Extensions_Account\n * @author     Christoph Rieß <c.riess.dev@googlemail.com>, Norman Heino <norman.heino@gmail.com>\n */\nclass AccountController extends OntoWiki_Controller_Component\n{\n    /**\n     * Handles identity recovery operations\n     */\n    public function recoverAction()\n    {\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        $config    = Erfurt_App::getInstance()->getConfig();\n        $translate = $this->_owApp->translate;\n\n        // start in phase 0\n        $phase     = 0;\n        $success   = true;\n        $translate = $this->_owApp->translate;\n\n        // check available params\n        // phase 1 is generation of hash taking recovery measures (mailing etc...)\n        $params['for'] = $this->getParam('for');\n        if (empty($params['for'])) {\n            unset($params['for']);\n        } else {\n            $this->view->identity = $params['for'];\n            $phase                = 1;\n        }\n\n        // phase 2 for entering new password\n        $params['hash'] = $this->getParam('hash');\n        if (empty($params['hash'])) {\n            unset($params['hash']);\n        } else {\n            $this->view->hash = $params['hash'];\n            $phase            = 2;\n        }\n\n        // phase 3 for cleanup and password change in ow system\n        $params['password_o'] = $this->getParam('password_o');\n        $params['password_r'] = $this->getParam('password_r');\n        if (empty($params['hash']) || empty($params['password_o']) || empty($params['password_r'])) {\n            unset($params['password_o']);\n            unset($params['password_r']);\n        } else {\n            $phase = 3;\n        }\n\n        $title = sprintf($translate->_('Account Recovery Stage %s'), ($phase + 1) . ' / 4');\n\n        $this->view->placeholder('main.window.title')->set($title);\n        $this->view->phase = $phase;\n\n        $recoveryObject = new Erfurt_Auth_Identity_Recovery();\n\n        try {\n\n            switch ($phase) {\n                case 0:\n                    break;\n                case 1:\n                    $userInfo = $recoveryObject->validateUser($params['for']);\n\n                    $tplDir = $this->_componentRoot . 'templates/';\n\n                    $userUri  = $userInfo['userUri'];\n                    $template = array();\n\n                    $template['mailSubject'] = $translate->_('OntoWiki Account Recovery');\n                    $template['mailTo']      = $userInfo[$config->ac->user->mail];\n                    $template['mailUser']    = $userInfo[$config->ac->user->name];\n\n                    $url = new OntoWiki_Url();\n                    $url->setParam('controller', 'account');\n                    $url->setParam('action', 'recover');\n                    $url->setParam('hash', $userInfo['hash']);\n                    $url->setParam('for', null);\n\n                    $this->view->recoveryUrl = (string)$url;\n\n                    $this->view->username = $userInfo[$config->ac->user->name];\n\n                    $txtFile = 'mail/text/' . $this->_owApp->translate->getLocale() . '.txt';\n                    if (file_exists($tplDir . $txtFile)) {\n                        $template['contentText'] = $this->view->render($txtFile);\n                    } else {\n                        $template['contentText'] = $this->view->render('mail/text/default.txt');\n                    }\n\n                    $htmlFile = 'mail/html/' . $this->_owApp->translate->getLocale() . '.phtml';\n                    if (file_exists($tplDir . $htmlFile)) {\n                        $template['contentHtml'] = $this->view->render($htmlFile);\n                    } else {\n                        $template['contentHtml'] = $this->view->render('mail/html/default.phtml');\n                    }\n\n                    $recoveryObject->setTemplate($template);\n\n                    $success = $recoveryObject->recoverWithIdentity($userUri);\n                    break;\n                case 2:\n                    $success = $recoveryObject->validateHash($params['hash']);\n                    break;\n                case 3:\n                    $success = $recoveryObject->resetPassword(\n                        $params['hash'],\n                        $params['password_o'],\n                        $params['password_r']\n                    );\n                    break;\n                default:\n                    break;\n            }\n\n        } catch (Erfurt_Exception $e) {\n            $success = false;\n            $message = $translate->_($e->getMessage());\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message($message, OntoWiki_Message::ERROR)\n            );\n        }\n\n        // show toolbar if not in last phase and no errors occured\n        if ($success && $phase < 3) {\n            $toolbar = $this->_owApp->toolbar;\n            $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Submit'));\n            $this->view->placeholder('main.window.toolbar')->set($toolbar);\n        }\n\n        if (!$success) {\n            $title = $translate->_('Account Recovery Error');\n            $this->view->placeholder('main.window.title')->set($title);\n        }\n\n        $this->view->success       = $success;\n        $this->view->formActionUrl = $this->_config->urlBase . 'account/recover';\n        $this->view->formEncoding  = 'multipart/form-data';\n        $this->view->formClass     = 'simple-input input-justify-left';\n        $this->view->formMethod    = 'post';\n        $this->view->formName      = 'accountrecovery';\n    }\n}\n"
  },
  {
    "path": "extensions/account/LoginModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki login module\n *\n * Provides the OntoWiki application menu and a search field\n *\n * @category   OntoWiki\n * @package    Extensions_Account\n * @author     Norman Heino <norman.heino@gmail.com>\n */\nclass LoginModule extends OntoWiki_Module\n{\n    /**\n     * Returns the message of the module\n     *\n     * @return array\n     */\n    public function getMessage()\n    {\n        if ($authResult = $this->_owApp->authResult) {\n\n            // Translate partial messages before creation of message box\n            $translate = OntoWiki::getInstance()->translate;\n\n            $message = $translate->translate($authResult[0]);\n\n            $message .= '<a href=\"' . $this->view->urlBase . 'account/recover\"> '\n                . $translate->translate('Forgot your password?')\n                . ' </a>';\n\n            // create messagebox for loginbox (no escape for html code)\n            $message = new OntoWiki_Message(\n                $message,\n                OntoWiki_Message::ERROR,\n                array('escape' => false, 'translate' => false)\n            );\n            unset($this->_owApp->authResult);\n\n            return $message;\n        }\n    }\n\n    /**\n     * Returns the content for the model list.\n     */\n    public function getContents()\n    {\n        $request = $this->_owApp->request;\n        $url     = $request->getServer('REQUEST_URI');\n\n        $data = array(\n            'actionUrl'   => $this->_config->urlBase . 'application/login',\n            'redirectUri' => urlencode((string)$url)\n        );\n\n        if ($this->_erfurt->getAc()->isActionAllowed('RegisterNewUser')\n            && !(isset($this->_owApp->config->ac)\n            && ((boolean)$this->_owApp->config->ac->deactivateRegistration === true))\n        ) {\n            $data['showRegisterButton']      = true;\n            $data['registerActionUrl']       = $this->_config->urlBase . 'application/register';\n            $data['openIdRegisterActionUrl'] = $this->_config->urlBase . 'application/openidreg';\n            $data['webIdRegisterActionUrl']  = $this->_config->urlBase . 'application/webidreg';\n        } else {\n            $data['showRegisterButton'] = false;\n        }\n\n        // insert subtemplates according to the allow array in the config\n        $content = array();\n        foreach ($this->_privateConfig->allow as $template => $value) {\n            if ($value == 1) {\n                $content[$template] = $this->render('templates/' . $template, $data);\n            }\n        }\n\n        return $content;\n    }\n\n    public function shouldShow()\n    {\n        if ($this->_owApp->erfurt->getAc() instanceof Erfurt_Ac_None) {\n            return false;\n        }\n\n        if (!$this->_owApp->user || $this->_owApp->user->isAnonymousUser()) {\n            return true;\n        }\n\n        return false;\n    }\n\n    public function allowCaching()\n    {\n        // no caching\n        return false;\n    }\n\n    public function getTitle()\n    {\n        return \"Login\";\n    }\n}\n"
  },
  {
    "path": "extensions/account/default.ini",
    "content": ";;\n; Static module configuration\n;;\nenabled     = true\nname        = \"Login Module\"\ndescription = \"provides a login module and a recover action.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\ncaching     = yes\npriority    = 40\ncontexts[] = \"main.sidewindows\"\ntemplates  = \"templates\"\nlanguages  = \"languages\"\n\n[private]\n\n; local username + pass\nallow.local  = true\n; remote WebIDs, currently broken\nallow.webid  = false\n; remote OpenIDs\nallow.openid = true\n\n"
  },
  {
    "path": "extensions/account/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/account/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :account .\n:account a doap:Project ;\n  doap:name \"account\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/account/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Login Module\" ;\n  doap:description \"provides a login module and a recover action.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:templates \"templates\" ;\n  owconfig:languages \"languages\" ;\n  owconfig:hasModule :Default .\n:Default a owconfig:Module ;\n  rdfs:label \"Default\" ;\n  owconfig:caching \"true\"^^xsd:boolean ;\n  owconfig:priority \"40\" ;\n  owconfig:context \"main.sidewindows\" .\n:account owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"allow\";\n      :local \"true\"^^xsd:boolean ;\n      :webid \"false\"^^xsd:boolean ;\n      :openid \"true\"^^xsd:boolean\n] ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/account/languages/account-de.csv",
    "content": "Account Recovery Stage %s;Account Wiederherstellung Abschnitt %s\nAccount Recovery Error;Account Wiederherstellung Fehler\nInvalid recovery session identifier.;Ungültige Wiederherstellungssitzungskennung.\nYou received a mail with further information for account %s. Please follow these instructions to reset your password.;Sie haben eine E-Mail mit weiteren Informationen zu dem Account %s erhalten. Bitte folgen sie diesen Anweisungen um ihr Passwort wiederherzustellen.\nYou should able to login with your new password now.;Sie können sich nun mit ihrem neuen Passwort anmelden.\nUsername or email;Benutzername oder E-Mail\nlocal;Lokal\nopenid;OpenID\nwebid;WebID\n\n"
  },
  {
    "path": "extensions/account/languages/account-en.csv",
    "content": "Account Recovery Stage %s\nAccount Recovery Error\nInvalid recovery session identifier.\nYou received a mail with further information for account %s. Please follow these instructions to reset your password.\nYou should able to login with your new password now.\nUsername or email\nlocal;Local\nopenid;OpenID\nwebid;WebID\n"
  },
  {
    "path": "extensions/account/templates/account/recover.phtml",
    "content": "<?php\n\n/**\n * OntoWiki account recovery template\n *\n * @author Norman Heino <norman.heino@gmail.com>\n * @author Philipp Frischmuth <pfrischmuth@googlemail.com>\n * @author Christoph Rieß <c.riess.dev@googlemail.com>\n */\n\n?>\n<?php if ($this->success) { ?>\n\n    <?php switch ($this->phase) {\n    case 0: ?>\n        <fieldset class=\"activeForm\" id=\"upload\">\n            <div>\n                <label for=\"for\"><?php echo $this->_('Username or email') . ' : '; ?></label>\n                <input type=\"text\" class=\"text\" id=\"for\" name=\"for\" />\n                <br class=\"clearall\" />\n            </div>\n        </fieldset>\n    <?php break; ?>\n\n    <?php case 1: ?>\n        <p>\n            <?php $message = $this->_('You received a mail with further information for account %s. Please follow these instructions to reset your password.'); ?>\n            <?php echo sprintf($message, $this->identity); ?>\n        </p>\n    <?php break; ?>\n\n    <?php case 2: ?>\n        <fieldset class=\"activeForm\" id=\"upload\">\n            <div>\n                <label for=\"password_o\"><?php echo $this->_('Password') ?></label>\n                <input class=\"text\" id=\"password_o\" type=\"password\" name=\"password_o\" />\n                <br class=\"clearall\" />\n            </div>\n            <div>\n                <label for=\"password_r\"><?php echo $this->_('Password (repeat)') ?></label>\n                <input class=\"text\" id=\"password_r\" type=\"password\" name=\"password_r\" />\n                <br class=\"clearall\" />\n            </div>\n            <div>\n                <input type=\"hidden\" name=\"hash\" value=\"<?php echo $this->hash; ?>\"/>\n                <br class=\"clearall\" />\n            </div>\n        </fieldset>\n    <?php break; ?>\n\n    <?php case 3: ?>\n        <div><?php echo $this->_('You should able to login with your new password now.'); ?></div>\n    <?php break; ?>\n\n    <?php } ?>\n\n<?php } ?>\n"
  },
  {
    "path": "extensions/account/templates/local.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki login module template\n */\n\n?>\n<form method=\"post\" action=\"<?php echo $this->actionUrl ?>\" class=\"simple-input input-justify-left\" name=\"locallogin\">\n    <input type=\"hidden\" name=\"logintype\" value=\"locallogin\" />\n    <fieldset>\n        <input type=\"hidden\" name=\"redirect-uri\" value=\"<?php echo $this->redirectUri ?>\" />\n        <div>\n            <label for=\"username\"><?php echo $this->_('Username') ?></label>\n            <input class=\"text focusNextOnEnter\" type=\"text\" id=\"username\" name=\"username\" value=\"\" />\n            <br class=\"clearall\" />\n        </div>\n        <div>\n            <label for=\"password\"><?php echo $this->_('Password') ?></label>\n            <input class=\"password submitOnEnter\" type=\"password\" id=\"password\" name=\"password\" />\n            <br class=\"clearall\" />\n        </div>\n        <div>\n            <label class=\"checkboxradio\">\n                <input class=\"checkbox\" type=\"checkbox\" id=\"login-save\" name=\"login-save\" />\n                <?php echo $this->_('Remember me') ?>\n            </label>\n            <br class=\"clearall\" />\n        </div>\n        <div class=\"actionbuttons\">\n                <a id=\"locallogin\" class=\"minibutton submit\"><?php echo $this->_('Login') ?></a>\n        <?php if ($this->showRegisterButton) : ?>\n                    <a class=\"minibutton\" href=\"<?php echo $this->registerActionUrl; ?>\"><?php echo $this->_('Register') ?></a>\n        <?php endif; ?>\n        </div>\n    </fieldset>\n</form>\n"
  },
  {
    "path": "extensions/account/templates/mail/html/default.phtml",
    "content": "<?php // Template for mail (HTML) ?>\n<div>\n    <h2>This is an automatic account recovery mail for OntoWiki</h2>\n\n    <p>Please open the following \n        <a href=\"<?php echo $this->recoveryUrl; ?>\"> link </a>\n        to reset the password for user <?php echo $this->username; ?>\n    </p>\n    <p>\n        Do not reply to this mail.\n    </p>\n</div>\n"
  },
  {
    "path": "extensions/account/templates/mail/text/default.txt",
    "content": "<?php // Template for mail (TEXT) ?>\nThis is an automatic account recovery mail for OntoWiki\n\nPlease open the following link : <?php echo $this->recoveryUrl; ?> to reset the password for user <?php echo $this->username; ?>\n\nDo not reply to this mail.\n"
  },
  {
    "path": "extensions/account/templates/openid.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki login module template\n */\n\n?>\n<form method=\"post\" action=\"<?php echo $this->actionUrl ?>\" class=\"simple-input input-justify-left\" name=\"openidlogin\">\n    <input type=\"hidden\" name=\"logintype\" value=\"openidlogin\" />\n    <fieldset>\n        <input type=\"hidden\" name=\"redirect-uri\" value=\"<?php echo $this->redirectUri ?>\" />\n        <div>\n            <label for=\"openid_url\" class=\"openid\"><?php echo $this->_('OpenID') ?></label>\n            <input class=\"text submitOnEnter\" type=\"text\" id=\"openid_url\" name=\"openid_url\" value=\"\" />\n            <br class=\"clearall\" />\n        </div>\n        <div class=\"actionbuttons\">\n            <a id=\"openidlogin\" class=\"minibutton submit\"><?php echo $this->_('Login') ?></a>\n            <?php if ($this->showRegisterButton) : ?>\n            <a class=\"minibutton\" href=\"<?php echo $this->openIdRegisterActionUrl; ?>\"><?php echo $this->_('Register') ?></a>\n            <?php endif; ?>\n        </div>\n    </fieldset>\n</form>\n"
  },
  {
    "path": "extensions/account/templates/webid.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki login module template\n */\n\n?>\n<form method=\"post\" action=\"<?php echo $this->actionUrl ?>\" class=\"simple-input input-justify-left\" name=\"webidlogin\">\n        <input type=\"hidden\" name=\"logintype\" value=\"webidlogin\" />\n        <input type=\"hidden\" name=\"redirect-uri\" value=\"<?php echo $this->redirectUri ?>\" />\n        <div class=\"actionbuttons\">\n            <a id=\"webidlogin\" class=\"minibutton submit\"><?php echo $this->_('Login') ?></a>\n            <?php if ($this->showRegisterButton) : ?>\n                <a class=\"minibutton\" href=\"<?php echo $this->webIdRegisterActionUrl; ?>\"><?php echo $this->_('Register') ?></a>\n            <?php endif; ?>\n        </div>\n</form>\n"
  },
  {
    "path": "extensions/application/ApplicationModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module – application\n *\n * Provides the OntoWiki application menu and a search field\n *\n * @category   OntoWiki\n * @package    Extensions_Application\n */\nclass ApplicationModule extends OntoWiki_Module\n{\n    public function init()\n    {\n\n    }\n\n    /**\n     * Returns the title of the module\n     *\n     * @return string\n     */\n    public function getTitle()\n    {\n        $title = 'OntoWiki';\n\n        if (!($this->_owApp->user instanceof Erfurt_Auth_Identity)) {\n            return $title;\n        }\n\n        if ($this->_owApp->user->isOpenId() || $this->_owApp->user->isWebId()) {\n            if ($this->_owApp->user->getLabel() !== '') {\n                $userName = $this->_owApp->user->getLabel();\n                $userName = OntoWiki_Utils::shorten($userName, 25);\n            } else {\n                $userName = OntoWiki_Utils::getUriLocalPart($this->_owApp->user->getUri());\n                $userName = OntoWiki_Utils::shorten($userName, 25);\n            }\n        } else {\n            if ($this->_owApp->user->getUsername() !== '') {\n                $userName = $this->_owApp->user->getUsername();\n                $userName = OntoWiki_Utils::shorten($userName, 25);\n            } else {\n                $userName = OntoWiki_Utils::getUriLocalPart($this->_owApp->user->getUri());\n                $userName = OntoWiki_Utils::shorten($userName, 25);\n            }\n        }\n\n        if (isset($userName) && $userName !== 'Anonymous') {\n            $title .= ' (' . $userName . ')';\n        }\n\n        return $title;\n    }\n\n    /**\n     * Maybe we should disable the app module in some case?\n     *\n     * @return string\n     */\n    public function shouldShow()\n    {\n        if ($this->_privateConfig->hideForAnonymousOnNoModels\n            && $this->_owApp->user->isAnonymousUser()\n        ) {\n            // show only if there are models (visible or hidden)\n            if ($this->_store->getAvailableModels(true)) {\n                return true;\n            } else {\n                return false;\n            }\n        } else {\n            return true;\n        }\n    }\n\n    /**\n     * Returns the menu of the module\n     *\n     * @return string\n     */\n    public function getMenu()\n    {\n        return OntoWiki_Menu_Registry::getInstance()->getMenu('application');\n    }\n\n    /**\n     * Returns the content for the model list.\n     */\n    public function getContents()\n    {\n        $data = array(\n            'actionUrl'       => $this->_config->urlBase . 'application/search/',\n            'modelSelected'   => isset($this->_owApp->selectedModel),\n            'searchtextinput' => $this->_request->getParam('searchtext-input')\n        );\n\n        if (null !== ($logo = $this->_owApp->erfurt->getStore()->getLogoUri())) {\n            $data['logo']     = $logo;\n            $data['logo_alt'] = 'Store Logo';\n        }\n        if ($this->_owApp->selectedModel) {\n            $data['showSearch'] = true;\n        } else {\n            $data['showSearch'] = false;\n        }\n\n        $content = $this->render('application', $data);\n\n        return $content;\n    }\n\n    public function allowCaching()\n    {\n        // no caching\n        return false;\n    }\n}\n"
  },
  {
    "path": "extensions/application/application.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki application module template\n *\n * @version $Id$\n */\n\n?>\n\n<form method=\"GET\" action=\"<?php echo $this->actionUrl ?>\">\n\t<?php if ($this->showSearch) : ?>\n\t<p class=\"width98\">\n\t\t<label class=\"display-block\" for=\"searchtext-input\"><?php echo $this->_('Search for Resources') ?></label>\n\t\t<input class=\"text width99 inner-label\" type=\"text\" id=\"searchtext-input\" name=\"searchtext-input\" value=\"<?php echo $this->searchtextinput ?>\" />\n\t</p>\n\t<?php endif; ?>\n\t<p>\n\t\t<?php if ($this->has('logo')): ?>\n\t\t    <img src=\"<?php echo $this->logo ?>\" style=\"float:right;vertical-align:bottom\" alt=\"<?php echo $this->logo_alt ?>\" />\n\t\t<?php endif; ?>\n\t</p>\n</form>\n"
  },
  {
    "path": "extensions/application/default.ini",
    "content": ";;\n; Static module configuration\n;;\nenabled    = true\nname        = \"Application Module\"\ndescription = \"provides the application module with search input and main menu.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\ncaching    = no\npriority   = 1\ncontexts[] = \"main.sidewindows\"\n\n[private]\n\n; this option hides the application module for the anonymous user\n; if there are no available models for the anonymous user\nhideForAnonymousOnNoModels = no\n\n"
  },
  {
    "path": "extensions/application/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/application/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :application .\n:application a doap:Project ;\n  doap:name \"application\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/application/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Application Module\" ;\n  doap:description \"provides the application module with search input and main menu.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:hasModule :Default .\n:Default a owconfig:Module ;\n  rdfs:label \"Default\" ;\n  owconfig:caching \"false\"^^xsd:boolean ;\n  owconfig:priority \"1\" ;\n  owconfig:context \"main.sidewindows\" .\n:application :hideForAnonymousOnNoModels \"false\"^^xsd:boolean ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/auth/AuthController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Controller/Component.php';\n\n/**\n * Controller class for auth component.\n *\n * @category   OntoWiki\n * @package    Extensions_Auth\n * @copyright  Copyright (c) 2012 {@link http://aksw.org aksw}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass AuthController extends OntoWiki_Controller_Component\n{\n    public function certAction()\n    {\n        $translate = $this->_owApp->translate;\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n        $this->_helper->viewRenderer->setScriptAction('cert1');\n        $this->view->placeholder('main.window.title')->set($translate->_('Create Certificate - Step 1'));\n\n        require_once 'Erfurt/Auth/Adapter/FoafSsl.php';\n        if (!Erfurt_Auth_Adapter_FoafSsl::canCreateCertificates()) {\n            $this->view->errorFlag = true;\n            require_once 'OntoWiki/Message.php';\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message(\n                    $translate->_('The creation of self signed certificates is not supported.'),\n                    OntoWiki_Message::ERROR\n                )\n            );\n\n            return;\n        }\n\n        $this->view->formActionUrl = $this->_config->urlBase . 'auth/cert';\n        $this->view->formMethod    = 'post';\n        $this->view->formClass     = 'simple-input input-justify-left';\n        $this->view->formName      = 'createcert';\n\n        $get  = $this->_request->getQuery();\n        $post = $this->_request->getPost();\n\n        if (empty($get) && empty($post)) {\n            // Initial request... check whether a valid cert is already given and show message if yes.\n\n            $info = Erfurt_Auth_Adapter_FoafSsl::getCertificateInfo();\n            // If $info is false, we have no cert, so we can create one.\n            if ($info !== false) {\n                if (isset($info['foafPublicKey'])) {\n                    // We have a valid id here... we need no cert.\n                    $this->view->errorFlag = true;\n                    require_once 'OntoWiki/Message.php';\n                    $this->_owApp->appendMessage(\n                        new OntoWiki_Message(\n                            sprintf(\n                                $translate->_(\n                                    'You already have a valid identity that you can use to sign in. ' .\n                                    'Your WebID is: <b>%1$s</b>'\n                                ),\n                                $info['webId']\n                            ),\n                            OntoWiki_Message::INFO,\n                            array(\n                                 'escape' => false\n                            )\n                        )\n                    );\n\n                    return;\n                } else {\n                    // We have a valid cert, but the foaf data does not contain the public key info... so show it.\n                    $this->view->errorFlag = true;\n\n                    $message = '<span>' .\n                        sprintf(\n                            $translate->_(\n                                'You already have a valid certificate, but the FOAF data behind your WebID ' .\n                                '<b>%1&s</b> does not contain the right public key infos.<br /> You should add the ' .\n                                'following infos to your FOAF profile: <br /><br /> Modulus <pre>%2$s</pre><br /> ' .\n                                'Exponent <pre>%3$s</pre>',\n                                $info['webId'],\n                                $info['certPublicKey']['modulus'],\n                                hexdec($info['certPublicKey']['exponent'])\n                            )\n                        ) . '</span>';\n\n                    require_once 'OntoWiki/Message.php';\n                    $this->_owApp->appendMessage(\n                        new OntoWiki_Message(\n                            $message,\n                            OntoWiki_Message::INFO,\n                            array(\n                                 'escape' => false\n                            )\n                        )\n                    );\n\n                    return;\n                }\n            }\n\n            // If we reach this, we can show the initial step, where the user enters a webid or generates one.\n            $toolbar = $this->_owApp->toolbar;\n            $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => $translate->_('Check WebID')));\n            $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n            return;\n        }\n\n        if (!empty($post)) {\n            if (isset($post['checkwebid'])) {\n                // Step 1: Check the WebID or create one...\n                $webId = $post['webid-input'];\n                if (trim($webId) === '') {\n                    $this->view->name  = '';\n                    $this->view->email = '';\n                } else {\n                    // Check for metadata\n                    $foafData = Erfurt_Auth_Adapter_FoafSsl::getFoafData($webId);\n\n                    if (isset($foafData[$webId]['http://xmlns.com/foaf/0.1/name'][0]['value'])) {\n                        $this->view->name = $foafData[$webId]['http://xmlns.com/foaf/0.1/name'][0]['value'];\n                    } else {\n                        $this->view->name = '';\n                    }\n\n                    if (isset($foafData[$webId]['http://xmlns.com/foaf/0.1/mbox'][0]['value'])) {\n                        $this->view->email = $foafData[$webId]['http://xmlns.com/foaf/0.1/mbox'][0]['value'];\n                    } else {\n                        $this->view->email = '';\n                    }\n\n                    if (isset($foafData[$webId]['http://xmlns.com/foaf/0.1/depiction'][0]['value'])) {\n                        $this->view->depiction = $foafData[$webId]['http://xmlns.com/foaf/0.1/depiction'][0]['value'];\n                    }\n\n                    $this->view->webid = $webId;\n                }\n\n                // Show step 2\n                $this->_helper->viewRenderer->setScriptAction('cert2');\n                $this->view->placeholder('main.window.title')->set($translate->_('Create Certificate - Step 2'));\n\n                $toolbar = $this->_owApp->toolbar;\n                $toolbar->appendButton(\n                    OntoWiki_Toolbar::SUBMIT,\n                    array('name' => htmlspecialchars($translate->_('Create Certificate & Register')))\n                );\n                $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n                // Message to inform the user that after cert creation he needs to reload\n                $message = $translate->_(\n                    'Please note that you need to return to the start page after certificate creation.'\n                );\n\n                require_once 'OntoWiki/Message.php';\n                $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::INFO));\n\n                return;\n            }\n            if (isset($post['createcert'])) {\n                // Step2: Create the cert...\n                $name = $post['name-input'];\n                if (trim($name) === '') {\n                    // We need a name!\n                    $this->view->errorFlag = true;\n                    require_once 'OntoWiki/Message.php';\n                    $this->_owApp->appendMessage(\n                        new OntoWiki_Message(\n                            $translate->_('The name field must not be empty.'),\n                            OntoWiki_Message::ERROR\n                        )\n                    );\n\n                    return;\n                }\n\n                if (isset($post['webid-input'])) {\n                    // WebId given\n                    $webId = $post['webid-input'];\n                } else {\n                    // Autogenerate WebId\n                    $webId = $this->_generateWebId(str_replace(' ', '', $name));\n                }\n\n                $email = trim($post['email-input']);\n                if ($email !== '' && substr($email, 0, 7) !== 'mailto:') {\n                    $email = 'mailto:' . $email;\n                }\n\n                $cert = Erfurt_Auth_Adapter_FoafSsl::createCertificate(\n                    $webId,\n                    $name,\n                    $email,\n                    $post['pubkey']\n                );\n\n                // Add the user...\n                $auth    = new Erfurt_Auth_Adapter_FoafSsl();\n                $success = $auth->addUser($webId);\n\n                if ($success !== false) {\n                    $store       = Erfurt_App::getInstance()->getStore();\n                    $bnodePrefix = '_:' . md5($webId);\n                    $nodeA       = $bnodePrefix . '_1';\n                    $nodeB       = $bnodePrefix . '_2';\n                    $nodeC       = $bnodePrefix . '_3';\n                    $stmtArray   = array(\n                        $nodeA => array(\n                            EF_RDF_TYPE => array(array(\n                                'type'  => 'uri',\n                                'value' => 'http://www.w3.org/ns/auth/rsa#RSAPublicKey'\n                            )),\n                            'http://www.w3.org/ns/auth/cert#identity' => array(array(\n                                'type'  => 'uri',\n                                'value' => $webId\n                            )),\n                            'http://www.w3.org/ns/auth/rsa#public_exponent' => array(array(\n                                'type'  => 'bnode',\n                                'value' => $nodeB\n                            )),\n                            'http://www.w3.org/ns/auth/rsa#modulus' => array(array(\n                                'type'  => 'bnode',\n                                'value' => $nodeC\n                            ))\n                        ),\n                        $nodeB => array(\n                            'http://www.w3.org/ns/auth/cert#decimal' => array(array(\n                                'type'  => 'literal',\n                                'value' => $cert['exponent']\n                            ))\n                        ),\n                        $nodeC => array(\n                            'http://www.w3.org/ns/auth/cert#hex' => array(array(\n                                'type'  => 'literal',\n                                'value' => $cert['modulus']\n                            ))\n                        )\n                    );\n\n                    $store->addMultipleStatements('http://localhost/OntoWiki/Config/', $stmtArray, false);\n                }\n\n                header(\"Content-Type: application/x-x509-user-cert\");\n                echo $cert['certData'];\n\n                return;\n            }\n        }\n\n        $config = $this->_config;\n\n        $this->view->formActionUrl = $this->_config->urlBase . 'auth/cert';\n        $this->view->formMethod    = 'post';\n        $this->view->formClass     = 'simple-input input-justify-left';\n        $this->view->formName      = 'createcert';\n        $this->view->username      = '';\n        $this->view->readonly      = '';\n        $this->view->email         = '';\n\n        $toolbar = $this->_owApp->toolbar;\n        $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => $translate->_('Create Certificate')))\n            ->appendButton(OntoWiki_Toolbar::RESET, array('name' => $translate->_('Reset Form')));\n        $this->view->placeholder('main.window.toolbar')->set($toolbar);\n    }\n\n    public function usersAction()\n    {\n// TODO Make sure that no sensilbe information (pw) is exported...\n        $this->_helper->viewRenderer->setNoRender();\n        $this->_helper->layout->disableLayout();\n\n        if (null === $this->_request->id) {\n            echo '\"id\" parameter is missing.';\n\n            return;\n        }\n\n        $id       = $this->_config->urlBase . 'auth/users/id/' . $this->_request->id;\n        $modelUri = 'http://localhost/OntoWiki/Config/';\n        $store    = $this->_erfurt->getStore();\n\n        require_once 'Erfurt/Syntax/RdfSerializer.php';\n        $serializer = Erfurt_Syntax_RdfSerializer::rdfSerializerWithFormat('rdfxml');\n        echo $serializer->serializeResourceToString($id, $modelUri, false, false);\n\n        $response = $this->getResponse();\n        $response->setHeader('Content-Type', 'application/rdf+xml', true);\n    }\n\n    public function agentAction()\n    {\n// TODO Do this in a more dynamic way...\n\n        echo '<rdf:RDF xmlns:cert=\"http://www.w3.org/ns/auth/cert#\"\n                 xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"\n                 xmlns:rsa=\"http://www.w3.org/ns/auth/rsa#\"\n                 xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n        \t<foaf:Agent rdf:about=\"' . $this->_privateConfig->auth->agentId . '\" />\n        \t<rsa:RSAPublicKey>\n        \t\t<cert:identity rdf:resource=\"' . $this->_privateConfig->auth->agentId . '\" />\n        \t\t<rsa:public_exponent cert:decimal=\"' . $this->_privateConfig->auth->exponent . '\"/>\n        \t\t<rsa:modulus cert:hex=\"' . $this->_privateConfig->auth->modulus . '\" />\n        \t</rsa:RSAPublicKey>\n        </rdf:RDF>';\n\n        $response = $this->getResponse();\n        $response->setHeader('Content-Type', 'application/rdf+xml', true);\n    }\n\n\n    private function _generateWebId($suffix = '')\n    {\n        $base  = $this->_config->urlBase . 'auth/users/id/';\n        $users = Erfurt_App::getInstance()->getUsers();\n\n        $url = $base . $suffix;\n        if (!isset($users[$url])) {\n            return $url;\n        } else {\n            $i    = 0;\n            $urlB = $url . $i;\n\n            while (true) {\n                if (!isset($users[$urlB])) {\n                    return $urlB;\n                } else {\n                    ++$i;\n                    $urlB = $url . $i;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/auth/default.ini",
    "content": "enabled = true\ntemplates = \"templates/\"\nlanguages = \"languages/\"\nname       = \"Authentification\"\ndescription = \"provides WebID and FOAF+SSL authentification.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\n[private]\n\nauth.agentId  = \"https://localhost/ow_da/auth/agent\"\nauth.exponent = \"65537\"\nauth.modulus  = \"cd98a73faf90a4013ef0477b679fe4415b8c4504823e7586a961dab8a35596fcb1803a4b4966f2515320bada80bbc61342f97405b41fdac4140ddbb12fa360befb71482a6cf886991bda3039ef7ce7fa73c9ecc7796cd3f30ce9726dce1977b426c616b6fae11af480cddf051d8631814006508a377e14fb3c8360cb615989a7\"\n\n\n"
  },
  {
    "path": "extensions/auth/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/auth/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :auth .\n:auth a doap:Project ;\n  doap:name \"auth\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/auth/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  owconfig:templates \"templates/\" ;\n  owconfig:languages \"languages/\" ;\n  rdfs:label \"Authentification\" ;\n  doap:description \"provides WebID and FOAF+SSL authentification.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"auth\";\n      :agentId <https://localhost/ow_da/auth/agent> ;\n      :exponent \"65537\" ;\n      :modulus \"cd98a73faf90a4013ef0477b679fe4415b8c4504823e7586a961dab8a35596fcb1803a4b4966f2515320bada80bbc61342f97405b41fdac4140ddbb12fa360befb71482a6cf886991bda3039ef7ce7fa73c9ecc7796cd3f30ce9726dce1977b426c616b6fae11af480cddf051d8631814006508a377e14fb3c8360cb615989a7\"\n] ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/auth/languages/auth-de.csv",
    "content": "The creation of self signed certificates is not supported.;The creation of self signed certificates is not supported.\nYou already have a valid identity that you can use to sign in. Your WebID is: <b>%1$s</b>;Sie besitzen bereits ein gültiges Zertifikat. Nutzen Sie dieses, um sich anzumelden. Ihre WebID lautet: <b>%1$s</b>\nYou already have a valid certificate, but the FOAF data behind your WebID <b>%1&s</b> does not contain the right public key infos.<br /> You should add the following infos to your FOAF profile: <br /><br /> Modulus <pre>%2$s</pre><br /> Exponent <pre>%3$s</pre>;Sie besitzen bereits ein gültiges Zertifikat, aber die zugehörigen FOAF-Daten (<b>%1&s</b>) enthalten nicht die richtigen Informationen über den öffentlichen Schlüssel.<br /> Sie sollten die folgenden Informationen zu Ihren FOAF-Daten hinzufügen: <br /><br /> Modulus <pre>%2$s</pre><br /> Exponent <pre>%3$s</pre>\nCreate Certificate - Step 1;Zertifikat erstellen - Schritt 1\nCheck WebID;WebID prüfen\nCreate Certificate - Step 2;Zertifikat erstellen - Schritt 2\nCreate Certificate & Register;Zertifikat erstellen & Registrieren\nThe name field must not be empty.;Das Eingabefeld für den Namen darf nicht leer sein.\nReset Form;Formular zurücksetzen\nIf not provided a WebID will be generated.;Wenn Sie keine WebID angeben, wird automatisch eine erstellt.\nWebID;WebID\nName;Ihr Name\nEmail;Email\nPlease note that you need to return to the start page after certificate creation.;Bitte beachten Sie, dass Sie nach der Erstellung des Zertifikats zur Startseite zurückkehren müssen."
  },
  {
    "path": "extensions/auth/languages/auth-en.csv",
    "content": "The creation of self signed certificates is not supported.;The creation of self signed certificates is not supported.\nYou already have a valid identity that you can use to sign in. Your WebID is: <b>%1$s</b>;You already have a valid identity that you can use to sign in. Your WebID is: <b>%1$s</b>\nYou already have a valid certificate, but the FOAF data behind your WebID <b>%1&s</b> does not contain the right public key infos.<br /> You should add the following infos to your FOAF profile: <br /><br /> Modulus <pre>%2$s</pre><br /> Exponent <pre>%3$s</pre>;You already have a valid certificate, but the FOAF data behind your WebID <b>%1&s</b> does not contain the right public key infos.<br /> You should add the following infos to your FOAF profile: <br /><br /> Modulus <pre>%2$s</pre><br /> Exponent <pre>%3$s</pre>\nCreate Certificate - Step 1;Create Certificate - Step 1\nCheck WebID;Check WebID\nCreate Certificate - Step 2;Create Certificate - Step 2\nCreate Certificate & Register;Create Certificate & Register\nThe name field must not be empty.;The name field must not be empty.\nReset Form;Reset Form\nIf not provided a WebID will be generated.;If not provided a WebID will be generated.\nWebID;WebID\nName;Your Name\nEmail;Email\nPlease note that you need to return to the start page after certificate creation.;Please note that you need to return to the start page after certificate creation."
  },
  {
    "path": "extensions/auth/templates/auth/cert1.phtml",
    "content": "<?php\n\n/**\n * OntoWiki user details template\n *\n * @author Norman Heino <norman.heino@gmail.com>\n * @author Philipp Frischmuth <pfrischmuth@googlemail.com>\n * @version $Id: userdetails.phtml 2917 2009-04-21 12:13:33Z norman.heino $\n */\n\n?>\n\n<?php if (!isset($this->errorFlag)): ?>    \n<fieldset>\n\n    <div>\n        <input type=\"hidden\" name=\"checkwebid\" />\n        <label for=\"webid-input\"><?php echo $this->_('WebID') ?></label>\n        <input class=\"text\" id=\"webid-input\" type=\"text\" name=\"webid-input\" />\n        <span style=\"font-size: .8em\"><?php echo $this->_('If not provided a WebID will be generated.') ?></span>\n        <br class=\"clearall\">\n    </div>\n    <div class=\"clearall\"></div>\n</fieldset>\n<?php endif; ?>\n"
  },
  {
    "path": "extensions/auth/templates/auth/cert2.phtml",
    "content": "<?php\n\n/**\n * OntoWiki user details template\n *\n * @author Norman Heino <norman.heino@gmail.com>\n * @author Philipp Frischmuth <pfrischmuth@googlemail.com>\n * @version $Id: userdetails.phtml 2917 2009-04-21 12:13:33Z norman.heino $\n */\n\n?>\n\n<?php if (!isset($this->errorFlag)): ?>    \n<fieldset>\n    <input type=\"hidden\" name=\"createcert\" />\n    <?php if (isset($this->webid)): ?>\n    <div>\n        <label for=\"webid-input\"><?php echo $this->_('WebID') ?></label>\n        <input class=\"text\" id=\"webid-input\" type=\"text\" name=\"webid-input\" disabled=\"disabled\" value=\"<?php echo $this->webid ?>\" />\n        <br class=\"clearall\">\n    </div>\n    <?php endif; ?>\n    \n    <?php if (isset($this->depiction)): ?>\n    <div>\n        <label for=\"depiction-input\"></label>\n        <img src=\"<?php echo $this->depiction ?>\" style=\"width: 100px\" />\n    </div>\n    <?php endif; ?>\n\n    <div>\n        <label for=\"name-input\"><?php echo $this->_('Name') ?></label>\n        <input class=\"text\" id=\"name-input\" type=\"text\" name=\"name-input\" value=\"<?php echo $this->name ?>\" />\n        <br class=\"clearall\">\n    </div>\n    \n    <div>\n        <label for=\"email-input\"><?php echo $this->_('Email') ?></label>\n        <input class=\"text\" id=\"email-input\" type=\"text\" name=\"email-input\" value=\"<?php echo $this->email ?>\" />\n        <br class=\"clearall\">\n    </div>\n    \n    <div>\n        <label for=\"pubkey\"></label>\n        <keygen name=\"pubkey\" challenge=\"wefehfcgvrbtnjrcgbntzervetc4t44657vfergcsdefrfcadsdfretercfercreqfxarvrtc4rx\">\n        <br class=\"clearall\">\n    </div>\n    \n    <div class=\"clearall\"></div>\n</fieldset>\n<?php endif; ?>\n"
  },
  {
    "path": "extensions/autologin/AutologinPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Plugin.php';\n\n/**\n * OntoWiki FOAF+SSL autologin plug-in\n *\n * @category   OntoWiki\n * @package    Extensions_Autologin\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass AutologinPlugin extends OntoWiki_Plugin\n{\n    public function onRouteShutdown($event)\n    {\n        if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) === 'on' && extension_loaded('openssl')) {\n            $app = Erfurt_App::getInstance();\n\n            if ($app->getAuth()->getIdentity()->isAnonymousUser()) {\n                $result = $app->authenticateWithFoafSsl();\n\n                if ($result->isValid()) {\n                    // Redirect to referer page...\n                    require_once 'Zend/Controller/Front.php';\n                    $front = Zend_Controller_Front::getInstance()->getResponse()->setRedirect($_SERVER['HTTP_REFERER']);\n                }\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "extensions/autologin/default.ini",
    "content": "enabled     = false\nname        = AutoLogin\ndescription = \"A plug-in that allows FOAF+SSL based auto login.\"\nauthor      = \"Philipp Frischmuth\"\n\n[events]\n1 = onRouteShutdown\n\n[private]\n"
  },
  {
    "path": "extensions/autologin/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/autologin/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :autologin .\n:autologin a doap:Project ;\n  doap:name \"autologin\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/autologin/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  rdfs:label \"AutoLogin\" ;\n  doap:description \"A plug-in that allows FOAF+SSL based auto login.\" ;\n  owconfig:authorLabel \"Philipp Frischmuth\" ;\n  owconfig:pluginEvent event:onRouteShutdown ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/basicimporter/BasicimporterController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Controller for OntoWiki Basicimporter Extension\n *\n * @category OntoWiki\n * @package  Extensions_Basicimporter\n * @author   Sebastian Tramp <mail@sebastian.tramp.name>\n */\nclass BasicimporterController extends OntoWiki_Controller_Component\n{\n    private $_model = null;\n    private $_post = null;\n\n    /**\n     * init() Method to init() normal and add tabbed Navigation\n     */\n    public function init()\n    {\n        parent::init();\n\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n        // provide basic view data\n        $action = $this->_request->getActionName();\n        $this->view->placeholder('main.window.title')->set('Import Data');\n        $this->view->formActionUrl    = $this->_config->urlBase . 'basicimporter/' . $action;\n        $this->view->formEncoding     = 'multipart/form-data';\n        $this->view->formClass        = 'simple-input input-justify-left';\n        $this->view->formMethod       = 'post';\n        $this->view->formName         = 'importdata';\n        $this->view->supportedFormats = $this->_erfurt->getStore()->getSupportedImportFormats();\n\n        if (!$this->isSelectedModelEditable()) {\n            return;\n        } else {\n            $this->_model = $this->_owApp->selectedModel;\n        }\n\n        // add a standard toolbar\n        $toolbar = $this->_owApp->toolbar;\n        $toolbar->appendButton(\n            OntoWiki_Toolbar::SUBMIT,\n            array('name' => 'Import Data', 'id' => 'importdata')\n        )->appendButton(\n            OntoWiki_Toolbar::RESET,\n            array('name' => 'Cancel', 'id' => 'importdata')\n        );\n        $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n        if ($this->_request->isPost()) {\n            $this->_post = $this->_request->getPost();\n        }\n    }\n\n    public function rdfpasterAction()\n    {\n        $this->view->placeholder('main.window.title')->set('Paste RDF Content');\n\n        if ($this->_request->isPost()) {\n            $post = $this->_request->getPost();\n            $filetype = $post['filetype-paste'];\n            $file = tempnam(sys_get_temp_dir(), 'ow');\n            $temp = fopen($file, 'wb');\n            fwrite($temp, $this->getParam('paste'));\n            fclose($temp);\n            $locator  = Erfurt_Syntax_RdfParser::LOCATOR_FILE;\n\n            try {\n                $this->_import($file, $filetype, $locator);\n            } catch (Exception $e) {\n                $message = $e->getMessage();\n                $this->_owApp->appendErrorMessage($message);\n                return;\n            }\n\n            $this->_owApp->appendSuccessMessage('Data successfully imported.');\n        }\n    }\n\n    public function rdfwebimportAction()\n    {\n        $this->view->placeholder('main.window.title')->set('Import RDF from the Web');\n        $this->addModuleContext('main.window.basicimporter.rdfwebimport');\n\n        if ($this->_request->isPost()) {\n            $postData = $this->_request->getPost();\n            $location = $postData['location'] != '' ? $postData['location'] : (string)$this->_model;\n        } else {\n            // walkthrough paramater is added by the SelectorModule\n            if ($this->_request->getParam('importOptions') == 'walkthrough') {\n                // use model uri as location\n                $location = $this->_request->getParam('m');\n            }\n        }\n\n        if (isset($location)) {\n            try {\n                $filetype = 'rdfxml';\n                $locator  = Erfurt_Syntax_RdfParser::LOCATOR_URL;\n                $this->_import($location, $filetype, $locator);\n            } catch (Exception $e) {\n                $message = $e->getMessage();\n                $this->_owApp->appendErrorMessage($message);\n                return;\n            }\n            $this->_owApp->appendSuccessMessage('Data from ' . $location . ' successfully imported.');\n\n            // redirect to model info\n            if ($this->_request->getParam('importOptions') == 'walkthrough') {\n                $url = new OntoWiki_Url(\n                    array(\n                        'controller' => 'model',\n                        'action' => 'info'\n                    )\n                );\n                $this->_redirect($url, array('code' => 302));\n            }\n        }\n    }\n\n    public function rdfuploadAction()\n    {\n        $this->view->placeholder('main.window.title')->set('Upload RDF Dumps');\n\n        if ($this->_request->isPost()) {\n            $postData = $this->_request->getPost();\n            $upload = new Zend_File_Transfer();\n            $filesArray = $upload->getFileInfo();\n\n            $message = '';\n            switch (true) {\n                case empty($filesArray):\n                    $message = 'upload went wrong. check post_max_size in your php.ini.';\n                    break;\n                case ($filesArray['source']['error'] == UPLOAD_ERR_INI_SIZE):\n                    $message = 'The uploaded files\\'s size exceeds the upload_max_filesize directive in php.ini.';\n                    break;\n                case ($filesArray['source']['error'] == UPLOAD_ERR_PARTIAL):\n                    $message = 'The file was only partially uploaded.';\n                    break;\n                case ($filesArray['source']['error'] >= UPLOAD_ERR_NO_FILE):\n                    $message = 'Please select a file to upload';\n                    break;\n            }\n\n            if ($message != '') {\n                $this->_owApp->appendErrorMessage($message);\n                return;\n            }\n\n            $file = $filesArray['source']['tmp_name'];\n            // setting permissions to read the tempfile for everybody\n            // (e.g. if db and webserver owned by different users)\n            chmod($file, 0644);\n            $locator  = Erfurt_Syntax_RdfParser::LOCATOR_FILE;\n            $filetype = 'auto';\n            // guess file mime type\n            if ($postData['filetype-upload'] != 'auto') {\n                $filetype = $postData['filetype-upload'];\n            } else {\n                // guess file type extension\n                $extension = strtolower(strrchr($filesArray['source']['name'], '.'));\n                if ($extension == '.rdf' || $extension == '.owl') {\n                    $filetype = 'rdfxml';\n                } else if ($extension == '.n3') {\n                    $filetype = 'ttl';\n                } else if ($extension == '.json') {\n                    $filetype = 'rdfjson';\n                } else if ($extension == '.ttl') {\n                    $filetype = 'ttl';\n                } else if ($extension == '.nt') {\n                    $filetype = 'ttl';\n                }\n            }\n\n            try {\n                $this->_import($file, $filetype, $locator);\n            } catch (Exception $e) {\n                $message = $e->getMessage();\n                $this->_owApp->appendErrorMessage($message);\n                return;\n            }\n\n            $this->_owApp->appendSuccessMessage('Data successfully imported.');\n        }\n    }\n\n    private function _import($fileOrUrl, $filetype, $locator)\n    {\n        $modelIri = (string)$this->_model;\n\n        try {\n            $this->_erfurt->getStore()->importRdf($modelIri, $fileOrUrl, $filetype, $locator);\n        } catch (Erfurt_Exception $e) {\n            // re-throw\n            throw new OntoWiki_Controller_Exception(\n                'Could not import given model: ' . $e->getMessage(),\n                0,\n                $e\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/basicimporter/BasicimporterPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2013-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * The main class for the basicimporter plugin.\n *\n * @category   OntoWiki\n * @package    Extensions_Basicimporter\n * @author     Sebastian Tramp <tramp@informatik.uni-leipzig.de>\n */\nclass BasicimporterPlugin extends OntoWiki_Plugin\n{\n    /*\n     * our event method\n     */\n    public function onProvideImportActions($event)\n    {\n        $this->provideImportActions($event);\n    }\n\n    /**\n     * Listen for the store initialization event\n     */\n    public function onSetupStore($event)\n    {\n     //   $this->importModels();\n    }\n\n    /*\n     * here we add new import actions\n     */\n    private function provideImportActions($event)\n    {\n        $myImportActions = array(\n            'basicimporter-rdfweb' => array(\n                'controller' => 'basicimporter',\n                'action' => 'rdfwebimport',\n                'label' => 'Import an RDF resource from the web',\n                'description' => 'Tries to fetch a graph from the web.'\n            ),\n            'basicimporter-rdfupload' => array(\n                'controller' => 'basicimporter',\n                'action' => 'rdfupload',\n                'label' => 'Upload an RDF Dump',\n                'description' => 'Parse and import turtle, ntriples, rdfxml and other dumps.'\n            ),\n            'basicimporter-rdfpaster' => array(\n                'controller' => 'basicimporter',\n                'action' => 'rdfpaster',\n                'label' => 'Paste Source',\n                'description' => 'Parses and import turtle, ntriples and rdfxml import from a textfield.'\n            ),\n        );\n\n        // sad but true, some php installation do not allow this\n        if (!ini_get('allow_url_fopen')) {\n            unset($myImportActions['basicimporter-rdfwebimport']);\n        }\n\n        $event->importActions = array_merge($event->importActions, $myImportActions);\n        return $event;\n    }\n\n    private function importModels()\n    {\n        // read config for models to import\n        $owApp = OntoWiki::getInstance();\n        $models = $this->_privateConfig->setup->model->toArray();\n        foreach ($models as $info) {\n            // import models\n            $path = ONTOWIKI_ROOT . '/' . $info['path'];\n            $uri = $info['uri'];\n            $hidden = $info['hidden'];\n            $this->_import($uri, $path);\n        }\n    }\n\n    private function _import($modelIri, $fileOrUrl)\n    {\n        try {\n            Erfurt_App::getInstance()->getStore()->importRdf($modelIri, $fileOrUrl);\n        } catch (Erfurt_Exception $e) {\n            // re-throw\n            throw new OntoWiki_Controller_Exception(\n                'Could not import given model: ' . $e->getMessage(),\n                0,\n                $e\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/basicimporter/SelectorModule.js",
    "content": "/*global document,$,alert,console */\n/*jslint browser: true, vars: true, plusplus: true */\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module - selector module script compontent\n *\n * @category OntoWiki\n * @package  OntoWiki_Extensions_basicimporter\n * @author   Sebastian Tramp <mail@sebastian.tramp.name>\n */\n\n$(document).ready(function () {\n    'use strict';\n\n    /* defined entry points */\n    var lovSearchInput = $(\"#lov-search-input\"),\n        lovSearchResults = $(\".lov-search-result\");\n\n    /*\n     * convert xml (esp. sparql xml resultset) to json objects\n     * http://stackoverflow.com/questions/7769829/\n     * */\n    var xmlToJson = function (xml) {\n        var obj = {};\n        if (xml.nodeType === 1) {\n            if (xml.attributes.length > 0) {\n                var j = 0;\n                obj[\"@attributes\"] = {};\n                for (j = 0; j < xml.attributes.length; j++) {\n                    var attribute = xml.attributes.item(j);\n                    obj[\"@attributes\"][attribute.nodeName] = attribute.nodeValue;\n                }\n            }\n        } else if (xml.nodeType === 3) {\n            obj = xml.nodeValue;\n        }\n        if (xml.hasChildNodes()) {\n            var i = 0;\n            for (i = 0; i < xml.childNodes.length; i++) {\n                var item = xml.childNodes.item(i);\n                var nodeName = item.nodeName;\n                if (typeof (obj[nodeName]) === \"undefined\") {\n                    obj[nodeName] = xmlToJson(item);\n                } else {\n                    if (typeof (obj[nodeName].push) === \"undefined\") {\n                        var old = obj[nodeName];\n                        obj[nodeName] = [];\n                        obj[nodeName].push(old);\n                    }\n                    obj[nodeName].push(xmlToJson(item));\n                }\n            }\n        }\n        return obj;\n    };\n\n    var flushSchemaTable = function (data, textStatus, jqXHR, callback) {\n        var xmlDocument = xmlToJson(data),\n            results = xmlDocument.sparql.results.result,\n            i = 0;\n\n        if ((typeof results !== 'undefined') && (results.length > 0)) {\n            var prefix, namespace, title;\n            for (i = 0; i < results.length; i++) {\n                prefix    = results[i].binding[0].literal['#text'];\n                namespace = results[i].binding[1].uri['#text'];\n                title     = results[i].binding[2].literal['#text'];\n\n                // create list\n                // <li><a class=\"even lov-search-result\" data-prefix=\"skos\" data-namespace=\"http://www.w3.org/2004/02/skos/core#\">SKOS Vocabulary</a></li>\n                $('#lov-search-output').append(\n                    '<li> ' +\n                        '<a class=\"even lov-search-result\" ' +\n                        'data-prefix=\"' + prefix + '\" ' +\n                        'data-namespace=\"' + namespace + '\">' +\n                        title +\n                        '</a>' +\n                        '</li>'\n                );\n            }\n        } else {\n            $('#lov-search-output').append('<li>Sorry, nothing found</li>');\n        }\n        $('#lov-search-input').removeClass('is-processing');\n        $('#lov-search-output').slideDown();\n    };\n\n    /* query the LOV endpoint with SPARQL and provide a callback */\n    var lovQuery = function (query, callback) {\n        console.log(query);\n        var parameters = {\n            'service-uri': \"http://lov.okfn.org/endpoint/lov\",\n            query: query\n        };\n        var ajaxOptions = {\n            type: 'GET',\n            timeout: 2000,\n            url: 'http://cstadler.aksw.org/services/sparql-proxy.php',\n            data: parameters,\n            async: true,\n            headers: {\n                'Accept': 'application/sparql-results+xml'\n            },\n            success: flushSchemaTable\n        };\n        $('#lov-search-input').addClass('is-processing');\n        $('#lov-search-output').hide().empty();\n        $.ajax(ajaxOptions);\n    };\n\n    /*\n     * here start the livequery assignments\n     */\n\n    // click to add the data to other input fields\n    lovSearchResults.livequery('click', function (event) {\n        // query for data\n        var prefix    = $(event.target).data('prefix'),\n            namespace = $(event.target).data('namespace'),\n            title     = $(event.target).text();\n\n        // do nothing on incomplete data\n        if ((namespace !== undefined) && (prefix !== undefined)) {\n            // fill and submit the modelconfig form if present\n            var formModelConfig = $(\"form[name|='modelconfig']\");\n            if (formModelConfig.length === 1) {\n                formModelConfig.find(\"input[name|='new_prefix_prefix']\").attr(\"value\", prefix);\n                formModelConfig.find(\"input[name|='new_prefix_namespace']\").attr(\"value\", namespace);\n                formModelConfig.find(\"a.submit\").trigger('click');\n            }\n            // fill and submit the createmodel form if present\n            var formCreateModel = $(\"form[name|='createmodel']\");\n            if (formCreateModel.length === 1) {\n                formCreateModel.find(\"input[name|='title']\").attr(\"value\", title);\n                formCreateModel.find(\"input[name|='modeluri']\").attr(\"value\", namespace);\n                formCreateModel.find(\"input[name|='importOptions']\").attr(\"value\", 'walkthrough');\n                $(\"#import-basicimporter-rdfweb\").attr('checked', 'checked');\n                formCreateModel.find(\"a.submit\").trigger('click');\n            }\n            // fill and submit the Import from the web form if present\n            if ($(\"#importdata\").length === 1) {\n                if ($(\"#location-input\").length === 1) {\n                    $(\"#location-input\").attr(\"value\", namespace);\n                    $(\"form[name|='importdata'] a.submit\").trigger('click');\n                }\n            }\n\n        }\n    });\n\n    // do not search until user pressed enter\n    lovSearchInput.livequery('keypress', function (event) {\n        if ((event.which === 13) && (event.currentTarget.value !== '')) {\n            // do search here\n            var queryString = $(event.currentTarget).val();\n            $(event.currentTarget).val('');\n            lovQuery(\n                'PREFIX vann:<http://purl.org/vocab/vann/> ' +\n                    'PREFIX voaf:<http://purl.org/vocommons/voaf#> ' +\n                    'PREFIX dcterms:<http://purl.org/dc/terms/> ' +\n                    'SELECT DISTINCT ?prefix ?namespace ?title ' +\n                    'WHERE{ ' +\n                    '    ?namespace a voaf:Vocabulary . ' +\n                    '    ?namespace dcterms:title ?title . ' +\n                    '    ?namespace vann:preferredNamespacePrefix ?prefix . ' +\n                    '    ?namespace ?property ?value . ' +\n                    '    FILTER regex(?value, \".*' + queryString + '.*\", \"i\") }',\n                flushSchemaTable\n            );\n            return false;\n        }\n        if (event.which === 13) {\n            return false;\n        }\n        return true;\n    });\n\n});\n"
  },
  {
    "path": "extensions/basicimporter/SelectorModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module – LOV and prefix.cc vocabulary selection\n *\n * Allows for selection of LOV vocabularies in the model import screen\n *\n * @category OntoWiki\n * @package  OntoWiki_Extensions_basicimporter\n * @author   Sebastian Tramp <mail@sebastian.tramp.name>\n */\nclass SelectorModule extends OntoWiki_Module\n{\n    public function getTitle()\n    {\n        return 'Select a Vocabulary';\n    }\n\n    public function getContents()\n    {\n        $this->view->headScript()->appendFile(\n            $this->_config->urlBase . 'extensions/basicimporter/SelectorModule.js'\n        );\n\n        $data = array();\n        $content  = $this->render('templates/basicimporter/search', $data);\n\n        return $content;\n    }\n}\n"
  },
  {
    "path": "extensions/basicimporter/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <http://ns.ontowiki.net/Extensions/basicimporter/> .\n\n<> foaf:primaryTopic :extension .\n:extension a doap:Project ;\n  doap:name \"basicimporter\" ;\n  owconfig:privateNamespace <http://ns.ontowiki.net/Extensions/basicimporter/> ;\n  owconfig:pluginEvent event:onProvideImportActions, event:onSetupStore ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Basic Data Import Actions\" ;\n  doap:description \"provides import from web an RDF files\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:templates \"templates\" ;\n  owconfig:languages \"languages\" ;\n  doap:release :v1-0 ;\n  owconfig:hasModule :Selector .\n\n:Selector a owconfig:Module ;\n  owconfig:priority \"19\" ;\n  rdfs:label \"LOV Selector\" ;\n  owconfig:context \"main.window.basicimporter.rdfwebimport\", \"main.window.modelcreate\", \"main.window.modelconfig\".\n\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n\n"
  },
  {
    "path": "extensions/basicimporter/languages/basicimporter-de.csv",
    "content": "LovBySearch;Suche\nLovByPrefix;Präfix\nLovByCategory;Kategorie\n\n"
  },
  {
    "path": "extensions/basicimporter/languages/basicimporter-en.csv",
    "content": "LovBySearch;Search\nLovByPrefix;Prefix\nLovByCategory;Category\n\n"
  },
  {
    "path": "extensions/basicimporter/templates/basicimporter/category.phtml",
    "content": "<?php\n/**\n * OntoWiki LOV category template\n */\n?>\n<p class=\"messagebox info\">The Linked Open Vocabulary (LOV) repository categorizes over 300 Semantic Web ontologies</p>\n<p class=\"messagebox error\">Not implemented yet</p>\n"
  },
  {
    "path": "extensions/basicimporter/templates/basicimporter/prefix.phtml",
    "content": "<?php\n/**\n * OntoWiki LOV prefix template\n */\n?>\n<p class=\"messagebox info\">The <a href=\"http://prefix.cc\">prefix.cc service</a> allows for prefix searches.</p>\n<p>\n    <label\n        class=\"display-block onlyAural\"\n        for=\"prefixcc-search-input\">Please type a known prefix.cc prefix</label>\n    <input\n        id=\"prefixcc-search-input\"\n        class=\"text width99 inner-label\"\n        type=\"text\"\n        value=\"\"\n        name=\"prefixcc-search-input\"/>\n</p>\n<p class=\"messagebox error\">Not implemented yet</p>\n"
  },
  {
    "path": "extensions/basicimporter/templates/basicimporter/rdfpaster.phtml",
    "content": "<?php\n/**\n * OntoWiki rdf paste import template\n */\n\n?>\n<fieldset class=\"activeForm\" id=\"importdata\">\n    <legend><?php echo $this->_('Paste Source') ?></legend>\n    <div>\n        <label for=\"filetype-paste-select\"><?php echo $this->_('Format') ?></label>\n        <select name=\"filetype-paste\" id=\"filetype-paste-select\">\n            <?php foreach ($this->supportedFormats as $key => $name): ?>\n                <option value=\"<?php echo $key ?>\"><?php echo $name ?></option>\n            <?php endforeach; ?>\n        </select>\n        <br class=\"clearall\" />\n        <label for=\"code-input\"><?php echo $this->_('Source Code') ?></label>\n        <textarea class=\"code-input\" name=\"paste\"></textarea>\n        <br class=\"clearall\">\n    </div>\n</fieldset>\n"
  },
  {
    "path": "extensions/basicimporter/templates/basicimporter/rdfupload.phtml",
    "content": "<?php\n/**\n * OntoWiki rdf upload import import template\n */\n?>\n<fieldset class=\"activeForm\" id=\"importdata\">\n    <legend><?php echo $this->_('Upload a File') ?></legend>\n    <div>\n    <label for=\"filetype-upload-select\"><?php echo $this->_('File Type') ?></label>\n    <select name=\"filetype-upload\" id=\"filetype-upload-select\">\n        <option value=\"auto\"><?php echo $this->_('Autodetect') ?></option>\n        <?php foreach ($this->supportedFormats as $key => $name): ?>\n            <option value=\"<?php echo $key ?>\"><?php echo $name ?></option>\n        <?php endforeach; ?>\n    </select>\n    <br class=\"clearall\" />\n    </div>\n    <div>\n        <label for=\"file-input\">\n            <?php echo sprintf(\n                $this->_('File (max. %1$sB)'),\n                preg_replace('/([kMG])/', ' $1', ini_get('upload_max_filesize'))\n            ) ?>\n        </label>\n        <input type=\"file\" id=\"file-input\" name=\"source\" />\n        <br class=\"clearall\" />\n    </div>\n</fieldset>\n"
  },
  {
    "path": "extensions/basicimporter/templates/basicimporter/rdfwebimport.phtml",
    "content": "<?php\n/**\n * OntoWiki URL web import template\n */\n?>\n<?php if (ini_get('allow_url_fopen')): ?>\n<fieldset class=\"activeForm\" id=\"importdata\">\n    <legend><?php echo $this->_('Import From the Web') ?></legend>\n    <div>\n        <p class=\"messagebox info\">\n            <?php echo $this->_('Enter the URL where the model should be downloaded from. If you leave the field empty the model URI will be used.') ?>\n        </p>\n        <label for=\"location-input\"><?php echo $this->_('Location') ?></label>\n        <input type=\"text\" class=\"text\" id=\"location-input\" name=\"location\" />\n        <br class=\"clearall\"/>\n    </div>\n</fieldset>\n<?php endif; ?>\n"
  },
  {
    "path": "extensions/basicimporter/templates/basicimporter/search.phtml",
    "content": "<?php\n/**\n * OntoWiki LOV search template\n */\n?>\n<p class=\"messagebox info\">Find vocabularies by searching the <a href=\"http://lov.okfn.org/dataset/lov/\">Linked Open Vocabularies (LOV) repository</a>.</p>\n<p>\n    <label\n        class=\"display-block onlyAural\"\n        for=\"lov-search-input\">Search in LOV Repository</label>\n    <input\n        id=\"lov-search-input\"\n        class=\"text width99 inner-label\"\n        type=\"text\"\n        value=\"\"\n        name=\"navigation-input\"/>\n</p>\n<ul class=\"bullets-none separated has-contextmenus-block\" id=\"lov-search-output\">\n<li><a class=\"even lov-search-result\" data-prefix=\"skos\" data-namespace=\"http://www.w3.org/2004/02/skos/core#\">SKOS Vocabulary</a></li>\n<li><a class=\"odd lov-search-result\" data-prefix=\"foaf\" data-namespace=\"http://xmlns.com/foaf/0.1/\">Friend of a Friend (FOAF) vocabulary</a></li>\n<li><a class=\"even lov-search-result\" data-prefix=\"sioc\" data-namespace=\"http://rdfs.org/sioc/ns#\">SIOC Core Ontology Namespace</a></li>\n<li><a class=\"odd lov-search-result\" data-prefix=\"dc\" data-namespace=\"http://purl.org/dc/elements/1.1/\">Dublin Core Metadata Element Set, Version 1.1</a></li>\n<li><a class=\"even lov-search-result\" data-prefix=\"dct\" data-namespace=\"http://purl.org/dc/terms/\">DCMI Metadata Terms - other</a></li>\n</ul>\n"
  },
  {
    "path": "extensions/bookmarklet/BookmarkletModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module – bookmarklet\n *\n * Shows a bookmarklet link on model info\n *\n * @category  OntoWiki\n * @package   Extensions_Bookmarklet\n * @author    Norman Heino <norman.heino@gmail.com>\n * @author    Sebastian Tramp <tramp@informatik.uni-leipzig.de>\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass BookmarkletModule extends OntoWiki_Module\n{\n    public function getTitle()\n    {\n        return 'Bookmarklet';\n    }\n\n    public function getContents()\n    {\n        $this->view->infoMessage          = 'Use this Bookmarklet to add content to this Knowledge Base.';\n        $this->view->rdfAuthorBase        = $this->_config->libraryUrlBase . 'RDFauthor/';\n        $this->view->defaultGraph         = (string)OntoWiki::getInstance()->selectedModel;\n        $this->view->defaultUpdateService = $this->_config->urlBase . 'update/';\n        $this->view->defaultQueryService  = $this->_config->urlBase . 'sparql/';\n        $this->view->ontoWikiUrl          = $this->_config->urlBase;\n\n        $frontController = Zend_Controller_Front::getInstance();\n        $request         = $frontController->getRequest();\n\n        return $this->render('bookmarklet');\n    }\n\n    public function shouldShow()\n    {\n        // do not show if model is not writeable\n\n        if ($this->_owApp->selectedModel->isEditable()) {\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n}\n\n"
  },
  {
    "path": "extensions/bookmarklet/bookmarklet.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author     Sebastian Dietzold <dietzold@informatik.uni-leipzig.de>\n */\n\n/**\n * OntoWiki bookmarklet module template\n *\n * @author     Sebastian Dietzold <dietzold@informatik.uni-leipzig.de>\n */\n?>\n<?php if ($this->has('warningMessage')): ?>\n    <p class=\"messagebox info\"><?php echo $this->warningMessage ?></p>\n<?php endif; ?>\n<?php if ($this->has('infoMessage')): ?>\n    <p class=\"messagebox info\"><?php echo $this->infoMessage ?></p>\n<?php endif; ?>\n<script type=\"text/javascript\" charset=\"utf-8\">\n    var saveTitle = 'Save to OntoWiki';\n    var windowTitle = 'Extract Triples to OntoWiki at <?php echo $this->ontoWikiUrl ?>';\n    var bmWidgetBase = '<?php echo $this->rdfAuthorBase ?>';\n    var href = '\\\n        href=\"javascript:void((function() {\\\n        RDFAUTHOR_BASE = \\'' + bmWidgetBase + '\\';\\\n        RDFAUTHOR_DEFAULT_GRAPH = \\'<?php echo $this->defaultGraph ?>\\';\\\n        RDFAUTHOR_DEFAULT_UPDATE_ENDPOINT = \\'<?php echo $this->defaultUpdateService ?>\\';\\\n        RDFAUTHOR_DEFAULT_QUERY_ENDPOINT = \\'<?php echo $this->defaultQueryService ?>\\';\\\n        RDFAUTHOR_READY_CALLBACK = function() {\\\n            RDFauthor.setOptions({\\\n                saveButtonTitle: saveTitle,\\\n                cancelButtonTitle: \\'Cancel\\',\\\n                title: windowTitle,\\\n                showAddPropertyButton: false\\\n            });\\\n            RDFauthor.start();\\\n        };\\\n        load = function() {\\\n            var s = document.createElement(\\'script\\');\\\n            s.type = \\'text/javascript\\';\\\n            s.id = \\'rdfauthor-script\\';\\\n            s.src = RDFAUTHOR_BASE + \\'src/rdfauthor.js\\';\\\n            document.getElementsByTagName(\\'head\\')[0].appendChild(s);\\\n        };\\\n        if (typeof jQuery == \\'undefined\\') {\\\n            var j = document.createElement(\\'script\\');\\\n            j.type = \\'text/javascript\\';\\\n            j.src = RDFAUTHOR_BASE + \\'libraries/jquery.js\\';\\\n            j.onload = load;\\\n            document.getElementsByTagName(\\'head\\')[0].appendChild(j);\\\n        } else {\\\n            if (!document.getElementById(\\'rdfauthor-script\\')) {\\\n                load();\\\n            }\\\n        }\\\n    })());\"';\n    \n    // rebuild strings\n    document.writeln('<a ' + \n        href.replace(/[\\s]/g, '')\n            .replace('saveTitle', '\\'' + saveTitle + '\\'')\n            .replace('windowTitle', '\\'' + windowTitle + '\\'')\n            .replace('varj', 'var j').replace('vars', 'var s').replace('vars', 'var s')\n            .replace('typeofjQuery', 'typeof jQuery') + \n        '>Save to OntoWiki with RDFauthor</a>');\n</script>\n"
  },
  {
    "path": "extensions/bookmarklet/default.ini",
    "content": "enabled    = false\nname       = \"RDFauthor Bookmarklet\"\ncaching    = no\npriority   = 19\ncontexts[] = \"main.window.modelinfo\"\ndescription = \"extract rdfa from websites, import to ontowiki, done with RDFauthor delivered in a bookmarklet.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\n[private]\n\n"
  },
  {
    "path": "extensions/bookmarklet/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/bookmarklet/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :bookmarklet .\n:bookmarklet a doap:Project ;\n  doap:name \"bookmarklet\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/bookmarklet/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  rdfs:label \"RDFauthor Bookmarklet\" ;\n  doap:description \"extract rdfa from websites, import to ontowiki, done with RDFauthor delivered in a bookmarklet.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:hasModule :Default .\n:Default a owconfig:Module ;\n  rdfs:label \"Default\" ;\n  owconfig:caching \"false\"^^xsd:boolean ;\n  owconfig:priority \"19\" ;\n  owconfig:context \"main.window.modelinfo\" .\n:bookmarklet doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/ckan/CkanController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * The main ckan controller provides the register and (later) the browser action\n *\n * @category   OntoWiki\n * @package    Extensions_Ckan\n */\nclass CkanController extends OntoWiki_Controller_Component\n{\n    /** @var CKAN registration uri base */\n    protected $_registerBaseUrl = \"http://thedatahub.org/package/new\";\n\n    /**\n     * Constructor\n     */\n    public function init()\n    {\n        // this provides many std controller vars and other stuff ...\n        parent::init();\n        // init controller variables\n        $this->store    = $this->_owApp->erfurt->getStore();\n        $this->_config  = $this->_owApp->config;\n        $this->response = Zend_Controller_Front::getInstance()->getResponse();\n        $this->request  = Zend_Controller_Front::getInstance()->getRequest();\n    }\n\n    /**\n     * search GUI to import CKAN packages into ontowiki\n     * TODO: finish :)\n     */\n    public function browserAction()\n    {\n        $t = $this->_owApp->translate;\n        $this->view->placeholder('main.window.title')->set($t->_('CKAN Package Browser'));\n        $this->addModuleContext('main.window.ckan.browser');\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        echo \"not finished yet\";\n\n        return;\n    }\n\n    /**\n     * forwards to the CKAN registration page with some prefilled values\n     */\n    public function registerAction()\n    {\n        // this action needs no view\n        $this->_helper->viewRenderer->setNoRender();\n        // disable layout\n        $this->_helper->layout()->disableLayout();\n\n        // m (model) is automatically used and selected\n        if ((!isset($this->request->m)) && (!$this->_owApp->selectedModel)) {\n            throw new OntoWiki_Exception('No model pre-selected model and missing parameter m (model)!');\n        } else {\n            $model = $this->_owApp->selectedModel;\n        }\n\n        // get model URI / resource and load description\n        $resourceUri = (string)$model;\n        $resource    = new Erfurt_Rdf_Resource($resourceUri, $model);\n        $description = $resource->getDescription();\n        $description = $description[$resourceUri];\n\n        // fill CKAN parameter\n        $parameter          = array();\n        $parameter['title'] = $model->getTitle();\n        $parameter['url']   = $resourceUri;\n\n        // go through the model info properties and use the first value as\n        // notes value for ckan\n        $infoProperties = $this->_config->descriptionHelper->properties;\n        foreach ($infoProperties as $infoProperty) {\n            if (!isset($parameter['description'])) {\n                if (isset($description[$infoProperty][0]['value'])) {\n                    $parameter['notes'] = $description[$infoProperty][0]['value'];\n                }\n            }\n        }\n\n        // build GET URI from the parameter array to redirect\n        $getparams = '?';\n        foreach ($parameter as $key => $value) {\n            $getparams .= '&' . $key . '=' . urlencode($value);\n        }\n        $redirectUrl = $this->registerBaseUrl . $getparams;\n\n        // redirect to CKANs dataset registration page\n        $this->_response->setRedirect($redirectUrl, $code = 302);\n    }\n}\n\n"
  },
  {
    "path": "extensions/ckan/CkanHelper.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * The ckan component helper (to insert a menu entry)\n *\n * @category   OntoWiki\n * @package    Extensions_Ckan\n */\n\nclass CkanHelper extends OntoWiki_Component_Helper\n{\n    /*\n     * handler for the on onCreateMenu event\n     */\n    public function onCreateMenu($event)\n    {\n        $modelUri         = (string)$event->resource;\n        $baseUrl          = OntoWiki::getInstance()->config->urlBase;\n        $extensionManager = OntoWiki::getInstance()->extensionManager;\n\n        // do NOT create the menu entry ...\n        switch (true) {\n            // ... for resources\n            case (!$event->isModel):\n                // ... for localhost models (can't be registered at CKAN)\n            case (substr_count($modelUri, 'http://localhost') > 0):\n                // ... if the model is not part of the base url (no Linked Data)\n            case (substr_count($modelUri, $baseUrl) !== 1) :\n                // ... if we do not have a linked data server online\n            case (!$extensionManager->isExtensionRegistered('linkeddataserver')):\n                return;\n        }\n\n        // finally, create the holy menu entry and PREPEND it on top of the menu\n        $url = new OntoWiki_Url(\n            array('controller' => 'ckan', 'action' => 'register'),\n            array('m')\n        );\n        $url->setParam('m', $modelUri);\n        $event->menu->prependEntry('Register Knowledge Base @ CKAN', (string)$url);\n    }\n}\n\n"
  },
  {
    "path": "extensions/ckan/default.ini",
    "content": "enabled     = false\nname        = \"CKAN Integration\"\ndescription = \"allows for registration of CKAN datasets from your OntoWiki instance\"\nauthor      = \"Sebastian Tramp\"\nauthorUrl   = \"http://sebastian.tramp.name\"\ntemplates   = \"templates\"\nlanguages   = \"languages\"\n\nhelperEvents[] = \"onCreateMenu\"\n[private]\nfeatures.registration = enabled\n\n"
  },
  {
    "path": "extensions/ckan/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/ckan/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :ckan .\n:ckan a doap:Project ;\n  doap:name \"ckan\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/ckan/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  rdfs:label \"CKAN Integration\" ;\n  doap:description \"allows for registration of CKAN datasets from your OntoWiki instance\" ;\n  owconfig:authorLabel \"Sebastian Tramp\" ;\n  doap:maintainer <http://sebastian.tramp.name> ;\n  owconfig:templates \"templates\" ;\n  owconfig:languages \"languages\" ;\n  owconfig:helperEvent event:onCreateMenu ;\n  owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"features\";\n      :registration \"enabled\"\n] ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/ckan/templates/ckan/browser.phtml",
    "content": "<p class=\"messagebox info\">Search for a CKAN datasets and upload it to a new Knowledge Base</p>\n\n<?php if (isset($this->data)) : ?>\n<ul>\n<?php foreach ($this->data as $package) : ?>\n<li><?php echo $package->title ?></li>\n<?php endforeach; ?>\n</ul>\n<?php endif; ?>\n"
  },
  {
    "path": "extensions/community/CommentModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module – comment\n *\n * Allows to post a comment about a resource and show thes last activities refering to this resource\n *\n * @category   OntoWiki\n * @package    Extensions_Community\n * @author     Norman Heino <norman.heino@gmail.com>\n * @author     Sebastian Tramp <mail@sebastian.tramp.name>\n * @author     Natanael Arndt <arndtn@gmail.com>\n */\nclass CommentModule extends OntoWiki_Module\n{\n    public function init()\n    {\n    }\n\n    public function getTitle()\n    {\n        return 'Latest Comments';\n    }\n\n    public function getContents()\n    {\n        $content = '';\n\n        // comment form part\n        if ((isset($this->_owApp->selectedModel))\n            && ($this->_owApp->erfurt->getAc()->isModelAllowed('edit', $this->_owApp->selectedModel))\n        ) {\n            $limit = $this->_privateConfig->limit;\n            $actionUrl = new OntoWiki_Url(array('controller' => 'community', 'action' => 'comment'), array());\n            $listUrl = new OntoWiki_Url(array('controller' => 'community', 'action' => 'list'), array());\n            $listUrl->setParam('climit', $limit, true);\n            $this->view->actionUrl = (string)$actionUrl;\n            $this->view->listUrl = (string)$listUrl;\n            $this->view->context = $this->getContext();\n\n            $content = $this->render('templates/comment');\n        }\n\n        if ($this->getContext() != 'main.window.community') {\n            $helper = $this->_owApp->extensionManager->getComponentHelper('community');\n            $comments = $helper->getList($this->view);\n\n            if ($comments === null) {\n                $this->view->infomessage = 'There are no discussions yet.';\n            } else {\n                $this->view->comments = $comments;\n            }\n\n            $content .= $this->render('templates/lastcomments');\n        }\n\n        return $content;\n    }\n}\n"
  },
  {
    "path": "extensions/community/CommunityController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * @category   OntoWiki\n * @package    Extensions_Community\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n * @author     Jonas Brekle <jonas.brekle@gmail.com>\n * @author     Natanael Arndt <arndtn@gmail.com>\n */\nclass CommunityController extends OntoWiki_Controller_Component\n{\n    /**\n     * list comments\n     */\n    public function listAction()\n    {\n        $translate = $this->_owApp->translate;\n        $singleResource = true;\n        if ($this->_request->getParam('mode') === 'multi') {\n            $windowTitle    = $translate->_('Discussion about elements of the list');\n            $singleResource = false;\n        } else {\n            $resource   = $this->_owApp->selectedResource;\n            if ($resource->getTitle()) {\n                $title = $resource->getTitle();\n            } else {\n                $title = OntoWiki_Utils::contractNamespace($resource->getIri());\n            }\n            $windowTitle = sprintf($translate->_('Discussion about %1$s'), $title);\n        }\n\n        $this->addModuleContext('main.window.community');\n        $this->view->placeholder('main.window.title')->set($windowTitle);\n\n        $limit = $this->_request->getParam('climit');\n        if ($limit === null) {\n            $limit = 10;\n        }\n\n        $helper = $this->_owApp->extensionManager->getComponentHelper('community');\n        $comments = $helper->getList($this->view, $singleResource, $limit);\n        if ($comments === null) {\n            $this->view->infomessage = 'There are no discussions yet.';\n        } else {\n            $this->view->comments = $comments;\n        }\n    }\n\n    /**\n     * save a comment\n     */\n    public function commentAction()\n    {\n        if (!$this->_owApp->selectedModel->isEditable()) {\n            throw new Erfurt_Ac_Exception(\"Access control violation. Model not editable.\");\n        }\n\n        $this->_helper->viewRenderer->setNoRender();\n        $this->_helper->layout()->disableLayout();\n\n        $user = $this->_owApp->getUser()->getUri();\n        $date = date('c'); // xsd:datetime\n\n        $resource        = (string)$this->_owApp->selectedResource;\n        $aboutProperty   = $this->_privateConfig->about->property;\n        $creatorProperty = $this->_privateConfig->creator->property;\n        $commentType     = $this->_privateConfig->comment->type;\n        $contentProperty = $this->_privateConfig->content->property;\n        $dateProperty    = $this->_privateConfig->date->property;\n        $content         = $this->getParam('c');\n\n        if (!empty($content)) {\n            // make URI\n            $commentUri = $this->_owApp->selectedModel->createResourceUri('Comment');\n\n            // preparing versioning\n            $versioning                = $this->_erfurt->getVersioning();\n            $actionSpec                = array();\n            $actionSpec['type']        = 110;\n            $actionSpec['modeluri']    = (string)$this->_owApp->selectedModel;\n            $actionSpec['resourceuri'] = $commentUri;\n\n            $versioning->startAction($actionSpec);\n\n            // insert comment\n            $this->_owApp->selectedModel->addStatement(\n                $commentUri,\n                $aboutProperty,\n                array('value' => $resource, 'type' => 'uri')\n            );\n\n            $this->_owApp->selectedModel->addStatement(\n                $commentUri,\n                EF_RDF_TYPE,\n                array('value' => $commentType, 'type' => 'uri')\n            );\n\n            $this->_owApp->selectedModel->addStatement(\n                $commentUri,\n                $creatorProperty,\n                array('value' => (string)$user, 'type' => 'uri')\n            );\n\n            $this->_owApp->selectedModel->addStatement(\n                $commentUri, $dateProperty, array(\n                                                 'value'    => $date,\n                                                 'type'     => 'literal',\n                                                 'datatype' => EF_XSD_NS . 'dateTime'\n                                            )\n            );\n            $this->_owApp->selectedModel->addStatement(\n                $commentUri, $contentProperty, array(\n                                                    'value' => $content,\n                                                    'type'  => 'literal'\n                                               )\n            );\n\n            // stop Action\n            $versioning->endAction();\n        }\n    }\n\n    /**\n     * rate a resource\n     */\n    public function rateAction()\n    {\n        if (!$this->_owApp->selectedModel->isEditable()) {\n            require_once 'Erfurt/Ac/Exception.php';\n            throw new Erfurt_Ac_Exception(\"Access control violation. Model not editable.\");\n        }\n\n        $user = $this->_owApp->getUser()->getUri();\n        $date = date('rating'); // xsd:datetime\n\n        $resource        = (string)$this->_owApp->selectedResource;\n        $aboutProperty   = $this->_privateConfig->about->property;\n        $creatorProperty = $this->_privateConfig->creator->property;\n        $ratingType      = $this->_privateConfig->rating->type;\n        $noteProperty    = $this->_privateConfig->note->property;\n        $dateProperty    = $this->_privateConfig->date->property;\n\n        //get rating Value\n        $ratingValue = $this->getParam('rating');\n\n        if (!empty($ratingValue)) {\n\n            $query = new Erfurt_Sparql_SimpleQuery();\n            $model = OntoWiki::getInstance()->selectedModel;\n\n            //query rating and creator of rating\n\n            $query->setProloguePart(\n                '\n                prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n                prefix ns0: <http://rdfs.org/sioc/ns#>\n                prefix ns1: <http://rdfs.org/sioc/types#>'\n            );\n            $query->setSelectClause('SELECT *');\n            $query->setWherePart(\n                'where {\n                ?rating rdf:type ns1:Poll.\n                ?rating ns0:about <' . $this->_owApp->selectedResource . '>.\n                ?rating ns0:has_creator ?creator}'\n            );\n\n            $results = $model->sparqlQuery($query);\n\n            if ($results) {\n\n                $creatorExists = false;\n                foreach ($results as $result) {\n\n                    if ((string)$user == $result['creator']) {\n                        $creatorExists = true;\n                        $ratingNote    = $result['rating'];\n                        break;\n                    }\n                }\n\n                if ($creatorExists) {\n                    $this->_owApp->selectedModel->deleteMatchingStatements($ratingNote, null, null, array());\n                }\n            }\n\n            // make URI\n            $ratingNoteUri = $this->_owApp->selectedModel->createResourceUri('Rating');\n\n            // preparing versioning\n            $versioning                = $this->_erfurt->getVersioning();\n            $actionSpec                = array();\n            $actionSpec['type']        = 110;\n            $actionSpec['modeluri']    = (string)$this->_owApp->selectedModel;\n            $actionSpec['resourceuri'] = $ratingNoteUri;\n\n            $versioning->startAction($actionSpec);\n\n            // create namespaces (todo: this should be based on used properties)\n            $this->_owApp->selectedModel->getNamespacePrefix('http://rdfs.org/sioc/ns#');\n            $this->_owApp->selectedModel->getNamespacePrefix('http://rdfs.org/sioc/types#');\n            $this->_owApp->selectedModel->getNamespacePrefix('http://localhost/OntoWiki/Config/');\n\n            // insert rating\n            $this->_owApp->selectedModel->addStatement(\n                $ratingNoteUri,\n                $aboutProperty,\n                array('value' => $resource, 'type' => 'uri')\n            );\n\n            $this->_owApp->selectedModel->addStatement(\n                $ratingNoteUri,\n                EF_RDF_TYPE,\n                array('value' => $ratingType, 'type' => 'uri')\n            );\n\n            $this->_owApp->selectedModel->addStatement(\n                $ratingNoteUri,\n                $creatorProperty,\n                array('value' => (string)$user, 'type' => 'uri')\n            );\n\n            $this->_owApp->selectedModel->addStatement(\n                $ratingNoteUri, $dateProperty, array(\n                                                    'value'    => $date,\n                                                    'type'     => 'literal',\n                                                    'datatype' => EF_XSD_NS . 'dateTime'\n                                               )\n            );\n            $this->_owApp->selectedModel->addStatement(\n                $ratingNoteUri, $noteProperty, array(\n                                                    'value' => $ratingValue,\n                                                    'type'  => 'literal'\n                                               )\n            );\n\n            $cache = $this->_erfurt->getQueryCache();\n            $ret   = $cache->cleanUpCache(array('mode' => 'uninstall'));\n\n        }\n\n        // stop Action\n        $versioning->endAction();\n    }\n}\n"
  },
  {
    "path": "extensions/community/CommunityHelper.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Helper class for the Community component.\n *\n * - register the tab for navigation on properties view\n *\n * @category   OntoWiki\n * @package    Extensions_Community\n */\nclass CommunityHelper extends OntoWiki_Component_Helper\n{\n    public function init()\n    {\n        /*\n         * check for $request->getParam('mode') == 'multi' if tab should also be displayed for\n         * multiple resources/lists ($request->getActionName() == 'instances')\n         * And set 'mode' => 'multi' to tell the controller the multi mode\n         *\n         * Multi mode was disabled because it doesn't seam to work\n         */\n\n        $owApp = OntoWiki::getInstance();\n\n        if ($owApp->lastRoute == 'properties' && $owApp->selectedResource != null) {\n            $owApp->getNavigation()->register(\n                'community',\n                array(\n                    'controller' => 'community',\n                    'action'     => 'list',\n                    'name'       => 'Community',\n                    'mode'       => 'single',\n                    'priority'   => 50\n                )\n            );\n        }\n    }\n\n    public function getList($view, $singleResource = true, $limit = null)\n    {\n        $store      = $this->_owApp->erfurt->getStore();\n        $graph      = $this->_owApp->selectedModel;\n        $resource   = $this->_owApp->selectedResource;\n\n        $aboutProperty   = $this->_privateConfig->about->property;\n        $creatorProperty = $this->_privateConfig->creator->property;\n        $commentType     = $this->_privateConfig->comment->type;\n        $contentProperty = $this->_privateConfig->content->property;\n        $dateProperty    = $this->_privateConfig->date->property;\n\n        if ($limit === null) {\n            $limit = $this->_privateConfig->limit;\n        }\n\n        // get all resource comments\n        // Loading data for list of saved queries\n        $listHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('List');\n\n        $list = new OntoWiki_Model_Instances($store, $graph, array());\n\n        $list->addTypeFilter($commentType, 'searchcomments');\n        $list->addShownProperty($aboutProperty, \"about\", false, null, false);\n        $list->addShownProperty($creatorProperty, \"creator\", false, null, false);\n        $list->addShownProperty($contentProperty, \"content\", false, null, false);\n        $list->addShownProperty($dateProperty, \"date\", false, null, false);\n        $list->setLimit($limit);\n        $list->setOrderProperty($dateProperty, false);\n\n        if ($singleResource) {\n            $list->addTripleFilter(\n                array(\n                     new Erfurt_Sparql_Query2_Triple(\n                         $list->getResourceVar(),\n                         new Erfurt_Sparql_Query2_IriRef($aboutProperty),\n                         new Erfurt_Sparql_Query2_IriRef((string)$resource)\n                     )\n                )\n            );\n        } else {\n            // doesn't work\n            $list->addShownProperty($aboutProperty, \"about\", false, null, false);\n\n            $instances   = $listHelper->getList('instances');\n            $query       = clone $instances->getResourceQuery();\n            $resourceVar = $instances->getResourceVar();\n\n            $vars = $query->getWhere()->getVars();\n            foreach ($vars as $var) {\n                if ($var->getName() == $resourceVar->getName()) {\n                    $var->setName('listresource');\n                }\n            }\n            $elements = $query->getWhere()->getElements();\n            //link old list to elements of the community-list\n            $elements[] = new Erfurt_Sparql_Query2_Triple(\n                $list->getResourceVar(),\n                new Erfurt_Sparql_Query2_IriRef($aboutProperty),\n                $var\n            );\n            $list->addTripleFilter($elements, \"listfilter\");\n        }\n\n        $listName   = \"community\";\n        $other      = new stdClass();\n        $other->singleResource  = $singleResource;\n        $other->statusBar       = false;\n        if ($list->hasData()) {\n            return $listHelper->addListPermanently(\n                $listName, $list, $view, 'list_community_main', $other, true\n            );\n        } else {\n            return null;\n        }\n    }\n\n    public function getMultiList()\n    {\n        $this->store = $this->_owApp->erfurt->getStore();\n        $this->model = $this->_owApp->selectedModel;\n\n        /* prepare schema elements */\n        // TODO: This should be used from the CommunityController\n        $aboutProperty   = $this->_privateConfig->about->property;\n        $creatorProperty = $this->_privateConfig->creator->property;\n        $commentType     = $this->_privateConfig->comment->type;\n        $contentProperty = $this->_privateConfig->content->property;\n        $dateProperty    = $this->_privateConfig->date->property;\n\n        $realLimit = $this->_privateConfig->limit + 1; // used for query to check for \"more\"\n\n        // get the latest comments\n        $commentSparql\n            = 'SELECT DISTINCT ?resource ?author ?comment ?content ?date #?alabel\n            WHERE {\n                ?comment <' . $aboutProperty . '> ?resource.\n                ?comment a <' . $commentType . '>.\n                ?comment <' . $creatorProperty . '> ?author.\n                ?comment <' . $contentProperty . '> ?content.\n                ?comment <' . $dateProperty . '> ?date.\n            }\n            ORDER BY DESC(?date)\n            LIMIT ' . $realLimit;\n\n        $query = Erfurt_Sparql_SimpleQuery::initWithString($commentSparql);\n\n        return $this->model->sparqlQuery($query);\n    }\n}\n"
  },
  {
    "path": "extensions/community/LastchangesModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module – lastchanges\n *\n * show last activities in a knowledge base and link to the resources\n *\n * @category   OntoWiki\n * @package    Extensions_Community\n * @author     Sebastian Tramp <mail@sebastian.tramp.name>\n */\nclass LastchangesModule extends OntoWiki_Module\n{\n\n    public function init()\n    {\n        // enabling versioning\n        $this->versioning = $this->_erfurt->getVersioning();\n        if (!$this->versioning instanceof Erfurt_Versioning) {\n            return;\n        }\n\n        if (!$this->versioning->isVersioningEnabled()) {\n            $this->view->warningmessage\n                = 'Versioning/history is currently disabled. This means, you can not see the latest changes.';\n        } else {\n            // The system config is used to get the user title\n            // TODO: How can switch from ACL to Non-ACL use?\n            $this->systemModel\n                = new Erfurt_Rdf_Model('http://localhost/OntoWiki/Config/', 'http://localhost/OntoWiki/Config/');\n\n            if ($this->getContext() == \"main.window.dashmodelinfo\") {\n                $this->user    = $this->_erfurt->getAuth()->getIdentity()->getUri();\n                $this->results = $this->versioning->getHistoryForUserDash($this->user);\n            } else {\n                $this->model = $this->_owApp->selectedModel;\n\n                $this->results = $this->versioning->getConciseHistoryForGraph($this->model->getModelIri());\n            }\n        }\n    }\n\n    public function getTitle()\n    {\n        return 'Latest Changes';\n    }\n\n    public function shouldShow()\n    {\n        if (!$this->versioning instanceof Erfurt_Versioning) {\n            return false;\n        }\n\n        return true;\n    }\n\n    public function getContents()\n    {\n        $url     = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n        $changes = array();\n        if ($this->results) {\n            foreach ($this->results as $change) {\n\n                if ($this->getContext() == \"main.window.dashmodelinfo\") {\n                    //id, resource, tstamp, action_type\n                    $change['useruri'] = $this->user;\n                    $this->model       = null;\n                }\n\n                if (Erfurt_Uri::check($change['resource'])) {\n                    $change['aresource'] = new OntoWiki_Resource((string)$change['useruri'], $this->systemModel);\n\n                    if ($change['aresource']->getTitle()) {\n                        $change['author'] = $change['aresource']->getTitle();\n                    } else {\n                        $change['author'] = OntoWiki_Utils::getUriLocalPart($change['aresource']);\n                    }\n\n                    $url->setParam('r', (string)$change['aresource'], true);\n                    $change['ahref'] = (string)$url;\n\n                    $url->setParam('r', (string)$change['resource'], true);\n                    $change['rhref']    = (string)$url;\n                    $change['resource'] = new OntoWiki_Resource((string)$change['resource'], $this->model);\n\n                    if ($change['resource']->getTitle()) {\n                        $change['rname'] = $change['resource']->getTitle();\n                    } else {\n                        $change['rname'] = OntoWiki_Utils::contractNamespace($change['resource']->getIri());\n                    }\n\n                    $changes[] = $change;\n                }\n            }\n        }\n\n        if (empty($changes)) {\n            $this->view->infomessage = 'There are no changes yet.';\n        } else {\n            $this->view->changes = $changes;\n        }\n\n        return $this->render('templates/lastchanges');\n    }\n}\n"
  },
  {
    "path": "extensions/community/RatingModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Module.php';\n\n/**\n * OntoWiki module – comment\n *\n * Allows to post a comment about a resource.\n *\n * @category   OntoWiki\n * @package    Extensions_Community\n * @author     Christian Maier, Niederstätter Michael\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass RatingModule extends OntoWiki_Module\n{\n    public function getTitle()\n    {\n        return 'Rating';\n    }\n\n    public function getContents()\n    {\n        $url                   = new OntoWiki_Url(array('controller' => 'community', 'action' => 'rate'), array());\n        $this->view->actionUrl = (string)$url;\n\n        $query = new Erfurt_Sparql_SimpleQuery();\n        $model = new OntoWiki_Model(Erfurt_App::getInstance()->getStore(), $this->_owApp->selectedModel);\n\n        //query ratings for the current resource\n\n        $query->setProloguePart(\n            'prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n             prefix ns0: <http://rdfs.org/sioc/ns#>\n             prefix ns1: <http://rdfs.org/sioc/types#>\n             prefix terms: <http://purl.org/dc/terms/>'\n        );\n        $query->setSelectClause('SELECT *');\n        $query->setWherePart(\n            'where {\n            ?rating rdf:type ns1:Poll.\n            ?rating ns0:about <' . $this->_owApp->selectedResource . '>.\n            ?rating ns0:note ?note.\n            ?rating ns0:has_creator ?creator}'\n        );\n\n        $results = $this->_store->sparqlQuery($query);\n\n        $ratingArray = Array();\n\n        $user = (string)$this->_owApp->getUser()->getUri();\n\n        $creator     = '0';\n        $creatorNote = '0';\n        foreach ($results as $result) {\n            $ratingArray[] = (double)$result['note'];\n            if ($user == $result['creator']) {\n                $creator     = '1';\n                $creatorNote = (double)$result['note'];\n            }\n        }\n\n        $rating      = '0';\n        $ratingvalue = '0';\n\n        if (count($ratingArray) != 0) {\n            $ratingvalue = round(array_sum($ratingArray) / count($ratingArray), 2);\n\n            $rating = round(array_sum($ratingArray) / count($ratingArray) * 2 - 1, 0);\n        }\n        $ratingJs = 'var rating = ' . ($rating) . '; var count =' . count($ratingArray) . '; var creator =' .\n            $creator . '; var creatorNote =' . ($creatorNote - 1) . '; var ratingValue =' . $ratingvalue . ';';\n\n        // append Java Scripts and Style Sheets\n\n        $this->view->headScript()->appendScript($ratingJs);\n        $this->view->headScript()->appendFile($this->_config->urlBase . 'extensions/modules/rating/jquery.MetaData.js');\n        $this->view->headScript()->appendFile($this->_config->urlBase . 'extensions/modules/rating/jquery.rating.js');\n        $this->view->headScript()->appendFile(\n            $this->_config->urlBase . 'extensions/modules/rating/jquery.rating.pack.js'\n        );\n        $this->view->headScript()->appendFile($this->_config->urlBase . 'extensions/modules/rating/rating.js');\n        $this->view->headLink()->appendStylesheet(\n            $this->_config->urlBase . 'extensions/modules/rating/jquery.rating.css'\n        );\n\n        $this->view->count  = count($ratingArray);\n        $this->view->rating = $ratingvalue;\n\n        $content = $this->render('templates/rating');\n\n        return $content;\n    }\n\n    public function shouldShow()\n    {\n        // show only if enabled in private config\n        if ($this->_privateConfig->enableRating == false) {\n            return false;\n        }\n\n        // the rating action is displayed only for registered users\n        // and if set in the module.ini file only for predefined resources\n        if ($this->_owApp->getUser()->getUsername() == 'Anonymous' || !$this->typeAllowed()) {\n            return false;\n        } else {\n            return true;\n        }\n    }\n\n    private function typeAllowed()\n    {\n        if ($this->_privateConfig->ratingClass) {\n            $classArray = $this->_privateConfig->ratingClass->toArray();\n\n            $store    = $this->_owApp->erfurt->getStore();\n            $resource = $this->_owApp->selectedResource;\n\n            $query = new Erfurt_Sparql_SimpleQuery();\n\n            $query->setSelectClause('SELECT *')->setWherePart(\n                'WHERE {\n                    <' . $resource . '> <' . EF_RDF_TYPE . '> ?type\n                }'\n            );\n\n            $results = $store->sparqlQuery($query);\n            if (in_array($results[0]['type'], $classArray)) {\n                return true;\n            } else {\n                return false;\n            }\n        } else {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/community/default.ini",
    "content": ";;\n; Basic component configuration\n;;\nenabled    = true\ntemplates  = \"templates\"\nlanguages  = \"languages/\"\n\naction     = list\nname       = \"Community\"\n\ndescription = \"rate and comment on resources.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\nmodules.comment.priority = 19\nmodules.comment.name = \"Comment\"\nmodules.comment.contexts.0 = \"main.window.community\"\n\nmodules.lastchanges.priority = 18\nmodules.lastchanges.name = \"Last Changes\"\nmodules.lastchanges.contexts.0 = \"main.window.modelinfo\"\nmodules.lastchanges.contexts.1 = \"main.window.dashmodelinfo\"\n\nmodules.lastcomments.priority   = 15\nmodules.lastcomments.name = \"Last Comments\"\nmodules.lastcomments.contexts.0 = \"main.window.modelinfo\"\nmodules.lastcomments.contexts.1 = \"main.window.dashmodelinfo\"\n\nmodules.rating.title      = \"Rating\"\nmodules.rating.caching    = no\nmodules.rating.priority   = 20\nmodules.rating.contexts.0 = \"main.window.properties\"\n\n;;\n; Component's private configuration\n; Anything set below will be available within the component ($this->_privateConfig->key)\n;;\n[private]\nenableRating = false\n\n;-----------------------------------------------------------------------------;\n; Properties and types used for comments and ratings.                         ;\n;-----------------------------------------------------------------------------;\nabout.property   = \"http://rdfs.org/sioc/ns#about\"       ; comment about resource\ncreator.property = \"http://rdfs.org/sioc/ns#has_creator\" ; comment has_creator user \ncomment.type     = \"http://rdfs.org/sioc/types#Comment\"     ; comment rdf:type Comment\ncontent.property = \"http://rdfs.org/sioc/ns#content\"     ; comment content \"literal\"\ndate.property    = \"http://purl.org/dc/terms/created\"  ; comment created_at \"2008-03-07\"^^xsd:date\n\nrating.type      = \"http://rdfs.org/sioc/types#Poll\"        ; rating rdf:type Poll\nnote.property    = \"http://rdfs.org/sioc/ns#note\"        ; rating note \"note\"\n"
  },
  {
    "path": "extensions/community/default.n3",
    "content": "@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <http://ns.ontowiki.net/Extensions/community/> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n\n<> foaf:primaryTopic :community .\n\n:community a doap:Project;\n    doap:name \"Community\";\n    doap:description \"rate and comment on resources.\";\n    doap:maintainer <http://aksw.org/SebastianTramp>;\n    owconfig:enabled \"true\"^^xsd:boolean;\n    owconfig:templates \"templates\";\n    owconfig:languages \"languages/\";\n    owconfig:action \"list\";\n    owconfig:hasModule :Comments, :LastChanges, :LastComments, :Rating;\n    owconfig:privateNamespace <http://ns.ontowiki.net/Extensions/community/>.\n\n:Comments a owconfig:Module;\n    rdfs:label \"Comment\";\n    owconfig:priority 19;\n    owconfig:context <http://ns.ontowiki.net/Contexts/main/window/community>.\n\n:LastChanges a owconfig:Module;\n    rdfs:label \"Last Changes\";\n    owconfig:priority 18;\n    owconfig:context <http://ns.ontowiki.net/Contexts/main/window/modelinfo>;\n    owconfig:context <http://ns.ontowiki.net/Contexts/main/window/dashmodelinfo>.\n\n:LastComments a owconfig:Module;\n    rdfs:label \"Last Comments\";\n    owconfig:priority 15;\n    owconfig:context <http://ns.ontowiki.net/Contexts/main/window/modelinfo>;\n    owconfig:context <http://ns.ontowiki.net/Contexts/main/window/dashmodelinfo>.\n\n:Rating a owconfig:Module;\n    rdfs:label \"Rating\";\n    owconfig:caching \"false\"^^xsd:boolean;\n    owconfig:priority 20;\n    owconfig:context <http://ns.ontowiki.net/Contexts/main/window/properties>.\n\n:community\n    :enableRating \"false\"^^xsd:boolean;\n    owconfig:config [\n            # about.property   = \"http://rdfs.org/sioc/ns#about\"       ; comment about resource\n            a owconfig:Config;\n            owconfig:id \"about\";\n            rdfs:comment \"comment about resource\";\n            :property <http://rdfs.org/sioc/ns#about>\n        ];\n    owconfig:config [\n            # creator.property = \"http://rdfs.org/sioc/ns#has_creator\" ; comment has_creator user\n            owconfig:id \"creator\";\n            rdfs:comment \"comment has_creator user\";\n            :property <http://rdfs.org/sioc/ns#has_creator>\n        ];\n            # comment.type     = \"http://rdfs.org/sioc/types#Comment\"     ; comment rdf:type Comment\n    owconfig:config [\n            owconfig:id \"comment\";\n            rdfs:comment \"comment rdf:type Comment\";\n            :type <http://rdfs.org/sioc/types#Comment>\n        ];\n    owconfig:config [\n            # content.property = \"http://rdfs.org/sioc/ns#content\"     ; comment content \"literal\"\n            owconfig:id \"content\";\n            rdfs:comment \"comment content literal\";\n            :property <http://rdfs.org/sioc/ns#content>\n        ];\n    owconfig:config [\n            # date.property    = \"http://purl.org/dc/terms/created\"  ; comment created_at \"2008-03-07\"^^xsd:date\n            owconfig:id \"date\";\n            rdfs:comment \"comment created_at '2008-03-07'^^xsd:date\";\n            :property <http://purl.org/dc/terms/created>\n        ];\n    owconfig:config [\n            # rating.type      = \"http://rdfs.org/sioc/types#Poll\"        ; rating rdf:type Poll\n            owconfig:id \"rating\";\n            rdfs:comment \"rating rdf:type Poll\";\n            :type <http://rdfs.org/sioc/types#Poll>\n        ];\n    owconfig:config [\n            # note.property    = \"http://rdfs.org/sioc/ns#note\"        ; rating note \"note\"\n            owconfig:id \"note\";\n            rdfs:comment \"rating note literal\";\n            :property <http://rdfs.org/sioc/ns#note>\n        ].\n\n"
  },
  {
    "path": "extensions/community/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/community/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :community .\n:community a doap:Project ;\n  doap:name \"community\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/community/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  owconfig:templates \"templates\" ;\n  owconfig:languages \"languages/\" ;\n  owconfig:defaultAction \"list\" ;\n  rdfs:label \"Community\" ;\n  doap:description \"rate and comment on resources.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:hasModule :Comment .\n:Comment a owconfig:Module ;\n  owconfig:priority \"19\" ;\n  rdfs:label \"Comment\" ;\n  owconfig:context \"main.window.modelinfo\" ;\n  owconfig:context \"main.window.dashmodelinfo\" ;\n  owconfig:context \"main.window.community\" ;\n  owconfig:context \"main.window.properties\" .\n:community owconfig:hasModule :Lastchanges .\n:Lastchanges a owconfig:Module ;\n  owconfig:priority \"18\" ;\n  rdfs:label \"Last Changes\" ;\n  owconfig:context \"main.window.modelinfo\" ;\n  owconfig:context \"main.window.dashmodelinfo\" .\n:community owconfig:hasModule :Rating .\n:Rating a owconfig:Module ;\n  rdfs:label \"Rating\" ;\n  owconfig:caching \"false\"^^xsd:boolean ;\n  owconfig:priority \"20\" ;\n  owconfig:context \"main.window.properties\" .\n:community :enableRating \"false\"^^xsd:boolean ;\n           :limit \"5\"^^xsd:int ;\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"about\";\n      :property <http://rdfs.org/sioc/ns#about>\n];\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"creator\";\n      :property <http://rdfs.org/sioc/ns#has_creator>\n];\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"comment\";\n      :type <http://rdfs.org/sioc/types#Comment>\n];\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"content\";\n      :property <http://rdfs.org/sioc/ns#content>\n];\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"date\";\n      :property <http://purl.org/dc/terms/created>\n];\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"rating\";\n      :type <http://rdfs.org/sioc/types#Poll>\n];\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"note\";\n      :property <http://rdfs.org/sioc/ns#note>\n] .\n:community doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/community/insert.sparql",
    "content": "insert into graph <http://localhost/OntoWiki/Config/> {\n    <http://localhost/OntoWiki/Config/Comment2> <http://rdfs.org/sioc/ns#about> <http://localhost/OntoWiki/Config/File>.\n    <http://localhost/OntoWiki/Config/Comment2> a <http://rdfs.org/sioc/ns#Comment>.\n    <http://localhost/OntoWiki/Config/Comment2> <http://rdfs.org/sioc/ns#has_creator> <http://localhost/OntoWiki/Config/Anonymous>.\n    <http://localhost/OntoWiki/Config/Comment2> <http://rdfs.org/sioc/ns#content> \"Good idea.\".\n    <http://localhost/OntoWiki/Config/Comment2> <http://rdfs.org/sioc/ns#created_at> \"2008-12-09T02:04:34\"^^xsd:dateTime.\n}"
  },
  {
    "path": "extensions/community/jquery.MetaData.js",
    "content": "/*\r\n * Metadata - jQuery plugin for parsing metadata from elements\r\n *\r\n * Copyright (c) 2006 John Resig, Yehuda Katz, Jrn Zaefferer, Paul McLanahan\r\n *\r\n * Dual licensed under the MIT and GPL licenses:\r\n *   http://www.opensource.org/licenses/mit-license.php\r\n *   http://www.gnu.org/licenses/gpl.html\r\n *\r\n * Revision: $Id$\r\n *\r\n */\r\n\r\n/**\r\n * Sets the type of metadata to use. Metadata is encoded in JSON, and each property\r\n * in the JSON will become a property of the element itself.\r\n *\r\n * There are three supported types of metadata storage:\r\n *\r\n *   attr:  Inside an attribute. The name parameter indicates *which* attribute.\r\n *          \r\n *   class: Inside the class attribute, wrapped in curly braces: { }\r\n *   \r\n *   elem:  Inside a child element (e.g. a script tag). The\r\n *          name parameter indicates *which* element.\r\n *          \r\n * The metadata for an element is loaded the first time the element is accessed via jQuery.\r\n *\r\n * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements\r\n * matched by expr, then redefine the metadata type and run another $(expr) for other elements.\r\n * \r\n * @name $.metadata.setType\r\n *\r\n * @example <p id=\"one\" class=\"some_class {item_id: 1, item_label: 'Label'}\">This is a p</p>\r\n * @before $.metadata.setType(\"class\")\r\n * @after $(\"#one\").metadata().item_id == 1; $(\"#one\").metadata().item_label == \"Label\"\r\n * @desc Reads metadata from the class attribute\r\n * \r\n * @example <p id=\"one\" class=\"some_class\" data=\"{item_id: 1, item_label: 'Label'}\">This is a p</p>\r\n * @before $.metadata.setType(\"attr\", \"data\")\r\n * @after $(\"#one\").metadata().item_id == 1; $(\"#one\").metadata().item_label == \"Label\"\r\n * @desc Reads metadata from a \"data\" attribute\r\n * \r\n * @example <p id=\"one\" class=\"some_class\"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>\r\n * @before $.metadata.setType(\"elem\", \"script\")\r\n * @after $(\"#one\").metadata().item_id == 1; $(\"#one\").metadata().item_label == \"Label\"\r\n * @desc Reads metadata from a nested script element\r\n * \r\n * @param String type The encoding type\r\n * @param String name The name of the attribute to be used to get metadata (optional)\r\n * @cat Plugins/Metadata\r\n * @descr Sets the type of encoding to be used when loading metadata for the first time\r\n * @type undefined\r\n * @see metadata()\r\n */\r\n\r\n(function($) {\r\n\r\n$.extend({\r\n\tmetadata : {\r\n\t\tdefaults : {\r\n\t\t\ttype: 'class',\r\n\t\t\tname: 'metadata',\r\n\t\t\tcre: /({.*})/,\r\n\t\t\tsingle: 'metadata'\r\n\t\t},\r\n\t\tsetType: function( type, name ){\r\n\t\t\tthis.defaults.type = type;\r\n\t\t\tthis.defaults.name = name;\r\n\t\t},\r\n\t\tget: function( elem, opts ){\r\n\t\t\tvar settings = $.extend({},this.defaults,opts);\r\n\t\t\t// check for empty string in single property\r\n\t\t\tif ( !settings.single.length ) settings.single = 'metadata';\r\n\t\t\t\r\n\t\t\tvar data = $.data(elem, settings.single);\r\n\t\t\t// returned cached data if it already exists\r\n\t\t\tif ( data ) return data;\r\n\t\t\t\r\n\t\t\tdata = \"{}\";\r\n\t\t\t\r\n\t\t\tif ( settings.type == \"class\" ) {\r\n\t\t\t\tvar m = settings.cre.exec( elem.className );\r\n\t\t\t\tif ( m )\r\n\t\t\t\t\tdata = m[1];\r\n\t\t\t} else if ( settings.type == \"elem\" ) {\r\n\t\t\t\tif( !elem.getElementsByTagName ) return;\r\n\t\t\t\tvar e = elem.getElementsByTagName(settings.name);\r\n\t\t\t\tif ( e.length )\r\n\t\t\t\t\tdata = $.trim(e[0].innerHTML);\r\n\t\t\t} else if ( elem.getAttribute != undefined ) {\r\n\t\t\t\tvar attr = elem.getAttribute( settings.name );\r\n\t\t\t\tif ( attr )\r\n\t\t\t\t\tdata = attr;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( data.indexOf( '{' ) <0 )\r\n\t\t\tdata = \"{\" + data + \"}\";\r\n\t\t\t\r\n\t\t\tdata = eval(\"(\" + data + \")\");\r\n\t\t\t\r\n\t\t\t$.data( elem, settings.single, data );\r\n\t\t\treturn data;\r\n\t\t}\r\n\t}\r\n});\r\n\r\n/**\r\n * Returns the metadata object for the first member of the jQuery object.\r\n *\r\n * @name metadata\r\n * @descr Returns element's metadata object\r\n * @param Object opts An object contianing settings to override the defaults\r\n * @type jQuery\r\n * @cat Plugins/Metadata\r\n */\r\n$.fn.metadata = function( opts ){\r\n\treturn $.metadata.get( this[0], opts );\r\n};\r\n\r\n})(jQuery);"
  },
  {
    "path": "extensions/community/jquery.rating.css",
    "content": "/* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */\r\ndiv.rating-cancel,div.star-rating{float:left;width:17px;height:15px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}\r\ndiv.rating-cancel,div.rating-cancel a{background:url(delete.gif) no-repeat 0 -16px}\r\ndiv.star-rating,div.star-rating a{background:url(star.gif) no-repeat 0 0px}\r\ndiv.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 0px;border:0}\r\ndiv.star-rating-on a{background-position:0 -16px!important}\r\ndiv.star-rating-hover a{background-position:0 -32px}\r\n/* Read Only CSS */\r\ndiv.star-rating-readonly a{cursor:default !important}\r\n/* Partial Star CSS */\r\ndiv.star-rating{background:transparent!important;overflow:hidden!important}\r\n/* END jQuery.Rating Plugin CSS */\r\n"
  },
  {
    "path": "extensions/community/jquery.rating.js",
    "content": "/*\r\n ### jQuery Star Rating Plugin v3.12 - 2009-04-16 ###\r\n * Home: http://www.fyneworks.com/jquery/star-rating/\r\n * Code: http://code.google.com/p/jquery-star-rating-plugin/\r\n *\r\n\t* Dual licensed under the MIT and GPL licenses:\r\n *   http://www.opensource.org/licenses/mit-license.php\r\n *   http://www.gnu.org/licenses/gpl.html\r\n ###\r\n*/\r\n\r\n/*# AVOID COLLISIONS #*/\r\n;if(window.jQuery) (function($){\r\n/*# AVOID COLLISIONS #*/\r\n\t\r\n\t// IE6 Background Image Fix\r\n\tif ($.browser.msie) try { document.execCommand(\"BackgroundImageCache\", false, true)} catch(e) { };\r\n\t// Thanks to http://www.visualjquery.com/rating/rating_redux.html\r\n\t\r\n\t// plugin initialization\r\n\t$.fn.rating = function(options){\r\n\t\tif(this.length==0) return this; // quick fail\r\n\t\t\r\n\t\t// Handle API methods\r\n\t\tif(typeof arguments[0]=='string'){\r\n\t\t\t// Perform API methods on individual elements\r\n\t\t\tif(this.length>1){\r\n\t\t\t\tvar args = arguments;\r\n\t\t\t\treturn this.each(function(){\r\n\t\t\t\t\t$.fn.rating.apply($(this), args);\r\n    });\r\n\t\t\t};\r\n\t\t\t// Invoke API method handler\r\n\t\t\t$.fn.rating[arguments[0]].apply(this, $.makeArray(arguments).slice(1) || []);\r\n\t\t\t// Quick exit...\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\t\r\n\t\t// Initialize options for this call\r\n\t\tvar options = $.extend(\r\n\t\t\t{}/* new object */,\r\n\t\t\t$.fn.rating.options/* default options */,\r\n\t\t\toptions || {} /* just-in-time options */\r\n\t\t);\r\n\t\t\r\n\t\t// Allow multiple controls with the same name by making each call unique\r\n\t\t$.fn.rating.calls++;\r\n\t\t\r\n\t\t// loop through each matched element\r\n\t\tthis\r\n\t\t .not('.star-rating-applied')\r\n\t\t\t.addClass('star-rating-applied')\r\n\t\t.each(function(){\r\n\t\t\t\r\n\t\t\t// Load control parameters / find context / etc\r\n\t\t\tvar control, input = $(this);\r\n\t\t\tvar eid = (this.name || 'unnamed-rating').replace(/\\[|\\]/g, '_').replace(/^\\_+|\\_+$/g,'');\r\n\t\t\tvar context = $(this.form || document.body);\r\n\t\t\t\r\n\t\t\t// FIX: http://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=23\r\n\t\t\tvar raters = context.data('rating');\r\n\t\t\tif(!raters || raters.call!=$.fn.rating.calls) raters = { count:0, call:$.fn.rating.calls };\r\n\t\t\tvar rater = raters[eid];\r\n\t\t\t\r\n\t\t\t// if rater is available, verify that the control still exists\r\n\t\t\tif(rater) control = rater.data('rating');\r\n\t\t\t\r\n\t\t\tif(rater && control)//{// save a byte!\r\n\t\t\t\t// add star to control if rater is available and the same control still exists\r\n\t\t\t\tcontrol.count++;\r\n\t\t\t\t\r\n\t\t\t//}// save a byte!\r\n\t\t\telse{\r\n\t\t\t\t// create new control if first star or control element was removed/replaced\r\n\t\t\t\t\r\n\t\t\t\t// Initialize options for this raters\r\n\t\t\t\tcontrol = $.extend(\r\n\t\t\t\t\t{}/* new object */,\r\n\t\t\t\t\toptions || {} /* current call options */,\r\n\t\t\t\t\t($.metadata? input.metadata(): ($.meta?input.data():null)) || {}, /* metadata options */\r\n\t\t\t\t\t{ count:0, stars: [], inputs: [] }\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t// increment number of rating controls\r\n\t\t\t\tcontrol.serial = raters.count++;\r\n\t\t\t\t\r\n\t\t\t\t// create rating element\r\n\t\t\t\trater = $('<span class=\"star-rating-control\"/>');\r\n\t\t\t\tinput.before(rater);\r\n\t\t\t\t\r\n\t\t\t\t// Mark element for initialization (once all stars are ready)\r\n\t\t\t\trater.addClass('rating-to-be-drawn');\r\n\t\t\t\t\r\n\t\t\t\t// Accept readOnly setting from 'disabled' property\r\n\t\t\t\tif(input.attr('disabled')) control.readOnly = true;\r\n\t\t\t\t\r\n\t\t\t\t// Create 'cancel' button\r\n\t\t\t\trater.append(\r\n\t\t\t\t\tcontrol.cancel = $('<div class=\"rating-cancel\"><a title=\"' + control.cancel + '\">' + control.cancelValue + '</a></div>')\r\n\t\t\t\t\t.mouseover(function(){\r\n\t\t\t\t\t\t$(this).rating('drain');\r\n\t\t\t\t\t\t$(this).addClass('star-rating-hover');\r\n\t\t\t\t\t\t//$(this).rating('focus');\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.mouseout(function(){\r\n\t\t\t\t\t\t$(this).rating('draw');\r\n\t\t\t\t\t\t$(this).removeClass('star-rating-hover');\r\n\t\t\t\t\t\t//$(this).rating('blur');\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.click(function(){\r\n\t\t\t\t\t $(this).rating('select');\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.data('rating', control)\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t}; // first element of group\r\n\t\t\t\r\n\t\t\t// insert rating star\r\n\t\t\tvar star = $('<div class=\"star-rating rater-'+ control.serial +'\"><a title=\"' + (this.title || this.value) + '\">' + this.value + '</a></div>');\r\n\t\t\trater.append(star);\r\n\t\t\t\r\n\t\t\t// inherit attributes from input element\r\n\t\t\tif(this.id) star.attr('id', this.id);\r\n\t\t\tif(this.className) star.addClass(this.className);\r\n\t\t\t\r\n\t\t\t// Half-stars?\r\n\t\t\tif(control.half) control.split = 2;\r\n\t\t\t\r\n\t\t\t// Prepare division control\r\n\t\t\tif(typeof control.split=='number' && control.split>0){\r\n\t\t\t\tvar stw = ($.fn.width ? star.width() : 0) || control.starWidth;\r\n\t\t\t\tvar spi = (control.count % control.split), spw = Math.floor(stw/control.split);\r\n\t\t\t\tstar\r\n\t\t\t\t// restrict star's width and hide overflow (already in CSS)\r\n\t\t\t\t.width(spw)\r\n\t\t\t\t// move the star left by using a negative margin\r\n\t\t\t\t// this is work-around to IE's stupid box model (position:relative doesn't work)\r\n\t\t\t\t.find('a').css({ 'margin-left':'-'+ (spi*spw) +'px' })\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\t// readOnly?\r\n\t\t\tif(control.readOnly)//{ //save a byte!\r\n\t\t\t\t// Mark star as readOnly so user can customize display\r\n\t\t\t\tstar.addClass('star-rating-readonly');\r\n\t\t\t//}  //save a byte!\r\n\t\t\telse//{ //save a byte!\r\n\t\t\t // Enable hover css effects\r\n\t\t\t\tstar.addClass('star-rating-live')\r\n\t\t\t\t // Attach mouse events\r\n\t\t\t\t\t.mouseover(function(){\r\n\t\t\t\t\t\t$(this).rating('fill');\r\n\t\t\t\t\t\t$(this).rating('focus');\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.mouseout(function(){\r\n\t\t\t\t\t\t$(this).rating('draw');\r\n\t\t\t\t\t\t$(this).rating('blur');\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.click(function(){\r\n\t\t\t\t\t\t$(this).rating('select');\r\n\t\t\t\t\t})\r\n\t\t\t\t;\r\n\t\t\t//}; //save a byte!\r\n\t\t\t\r\n\t\t\t// set current selection\r\n\t\t\tif(this.checked)\tcontrol.current = star;\r\n\t\t\t\r\n\t\t\t// hide input element\r\n\t\t\tinput.hide();\r\n\t\t\t\r\n\t\t\t// backward compatibility, form element to plugin\r\n\t\t\tinput.change(function(){\r\n    $(this).rating('select');\r\n   });\r\n\t\t\t\r\n\t\t\t// attach reference to star to input element and vice-versa\r\n\t\t\tstar.data('rating.input', input.data('rating.star', star));\r\n\t\t\t\r\n\t\t\t// store control information in form (or body when form not available)\r\n\t\t\tcontrol.stars[control.stars.length] = star[0];\r\n\t\t\tcontrol.inputs[control.inputs.length] = input[0];\r\n\t\t\tcontrol.rater = raters[eid] = rater;\r\n\t\t\tcontrol.context = context;\r\n\t\t\t\r\n\t\t\tinput.data('rating', control);\r\n\t\t\trater.data('rating', control);\r\n\t\t\tstar.data('rating', control);\r\n\t\t\tcontext.data('rating', raters);\r\n  }); // each element\r\n\t\t\r\n\t\t// Initialize ratings (first draw)\r\n\t\t$('.rating-to-be-drawn').rating('draw').removeClass('rating-to-be-drawn');\r\n\t\t\r\n\t\treturn this; // don't break the chain...\r\n\t};\r\n\t\r\n\t/*--------------------------------------------------------*/\r\n\t\r\n\t/*\r\n\t\t### Core functionality and API ###\r\n\t*/\r\n\t$.extend($.fn.rating, {\r\n\t\t// Used to append a unique serial number to internal control ID\r\n\t\t// each time the plugin is invoked so same name controls can co-exist\r\n\t\tcalls: 0,\r\n\t\t\r\n\t\tfocus: function(){\r\n\t\t\tvar control = this.data('rating'); if(!control) return this;\r\n\t\t\tif(!control.focus) return this; // quick fail if not required\r\n\t\t\t// find data for event\r\n\t\t\tvar input = $(this).data('rating.input') || $( this.tagName=='INPUT' ? this : null );\r\n   // focus handler, as requested by focusdigital.co.uk\r\n\t\t\tif(control.focus) control.focus.apply(input[0], [input.val(), $('a', input.data('rating.star'))[0]]);\r\n\t\t}, // $.fn.rating.focus\r\n\t\t\r\n\t\tblur: function(){\r\n\t\t\tvar control = this.data('rating'); if(!control) return this;\r\n\t\t\tif(!control.blur) return this; // quick fail if not required\r\n\t\t\t// find data for event\r\n\t\t\tvar input = $(this).data('rating.input') || $( this.tagName=='INPUT' ? this : null );\r\n   // blur handler, as requested by focusdigital.co.uk\r\n\t\t\tif(control.blur) control.blur.apply(input[0], [input.val(), $('a', input.data('rating.star'))[0]]);\r\n\t\t}, // $.fn.rating.blur\r\n\t\t\r\n\t\tfill: function(){ // fill to the current mouse position.\r\n\t\t\tvar control = this.data('rating'); if(!control) return this;\r\n\t\t\t// do not execute when control is in read-only mode\r\n\t\t\tif(control.readOnly) return;\r\n\t\t\t// Reset all stars and highlight them up to this element\r\n\t\t\tthis.rating('drain');\r\n\t\t\tthis.prevAll().andSelf().filter('.rater-'+ control.serial).addClass('star-rating-hover');\r\n\t\t},// $.fn.rating.fill\r\n\t\t\r\n\t\tdrain: function() { // drain all the stars.\r\n\t\t\tvar control = this.data('rating'); if(!control) return this;\r\n\t\t\t// do not execute when control is in read-only mode\r\n\t\t\tif(control.readOnly) return;\r\n\t\t\t// Reset all stars\r\n\t\t\tcontrol.rater.children().filter('.rater-'+ control.serial).removeClass('star-rating-on').removeClass('star-rating-hover');\r\n\t\t},// $.fn.rating.drain\r\n\t\t\r\n\t\tdraw: function(){ // set value and stars to reflect current selection\r\n\t\t\tvar control = this.data('rating'); if(!control) return this;\r\n\t\t\t// Clear all stars\r\n\t\t\tthis.rating('drain');\r\n\t\t\t// Set control value\r\n\t\t\tif(control.current){\r\n\t\t\t\tcontrol.current.data('rating.input').attr('checked','checked');\r\n\t\t\t\tcontrol.current.prevAll().andSelf().filter('.rater-'+ control.serial).addClass('star-rating-on');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t $(control.inputs).removeAttr('checked');\r\n\t\t\t// Show/hide 'cancel' button\r\n\t\t\tcontrol.cancel[control.readOnly || control.required?'hide':'show']();\r\n\t\t\t// Add/remove read-only classes to remove hand pointer\r\n\t\t\tthis.siblings()[control.readOnly?'addClass':'removeClass']('star-rating-readonly');\r\n\t\t},// $.fn.rating.draw\r\n\t\t\r\n\t\tselect: function(value){ // select a value\r\n\t\t\tvar control = this.data('rating'); if(!control) return this;\r\n\t\t\t// do not execute when control is in read-only mode\r\n\t\t\tif(control.readOnly) return;\r\n\t\t\t// clear selection\r\n\t\t\tcontrol.current = null;\r\n\t\t\t// programmatically (based on user input)\r\n\t\t\tif(typeof value!='undefined'){\r\n\t\t\t // select by index (0 based)\r\n\t\t\t\tif(typeof value=='number')\r\n \t\t\t return $(control.stars[value]).rating('select');\r\n\t\t\t\t// select by literal value (must be passed as a string\r\n\t\t\t\tif(typeof value=='string')\r\n\t\t\t\t\t//return \r\n\t\t\t\t\t$.each(control.stars, function(){\r\n\t\t\t\t\t\tif($(this).data('rating.input').val()==value) $(this).rating('select');\r\n\t\t\t\t\t});\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tcontrol.current = this[0].tagName=='INPUT' ? \r\n\t\t\t\t this.data('rating.star') : \r\n\t\t\t\t\t(this.is('.rater-'+ control.serial) ? this : null);\r\n\t\t\t\r\n\t\t\t// Update rating control state\r\n\t\t\tthis.data('rating', control);\r\n\t\t\t// Update display\r\n\t\t\tthis.rating('draw');\r\n\t\t\t// find data for event\r\n\t\t\tvar input = $( control.current ? control.current.data('rating.input') : null );\r\n\t\t\t// click callback, as requested here: http://plugins.jquery.com/node/1655\r\n\t\t\tif(control.callback) control.callback.apply(input[0], [input.val(), $('a', control.current)[0]]);// callback event\r\n\t\t},// $.fn.rating.select\r\n\t\t\r\n\t\treadOnly: function(toggle, disable){ // make the control read-only (still submits value)\r\n\t\t\tvar control = this.data('rating'); if(!control) return this;\r\n\t\t\t// setread-only status\r\n\t\t\tcontrol.readOnly = toggle || toggle==undefined ? true : false;\r\n\t\t\t// enable/disable control value submission\r\n\t\t\tif(disable) $(control.inputs).attr(\"disabled\", \"disabled\");\r\n\t\t\telse     \t\t\t$(control.inputs).removeAttr(\"disabled\");\r\n\t\t\t// Update rating control state\r\n\t\t\tthis.data('rating', control);\r\n\t\t\t// Update display\r\n\t\t\tthis.rating('draw');\r\n\t\t},// $.fn.rating.readOnly\r\n\t\t\r\n\t\tdisable: function(){ // make read-only and never submit value\r\n\t\t\tthis.rating('readOnly', true, true);\r\n\t\t},// $.fn.rating.disable\r\n\t\t\r\n\t\tenable: function(){ // make read/write and submit value\r\n\t\t\tthis.rating('readOnly', false, false);\r\n\t\t}// $.fn.rating.select\r\n\t\t\r\n });\r\n\t\r\n\t/*--------------------------------------------------------*/\r\n\t\r\n\t/*\r\n\t\t### Default Settings ###\r\n\t\teg.: You can override default control like this:\r\n\t\t$.fn.rating.options.cancel = 'Clear';\r\n\t*/\r\n\t$.fn.rating.options = { //$.extend($.fn.rating, { options: {\r\n\t\t\tcancel: 'Cancel Rating',   // advisory title for the 'cancel' link\r\n\t\t\tcancelValue: '',           // value to submit when user click the 'cancel' link\r\n\t\t\tsplit: 0,                  // split the star into how many parts?\r\n\t\t\t\r\n\t\t\t// Width of star image in case the plugin can't work it out. This can happen if\r\n\t\t\t// the jQuery.dimensions plugin is not available OR the image is hidden at installation\r\n\t\t\tstarWidth: 16//,\r\n\t\t\t\r\n\t\t\t//NB.: These don't need to be pre-defined (can be undefined/null) so let's save some code!\r\n\t\t\t//half:     false,         // just a shortcut to control.split = 2\r\n\t\t\t//required: false,         // disables the 'cancel' button so user can only select one of the specified values\r\n\t\t\t//readOnly: false,         // disable rating plugin interaction/ values cannot be changed\r\n\t\t\t//focus:    function(){},  // executed when stars are focused\r\n\t\t\t//blur:     function(){},  // executed when stars are focused\r\n\t\t\t//callback: function(){},  // executed when a star is clicked\r\n }; //} });\r\n\t\r\n\t/*--------------------------------------------------------*/\r\n\t\r\n\t/*\r\n\t\t### Default implementation ###\r\n\t\tThe plugin will attach itself to file inputs\r\n\t\twith the class 'multi' when the page loads\r\n\t*/\r\n\t$(function(){\r\n\t $('input[type=radio].star').rating();\r\n\t});\r\n\t\r\n\t\r\n\t\r\n/*# AVOID COLLISIONS #*/\r\n})(jQuery);\r\n/*# AVOID COLLISIONS #*/\r\n"
  },
  {
    "path": "extensions/community/jquery.rating.pack.js",
    "content": "/*\r\n ### jQuery Star Rating Plugin v3.12 - 2009-04-16 ###\r\n * Home: http://www.fyneworks.com/jquery/star-rating/\r\n * Code: http://code.google.com/p/jquery-star-rating-plugin/\r\n *\r\n\t* Dual licensed under the MIT and GPL licenses:\r\n *   http://www.opensource.org/licenses/mit-license.php\r\n *   http://www.gnu.org/licenses/gpl.html\r\n ###\r\n*/\r\neval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c]);return p}(';5(1O.1t)(7($){5($.29.1x)1I{1m.23(\"1u\",P,z)}1F(e){}$.p.4=7(j){5(3.K==0)l 3;5(E J[0]==\\'1j\\'){5(3.K>1){8 k=J;l 3.W(7(){$.p.4.H($(3),k)})};$.p.4[J[0]].H(3,$.1T(J).21(1)||[]);l 3};8 j=$.10({},$.p.4.18,j||{});3.1v(\\'.9-4-1l\\').n(\\'9-4-1l\\').W(7(){8 a=(3.1J||\\'1K-4\\').1L(/\\\\[|\\\\]+/g,\"1S\");8 b=$(3.1U||1m.1X);8 c=$(3);8 d=b.6(\\'4\\')||{y:0};8 e=d[a];8 f;5(e)f=e.6(\\'4\\');5(e&&f){f.y++}B{f=$.10({},j||{},($.1k?c.1k():($.1H?c.6():s))||{},{y:0,C:[],u:[]});f.t=d.y++;e=$(\\'<1M 12=\"9-4-1Q\"/>\\');c.1R(e);e.n(\\'4-T-13-S\\');5(c.R(\\'Q\\'))f.m=z;e.1a(f.A=$(\\'<O 12=\"4-A\"><a 14=\"\\'+f.A+\\'\">\\'+f.15+\\'</a></O>\\').1d(7(){$(3).4(\\'N\\');$(3).n(\\'9-4-M\\')}).1b(7(){$(3).4(\\'v\\');$(3).D(\\'9-4-M\\')}).1h(7(){$(3).4(\\'w\\')}).6(\\'4\\',f))};8 g=$(\\'<O 12=\"9-4 q-\\'+f.t+\\'\"><a 14=\"\\'+(3.14||3.1p)+\\'\">\\'+3.1p+\\'</a></O>\\');e.1a(g);5(3.U)g.R(\\'U\\',3.U);5(3.17)g.n(3.17);5(f.1V)f.x=2;5(E f.x==\\'19\\'&&f.x>0){8 h=($.p.11?g.11():0)||f.1c;8 i=(f.y%f.x),V=1y.1z(h/f.x);g.11(V).1A(\\'a\\').1B({\\'1C-1D\\':\\'-\\'+(i*V)+\\'1E\\'})};5(f.m)g.n(\\'9-4-1e\\');B g.n(\\'9-4-1G\\').1d(7(){$(3).4(\\'1f\\');$(3).4(\\'G\\')}).1b(7(){$(3).4(\\'v\\');$(3).4(\\'F\\')}).1h(7(){$(3).4(\\'w\\')});5(3.L)f.o=g;c.1i();c.1N(7(){$(3).4(\\'w\\')});g.6(\\'4.r\\',c.6(\\'4.9\\',g));f.C[f.C.K]=g[0];f.u[f.u.K]=c[0];f.q=d[a]=e;f.1P=b;c.6(\\'4\\',f);e.6(\\'4\\',f);g.6(\\'4\\',f);b.6(\\'4\\',d)});$(\\'.4-T-13-S\\').4(\\'v\\').D(\\'4-T-13-S\\');l 3};$.10($.p.4,{G:7(){8 a=3.6(\\'4\\');5(!a)l 3;5(!a.G)l 3;8 b=$(3).6(\\'4.r\\')||$(3.Z==\\'X\\'?3:s);5(a.G)a.G.H(b[0],[b.I(),$(\\'a\\',b.6(\\'4.9\\'))[0]])},F:7(){8 a=3.6(\\'4\\');5(!a)l 3;5(!a.F)l 3;8 b=$(3).6(\\'4.r\\')||$(3.Z==\\'X\\'?3:s);5(a.F)a.F.H(b[0],[b.I(),$(\\'a\\',b.6(\\'4.9\\'))[0]])},1f:7(){8 a=3.6(\\'4\\');5(!a)l 3;5(a.m)l;3.4(\\'N\\');3.1n().1o().Y(\\'.q-\\'+a.t).n(\\'9-4-M\\')},N:7(){8 a=3.6(\\'4\\');5(!a)l 3;5(a.m)l;a.q.1W().Y(\\'.q-\\'+a.t).D(\\'9-4-1q\\').D(\\'9-4-M\\')},v:7(){8 a=3.6(\\'4\\');5(!a)l 3;3.4(\\'N\\');5(a.o){a.o.6(\\'4.r\\').R(\\'L\\',\\'L\\');a.o.1n().1o().Y(\\'.q-\\'+a.t).n(\\'9-4-1q\\')}B $(a.u).1r(\\'L\\');a.A[a.m||a.1Y?\\'1i\\':\\'1Z\\']();3.20()[a.m?\\'n\\':\\'D\\'](\\'9-4-1e\\')},w:7(a){8 b=3.6(\\'4\\');5(!b)l 3;5(b.m)l;b.o=s;5(E a!=\\'1s\\'){5(E a==\\'19\\')l $(b.C[a]).4(\\'w\\');5(E a==\\'1j\\')$.W(b.C,7(){5($(3).6(\\'4.r\\').I()==a)$(3).4(\\'w\\')})}B b.o=3[0].Z==\\'X\\'?3.6(\\'4.9\\'):(3.22(\\'.q-\\'+b.t)?3:s);3.6(\\'4\\',b);3.4(\\'v\\');8 c=$(b.o?b.o.6(\\'4.r\\'):s);5(b.1g)b.1g.H(c[0],[c.I(),$(\\'a\\',b.o)[0]])},m:7(a,b){8 c=3.6(\\'4\\');5(!c)l 3;c.m=a||a==1s?z:P;5(b)$(c.u).R(\"Q\",\"Q\");B $(c.u).1r(\"Q\");3.6(\\'4\\',c);3.4(\\'v\\')},24:7(){3.4(\\'m\\',z,z)},25:7(){3.4(\\'m\\',P,P)}});$.p.4.18={A:\\'26 27\\',15:\\'\\',x:0,1c:16};$(7(){$(\\'r[28=1w].9\\').4()})})(1t);',62,134,'|||this|rating|if|data|function|var|star||||||||||||return|readOnly|addClass|current|fn|rater|input|null|serial|inputs|draw|select|split|count|true|cancel|else|stars|removeClass|typeof|blur|focus|apply|val|arguments|length|checked|hover|drain|div|false|disabled|attr|drawn|to|id|spw|each|INPUT|filter|tagName|extend|width|class|be|title|cancelValue||className|options|number|append|mouseout|starWidth|mouseover|readonly|fill|callback|click|hide|string|metadata|applied|document|prevAll|andSelf|value|on|removeAttr|undefined|jQuery|BackgroundImageCache|not|radio|msie|Math|floor|find|css|margin|left|px|catch|live|meta|try|name|unnamed|replace|span|change|window|context|control|before|_|makeArray|form|half|children|body|required|show|siblings|slice|is|execCommand|disable|enable|Cancel|Rating|type|browser'.split('|'),0,{}))"
  },
  {
    "path": "extensions/community/languages/community-de.csv",
    "content": "Comment;Kommentar\nPost Comment;Kommentar hinzufügen\nEnter your Comment;Gib einen Kommentar ab\nThere are no discussions yet.;Es gibt noch keine Kommentare.\nHISTORY_ACTIONTYPE_110;Kommentar hinzugefügt\nHISTORY_ACTIONTYPE_111;DataWrapper benutzt\n\n"
  },
  {
    "path": "extensions/community/languages/community-en.csv",
    "content": "HISTORY_ACTIONTYPE_110;comment added\nHISTORY_ACTIONTYPE_111;datawrapper used\n\n"
  },
  {
    "path": "extensions/community/rating.js",
    "content": "/**\r\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\r\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\r\n */\r\n$(document).ready(function() {\r\n\r\n    var rating_disp = document.getElementsByName('rating');\r\n    var rating_in = document.getElementsByName('rating_input');\r\n    var rating_user = document.getElementsByName('rating_user');\r\n    var submitbutton = document.getElementsByName('submitbutton');\r\n\r\n    var tab0 = document.getElementById('change0');\r\n    var tab1 = document.getElementById('change1');\r\n    var tab2 = document.getElementById('change2');\r\n    var tab3 = document.getElementById('change3');\r\n    var tab4 = document.getElementById('change4');\r\n    var tab5 = document.getElementById('change5');\r\n\r\n    document.getElementById('rate_text').innerHTML = ' '+ratingValue +' '+'votes'+' ('+count+')';\r\n\r\n    if(count != '0'){\r\n        $(rating_disp).rating('select',rating) ;\r\n    }\r\n\r\n    $(submitbutton).click(function(){\r\n\r\n        if(getCheckedValue(rating_in) != '')\r\n        {\r\n            if(creator == '1')\r\n            {\r\n                newcount = parseInt(count);\r\n                ratingValuenew = (((parseFloat(ratingValue)) * parseInt(count)) - parseFloat(creatorNote+1) + parseFloat(getCheckedValue(rating_in)))/newcount;\r\n            }\r\n            else\r\n            {\r\n                newcount = parseInt(count)+1;\r\n                ratingValuenew = ((parseFloat(ratingValue) * parseInt(count))  + parseFloat(getCheckedValue(rating_in)))/newcount;\r\n            }\r\n\r\n            displayValue = Math.round((ratingValuenew * 2) -1);\r\n            $(rating_user).rating('readOnly',false);\r\n            $(rating_user).rating('select',getCheckedValue(rating_in));\r\n            $(rating_user).rating('readOnly',true);\r\n\r\n            $(rating_disp).rating('readOnly',false);\r\n            $(rating_disp).rating('select',displayValue);\r\n            $(rating_disp).rating('readOnly',true);\r\n\r\n            tab0.style.display = 'none';\r\n            tab1.style.display = 'none';\r\n            tab2.style.display = 'none';\r\n\r\n            tab3.style.display = '';\r\n            tab4.style.display = '';\r\n            tab5.style.display = '';\r\n\r\n            document.getElementById('rate_text').innerHTML = ' '+  Math.round(ratingValuenew*100)/100 +' '+'votes'+' ('+newcount+')';\r\n        }\r\n    });\r\n\r\n    $(rating_disp).rating('readOnly',true);\r\n    $(rating_in).rating('readOnly',false);\r\n\r\n    if(creator == 1){\r\n        $(rating_user).rating('readOnly',false);\r\n        $(rating_user).rating('select',creatorNote);\r\n        $(rating_user).rating('readOnly',true);\r\n\r\n        tab0.style.display = 'none';\r\n        tab1.style.display = 'none';\r\n        tab2.style.display = 'none';\r\n\r\n        tab3.style.display = '';\r\n        tab4.style.display = '';\r\n        tab5.style.display = '';\r\n    }\r\n\r\n    $('#changebutton').click(function(){\r\n        tab0.style.display = '';\r\n        tab1.style.display = '';\r\n        tab2.style.display = '';\r\n\r\n        tab3.style.display = 'none';\r\n        tab4.style.display = 'none';\r\n        tab5.style.display = 'none';\r\n     \r\n    });\r\n\r\n    $('#ratingfield').mouseout(function(){\r\n\r\n    $('#submit').val(getCheckedValue(rating_in));\r\n\r\n    });\r\n\r\n});\r\n\r\nfunction getCheckedValue(radioObj) {\r\n    if(!radioObj)\r\n        return \"\";\r\n    var radioLength = radioObj.length;\r\n    if(radioLength == undefined)\r\n        if(radioObj.checked)\r\n            return radioObj.value;\r\n        else\r\n            return \"\";\r\n    for(var i = 0; i < radioLength; i++) {\r\n        if(radioObj[i].checked) {\r\n            return radioObj[i].value;\r\n        }\r\n    }\r\n    return \"\";\r\n}"
  },
  {
    "path": "extensions/community/styles/community.css",
    "content": "/**\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n.comment {\n    background-image: ;\n}"
  },
  {
    "path": "extensions/community/templates/comment.phtml",
    "content": "<p>\n    <form id=\"comment-submit-form\" accept-charset=\"utf-8\" action=\"<?php echo $this->actionUrl ?>\" method=\"post\" name=\"comment\" class=\"width98 ajaxForm reloadOnSuccess\">\n        <?php if ($this->context == 'main.window.community') : ?>\n        <textarea style=\"min-width:50%;min-height:4.5em\" class=\"width99\" name=\"c\"></textarea>\n        <a class=\"button submit\">\n            <img src=\"<?php echo $this->themeUrlBase ?>/images/icon-comment-add.png\" alt=\"add comment icon\" />\n            <span><?php echo $this->_('Post Comment') ?></span>\n        </a>\n        <?php else : ?>\n        <label class=\"display-block onlyAural\" for=\"comment-text\"><?php echo $this->_('Enter your Comment'); ?></label>\n        <input id=\"comment-text\" class=\"text width99 inner-label\" name=\"c\" />\n        <?php endif; ?>\n    </form>\n    <script type=\"text/javascript\">\n        $(document).ready(function() {\n            // the following is not triggered in the main.window.community context\n            $('#comment-submit-form').on('submit', function(event) {\n                event.preventDefault();\n                var data = $(this).serialize();\n                $.post('<?php echo $this->actionUrl ?>', data, function() {\n                    $('#comment-list').load('<?php echo $this->listUrl ?>');\n                    <?php if ($this->context == 'main.window.community') : ?>\n                    $('#comment-submit-form').parents('.content.has-innerwindows').eq(0).children('.innercontent').load(document.URL);\n                    <?php endif; ?>\n                    $('#comment-submit-form').each(function(){this.reset();});\n                });\n            });\n        });\n    </script>\n</p>\n"
  },
  {
    "path": "extensions/community/templates/community/list.phtml",
    "content": "<?php if ($this->has('infomessage')): ?>\n    <p class=\"messagebox info\"><?php echo $this->_($this->infomessage) ?></p>\n<?php endif?>\n\n<?php if ($this->has('comments')): ?>\n    <div id=\"comment-list\">\n<?php echo $this->comments; ?>\n</div>\n<?php endif?>\n"
  },
  {
    "path": "extensions/community/templates/lastchanges.phtml",
    "content": "<?php\n\n/**\n * OntoWiki lastchanges module template\n *\n * @author     Sebastian Dietzold <dietzold@informatik.uni-leipzig.de>\n * @copyright  Copyright (c) 2009, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @version    $Id:  $\n */\n\n?>\n<?php if ($this->has('warningmessage')): ?>\n    <p class=\"messagebox info\"><?php echo $this->warningmessage ?></p>\n<?php endif?>\n<?php if ($this->has('infomessage')): ?>\n    <p class=\"messagebox info\"><?php echo $this->infomessage ?></p>\n<?php endif?>\n\n<?php if ($this->has('changes')): ?>\n<ol class=\"bullets-none separated\">\n<?php $odd = false; ?>\n<?php foreach($this->changes as $change): ?>\n    <li class=\"<?php echo $odd ? 'odd' : 'even'; $odd = !$odd; ?>\">\n            <a resource=\"<?php echo $change['resource'] ?>\" class=\"Resource hasMenu\"\n               about=\"<?php echo $change['resource'] ?>\"\n               href=\"<?php echo $change['rhref'] ?>\">\n                <?php echo $change['rname'] ?>\n            </a> by\n            <a class=\"Resource hasMenu\"\n               about=\"<?php echo $change['aresource'] ?>\"\n               href=\"<?php echo $change['ahref'] ?>\">\n                <?php echo $change['author'] ?>\n            </a>\n        </li>\n<?php endforeach; ?>\n</ol>\n<?php endif?>\n"
  },
  {
    "path": "extensions/community/templates/lastcomments.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki lastcomments module template\n *\n * @author     Sebastian Tramp <tramp@informatik.uni-leipzig.de>\n * @author     Natanael Arndt <arndtn@gmail.com>\n */\n?>\n<?php if ($this->has('infomessage')): ?>\n    <p class=\"messagebox info\"><?php echo $this->_($this->infomessage) ?></p>\n<?php endif?>\n\n<?php if ($this->has('comments')): ?>\n<div id=\"comment-list\">\n<?php echo $this->comments; ?>\n</div>\n\n<?php if ($this->has('more')): ?>\n    <p class=\"messagebox info\">There are more comments out there ...</p>\n<?php endif?>\n\n<?php endif?>\n"
  },
  {
    "path": "extensions/community/templates/partials/list_community_item.phtml",
    "content": "<?php\n$author = $this->author;\nif ($author === null) {\n    $author = '<em>anonymous</em>';\n}\n?>\n    <tr\n        about=\"<?php echo $this->comment ?>\"\n        resource=\"<?php echo $this->comment ?>\"\n        class=\"Resource community-item comment <?php echo $this->odd ? 'odd' : 'even'; ?>\"\n    >\n        <td>\n            <div class=\"has-contextmenu-area\">\n                <div class=\"contextmenu\">\n                    <a href=\"<?php echo $this->commentUrl ?>\"\n                        class=\"item\">\n                        <span class=\"icon icon-arrow-next\" title=\"Jump to resource\">\n                            <span>Jump to resource</span>\n                        </span>\n                    </a>\n                </div>\n                <strong><?= $author ?></strong>\n                <?php if (isset($this->resource)) : ?>\n                on \n                <a\n                    about=\"<?php echo $this->resource ?>\"\n                    resource=\"<?php echo $this->resource ?>\"\n                    class=\"Resource hasMenu\"\n                    href=\"<?php echo $this->resourceUrl ?>\"\n                ><?php echo $this->resourceName ?></a>\n                <?php endif; ?>\n                <span class=\"date\">(<?php echo $this->date ?>)</span>:\n                <?php echo $this->content ?>\n            </div>\n        </td>\n    </tr>\n"
  },
  {
    "path": "extensions/community/templates/partials/list_community_main.phtml",
    "content": "<table class=\"separated-vertical\">\n<?php\n$odd = true;\nforeach ($this->instanceInfo as $instance){\n    $author = null;\n    if (isset($this->instanceData[$instance['uri']]['creator'][0]['value'])) {\n        $author = $this->instanceData[$instance['uri']]['creator'][0]['value'];\n    }\n    $options = array(\n        'author'        => $author,\n        'comment'       => $instance['uri'],\n        'commentUrl'    => $instance['url'],\n        'content'       => $this->instanceData[$instance['uri']]['content'][0]['value'],\n        'date'          => OntoWiki_Utils::dateDifference(strtotime($this->instanceData[$instance['uri']]['date'][0]['value']), time()),\n        'odd'           => $odd,\n    );\n    if (!$this->other->singleResource) {\n        $options['resource']        = $this->instanceData[$instance['uri']]['about'][0]['uri'];\n        $options['resourceUrl']     = $this->instanceData[$instance['uri']]['about'][0]['url'];\n        $options['resourceName']    = $this->instanceData[$instance['uri']]['about'][0]['value'];\n    }\n    echo $this->partial('partials/list_community_item.phtml', $options);\n    $odd = !$odd;\n}\n?>\n</table>\n"
  },
  {
    "path": "extensions/community/templates/rating.phtml",
    "content": "<table class=\"separated-vertical\">\n    <tr >\n        <td>\n            <div>Current Rating </div>\n        </td>\n    </tr>\n\n\n    <tr class=\"even\">\n        <td>\n            <input  type=\"radio\" class=\"star {split:2}\" name=\"rating\" value=\"0.5\"/>\n            <input  type=\"radio\" class=\"star {split:2}\" name=\"rating\" value=\"1\"/>\n            <input  type=\"radio\" class=\"star {split:2}\" name=\"rating\" value=\"1.5\"/>\n            <input  type=\"radio\" class=\"star {split:2}\" name=\"rating\" value=\"2\"/>\n            <input  type=\"radio\" class=\"star {split:2}\" name=\"rating\" value=\"2.5\"/>\n            <input  type=\"radio\" class=\"star {split:2}\" name=\"rating\" value=\"3\"/>\n            <input  type=\"radio\" class=\"star {split:2}\" name=\"rating\" value=\"3.5\"/>\n            <input  type=\"radio\" class=\"star {split:2}\" name=\"rating\" value=\"4\"/>\n            <input  type=\"radio\" class=\"star {split:2}\" name=\"rating\" value=\"4.5\"/>\n            <input  type=\"radio\" class=\"star {split:2}\" name=\"rating\" value=\"5\"/>\n\n            <div id=\"rate_text\" > </div>\n        </td>\n    </tr>\n\n    <tr  id =\"change0\" >\n        <td>\n            <div> Rate the Resource </div>\n        </td>\n    </tr>\n    <tr id =\"change1\">\n        <td id=\"ratingfield\">\n            <input  type=\"radio\" class=\"star {split:1}\" name=\"rating_input\" value=\"1\"/>\n            <input  type=\"radio\" class=\"star {split:1}\" name=\"rating_input\" value=\"2\"/>\n            <input  type=\"radio\" class=\"star {split:1}\" name=\"rating_input\" value=\"3\"/>\n            <input  type=\"radio\" class=\"star {split:1}\" name=\"rating_input\" value=\"4\"/>\n            <input  type=\"radio\" class=\"star {split:1}\" name=\"rating_input\" value=\"5\"/>\n        </td>\n    </tr>\n    <tr  id =\"change2\" >\n        <td>\n            <form action=\"<?php echo $this->actionUrl ?>\" method=\"post\" accept-charset=\"utf-8\" name=\"note\" class=\"ajaxForm reloadOnSuccess\">\n                <fieldset style=\"display:none;\">\n                    <textarea id =\"submit\" style=\"min-width:50%;min-height:4.5em\" class=\"width99\" name=\"rating\"></textarea>\n                </fieldset>\n                <a class=\"button submit\" name =\"submitbutton\">\n                    <img src=\"<?php echo $this->themeUrlBase ?>/images/icon-comment-add.png\" alt=\"add comment icon\" />\n                    <span><?php echo $this->_('Rate') ?></span>\n                </a>\n            </form>\n        </td>\n    </tr>\n\n\n    <tr style=\"display:none;\" id =\"change3\">\n        <td>\n            <div> Your Vote: </div>\n        </td>\n    </tr>\n    <tr style=\"display:none;\" id =\"change4\">\n        <td>\n            <input  type=\"radio\" class=\"star {split:1}\" name=\"rating_user\" value=\"1\"/>\n            <input  type=\"radio\" class=\"star {split:1}\" name=\"rating_user\" value=\"2\"/>\n            <input  type=\"radio\" class=\"star {split:1}\" name=\"rating_user\" value=\"3\"/>\n            <input  type=\"radio\" class=\"star {split:1}\" name=\"rating_user\" value=\"4\"/>\n            <input  type=\"radio\" class=\"star {split:1}\" name=\"rating_user\" value=\"5\"/>\n        </td>\n    </tr>\n    <tr style=\"display:none;\" id =\"change5\">\n        <td>\n            <a class=\"button submit\" id =\"changebutton\" >\n                <img src=\"<?php echo $this->themeUrlBase ?>/images/icon-edit.png\" alt=\"add comment icon\" />\n                <span><?php echo $this->_('Change') ?></span>\n            </a>\n        </td>\n    </tr>\n\n\n</table>\n\n\n"
  },
  {
    "path": "extensions/cors/CorsPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * The main class for the cors plugin.\n *\n * @category   OntoWiki\n * @package    Extensions_Cors\n * @author     Sebastian Tramp <tramp@informatik.uni-leipzig.de>\n */\nclass CorsPlugin extends OntoWiki_Plugin\n{\n    /*\n     * our event method\n     */\n    public function onRouteStartup()\n    {\n        $this->addCorsHeader();\n    }\n\n    /*\n     * here we add the header field(s)\n     */\n    private function addCorsHeader()\n    {\n        $response = Zend_Controller_Front::getInstance()->getResponse();\n\n        /*\n         * TODO: allow more CORS header fields here\n         */\n        if (isset($this->_privateConfig->accessControlAllowOrigin)) {\n            $value = $this->_privateConfig->accessControlAllowOrigin;\n            $response->setHeader('Access-Control-Allow-Origin', $value, true);\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/cors/default.ini",
    "content": "enabled     = true\nname        = \"CORS\"\ndescription = \"Setup Cross-Origin Resource Sharing (CORS)\"\nauthor      = \"Sebastian Tramp\"\nauthorUrl   = \"http://sebastian.tramp.name\"\nurl         = http://enable-cors.org/\n\n[events]\n1 = onRouteStartup\n\n[private]\naccessControlAllowOrigin = \"*\"\n"
  },
  {
    "path": "extensions/cors/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/cors/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :cors .\n:cors a doap:Project ;\n  doap:name \"cors\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/cors/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"CORS\" ;\n  doap:description \"Setup Cross-Origin Resource Sharing (CORS)\" ;\n  owconfig:authorLabel \"Sebastian Tramp\" ;\n  doap:maintainer <http://sebastian.tramp.name> ;\n  :url <http://enable-cors.org/> ;\n  owconfig:pluginEvent event:onRouteStartup ;\n  :accessControlAllowOrigin \"*\" ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/datagathering/DatagatheringController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * The main controller class for the datagathering component. This class\n * provides services for URI search, statement import and statement sync.\n *\n * @category   OntoWiki\n * @package    Extensions_Datagathering\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass DatagatheringController extends OntoWiki_Controller_Component\n{\n    // ------------------------------------------------------------------------\n    // --- Search related constants -------------------------------------------\n    // ------------------------------------------------------------------------\n\n    const SEARCH_MODE_ALL        = 0;\n    const SEARCH_MODE_PROPERTIES = 1;\n\n    const SEARCH_DEFAULT_LIMIT = 20;\n    const SEARCH_MAX_LIMIT     = 100;\n\n\n    // ------------------------------------------------------------------------\n    // --- Import and Sync related constants ----------------------------------\n    // ------------------------------------------------------------------------\n\n    /**\n     * New versioning type codes.\n     */\n    const VERSIONING_IMPORT_ACTION_TYPE = 1010;\n    const VERSIONING_SYNC_ACTION_TYPE   = 1020;\n\n    /**\n     * Syncing status codes\n     */\n    const NO_SYNC_CONFIG_FOUND = 20;\n    const NO_EDITING_RIGHTS    = 10;\n    const SYNC_SUCCESS         = 30;\n\n    /**\n     * IMPORT STATUS CODES\n     */\n    const IMPORT_OK                           = 10;\n    const IMPORT_NO_DATA                      = 20;\n    const IMPORT_NO_NEW_DATA                  = 21;\n    const IMPORT_WRAPPER_ERR                  = 30;\n    const IMPORT_WRAPPER_INSTANCIATION_ERR    = 40;\n    const IMPORT_NOT_EDITABLE                 = 50;\n    const IMPORT_WRAPPER_NOT_AVAILABLE        = 70;\n    const IMPORT_WRAPPER_RESULT_NOT_AVAILABLE = 71;\n    const IMPORT_CUSTOMFILTER_EXCEPTION       = 80;\n    const IMPORT_GENERAL_EXCEPTION            = 90;\n\n    // ------------------------------------------------------------------------\n    // --- Import and Sync related private properties -------------------------\n    // ------------------------------------------------------------------------\n\n    /**\n     * Contains an array with matching sync configs.\n     *\n     * @var array\n     */\n    private $_syncConfigCache = array();\n\n\n    // ------------------------------------------------------------------------\n    // --- General private properties for this component ----------------------\n    // ------------------------------------------------------------------------\n\n    /**\n     * Contains the graph URI of the selected graph or the uri which is given\n     * by the m parameter\n     *\n     * @var string|null\n     */\n    private $_graphUri = null;\n\n    /**\n     * Contains the properties as configured in the ini file.\n     *\n     * @var array\n     */\n    private $_properties = array();\n\n    /**\n     * Contains the sync model helper URI as configured in the ini file.\n     *\n     * @var string\n     */\n    private $_syncModelHelperBase = null;\n\n    /**\n     * Contains the sync model URI as configured in the ini file.\n     *\n     * @var string\n     */\n    private $_syncModelUri = null;\n\n    /**\n     * Contains a reference to the wrapper registry.\n     *\n     * @var Erfurt_Wrapper_Registry\n     */\n    private $_wrapperRegistry = null;\n\n\n    // ------------------------------------------------------------------------\n    // --- Component initialization -------------------------------------------\n    // ------------------------------------------------------------------------\n\n    public function init()\n    {\n        parent::init();\n\n        $this->_syncModelUri        = $this->_privateConfig->syncModelUri;\n        $this->_syncModelHelperBase = $this->_privateConfig->syncModelHelperBase;\n\n        // For testability we reset the wrapper registry first, since\n        // multiple calls of this method would fail otherwise.\n        Erfurt_Wrapper_Registry::reset();\n        $this->_wrapperRegisty = Erfurt_Wrapper_Registry::getInstance();\n\n        $owApp = OntoWiki::getInstance();\n        if (null !== $owApp->selectedModel) {\n            $this->_graphUri = $owApp->selectedModel->getModelIri();\n        } else {\n            if (isset($this->_request->m)) {\n                $this->_graphUri = $this->_request->m;\n            }\n        }\n    }\n\n\n    // ------------------------------------------------------------------------\n    // --- URI and Property Search related methods ----------------------------\n    // ------------------------------------------------------------------------\n\n    /**\n     * Searches for relevant URIs for given term(s). This service has two\n     * modes. One that returns all matching URIs and one that returns only\n     * resource URIs that are defined as properties or at least used once as\n     * property.\n     *\n     * q - The mandatory parameter q contains a whitespace seperated list of\n     *     serach terms.\n     *\n     * mode - This optional parameter sets the search mode. The default value\n     *        is 0. In this mode all matching URIs will be returned. If the\n     *        mode is set to 1, only matching URIs are returned, that are\n     *        defined as properties or that are used as propertie at least\n     *        once.\n     *\n     * limit - Optional sets the maximum number of URIs the result may contain.\n     *         The default value is SEARCH_DEFAULT_LIMIT. The maximum value\n     *         is SEARCH_MAX_LIMIT.\n     *\n     * classes - an optional paramter which is a json_encoded array of class URIs\n     *\n     * This service will output a json encoded string, which represents the\n     * result list. Each entry is returned with an title, the URI itself and\n     * the source of that result. The entry components are sepearted by a | and\n     * the entries are seperated by a newline. If nothing is found an empty\n     * json encodes string will be returned.\n     */\n    public function searchAction()\n    {\n        // Use the selected graph if present. If not, search all available graphs.\n        if (null === $this->_graphUri) {\n            throw new OntoWiki_Exception(\"model must be selected or specified with the m parameter\");\n        }\n        $modelUri = $this->_graphUri;\n\n        // Check for the mandatory q parameter.\n        $q = $this->_request->q;\n        if (null === $q) {\n            $this->_response->setRawHeader('HTTP/1.0 400 Bad Request');\n            echo '400 Bad Request - The q parameter is missing.';\n\n            return;\n        }\n        $termsArray = explode(' ', $q);\n\n        // check for the classes json array\n        $classes = array();\n        if (null !== $this->_request->classes) {\n            $classes = json_decode($this->_request->classes);\n            if (!is_array($classes)) {\n                $classes = array();\n            }\n        }\n\n        // Set the search mode.\n        if (null !== $this->_request->mode) {\n            if ((int)$this->_request->mode === self::SEARCH_MODE_PROPERTIES) {\n                $mode = self::SEARCH_MODE_PROPERTIES;\n            } else {\n                // Default to search mode all.\n                $mode = self::SEARCH_MODE_ALL;\n            }\n        } else {\n            $mode = self::SEARCH_MODE_ALL;\n        }\n\n        // Check for optional limit parameter.\n        if (null !== $this->_request->limit) {\n            $limit = $this->_request->limit;\n            if ((int)$limit > 0 && $limit <= self::SEARCH_MAX_LIMIT) {\n                $limit = (int)$limit;\n            } else {\n                // Default to search mode all.\n                $limit = self::SEARCH_DEFAULT_LIMIT;\n            }\n        } else {\n            $limit = self::SEARCH_DEFAULT_LIMIT;\n        }\n\n        // Check whether given term is a URI! If a URI is given we return an empty result, for some users\n        // may want to enter URIs themself.\n        if (count($termsArray) === 1) {\n            foreach ($termsArray as $t) {\n                $regExp = '/^(' . implode(':|', $this->_listIanaSchemes()) . ':).$/';\n\n                if (preg_match($regExp, $t)) {\n                    echo json_encode('');\n\n                    return;\n                }\n                if (strlen($t) > 20) {\n                    echo json_encode('');\n\n                    return;\n                }\n            }\n        }\n\n        $result = array();\n\n        // Step 1a: Search the local database for URIs (class restricted)\n        $localWithRestriction = $this->_searchLocal($termsArray, $modelUri, $mode, $limit, $classes);\n        if (count($localWithRestriction) > 0) {\n            $result = $localWithRestriction;\n        }\n        // Step 1b: Search the local database for URIs (NOT class restricted)\n        $local = $this->_searchLocal($termsArray, $modelUri, $mode, $limit);\n        if (count($local) > 0) {\n            // put new result values at the end of the result array\n            foreach ($local as $resultKey => $resultValue) {\n                if (!isset($result[$resultKey])) {\n                    $result[$resultKey] = $resultValue;\n                }\n            }\n        }\n\n        if ($mode === self::SEARCH_MODE_ALL && count($result) < $limit) {\n            // Step 2: Extend the result with the results from plugins...\n            $currentCount = count($result);\n\n            require_once 'Erfurt/Event.php';\n            $event             = new Erfurt_Event('onDatagatheringComponentSearch');\n            $event->translate  = $this->_owApp->translate;\n            $event->termsArray = $termsArray;\n            $event->modelUri   = $modelUri;\n            $event->classes    = $classes;\n            $pluginResult      = $event->trigger();\n\n            if (is_array($pluginResult)) {\n                foreach ($pluginResult as $uri => $value) {\n                    if (!isset($result[$uri])) {\n                        $result[$uri] = $value;\n                        $currentCount++;\n                    }\n\n                    if ($currentCount === $limit) {\n                        break;\n                    }\n                }\n            }\n\n            // 3. Step: Expand qnames\n            if (count($result) < $limit) {\n                $currentCount = count($result);\n\n                $expanded = $this->_expandNamespaces($termsArray, $modelUri);\n                if (count($expanded) > 0) {\n                    foreach ($expanded as $uri => $value) {\n                        if (!isset($result[$uri])) {\n                            $result[$uri] = $value;\n                            $currentCount++;\n                        }\n\n                        if ($currentCount === $limit) {\n                            break;\n                        }\n                    }\n                }\n            }\n\n            // 4. If there is place for one more result, we add auto generated URI.\n            if (count($result) < $limit) {\n                $store = Erfurt_App::getInstance()->getStore();\n                $model = $store->getModel($modelUri);\n\n                if ($model) {\n                    $suffix = '';\n                    foreach ($termsArray as $t) {\n                        $suffix .= ucfirst($t);\n                    }\n\n                    $prefix   = $model->getBaseUri();\n                    $lastChar = substr($prefix, -1);\n                    if ($lastChar !== '/' && $lastChar !== '#') {\n                        $prefix .= '/';\n                    }\n                    $uri = $prefix . urlencode($suffix);\n\n                    if (!isset($result[$uri])) {\n                        $translate    = $this->_owApp->translate;\n                        $result[$uri] = implode(' ', $termsArray) . '|' . $uri . '|' . $translate->_('Generated URI');\n                    }\n                }\n            }\n        }\n\n        // 5. if the user input was an URI, give this URI as result back too\n        if (Zend_Uri::check($termsArray[0]) == true) {\n            $translate = $this->_owApp->translate;\n            $result    = array(\n                $termsArray[0] => $termsArray[0] . '|' . $termsArray[0] . '|' . $translate->_('your manual input')\n            ) + $result;\n        }\n\n        $body = json_encode(implode(PHP_EOL, $result));\n\n        if (isset($this->_request->callback)) {\n            $callback = $this->_request->callback;\n\n            // build jsonp\n            $body = $callback\n                . ' ('\n                . $body\n                . ')';\n        }\n\n        // send\n        $response = $this->getResponse();\n        $response->setBody($body);\n    }\n\n    /**\n     * Expands qnames if possible.\n     *\n     * @param array  $termsArray\n     * @param string $modelUri\n     *\n     * @return array\n     */\n    private function _expandNamespaces(array $termsArray, $modelUri)\n    {\n        $result = array();\n\n        // We need the model here, for prefix definitions are model specific.\n        if (null === $modelUri) {\n            return $result;\n        }\n\n        $erfurtNamespaces = Erfurt_App::getInstance()->getNamespaces();\n        $namespaces       = $erfurtNamespaces->getNamespacePrefixes($modelUri);\n\n        $translate = $this->_owApp->translate;\n        foreach ($termsArray as $t) {\n            if ($pos = strpos($t, ':')) {\n                $prefix = substr($t, 0, $pos);\n                $local  = substr($t, $pos + 1);\n\n                if (isset($namespaces[$prefix])) {\n                    $uri          = $namespaces[$prefix] . $local;\n                    $result[$uri] = implode(' ', $termsArray) . '|' . $uri . '|' . $translate->_('Expanded QNames');\n                }\n            }\n        }\n\n        return $result;\n    }\n\n    /**\n     * Returns a number between 0 and 1, which weights a result regardings its\n     * value for the given search.\n     *\n     * @param array       $termsArray\n     * @param string      $uri\n     * @param string|null $object\n     *\n     * @return int\n     */\n    private function _getWeight(array $termsArray, $uri, $object = null)\n    {\n        if (null !== $object) {\n            $object = strtolower($object);\n        }\n\n        $weight = 0.0;\n\n        if (substr($uri, -1) === '/') {\n            $uri = substr($uri, 0, -1);\n        }\n\n        if ($i = strrpos($uri, '#')) {\n            $uriLocalPart = substr($uri, $i + 1);\n        } else {\n            if ($i = strrpos($uri, '/')) {\n                $uriLocalPart = substr($uri, $i + 1);\n            }\n        }\n\n        if (null !== $uriLocalPart) {\n            foreach ($termsArray as $t) {\n                if (strpos($uriLocalPart, $t) !== false) {\n                    $weight += 0.4 / count($termsArray);\n                }\n            }\n        }\n\n        if (null !== $object) {\n            foreach ($termsArray as $t) {\n                if (strpos($object, $t) !== false) {\n                    $weight += 0.5 / count($termsArray);\n                }\n            }\n        }\n\n        if (strlen(implode('', $termsArray)) === strlen(str_replace(' ', '', trim($object)))) {\n            $weight += 0.1;\n        }\n\n        return $weight;\n    }\n\n    /**\n     * Returns a list of registered URI schemes.\n     *\n     * @return array\n     */\n    private function _listIanaSchemes()\n    {\n        return array('aaa', 'aaas', 'acap', 'cap', 'cid', 'crid', 'data', 'dav', 'dict', 'dns', 'fax', 'file', 'ftp',\n                     'go', 'gopher', 'h323', 'http', 'https', 'iax', 'icap', 'im', 'imap', 'info', 'ipp', 'iris',\n                     'iris.beep',\n                     'iris.xpc', 'iris.xpcs', 'iris.lwz', 'ldap', 'mailto', 'mid', 'modem', 'msrp', 'msrps', 'mtqp',\n                     'mupdate',\n                     'news', 'nfs', 'nntp', 'opaquelocktoken', 'pop', 'pres', 'rtsp', 'service', 'shttp', 'sieve',\n                     'sip', 'sips',\n                     'snmp', 'soap.beep', 'soap.beeps', 'tag', 'tel', 'telnet', 'tftp', 'thismessage', 'tip', 'tv',\n                     'urn',\n                     'vemmi', 'xmlrpc.beep', 'xmlrpc.beeps', 'xmpp', 'z39.50r', 'z39.50s', 'afs', 'dtn', 'mailserver',\n                     'pack',\n                     'tn3270', 'prospero', 'snews', 'videotex', 'wais'\n        );\n    }\n\n    /**\n     * Searches the local database for URIs. If mode is set to properties only,\n     * only defined properties and URIs that are used at least once as a\n     * property are returned.\n     *\n     * the classes array is used for class restrictions\n     *\n     * @param array  $termsArray\n     * @param string $modelUri\n     * @param int    $mode\n     * @param int    $limit\n     * @param array  $classes\n     *\n     * @return array\n     */\n    private function _searchLocal(array $termsArray, $modelUri, $mode, $limit, $classes = array())\n    {\n        if ($mode === self::SEARCH_MODE_PROPERTIES) {\n            return $this->_searchLocalPropertiesOnly($termsArray, $modelUri, $limit);\n        }\n\n        $store = Erfurt_App::getInstance()->getStore();\n\n        // get a store specific text-search query2 object\n        $searchPattern = $store->getSearchPattern(implode(\" \", $termsArray), $modelUri);\n        $query         = new Erfurt_Sparql_Query2();\n        $query->addElements($searchPattern);\n        $projVar = new Erfurt_Sparql_Query2_Var('resourceUri');\n        $query->addProjectionVar($projVar);\n\n        // add class restriction patterns for each class\n        foreach ($classes as $class) {\n            $classPattern = new Erfurt_Sparql_Query2_GroupGraphPattern();\n            $classPattern->addTriple(\n                $projVar,\n                new Erfurt_Sparql_Query2_IriRef(EF_RDF_TYPE),\n                new Erfurt_Sparql_Query2_IriRef($class)\n            );\n            $query->addElement($classPattern);\n        }\n\n        $query->setLimit(20);\n        $query->setDistinct(true);\n\n        $queryResult = $store->sparqlQuery($query, array('result_format' => 'extended'));\n\n        $tempResult = array();\n\n        foreach ($queryResult['results']['bindings'] as $row) {\n            $object = isset($row['o']) ? $row['o']['value'] : null;\n\n            $weight = $this->_getWeight($termsArray, $row['resourceUri']['value'], $object);\n\n            if (isset($tempResult[$row['resourceUri']['value']])) {\n                if ($weight > $tempResult[$row['resourceUri']['value']]) {\n                    $tempResult[$row['resourceUri']['value']] = $weight;\n                }\n            } else {\n                $tempResult[$row['resourceUri']['value']] = $weight;\n            }\n        }\n\n        arsort($tempResult);\n\n        require_once 'OntoWiki/Model/TitleHelper.php';\n        require_once 'OntoWiki/Utils.php';\n        if (null !== $modelUri) {\n            $model       = $store->getModel($modelUri, false);\n            $titleHelper = new OntoWiki_Model_TitleHelper($model);\n        } else {\n            $titleHelper = new OntoWiki_Model_TitleHelper();\n        }\n        $titleHelper->addResources(array_keys($tempResult));\n\n        $translate = $this->_owApp->translate;\n\n        // create different source description strings\n        if (count($classes) > 0) {\n            $sourceString = $translate->_('Local Search') . ' (' . $translate->_('recommended') . ')';\n        } else {\n            $sourceString = $translate->_('Local Search');\n        }\n\n        $result = array();\n        foreach ($tempResult as $uri => $w) {\n            $title = $titleHelper->getTitle($uri);\n\n            if (null !== $title) {\n                $result[$uri] = str_replace('|', '&Iota;', $title) . '|' . $uri . '|' . $sourceString;\n            } else {\n                $result[$uri] = OntoWiki_Utils::compactUri($uri) . $uri . '|' . $sourceString;\n            }\n        }\n\n        return $result;\n    }\n\n    /**\n     * Searches for properties in the local database.\n     *\n     * @param array  $termsArray\n     * @param string $modelUri\n     * @param int    $limit\n     *\n     * @return array\n     */\n    private function _searchLocalPropertiesOnly(array $termsArray, $modelUri, $limit)\n    {\n        require_once 'Erfurt/Sparql/SimpleQuery.php';\n        $query = new Erfurt_Sparql_SimpleQuery();\n        $query->setSelectClause('SELECT DISTINCT ?uri ?o');\n\n        if (null !== $modelUri) {\n            $query->addFrom($modelUri);\n        }\n\n        $where = '{ { ?uri ?p ?o . ?uri <' . EF_RDF_TYPE . '> ?o2 .\n            FILTER (\n                sameTerm(?o2, <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property>) ||\n                sameTerm(?o2, <http://www.w3.org/2002/07/owl#DatatypeProperty>) ||\n                sameTerm(?o2, <http://www.w3.org/2002/07/owl#ObjectProperty>)\n            )\n            FILTER ((';\n\n        $uriRegexFilter = array();\n        foreach ($termsArray as $t) {\n            $uriRegexFilter[] = 'regex(str(?uri), \"' . $t . '\", \"i\")';\n        }\n        $where .= implode(' && ', $uriRegexFilter) . ') || (isLiteral(?o) && ';\n\n        $oRegexFilter = array();\n        foreach ($termsArray as $t) {\n            $oRegexFilter[] = 'regex(?o, \"' . $t . '\", \"i\")';\n        }\n        $where .= implode(' && ', $oRegexFilter) . ')) } UNION {';\n\n        $where\n            .= '?s ?uri ?o .\n                  FILTER (';\n        $where .= implode(' && ', $uriRegexFilter) . ') } }';\n\n        $query->setWherePart($where);\n        $query->setOrderClause('?uri');\n        $query->setLimit($limit);\n\n        $store       = Erfurt_App::getInstance()->getStore();\n        $queryResult = $store->sparqlQuery($query, array('result_format' => 'extended'));\n\n        $tempResult = array();\n        foreach ($queryResult['results']['bindings'] as $row) {\n            if ($row['o']['type'] === 'literal') {\n                $weight = $this->_getWeight($termsArray, $row['uri']['value'], $row['o']['value']);\n            } else {\n                $weight = $this->_getWeight($termsArray, $row['uri']['value']);\n            }\n\n            if (isset($tempResult[$row['uri']['value']])) {\n                if ($weight > $tempResult[$row['uri']['value']]) {\n                    $tempResult[$row['uri']['value']] = $weight;\n                }\n            } else {\n                $tempResult[$row['uri']['value']] = $weight;\n            }\n        }\n\n        arsort($tempResult);\n\n        require_once 'OntoWiki/Model/TitleHelper.php';\n        require_once 'OntoWiki/Utils.php';\n        if (null !== $modelUri) {\n            $model       = $store->getModel($modelUri, false);\n            $titleHelper = new OntoWiki_Model_TitleHelper($model);\n        } else {\n            $titleHelper = new OntoWiki_Model_TitleHelper();\n        }\n        $titleHelper->addResources(array_keys($tempResult));\n\n        $translate = $this->_owApp->translate;\n        $result    = array();\n        foreach ($tempResult as $uri => $w) {\n            $title = $titleHelper->getTitle($uri);\n\n            if (null !== $title) {\n                $result[$uri] = str_replace('|', '&Iota;', $title) . '|' . $uri . '|' . $translate->_('Local Search');\n            } else {\n                $result[$uri] = OntoWiki_Utils::compactUri($uri) . $uri . '|' .\n                    $translate->_('Local Search');\n            }\n        }\n\n        return $result;\n    }\n\n\n    // ------------------------------------------------------------------------\n    // --- Statement import related methods -----------------------------------\n    // ------------------------------------------------------------------------\n\n    /**\n     * Imports data available for a given URI and wrapper name.\n     *\n     * uri - Mandatory parameter that contains the URI to test.\n     *\n     * wrapper - Optional parameter, which contains the name of the wrapper\n     *           to use. If not given linkeddata is used as default.\n     */\n    public function importAction()\n    {\n        // Disable rendering\n        $this->_helper->viewRenderer->setNoRender();\n        $this->_helper->layout()->disableLayout();\n\n        // We require GET requests here.\n        if (!$this->_request->isGet()) {\n            $this->_response->setException(new OntoWiki_Http_Exception(400));\n\n            return;\n        }\n\n        // uri param is required.\n        if (!isset($this->_request->uri)) {\n            $this->_response->setException(new OntoWiki_Http_Exception(400));\n\n            return;\n        }\n        $uri = urldecode($this->_request->uri);\n\n        $wrapperName = 'linkeddata';\n        if (isset($this->_request->wrapper)) {\n            $wrapperName = $this->_request->wrapper;\n        }\n\n        if (null === $this->_graphUri) {\n            throw new OntoWiki_Exception(\"model must be selected or specified with the m parameter\");\n        }\n\n        $presets = array();\n        if (isset($this->_privateConfig->fetch->preset)) {\n            $presets = $this->_privateConfig->fetch->preset->toArray();\n        }\n\n        $exceptedProperties = array();\n        if (isset($this->_privateConfig->fetch->default->exception)) {\n            $exceptedProperties = $this->_privateConfig->fetch->default->exception->toArray();\n        }\n\n        try {\n            $res = self::import(\n                $this->_graphUri,\n                $uri,\n                $this->_getProxyUri($uri),\n                isset($this->_privateConfig->fetch->allData)\n                && ((boolean)$this->_privateConfig->fetch->allData === true),\n                $presets,\n                $exceptedProperties,\n                $wrapperName,\n                $this->_privateConfig->fetch->default->mode\n            );\n        } catch (Exception $e) {\n            if (defined('_EFDEBUG')) {\n                $errorMessage = 'An error occured: ' . $e->getMessage() . \" – \" . $e->getTraceAsString();\n                return $this->_sendResponse(false, $errorMessage, OntoWiki_Message::ERROR);\n            } else {\n                $res = null;\n            }\n        }\n\n        if ($res == self::IMPORT_OK) {\n            return $this->_sendResponse(\n                true,\n                'Data was found for the given URI. Statements were added.',\n                OntoWiki_Message::INFO\n            );\n        } else {\n            if ($res == self::IMPORT_WRAPPER_ERR) {\n                return $this->_sendResponse(\n                    false, 'The requested wrapper failed with an error.', OntoWiki_Message::ERROR\n                );\n            } else {\n                if ($res == self::IMPORT_NO_DATA) {\n                    return $this->_sendResponse(false, 'No statements were found.', OntoWiki_Message::ERROR);\n                } else {\n                    if ($res == self::IMPORT_NO_NEW_DATA) {\n                        return $this->_sendResponse(false, 'No new statements were found.', OntoWiki_Message::ERROR);\n                    } else {\n                        if ($res == self::IMPORT_WRAPPER_INSTANCIATION_ERR) {\n                            $this->_response->setException(new OntoWiki_Http_Exception(400));\n\n                            return $this->_sendResponse(\n                                false, 'could not get wrapper instance.', OntoWiki_Message::ERROR\n                            );\n                        } else {\n                            if ($res == self::IMPORT_NOT_EDITABLE) {\n                                $this->_response->setException(new OntoWiki_Http_Exception(403));\n\n                                return $this->_sendResponse(\n                                    false, 'you cannot write to this model.', OntoWiki_Message::ERROR\n                                );\n                            } else {\n                                if ($res == self::IMPORT_WRAPPER_NOT_AVAILABLE) {\n                                    return $this->_sendResponse(\n                                        false, 'The requested wrapper is not available.', OntoWiki_Message::ERROR\n                                    );\n                                } else {\n                                    if ($res == self::IMPORT_WRAPPER_RESULT_NOT_AVAILABLE) {\n                                        return $this->_sendResponse(\n                                            false, 'The requested wrapper returned no result.', OntoWiki_Message::ERROR\n                                        );\n                                    } else {\n                                        return $this->_sendResponse(\n                                            false, 'unexpected return value.', OntoWiki_Message::ERROR\n                                        );\n                                    }\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    public static function filterStatements(\n        $statements, $uri, $all = true, $presets = array(),\n        $exceptedProperties = array(), $fetchMode = 'none'\n    ) {\n        // TODO handle configuration for import...\n        if ($all) {\n            // Keep all data...\n            return $statements;\n        } else {\n            // Only use those parts of the data, that have the resource URI as subject.\n            if (isset($statements[$uri])) {\n                $statements = array(\n                    $uri => $statements[$uri]\n                );\n            } else {\n                $statements = array();\n            }\n\n            // We also need to remove all blank node objects\n            $newResult = array();\n            foreach ($statements as $s => $pArray) {\n                foreach ($pArray as $p => $oArray) {\n                    foreach ($oArray as $oSpec) {\n                        if ($oSpec['type'] !== 'bnode') {\n                            if (!isset($newResult[$s])) {\n                                $newResult[$s] = array();\n                            }\n                            if (!isset($newResult[$s][$p])) {\n                                $newResult[$s][$p] = array();\n                            }\n                            $newResult[$s][$p][] = $oSpec;\n                        }\n                    }\n                }\n            }\n            $statements = $newResult;\n        }\n\n        $presetMatch = false;\n        foreach ($presets as $i => $preset) {\n            if (self::_matchUriStatic($preset['match'], $uri)) {\n                $presetMatch = $i;\n                break;\n            }\n        }\n\n        $data   = $statements;\n        $result = null;\n        if ($presetMatch !== false) {\n            // Use the preset\n            if (isset($presets[$presetMatch]['mode']) && $presets[$presetMatch]['mode'] === 'none') {\n                // Start with an empty result.\n                $result = array();\n                if (isset($presets[$presetMatch]['exception'])) {\n                    foreach ($presets[$presetMatch]['exception'] as $exception) {\n                        if (isset($data[$uri][$exception])) {\n                            if (!isset($result[$uri])) {\n                                $result[$uri] = array();\n                            }\n                            if (!isset($result[$uri][$exception])) {\n                                $result[$uri][$exception] = array();\n                            }\n\n                            foreach ($data[$uri][$exception] as $o) {\n                                if ($o['type'] === 'literal') {\n                                    if (isset($presets[$presetMatch]['lang'])) {\n                                        foreach ($presets[$presetMatch]['lang'] as $lang) {\n                                            if (isset($o['lang']) && $o['lang'] === $lang) {\n                                                $result[$uri][$exception][] = $o;\n                                            }\n                                        }\n                                    } else {\n                                        $result[$uri][$exception][] = $o;\n                                    }\n                                } else {\n                                    $result[$uri][$exception][] = $o;\n                                }\n                            }\n\n                            if (isset($presets[$presetMatch]['lang'])) {\n                                if (count($result[$uri][$exception]) === 0) {\n                                    foreach ($data[$uri][$exception] as $o) {\n                                        if (!isset($o['lang'])) {\n                                            $result[$uri][$exception][] = $o;\n                                            break;\n                                        }\n                                    }\n                                }\n                            }\n                        }\n                    }\n                }\n            } else {\n                // Use the default rule.\n                // Start with all data.\n                $result = $data;\n                if (isset($presets[$presetMatch]['exception'])) {\n                    foreach ($presets[$presetMatch]['exception'] as $exception) {\n                        if (isset($data[$uri][$exception])) {\n                            if (isset($result[$uri][$exception])) {\n                                unset($result[$uri][$exception]);\n                            }\n                        }\n                    }\n                }\n            }\n        } else {\n            if ($fetchMode === 'none') {\n                // Start with an empty result.\n                $result = array();\n                foreach ($exceptedProperties as $exception) {\n                    if (isset($data[$uri][$exception])) {\n                        if (!isset($result[$uri])) {\n                            $result[$uri] = array();\n                        }\n                        $result[$uri][$exception] = $data[$uri][$exception];\n                    }\n                }\n            } else {\n                // Start with all data.\n                $result = $data;\n                foreach ($exceptedProperties as $exception) {\n                    if (isset($data[$uri][$exception])) {\n                        if (isset($result[$uri][$exception])) {\n                            unset($result[$uri][$exception]);\n                        }\n                    }\n                }\n            }\n        }\n        $statements = $result;\n\n        return $statements;\n    }\n\n    /**\n     *\n     * @param string  $graphUri\n     * @param string  $uri\n     * @param type    $locator\n     * @param boolean $all\n     * @param array   $presets\n     * @param array   $exceptedProperties\n     * @param string  $wrapperName\n     * @param string  $fetchMode\n     * @param string  $action\n     * @param boolean $versioning\n     *\n     * @return int status code\n     */\n    //TODO refactor these 11 parameters (use a config object or break it down with adapters etc)\n    public static function import(\n        $graphUri, $uri, $locator, $all = true, $presets = array(),\n        $exceptedProperties = array(), $wrapperName = 'linkeddata', $fetchMode = 'none',\n        $action = 'add', $versioning = true, $filterCallback = null\n    ) {\n        // Check whether user is allowed to write the model.\n        $erfurt     = Erfurt_App::getInstance();\n        $store      = $erfurt->getStore();\n        $storeGraph = $store->getModel($graphUri);\n        if (!$storeGraph || !$storeGraph->isEditable()) {\n            return self::IMPORT_NOT_EDITABLE;\n        }\n\n        $r = new Erfurt_Rdf_Resource($uri);\n        $r->setLocator($locator);\n\n        // Try to instanciate the requested wrapper\n        $wrapper = null;\n        try {\n            $wrapper = Erfurt_Wrapper_Registry::getInstance()->getWrapperInstance($wrapperName);\n        } catch (Erfurt_Wrapper_Exception $e) {\n            return self::IMPORT_WRAPPER_INSTANCIATION_ERR;\n        }\n        if (null == $wrapper) {\n            return self::IMPORT_WRAPPER_NOT_AVAILABLE;\n        }\n\n        $wrapperResult = null;\n        try {\n            $wrapperResult = $wrapper->run($r, $graphUri, $all);\n        } catch (Erfurt_Wrapper_Exception $e) {\n            return self::IMPORT_WRAPPER_ERR;\n        }\n\n        if ($wrapperResult === false) {\n            return self::IMPORT_WRAPPER_RESULT_NOT_AVAILABLE;\n        } else {\n            if (is_array($wrapperResult)) {\n                if (isset($wrapperResult['status_codes'])) {\n                    if (in_array(Erfurt_Wrapper::RESULT_HAS_ADD, $wrapperResult['status_codes'])) {\n                        $newStatements = $wrapperResult['add'];\n\n                        //default filter\n                        $newStatements = self::filterStatements(\n                            $newStatements, $uri, $all, $presets, $exceptedProperties, $fetchMode\n                        );\n\n                        //custom filter\n                        if ($filterCallback != null && is_array($filterCallback)) {\n                            try {\n                                $newStatements = call_user_func($filterCallback, $newStatements);\n                            } catch (Exception $e) {\n                                return self::IMPORT_CUSTOMFILTER_EXCEPTION;\n                            }\n                        }\n\n                        $stmtBeforeCount = $store->countWhereMatches(\n                            $graphUri,\n                            '{ ?s ?p ?o }',\n                            '*'\n                        );\n\n                        if ($versioning) {\n                            // Prepare versioning...\n                            $versioning = $erfurt->getVersioning();\n                            $actionSpec = array(\n                                'type'        => self::VERSIONING_IMPORT_ACTION_TYPE,\n                                'modeluri'    => $graphUri,\n                                'resourceuri' => $uri\n                            );\n\n                            // Start action\n                            $versioning->startAction($actionSpec);\n                        }\n\n                        if ($action == 'add') {\n                            try {\n                                $store->addMultipleStatements($graphUri, $newStatements);\n                            } catch (Exception $e) {\n                                $versioning->abortAction();\n\n                                if (defined('_EFDEBUG')) {\n                                    throw $e;\n                                }\n\n                                return self::IMPORT_GENERAL_EXCEPTION;\n                            }\n                        } else {\n                            if ($action == 'update') {\n                                $queryoptions  = array(\n                                    'use_ac'                 => false,\n                                    'result_format'          => Erfurt_Store::RESULTFORMAT_EXTENDED,\n                                    'use_additional_imports' => false\n                                );\n                                $oldStatements = $store->sparqlQuery(\n                                    'SELECT * FROM <' . $graphUri . '> WHERE { ?s ?p ?o }',\n                                    $queryoptions\n                                );\n                                //transform resultset to rdf/php statements\n                                $modelOld = new Erfurt_Rdf_MemoryModel();\n                                $modelOld->addStatementsFromSPOQuery($oldStatements);\n                                $modelNew = new Erfurt_Rdf_MemoryModel($newStatements);\n                                $storeGraph->updateWithMutualDifference(\n                                    $modelOld->getStatements(),\n                                    $modelNew->getStatements()\n                                );\n                            }\n                        }\n\n                        if ($versioning) {\n                            $versioning->endAction();\n                        }\n\n                        $stmtAfterCount = $store->countWhereMatches(\n                            $graphUri,\n                            '{ ?s ?p ?o }',\n                            '*'\n                        );\n\n                        $stmtAddCount = $stmtAfterCount - $stmtBeforeCount;\n\n                        if ($stmtAddCount > 0) {\n                            // TODO test ns\n                            // If we added some statements, we check for additional namespaces and add them.\n                            if (in_array(Erfurt_Wrapper::RESULT_HAS_NS, $wrapperResult['status_codes'])) {\n                                $namespaces = $wrapperResult['ns'];\n\n                                $erfurtNamespaces = $erfurt->getNamespaces();\n\n                                foreach ($namespaces as $ns => $prefix) {\n                                    try {\n                                        $erfurtNamespaces->addNamespacePrefix(\n                                            $graphUri,\n                                            $prefix,\n                                            $ns,\n                                            false\n                                        );\n                                    } catch (Exception $e) {\n                                        // Ignore...\n                                    }\n                                }\n                            }\n\n                            return self::IMPORT_OK;\n\n                        } else {\n                            if (count($newStatements) > 0) {\n                                return self::IMPORT_NO_NEW_DATA;\n                            } else {\n                                return self::IMPORT_NO_DATA;\n                            }\n                        }\n                    } else {\n                        return self::IMPORT_NO_DATA;\n                    }\n                } else {\n                    return self::IMPORT_WRAPPER_ERR;\n                }\n            } else {\n                return self::IMPORT_WRAPPER_ERR;\n            }\n        }\n    }\n\n    private function _sendResponse($returnValue, $message = null, $messageType = OntoWiki_Message::SUCCESS)\n    {\n        if (null !== $message) {\n            $translate = $this->_owApp->translate;\n\n            $message = $translate->_($message);\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message($message, $messageType)\n            );\n        }\n\n        $returnValue = array(\n            'code'    => $returnValue,\n            'message' => $message\n        );\n\n        $this->_response->setHeader('Content-Type', 'application/json', true);\n        $this->_response->setBody(json_encode($returnValue));\n    }\n\n    // ------------------------------------------------------------------------\n    // --- Statement sync related methods -------------------------------------\n    // ------------------------------------------------------------------------\n\n    /**\n     * Filters a result regarding the configured sparql query.\n     *\n     * @param array  $result\n     * @param string $uri\n     * @param string $wrapperName\n     * @param string $modelUri\n     *\n     * @return array\n     */\n    private function _filterResult($result, $uri, $wrapperName, $modelUri)\n    {\n        $store      = Erfurt_App::getInstance()->getStore();\n        $syncConfig = $this->_getSyncConfig($uri, $wrapperName, $modelUri);\n\n        if (!is_array($syncConfig) || count($syncConfig) === 0) {\n            return array();\n        }\n        $syncConfig = $syncConfig[0];\n\n        // TODO We need support for in-memory models... this is a workaround\n        $tempModelUri = $this->_syncModelHelperBase . md5($uri . $wrapperName . $modelUri . time());\n        $tempModel    = $store->getNewModel($tempModelUri, '', 'rdf', false);\n        $store->addMultipleStatements($tempModelUri, $result);\n        $simpleQuery = Erfurt_Sparql_SimpleQuery::initWithString($syncConfig['syncQuery']);\n        $simpleQuery->addFrom($tempModelUri);\n        $sparqlResult = $store->sparqlQuery($simpleQuery, array('result_format' => 'extended', 'use_ac' => false));\n        $store->deleteModel($tempModelUri);\n\n        $retVal = array();\n        foreach ($sparqlResult['results']['bindings'] as $row) {\n            if (!isset($retVal[$row['s']['value']])) {\n                $retVal[$row['s']['value']] = array();\n            }\n            if (!isset($retVal[$row['s']['value']][$row['p']['value']])) {\n                $retVal[$row['s']['value']][$row['p']['value']] = array();\n            }\n\n            $oArray = array(\n                'value' => $row['o']['value']\n            );\n\n            if ($row['o']['type'] === 'typed-literal') {\n                $oArray['type']     = 'literal';\n                $oArray['dataytpe'] = $row['o']['datatype'];\n            } else {\n                $oArray['type'] = $row['o']['type'];\n            }\n\n            if (isset($row['o']['xml:lang'])) {\n                $oArray['lang'] = $row['o']['xml:lang'];\n            }\n\n            $retVal[$row['s']['value']][$row['p']['value']][] = $oArray;\n        }\n\n        return $retVal;\n    }\n\n    /**\n     * Fetches the data from the wrapper.\n     *\n     * @param string $uri\n     * @param string $wrapperName\n     * @param string $modelUri\n     *\n     * @return array\n     */\n    private function _getData($uri, $wrapperName, $modelUri)\n    {\n        try {\n            $wrapper = $this->_wrapperRegistry->getWrapperInstance($wrapperName);\n\n            $wrapperResult = $wrapper->run($uri, $modelUri);\n            if (is_array($wrapperResult) && isset($wrapperResult['add'])) {\n                $wrapperResult = $wrapperResult;\n            } else {\n                $wrapperResult = array();\n            }\n        } catch (Exception $e) {\n            $wrapperResult = array();\n        }\n\n        return $wrapperResult;\n    }\n\n\n    private function _getProxyUri($uri)\n    {\n        // If at least one rewrite rule is defined, we iterate through them.\n        if (isset($this->_privateConfig->rewrite)) {\n            $rulesArray = $this->_privateConfig->rewrite->toArray();\n            foreach ($rulesArray as $ruleId => $ruleSpec) {\n                $proxyUri = preg_replace($ruleSpec['pattern'], $ruleSpec['replacement'], $uri);\n                if ($proxyUri !== $uri) {\n                    return $proxyUri;\n                }\n            }\n        }\n\n        return null;\n    }\n\n    private function _matchUri($pattern, $uri)\n    {\n        if ((substr($pattern, 0, 7) !== 'http://')) {\n            $pattern = 'http://' . $pattern;\n        }\n\n        if ((substr($uri, 0, strlen($pattern)) === $pattern)) {\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    private static function _matchUriStatic($pattern, $uri)\n    {\n        if ((substr($pattern, 0, 7) !== 'http://')) {\n            $pattern = 'http://' . $pattern;\n        }\n\n        if ((substr($uri, 0, strlen($pattern)) === $pattern)) {\n            return true;\n        } else {\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/datagathering/DatagatheringHelper.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Component/Helper.php';\n\n/**\n * A helper class for the datagathering component.\n *\n * @category   OntoWiki\n * @package    Extensions_Datagathering\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass DatagatheringHelper extends OntoWiki_Component_Helper\n{\n    public function init()\n    {\n        $pathBase = $this->_owApp->extensionManager->getComponentUrl('datagathering');\n        $this->_owApp->view->headScript()->appendFile($pathBase . 'scripts/jquery.autocomplete.js');\n        $this->_owApp->view->headScript()->appendFile($pathBase . 'datagathering.js');\n\n        $this->_owApp->view->headLink()->appendStylesheet($pathBase . 'css/jquery.autocomplete.css');\n    }\n}\n"
  },
  {
    "path": "extensions/datagathering/DatagatheringPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * The main class for the datagathering plugin.\n *\n * @category   OntoWiki\n * @package    Extensions_Datagathering\n * @copyright  Copyright (c) 2012 {@link http://aksw.org aksw}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass DatagatheringPlugin extends OntoWiki_Plugin\n{\n    // ------------------------------------------------------------------------\n    // --- Private properties -------------------------------------------------\n    // ------------------------------------------------------------------------\n\n    /**\n     * Contains propertiy URIs configured in the ini file\n     *\n     * @var array\n     */\n    private $_properties = array();\n\n    /**\n     * The URI of the sync model as configured in the ini.\n     *\n     * @var string\n     */\n    private $_syncModelUri = null;\n\n    /**\n     * Contains the fetched sync configuration in order to avoid multiple\n     * fetching of it via SPARQL queries.\n     *\n     * @var array\n     */\n    private $_syncConfigCache = null;\n\n    /**\n     * Contains the fetched sync configurations in order to avoid multiple\n     * fetching of them via SPARQL queries.\n     *\n     * @var array\n     */\n    private $_syncConfigListCache = null;\n\n    /**\n     * The initialization method. Sets some properties.\n     */\n    public function init()\n    {\n        parent::init();\n        if ($this->_privateConfig->sync->enabled && isset($this->_privateConfig->properties)) {\n            $this->_properties = $this->_privateConfig->properties->toArray();\n        }\n        $this->_syncModelUri = $this->_privateConfig->syncModelUri;\n\n        // Translation hack in order to enable the plugin to translate...\n        $translate = OntoWiki::getInstance()->translate;\n        $translate->addTranslation(\n            $this->_pluginRoot . 'languages',\n            null,\n            array('scan' => Zend_Translate::LOCALE_FILENAME)\n        );\n        $translate->setLocale(OntoWiki::getInstance()->config->languages->locale);\n    }\n\n\n    // ------------------------------------------------------------------------\n    // --- Plugin handler methods ---------------------------------------------\n    // ------------------------------------------------------------------------\n\n    /**\n     * Event handler method, which is called on menu creation. Adds some\n     * datagathering relevant menu entries.\n     *\n     * @param Erfurt_Event $event\n     *\n     * @return bool\n     */\n    public function onCreateMenu($event)\n    {\n        $menu     = $event->menu;\n        $resource = $event->resource;\n        $model    = $event->model;\n        $owApp    = OntoWiki::getInstance();\n\n        // We only add entries to the menu, if all params are given and the\n        // model is editable.\n        if ((null === $resource) || (null === $model) || !$model->isEditable()\n            || !$owApp->erfurt->getAc()->isModelAllowed('edit', $owApp->selectedModel)\n        ) {\n            return;\n        }\n\n        $owApp     = OntoWiki::getInstance();\n        $translate = $owApp->translate;\n\n        $wrapperRegistry   = Erfurt_Wrapper_Registry::getInstance();\n        $activeWrapperList = $wrapperRegistry->listActiveWrapper();\n\n        if ((boolean)$this->_privateConfig->sync->enabled) {\n            $syncConfigList = $this->_listSyncConfigs();\n        } else {\n            $syncConfigList = array();\n        }\n\n        $uri      = (string)$resource;\n        $modelUri = (string)$model;\n\n        $menuArray = array();\n\n        // Check all active wrapper extensions, whether URI is handled. Also\n        // check, whether a sync config exists.\n        foreach ($activeWrapperList as $wrapperName) {\n            $hash = $this->_getHash($uri, $wrapperName, $modelUri);\n\n            $r = new Erfurt_Rdf_Resource($uri);\n            $r->setLocator($this->_getProxyUri($uri));\n\n            $wrapperInstance = $wrapperRegistry->getWrapperInstance($wrapperName);\n            if ($wrapperInstance->isHandled($r, $modelUri)) {\n                $menuArray[$wrapperName] = array(\n                    'instance' => $wrapperInstance\n                );\n\n                if (isset($syncConfigList[$hash])) {\n                    $menuArray[$wrapperName]['sync'] = true;\n                }\n            }\n        }\n\n        // Only add a separator, if at least one active wrapper exists.\n        if (count($menuArray) > 0) {\n            $menu->appendEntry(OntoWiki_Menu::SEPARATOR);\n        }\n\n        foreach ($menuArray as $wrapperName => $wrapperArray) {\n            $wrapperInstance = $wrapperArray['instance'];\n\n            if (isset($wrapperArray['sync']) && $wrapperArray['sync'] === true) {\n                $message = $translate->_('Sync Data with %1$s');\n\n                $menu->appendEntry(\n                    sprintf($message, $wrapperInstance->getName()),\n                    array(\n                         'about' => $uri,\n                         'class' => 'sync_data_button wrapper_' . $wrapperName\n                    )\n                );\n            } else {\n                $message = $translate->_('Import Data with %1$s');\n\n                $menu->appendEntry(\n                    sprintf($message, $wrapperInstance->getName()),\n                    array(\n                         'about' => $uri,\n                         'class' => 'fetch_data_button wrapper_' . $wrapperName\n                    )\n                );\n            }\n\n            // Configure for sync entry.\n            if ((boolean)$this->_privateConfig->sync->enabled) {\n                $configUrl = $owApp->config->urlBase . 'datagathering/config?uri=' . urlencode($uri) .\n                    '&wrapper=' . urlencode($wrapperName);\n\n                if ($event->isModel) {\n                    $configUrl .= '&m=' . urlencode($uri);\n                }\n\n                $message = $translate->_('Configure Sync with %1$s');\n\n                $menu->appendEntry(\n                    sprintf($message, $wrapperInstance->getName()),\n                    $configUrl\n                );\n            }\n        }\n\n        return true;\n    }\n\n    /**\n     * Event handler method, which is called whenever the property view of\n     * a resource will be displayed. Adds the location bar to the menu and\n     * adds a message if a resource is configured for sync.\n     *\n     * @param Erfurt_Event $event\n     *\n     * @return bool\n     */\n    public function onPropertiesAction($event)\n    {\n        $translate = OntoWiki::getInstance()->translate;\n        $session   = new Zend_Session_Namespace(_OWSESSION);\n\n        // Add the location bar menu entry.\n        $menu = OntoWiki_Menu_Registry::getInstance()->getMenu('resource');\n        $menu->prependEntry(OntoWiki_Menu::SEPARATOR);\n        if ($session->showLocationBar === false) {\n            $entry = $translate->_('Show/Hide Location Bar');\n            $menu->prependEntry($entry, array('class' => 'location_bar show'));\n        } else {\n            $entry = $translate->_('Show/Hide Location Bar');\n            $menu->prependEntry($entry, array('class' => 'location_bar'));\n        }\n\n        $uri      = $event->uri;\n        $modelUri = $event->graph;\n\n        if ((boolean)$this->_privateConfig->sync->enabled) {\n            $syncConfig = $this->_getSyncConfig($uri, 'linkeddata', $modelUri);\n        } else {\n            $syncConfig = false;\n        }\n        if ($syncConfig === false || $syncConfig['checkHasChanged'] === false) {\n            return false;\n        }\n\n        // Thre resource is configured for sync, so show a message box.\n        $message\n            = '<span id=\"dg_check_update\" >\n                        <span id=\"dg_configured_text\">' .\n            $translate->_('This Resource is configured for Sync') . '.' .\n            '</span>' .\n            '<span id=\"dg_updated_text\" style=\"display: none\">' .\n            $translate->_('This Resource has changed since last sync') . '.' .\n            '</span>\n                        <br />';\n\n        $message .= '<span style=\"font-size:0.8em; font-weight: bold\">';\n        if (isset($syncConfig['lastSyncDateTime'])) {\n            $message .= $translate->_('Last Sync') . ': ' . date('r', strtotime($syncConfig['lastSyncDateTime']));\n            $message .= '<br />';\n        }\n\n        $message .= '<span id=\"dg_lastmod_text\" style=\"display: none\">' .\n            $translate->_('Last Modified') . ': ' .\n            '<span id=\"dg_lastmod_date\">\n                        </span>\n                    </span>';\n        $message .= '</span>';\n        $message .= '<a id=\"dg_sync_button\" class=\"minibutton\"' .\n            ' style=\"display: none; float: right; min-height: 20px; padding-top: 8px\">';\n        $message .= $translate->_('Sync') . '</a>';\n        $message .= '</span>';\n\n        OntoWiki::getInstance()->appendMessage(\n            new OntoWiki_Message($message, OntoWiki_Message::INFO, array('escape' => false))\n        );\n\n        return true;\n    }\n\n    /**\n     * Event handler method, which is called before tabs content is created.\n     * Adds the location bar to the page.\n     *\n     * @param Erfurt_Event $event\n     *\n     * @return string\n     */\n    public function onPreTabsContentAction($event)\n    {\n        $translate = OntoWiki::getInstance()->translate;\n        $uri       = $event->uri;\n\n        $html\n            = '<div style=\"display: none; padding: 10px 20px 10px 30px\" id=\"location_bar_container\" class=\"cmDiv\">\n                    <input id=\"location_bar_input\" class=\"text width75\" type=\"text\" value=\"' . $uri . '\" name=\"l\" />\n                    <a id=\"location_open\" class=\"minibutton\" style=\"float: none\">' .\n            $translate->_('View Resource') .\n            '</a>\n                 </div>';\n\n        return $html;\n    }\n\n    /**\n     * Event handler method, which is called when a resource is deleted.\n     * We remove all sync configurations with that resource.\n     *\n     * @param Erfurt_Event $event\n     *\n     * @return bool\n     */\n    public function onDeleteResources($event)\n    {\n        if ($this->_privateConfig->sync->enabled) {\n            $modelUri = $event->modelUri;\n            $uriArray = $event->resourceArray;\n\n            require_once 'Erfurt/Sparql/SimpleQuery.php';\n            $query = new Erfurt_Sparql_SimpleQuery();\n            $query->setSelectClause('SELECT ?s ?o');\n            $query->addFrom($this->_syncModelUri);\n            $query->setWherePart(\n                'WHERE {\n                ?s <' . EF_RDF_TYPE . '> <' . $this->_properties['syncConfigClass'] . '> .\n                ?s <' . $this->_properties['targetModel'] . '> <' . $modelUri . '> .\n                ?s <' . $this->_properties['syncResource'] . '> ?o .\n                }'\n            );\n\n            $store  = Erfurt_App::getInstance()->getStore();\n            $result = $store->sparqlQuery($query, array('use_ac' => false));\n\n            foreach ($result as $row) {\n                if (in_array($row['o'], $uriArray)) {\n                    $store->deleteMatchingStatements(\n                        $this->_syncModelUri,\n                        $row['s'],\n                        null,\n                        null,\n                        array('use_ac' => false)\n                    );\n                }\n            }\n        }\n\n        return true;\n    }\n\n    /**\n     * Event handler method, which is called before a model is deleted.\n     * We remove all sync configurations with that model.\n     *\n     * @param Erfurt_Event $event\n     *\n     * @return bool\n     */\n    public function onPreDeleteModel($event)\n    {\n        if ($this->_privateConfig->sync->enabled) {\n            $modelUri = $event->modelUri;\n\n            require_once 'Erfurt/Sparql/SimpleQuery.php';\n            $query = new Erfurt_Sparql_SimpleQuery();\n            $query->setSelectClause('SELECT ?s');\n            $query->addFrom($this->_syncModelUri);\n            $query->setWherePart(\n                'WHERE {\n                    ?s <' . EF_RDF_TYPE . '> <' . $this->_properties['syncConfigClass'] . '> .\n                    ?s <' . $this->_properties['targetModel'] . '> <' . $modelUri . '> .\n                }'\n            );\n\n            $store  = Erfurt_App::getInstance()->getStore();\n            $result = $store->sparqlQuery($query, array('use_ac' => false));\n\n            foreach ($result as $row) {\n                $store->deleteMatchingStatements($this->_syncModelUri, $row['s'], null, null, array('use_ac' => false));\n            }\n        }\n\n        return true;\n    }\n\n\n    // ------------------------------------------------------------------------\n    // --- Private helpder methods --------------------------------------------\n    // ------------------------------------------------------------------------\n\n    /**\n     * Returns a md5 hash of the given parameters.\n     *\n     * @param string $uri\n     * @param string $wrapperName\n     * @param string $modelUri\n     *\n     * @return string\n     */\n    private function _getHash($uri, $wrapperName, $modelUri)\n    {\n        $uri         = (string)$uri;\n        $wrapperName = (string)$wrapperName;\n        $modelUri    = (string)$modelUri;\n\n        return md5(($uri . $wrapperName . $modelUri));\n    }\n\n    /**\n     * Returns the sync config for the given parameters or false, if no such exists.\n     *\n     * @param string $uri         The resource uri.\n     * @param string $wrapperName The wrapper name.\n     * @param string $modelUri    The model uri.\n     *\n     * @return array|bool\n     */\n    private function _getSyncConfig($uri, $wrapperName, $modelUri)\n    {\n        if (null === $this->_syncConfigCache) {\n            $store = Erfurt_App::getInstance()->getStore();\n\n            require_once 'Erfurt/Sparql/SimpleQuery.php';\n            $query = new Erfurt_Sparql_SimpleQuery();\n            $query->setSelectClause('SELECT ?s ?p ?o');\n            $query->addFrom($this->_syncModelUri);\n            $where\n                = 'WHERE {\n                ?s ?p ?o .\n                ?s <' . EF_RDF_TYPE . '> <' . $this->_properties['syncConfigClass'] . '> .\n                ?s <' . $this->_properties['syncResource'] . '> <' . $uri . '> .\n                ?s <' . $this->_properties['targetModel'] . '> <' . $modelUri . '> .\n                ?s <' . $this->_properties['wrapperName'] . '> \"' . $wrapperName . '\" .\n            }';\n            $query->setWherePart($where);\n\n            $result = $store->sparqlQuery($query, array('use_ac' => false));\n\n            if (count($result) === 0) {\n                return false;\n            }\n\n            $retVal = array();\n            foreach ($result as $row) {\n                if (!isset($retVal[$row['s']])) {\n                    $retVal[$row['s']] = array(\n                        'uri' => $row['s']\n                    );\n                }\n\n                switch ($row['p']) {\n                    case $this->_properties['targetModel']:\n                        $retVal[$row['s']]['targetModel'] = $row['o'];\n                        break;\n                    case $this->_properties['syncResource']:\n                        $retVal[$row['s']]['syncResource'] = $row['o'];\n                        break;\n                    case $this->_properties['wrapperName']:\n                        $retVal[$row['s']]['wrapperName'] = $row['o'];\n                        break;\n                    case $this->_properties['lastSyncPayload']:\n                        $retVal[$row['s']]['lastSyncPayload'] = unserialize($row['o']);\n                        break;\n                    case $this->_properties['lastSyncDateTime']:\n                        $retVal[$row['s']]['lastSyncDateTime'] = $row['o'];\n                        break;\n                    case $this->_properties['syncQuery']:\n                        $retVal[$row['s']]['syncQuery'] = $row['o'];\n                        break;\n                    case $this->_properties['checkHasChanged']:\n                        $retVal[$row['s']]['checkHasChanged'] = (bool)$row['o'];\n                        break;\n                }\n            }\n\n            $this->_syncConfigCache = array_values($retVal);\n            $this->_syncConfigCache = $this->_syncConfigCache[0]; // Only return one config!\n        }\n\n        return $this->_syncConfigCache;\n    }\n\n    /**\n     * Returns all existing sync configurations.\n     *\n     * @return array|bool\n     */\n    private function _listSyncConfigs()\n    {\n        if (null === $this->_syncConfigListCache) {\n            $store = Erfurt_App::getInstance()->getStore();\n\n            require_once 'Erfurt/Sparql/SimpleQuery.php';\n            $query = new Erfurt_Sparql_SimpleQuery();\n            $query->setSelectClause('SELECT ?s ?p ?o');\n            $query->addFrom($this->_syncModelUri);\n            $where\n                = 'WHERE {\n                ?s ?p ?o .\n                ?s <' . EF_RDF_TYPE . '> <' . $this->_properties['syncConfigClass'] . '> . }';\n            $query->setWherePart($where);\n            $result = $store->sparqlQuery($query, array('use_ac' => false));\n\n            if (count($result) === 0) {\n                return false;\n            }\n\n            $retVal = array();\n            foreach ($result as $row) {\n                if (!isset($retVal[$row['s']])) {\n                    $retVal[$row['s']] = array(\n                        'uri' => $row['s']\n                    );\n                }\n\n                switch ($row['p']) {\n                    case $this->_properties['targetModel']:\n                        $retVal[$row['s']]['targetModel'] = $row['o'];\n                        break;\n                    case $this->_properties['syncResource']:\n                        $retVal[$row['s']]['syncResource'] = $row['o'];\n                        break;\n                    case $this->_properties['wrapperName']:\n                        $retVal[$row['s']]['wrapperName'] = $row['o'];\n                        break;\n                    case $this->_properties['lastSyncPayload']:\n                        $retVal[$row['s']]['lastSyncPayload'] = unserialize($row['o']);\n                        break;\n                    case $this->_properties['lastSyncDateTime']:\n                        $retVal[$row['s']]['lastSyncDateTime'] = $row['o'];\n                        break;\n                    case $this->_properties['syncQuery']:\n                        $retVal[$row['s']]['syncQuery'] = $row['o'];\n                        break;\n                    case $this->_properties['checkHasChanged']:\n                        $retVal[$row['s']]['checkHasChanged'] = (bool)$row['o'];\n                        break;\n                }\n            }\n\n            $cacheVal = array();\n            foreach ($retVal as $s => $valueArray) {\n                $hash            = $this->_getHash(\n                    $valueArray['syncResource'],\n                    $valueArray['wrapperName'],\n                    $valueArray['targetModel']\n                );\n                $cacheVal[$hash] = $valueArray;\n            }\n\n            $this->_syncConfigListCache = $cacheVal;\n        }\n\n        return $this->_syncConfigListCache;\n    }\n\n    private function _getProxyUri($uri)\n    {\n        // If at least one rewrite rule is defined, we iterate through them.\n        if (isset($this->_privateConfig->rewrite)) {\n            $rulesArray = $this->_privateConfig->rewrite->toArray();\n            foreach ($rulesArray as $ruleId => $ruleSpec) {\n                $proxyUri = @preg_replace($ruleSpec['pattern'], $ruleSpec['replacement'], $uri);\n                if ($proxyUri !== $uri) {\n                    return $proxyUri;\n                }\n            }\n        }\n\n        return null;\n    }\n}\n"
  },
  {
    "path": "extensions/datagathering/SyncSchema.rdf",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE rdf:RDF [\n  <!ENTITY SysOnt \"http://ns.ontowiki.net/SysOnt/\">\n  <!ENTITY sync \"http://ns.ontowiki.net/Sync/\">\n  <!ENTITY owl \"http://www.w3.org/2002/07/owl#\">\n  <!ENTITY rdf \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n  <!ENTITY rdfs \"http://www.w3.org/2000/01/rdf-schema#\">\n  <!ENTITY xsd \"http://www.w3.org/2001/XMLSchema#\">\n]>\n<rdf:RDF xml:base=\"&sync;\"\n         xmlns:sysont=\"&SysOnt;\"\n         xmlns:sync=\"&sync;\"\n         xmlns=\"&sync;\"\n         xmlns:owl=\"&owl;\"\n         xmlns:rdf=\"&rdf;\"\n         xmlns:rdfs=\"&rdfs;\">\n\n<!-- Ontology Information -->\n  <owl:Ontology rdf:about=\"http://localhost/OntoWiki/Sync/\"\n                rdfs:label=\"OntoWiki Sync Ontology\">\n    <rdfs:comment>This schema model provides the vocabulary for syncing resources with OntoWiki.</rdfs:comment>\n  </owl:Ontology>\n\n<!-- Classes -->\n  <owl:Class rdf:about=\"SyncConfig\"\n             rdfs:label=\"Sync Configuration\">\n    <rdfs:comment>This class contains all sync configurations.</rdfs:comment>\n  </owl:Class>\n\n<!-- Datatypes -->\n  <rdfs:Datatype rdf:about=\"&xsd;string\" rdfs:label=\"String\"/>\n  <rdfs:Datatype rdf:about=\"&xsd;dateTime\" rdfs:label=\"Date/Time\"/>\n  <rdfs:Datatype rdf:about=\"&xsd;boolean\" rdfs:label=\"Boolean\"/>\n\n<!-- Annotation Properties -->\n  <owl:AnnotationProperty rdf:about=\"&rdfs;comment\" rdfs:label=\"comment\">\n    <rdfs:range rdf:resource=\"&xsd;string\"/>\n  </owl:AnnotationProperty>\n  <owl:AnnotationProperty rdf:about=\"&rdfs;label\"  rdfs:label=\"label\">\n    <rdfs:range rdf:resource=\"&xsd;string\"/>\n  </owl:AnnotationProperty>\n\n<!-- Datatype Properties -->\n  <owl:DatatypeProperty rdf:about=\"wrapperName\"\n                        rdfs:comment=\"The name of the wrapper to use.\"\n                        rdfs:label=\"wrapper name\">\n    <rdfs:domain rdf:resource=\"SyncConfig\"/>\n    <rdfs:range rdf:resource=\"&xsd;string\"/>\n  </owl:DatatypeProperty>\n  \n  <owl:DatatypeProperty rdf:about=\"syncQuery\"\n                        rdfs:comment=\"The query to use in order to determine the statements, which will be added.\"\n                        rdfs:label=\"sync query\">\n    <rdfs:domain rdf:resource=\"SyncConfig\"/>\n    <rdfs:range rdf:resource=\"&xsd;string\"/>\n  </owl:DatatypeProperty>\n  \n  <owl:DatatypeProperty rdf:about=\"lastSyncDateTime\"\n                        rdfs:comment=\"The date and time of the last sync.\"\n                        rdfs:label=\"date/time of last sync\">\n    <rdfs:domain rdf:resource=\"SyncConfig\"/>\n    <rdfs:range rdf:resource=\"&xsd;dateTime\"/>\n  </owl:DatatypeProperty>\n  \n  <owl:DatatypeProperty rdf:about=\"lastSyncPayload\"\n                        rdfs:comment=\"Contains the statements, which were added at the last sync.\"\n                        rdfs:label=\"payload of last sync\">\n    <rdfs:domain rdf:resource=\"SyncConfig\"/>\n    <rdfs:range rdf:resource=\"&xsd;string\"/>\n  </owl:DatatypeProperty>\n  \n  <owl:DatatypeProperty rdf:about=\"checkHasChanged\"\n                        rdfs:comment=\"States, whether a syncable resource is checked for updates.\"\n                        rdfs:label=\"check for updates\">\n    <rdfs:domain rdf:resource=\"SyncConfig\"/>\n    <rdfs:range rdf:resource=\"&xsd;boolean\"/>\n  </owl:DatatypeProperty>\n\n<!-- Object Properties -->\n  <owl:ObjectProperty rdf:about=\"targetModel\"\n                      rdfs:label=\"target model\">\n    <rdfs:comment>This property defines the model, which will contain the statements.</rdfs:comment>\n    <rdfs:domain rdf:resource=\"SyncConfig\"/>\n    <rdfs:range rdf:resource=\"&SysOnt;Model\"/>\n  </owl:ObjectProperty>\n  \n  <owl:ObjectProperty rdf:about=\"syncResource\"\n                      rdfs:label=\"source uri\">\n    <rdfs:comment>This property defines the source of the data..</rdfs:comment>\n    <rdfs:domain rdf:resource=\"SyncConfig\"/>\n    <rdfs:range rdf:resource=\"&rdfs;Resource\"/>\n  </owl:ObjectProperty>\n\n</rdf:RDF>\n\n"
  },
  {
    "path": "extensions/datagathering/css/jquery.autocomplete.css",
    "content": ".ac_results {\n\tpadding: 0px;\n\tborder: 1px solid black;\n\tbackground-color: white;\n\toverflow: hidden;\n\tz-index: 99999;\n}\n\n.ac_results ul {\n\twidth: 100%;\n\tlist-style-position: outside;\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n}\n\n.ac_results li {\n\tmargin: 0px;\n\tpadding: 2px 5px;\n\tcursor: default;\n\tdisplay: block;\n\t/* \n\tif width will be 100% horizontal scrollbar will apear \n\twhen scroll mode will be used\n\t*/\n\t/*width: 100%;*/\n\tfont: menu;\n\tfont-size: 12px;\n\t/* \n\tit is very important, if line-height not setted or setted \n\tin relative units scroll will be broken in firefox\n\t*/\n\tline-height: 16px;\n\toverflow: hidden;\n}\n\n.ac_loading {\n\tbackground: white url('indicator.gif') right center no-repeat;\n}\n\n.ac_odd {\n\tbackground-color: #eee;\n}\n\n.ac_over {\n\tbackground-color: #0A246A;\n}\n"
  },
  {
    "path": "extensions/datagathering/datagathering.js",
    "content": "/**\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n$(document).ready(function()\n{\n    // ------------------------------------------------------------------------\n    // --- Location Bar -------------------------------------------------------\n    // ------------------------------------------------------------------------\n\n    // Bind the menu entry to the show and hide methods on click.\n    $('a.location_bar').parent('li').click(function() {\n        if ($('a.location_bar').hasClass('show')) {\n            showLocationBar();\n            sessionStore('showLocationBar', true, {method: 'set'});\n        } else {\n            hideLocationBar();\n            sessionStore('showLocationBar', false, {method: 'unset'});\n        }\n    });\n\n    // Show location bar if it is active...\n    if (typeof($('a.location_bar').get(0)) != 'undefined' && !$('a.location_bar').hasClass('show')) {\n        showLocationBar();\n    }\n\n    // Click event for the View button\n    $('#location_open').live('click', function(e) {\n        if (e.which == 1) {\n            window.location = urlBase + 'resource/properties?r=' + encodeURIComponent($('#location_bar_input').val());\n        }\n    });\n\n    // Enter event for the View button\n    $('#location_bar_input').live('keypress', function(evt) {\n        if (evt.which == 13) {\n            window.location = urlBase + 'resource/properties?r=' + encodeURIComponent($('#location_bar_input').val());\n        }\n    });\n\n\n    // ------------------------------------------------------------------------\n    // --- Datagathering ------------------------------------------------------\n    // ------------------------------------------------------------------------\n\n    // Datagathering via resource context menus\n    $('.fetch_data_button').livequery('click', function() {\n        var uriValue = $(this).attr('about');\n        var classesArray = $(this).attr('class').split(' ');\n        var wrapperName = '';\n        for (var i=0; i<classesArray.length; ++i) {\n            if (classesArray[i].substr(0, 7) == 'wrapper') {\n                wrapperName = classesArray[i].substr(8);\n                break;\n            }\n        }\n        var url = urlBase + 'datagathering/import/';\n        $(this).replaceWith('<span class=\"is-processing\" style=\"min-height: 16px; display: block\"></span>');\n\n        var request = $.ajax({\n           url: url,\n           data: { uri: uriValue, wrapper: wrapperName },\n           success: function(data, textStatus, jqXHR) {\n               $('.contextmenu-enhanced .contextmenu').fadeOut(effectTime, function(){ $(this).remove(); });\n               window.location = document.URL;\n           },\n           error: function(jqXHR, textStatus, errorThrown) {\n               $('.contextmenu-enhanced .contextmenu').fadeOut(effectTime, function(){ $(this).remove(); });\n               window.location = document.URL;\n           },\n           timeout: 30000\n        });\n\n        return false;\n    });\n\n    // Datagathering via resource context menus\n    $('.sync_data_button').livequery('click', function() {\n        var uriValue = $(this).attr('about');\n        var classesArray = $(this).attr('class').split(' ');\n        var wrapperName = '';\n        for (var i=0; i<classesArray.length; ++i) {\n            if (classesArray[i].substr(0, 7) == 'wrapper') {\n                wrapperName = classesArray[i].substr(8);\n                break;\n            }\n        }\n        var url = urlBase + 'datagathering/sync';\n        $(this).replaceWith('<span class=\"is-processing\" style=\"min-height: 16px; display: block\"></span>');\n        $.getJSON(url, {uri: uriValue, wrapper: wrapperName}, function(data) {\n            if (data['redirect']) {\n                $('.contextmenu-enhanced .contextmenu').fadeOut(effectTime, function(){ $(this).remove(); })\n                window.location = data['redirect'];\n                return false;\n            }\n\n            $('.contextmenu-enhanced .contextmenu').fadeOut(effectTime, function(){ $(this).remove(); })\n            window.location = document.URL;\n            return false;\n        });\n\n        return false;\n    });\n\n    // Check for updates. Currently only linkeddata is supported!\n    var checkElem = $('#dg_check_update');\n    if (typeof(checkElem.get(0)) != 'undefined') {\n        var uriValue = $('div.section-mainwindows table').eq(0).attr('about');\n        var url = urlBase + 'datagathering/modified';\n\n        $.getJSON(url, {uri: uriValue, wrapper: 'linkeddata'}, function(data) {\n            if (data != false) {\n                $('#dg_configured_text').hide();\n                $('#dg_updated_text').show();\n\n                $('#dg_lastmod_date').html(data.lastMod);\n                $('#dg_lastmod_date').show();\n                $('#dg_lastmod_text').show();\n                $('#dg_sync_button').show();\n\n\n\n                checkElem.parent('p').removeClass('info').addClass('success');\n\n                $('#dg_sync_button').livequery('click', function() {\n                    var url = urlBase + 'datagathering/sync';\n                    $(this).append('<div class=\"is-processing\" style=\"float:right; width: 16px; min-height: 16px; margin-left: 4px;\"></div>');\n                    $.getJSON(url, {uri: uriValue, wrapper: 'linkeddata'}, function(data) {\n                        window.location = document.URL;\n                    });\n\n                    return false;\n                });\n            }\n        });\n    }\n});\n\n\n// ------------------------------------------------------------------------\n// --- Location Bar related functions -------------------------------------\n// ------------------------------------------------------------------------\n\n/**\n * Shows the location bar.\n *//**\n * Function that executes a URI search.\n */\nfunction locationBarUriSearch(term, cb)\n{\n    var searchUrl = urlBase + 'datagathering/search?q=' + term;\n\n    $.getJSON(searchUrl,\n        function(jsonData) {\n            cb(jsonData);\n    });\n}\nfunction showLocationBar()\n{\n    $('a.location_bar').removeClass('show');\n    $('#location_bar_container').show();\n\n    // $('#location_bar_input')._autocomplete(function(term, cb) { locationBarUriSearch(term, cb); }, {\n    //         minChars: 3,\n    //         delay: 1000,\n    //         max: 100,\n    //         formatItem: function(data, i, n, term) {\n    //             return '<div style=\"overflow:hidden\">\\\n    //                     <span style=\"white-space: nowrap;font-size: 0.8em\">' + data[2] + '</span>\\\n    //                     <br />\\\n    //                     <span style=\"white-space: nowrap;font-weight: bold\">' + data[0] + '</span>\\\n    //                     <br />\\\n    //                     <span style=\"white-space: nowrap;font-size: 0.8em\">' + data[1] + '</span>\\\n    //                     </div>';\n    //         }\n    //     });\n\n    $('#location_bar_input').result(function(e, data, formated) {\n        $(this).attr('value', data[1]);\n    });\n}\n\n/**\n * Removes the location bar.\n */\nfunction hideLocationBar()\n{\n    $('#location_bar_container').hide();\n    $('a.location_bar').addClass('show');\n}\n\n/**\n * Function that executes a URI search.\n */\nfunction uriSearch(term, cb)\n{\n    var searchUrl = urlBase + 'datagathering/search?q=' + term;\n\n    $.getJSON(searchUrl,\n        function(jsonData) {\n            cb(jsonData);\n        });\n}\n"
  },
  {
    "path": "extensions/datagathering/default.ini",
    "content": "enabled = true\nname        = \"Linked Data Gathering\"\ndescription = \"a component and a wrapper to import linked data and expand local models.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\ntemplates = \"templates/\"\nlanguages = \"languages/\"\n\n[events] ; for plugin\n1 = onCreateMenu           ; Menu entries\n2 = onPropertiesAction     ; Location bar menu entry\n3 = onPreTabsContentAction ; Location bar\n4 = onDeleteResources      ; Sync \n5 = onPreDeleteModel       ; Sync\n\n[private]\n\nsync.enabled = false\n;syncModelUri        = \"http://localhost/OntoWiki/Sync/\"\n;syncModelUri        = \"http://localhost/OntoWiki/Config/\"\n;syncModelFilename   = \"SyncSchema.rdf\"\n;syncHelperModelBase = \"http://localhost/OntoWiki/Sync/Helper\"\n\n;properties.syncConfigClass  = \"http://ns.ontowiki.net/Sync/SyncConfig\"\n;properties.targetModel      = \"http://ns.ontowiki.net/Sync/targetModel\"\n;properties.syncResource     = \"http://ns.ontowiki.net/Sync/syncResource\"\n;properties.wrapperName      = \"http://ns.ontowiki.net/Sync/wrapperName\"\n;properties.syncQuery        = \"http://ns.ontowiki.net/Sync/syncQuery\"\n;properties.lastSyncDateTime = \"http://ns.ontowiki.net/Sync/lastSyncDateTime\"\n;properties.lastSyncPayload  = \"http://ns.ontowiki.net/Sync/lastSyncPayload\"\n;properties.checkHasChanged  = \"http://ns.ontowiki.net/Sync/checkHasChanged\"\n\n;;; DatagatheringComponent\n\n;fetch.allData = true   ; If enabled, not only data with subject == resource URI is imported, but all returned data.\n\nfetch.default.mode          = \"all\"                          ; all (default), none\n;fetch.default.exception[]  = \"http://www.w3.org/2000/01/rdf-schema#label\"\n\nfetch.preset.0.match       = \"http://dbpedia.org\"\nfetch.preset.0.mode        = \"none\"                         ; all (default), none\nfetch.preset.0.lang[]      = \"en\"\nfetch.preset.0.exception[] = \"http://www.w3.org/2000/01/rdf-schema#label\"\nfetch.preset.0.exception[] = \"http://xmlns.com/foaf/0.1/depiction\"\nfetch.preset.0.exception[] = \"http://xmlns.com/foaf/0.1/name\"\nfetch.preset.0.exception[] = \"http://xmlns.com/foaf/0.1/page\"\nfetch.preset.0.exception[] = \"http://xmlns.com/foaf/0.1/homepage\"\nfetch.preset.0.exception[] = \"http://dbpedia.org/ontology/birthDate\"\nfetch.preset.0.exception[] = \"http://dbpedia.org/ontology/birthPlace\"\nfetch.preset.0.exception[] = \"http://dbpedia.org/ontology/abstract\"\nfetch.preset.0.exception[] = \"http://www.w3.org/2003/01/geo/wgs84_pos#lat\"\nfetch.preset.0.exception[] = \"http://www.w3.org/2003/01/geo/wgs84_pos#long\"\n\n; have a look at http://de2.php.net/manual/en/function.preg-replace.php\n; for documantion about pattern and replace options\nrewrite.lsid.pattern     = \"/^(urn:lsid:.+)$/\"\nrewrite.lsid.replacement = \"http://lsid.tdwg.org/$1\"\nrewrite.go.pattern       = \"/^http:\\/\\/www.geneontology.org\\/go#GO:([0-9]+)$/\"\nrewrite.go.replacement   = \"http://go.ontowiki.de/$1\"\n\n;;; LinkedDataWrapper\n\nhandle.mode                 = \"all\"                          ; all: handle all http uris, none: handle no uris\n;handle.exception[]         = \"http://dbpedia.org\"           ; exceptions for handle mode, e.g http://dbpedia.org*\n\n;;; RdfaWrapper\n\nignore[] = 'http://www.w3.org/1999/xhtml/vocab#stylesheet'\nignore[] = 'http://www.w3.org/1999/xhtml/vocab#alternate'\nignore[] = 'http://poshrdf.org/ns/mf#nofollow'\n\ndefaultClass = 'http://xmlns.com/foaf/0.1/Document'\n"
  },
  {
    "path": "extensions/datagathering/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/datagathering/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :datagathering .\n:datagathering a doap:Project ;\n  doap:name \"datagathering\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/datagathering/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Linked Data Gathering\" ;\n  doap:description \"a component and a wrapper to import linked data and expand local models.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:templates \"templates/\" ;\n  owconfig:languages \"languages/\" ;\n  owconfig:pluginEvent event:onCreateMenu ;\n  owconfig:pluginEvent event:onPropertiesAction ;\n  owconfig:pluginEvent event:onPreTabsContentAction ;\n  owconfig:pluginEvent event:onDeleteResources ;\n  owconfig:pluginEvent event:onPreDeleteModel ;\n  owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"sync\";\n      owconfig:enabled \"false\"^^xsd:boolean\n];\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"fetch\";\n      owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"default\";\n          :mode \"all\"\n    ];\n owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"preset\";\n          owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"0\";\n              :match <http://dbpedia.org> ;\n              :mode \"none\" ;\n              :lang \"en\" ;\n              :exception <http://www.w3.org/2000/01/rdf-schema#label> ;\n              :exception <http://xmlns.com/foaf/0.1/depiction> ;\n              :exception <http://xmlns.com/foaf/0.1/name> ;\n              :exception <http://xmlns.com/foaf/0.1/page> ;\n              :exception <http://xmlns.com/foaf/0.1/homepage> ;\n              :exception <http://dbpedia.org/ontology/birthDate> ;\n              :exception <http://dbpedia.org/ontology/birthPlace> ;\n              :exception <http://dbpedia.org/ontology/abstract> ;\n              :exception <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ;\n              :exception <http://www.w3.org/2003/01/geo/wgs84_pos#long>\n        ]\n    ]\n];\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"rewrite\";\n      owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"lsid\";\n          :pattern \"/^(urn:lsid:.+)$/\" ;\n          :replacement <http://lsid.tdwg.org/$1>\n    ];\n owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"go\";\n          :pattern \"/^http:\\\\/\\\\/www.geneontology.org\\\\/go#GO:([0-9]+)$/\" ;\n          :replacement <http://go.ontowiki.de/$1>\n    ]\n];\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"handle\";\n      :mode \"all\"\n];\n :ignore <http://www.w3.org/1999/xhtml/vocab#stylesheet> ;\n  :ignore <http://www.w3.org/1999/xhtml/vocab#alternate> ;\n  :ignore <http://poshrdf.org/ns/mf#nofollow> ;\n  :defaultClass <http://xmlns.com/foaf/0.1/Document> .\n:datagathering doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/datagathering/languages/datagathering-de.csv",
    "content": "Sync Data with %1$s;Daten mit %1$s synchronisieren\nImport Data with %1$s;Daten mit %1$s importieren\nConfigure Sync with %1$s;Synchronisation mit %1$s konfigurieren\nThis Resource is configured for Sync;Diese Ressource ist für eine Synchronisation konfiguriert\nThis Resource has changed since last sync;Diese Ressource wurde seit der letzten Synchronisation aktualisiert\nLast Sync;Letze Synchronisation\nLast Modified;Zuletzt modifiziert\nSync;Synchronisieren\nView Resource;Ressource anzeigen\nShow/Hide Location Bar;Adressleiste zeigen/verstecken\nLocal Search;Lokale Suche\nExpanded QNames;Expandierte qualifizierte Bezeichner\nSindice Search;Sindice Suche\nGenerated URI;Automatisch generierte URI\nData was found for the given URI. %1$d statements were added.;Daten wurden für die gegebene URI gefunden und es wurden %1$d Statements hinzugefügt.\nData was found for the given URI but no statements were added.;Es wurden Daten für die gegebene URI gefunden, aber es wurden keine Statements hinzugefügt.\nNo data returned for the given URI by wrapper.;Keine Daten für die gegebene URI vom Wrapper gefunden.\nNo data was imported;Es wurden keine Daten importiert\nNo existing sync configuration. Create one now by clicking the Save button.;Es existiert bisher keine Konfiguration. Sie können nun eine Konfiguration erstellen, durch klicken auf Speichern.\nSync Configuration;Synchronisations-Konfiguration\nModel URI;Modell-URI\nWrapper Name;Wrapper-Name\nResource URI;Ressource URI\nCheck for Updates;Auf Aktualisierungen prüfen\nSync Query;Sync-Anfrage\nHISTORY_ACTIONTYPE_1010;Daten importiert\nHISTORY_ACTIONTYPE_1020;Ressource synchonisiert\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
  },
  {
    "path": "extensions/datagathering/languages/datagathering-en.csv",
    "content": "Sync Data with %1$s;Sync Data with %1$s\nImport Data with %1$s;Import Data with %1$s\nConfigure Sync with %1$s;Configure Sync with %1$s\nThis Resource is configured for Sync;This Resource is configured for Sync\nThis Resource has changed since last sync;This Resource has changed since last sync\nLast Sync;Last Sync\nLast Modified;Last Modified\nSync;Sync\nView Resource;View Resource\nShow/Hide Location Bar;Show/Hide Location Bar\nLocal Search;Local Search\nExpanded QNames;Expanded QNames\nSindice Search;Sindice Search\nGenerated URI;Generated URI\nData was found for the given URI. %1$d statements were added.;Data was found for the given URI. %1$d statements were added.\nData was found for the given URI but no statements were added.;Data was found for the given URI but no statements were added.\nNo data returned for the given URI by wrapper.;No data returned for the given URI by wrapper.\nNo data was imported;No data was imported\nNo existing sync configuration. Create one now by clicking the Save button.;No existing sync configuration. Create one now by clicking the Save button.\nSync Configuration;Sync Configuration\nModel URI;Model URI\nWrapper Name;Wrapper Name\nResource URI;Resource URI\nCheck for Updates;Check for Updates\nSync Query;Sync Query\nHISTORY_ACTIONTYPE_1010;data import\nHISTORY_ACTIONTYPE_1020;resource synced"
  },
  {
    "path": "extensions/datagathering/scripts/jquery.autocomplete.js",
    "content": "/*\n * Autocomplete - jQuery plugin 1.0.2\n *\n * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer\n *\n * Dual licensed under the MIT and GPL licenses:\n *   http://www.opensource.org/licenses/mit-license.php\n *   http://www.gnu.org/licenses/gpl.html\n *\n * Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $\n *\n */\n\n;(function($) {\n\t\n$.fn.extend({\n\t_autocomplete: function(urlOrData, options) {\n\t\tvar isUrl = (typeof urlOrData == \"string\" || typeof urlOrData == \"function\");\n\t\toptions = $.extend({}, $.Autocompleter.defaults, {\n\t\t\turl: isUrl ? urlOrData : null,\n\t\t\tdata: isUrl ? null : urlOrData,\n\t\t\tdelay: isUrl ? $.Autocompleter.defaults.delay : 10,\n\t\t\tmax: options && !options.scroll ? 10 : 150\n\t\t}, options);\n\t\t\n\t\t// if highlight is set to false, replace it with a do-nothing function\n\t\toptions.highlight = options.highlight || function(value) { return value; };\n\t\t\n\t\t// if the formatMatch option is not specified, then use formatItem for backwards compatibility\n\t\toptions.formatMatch = options.formatMatch || options.formatItem;\n\t\t\n\t\treturn this.each(function() {\n\t\t\tnew $.Autocompleter(this, options);\n\t\t});\n\t},\n\tresult: function(handler) {\n\t\treturn this.bind(\"result\", handler);\n\t},\n\tsearch: function(handler) {\n\t\treturn this.trigger(\"search\", [handler]);\n\t},\n\tflushCache: function() {\n\t\treturn this.trigger(\"flushCache\");\n\t},\n\tsetOptions: function(options){\n\t\treturn this.trigger(\"setOptions\", [options]);\n\t},\n\tunautocomplete: function() {\n\t\treturn this.trigger(\"unautocomplete\");\n\t}\n});\n\n$.Autocompleter = function(input, options) {\n\n\tvar KEY = {\n\t\tUP: 38,\n\t\tDOWN: 40,\n\t\tDEL: 46,\n\t\tTAB: 9,\n\t\tRETURN: 13,\n\t\tESC: 27,\n\t\tCOMMA: 188,\n\t\tPAGEUP: 33,\n\t\tPAGEDOWN: 34,\n\t\tBACKSPACE: 8\n\t};\n\n\t// Create $ object for input element\n\tvar $input = $(input).attr(\"autocomplete\", \"off\").addClass(options.inputClass);\n\n\tvar timeout;\n\tvar previousValue = \"\";\n\tvar cache = $.Autocompleter.Cache(options);\n\tvar hasFocus = 0;\n\tvar lastKeyPressCode;\n\tvar config = {\n\t\tmouseDownOnSelect: false\n\t};\n\tvar select = $.Autocompleter.Select(options, input, selectCurrent, config);\n\t\n\tvar blockSubmit;\n\t\n\t// prevent form submit in opera when selecting with return key\n\t$.browser.opera && $(input.form).bind(\"submit.autocomplete\", function() {\n\t\tif (blockSubmit) {\n\t\t\tblockSubmit = false;\n\t\t\treturn false;\n\t\t}\n\t});\n\t\n\t// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all\n\t$input.bind(($.browser.opera ? \"keypress\" : \"keydown\") + \".autocomplete\", function(event) {\n\t\t// track last key pressed\n\t\tlastKeyPressCode = event.keyCode;\n\t\tswitch(event.keyCode) {\n\t\t\n\t\t\tcase KEY.UP:\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( select.visible() ) {\n\t\t\t\t\tselect.prev();\n\t\t\t\t} else {\n\t\t\t\t\tonChange(0, true);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase KEY.DOWN:\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( select.visible() ) {\n\t\t\t\t\tselect.next();\n\t\t\t\t} else {\n\t\t\t\t\tonChange(0, true);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase KEY.PAGEUP:\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( select.visible() ) {\n\t\t\t\t\tselect.pageUp();\n\t\t\t\t} else {\n\t\t\t\t\tonChange(0, true);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase KEY.PAGEDOWN:\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( select.visible() ) {\n\t\t\t\t\tselect.pageDown();\n\t\t\t\t} else {\n\t\t\t\t\tonChange(0, true);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t// matches also semicolon\n\t\t\tcase options.multiple && $.trim(options.multipleSeparator) == \",\" && KEY.COMMA:\n\t\t\tcase KEY.TAB:\n\t\t\tcase KEY.RETURN:\n\t\t\t\tif( selectCurrent() ) {\n\t\t\t\t\t// stop default to prevent a form submit, Opera needs special handling\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tblockSubmit = true;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase KEY.ESC:\n\t\t\t\tselect.hide();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tclearTimeout(timeout);\n\t\t\t\ttimeout = setTimeout(onChange, options.delay);\n\t\t\t\tbreak;\n\t\t}\n\t}).focus(function(){\n\t\t// track whether the field has focus, we shouldn't process any\n\t\t// results if the field no longer has focus\n\t\thasFocus++;\n\t}).blur(function() {\n\t\thasFocus = 0;\n\t\tif (!config.mouseDownOnSelect) {\n\t\t\thideResults();\n\t\t}\n\t}).click(function() {\n\t\t// show select when clicking in a focused field\n\t\tif ( hasFocus++ > 1 && !select.visible() ) {\n\t\t\tonChange(0, true);\n\t\t}\n\t}).bind(\"search\", function() {\n\t\t// TODO why not just specifying both arguments?\n\t\tvar fn = (arguments.length > 1) ? arguments[1] : null;\n\t\tfunction findValueCallback(q, data) {\n\t\t\tvar result;\n\t\t\tif( data && data.length ) {\n\t\t\t\tfor (var i=0; i < data.length; i++) {\n\t\t\t\t\tif( data[i].result.toLowerCase() == q.toLowerCase() ) {\n\t\t\t\t\t\tresult = data[i];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( typeof fn == \"function\" ) fn(result);\n\t\t\telse $input.trigger(\"result\", result && [result.data, result.value]);\n\t\t}\n\t\t$.each(trimWords($input.val()), function(i, value) {\n\t\t\trequest(value, findValueCallback, findValueCallback);\n\t\t});\n\t}).bind(\"flushCache\", function() {\n\t\tcache.flush();\n\t}).bind(\"setOptions\", function() {\n\t\t$.extend(options, arguments[1]);\n\t\t// if we've updated the data, repopulate\n\t\tif ( \"data\" in arguments[1] )\n\t\t\tcache.populate();\n\t}).bind(\"unautocomplete\", function() {\n\t\tselect.unbind();\n\t\t$input.unbind();\n\t\t$(input.form).unbind(\".autocomplete\");\n\t});\n\t\n\t\n\tfunction selectCurrent() {\n\t\tvar selected = select.selected();\n\t\tif( !selected )\n\t\t\treturn false;\n\t\t\n\t\tvar v = selected.result;\n\t\tpreviousValue = v;\n\t\t\n\t\tif ( options.multiple ) {\n\t\t\tvar words = trimWords($input.val());\n\t\t\tif ( words.length > 1 ) {\n\t\t\t\tv = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v;\n\t\t\t}\n\t\t\tv += options.multipleSeparator;\n\t\t}\n\t\t\n\t\t$input.val(v);\n\t\thideResultsNow();\n\t\t$input.trigger(\"result\", [selected.data, selected.value]);\n\t\treturn true;\n\t}\n\t\n\tfunction onChange(crap, skipPrevCheck) {\n\t\tif( lastKeyPressCode == KEY.DEL ) {\n\t\t\tselect.hide();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tvar currentValue = $input.val();\n\t\t\n\t\tif ( !skipPrevCheck && currentValue == previousValue )\n\t\t\treturn;\n\t\t\n\t\tpreviousValue = currentValue;\n\t\t\n\t\tcurrentValue = lastWord(currentValue);\n\t\tif ( currentValue.length >= options.minChars) {\n\t\t\t$input.addClass(options.loadingClass);\n\t\t\tif (!options.matchCase)\n\t\t\t\tcurrentValue = currentValue.toLowerCase();\n\t\t\trequest(currentValue, receiveData, hideResultsNow);\n\t\t} else {\n\t\t\tstopLoading();\n\t\t\tselect.hide();\n\t\t}\n\t};\n\t\n\tfunction trimWords(value) {\n\t\tif ( !value ) {\n\t\t\treturn [\"\"];\n\t\t}\n\t\tvar words = value.split( options.multipleSeparator );\n\t\tvar result = [];\n\t\t$.each(words, function(i, value) {\n\t\t\tif ( $.trim(value) )\n\t\t\t\tresult[i] = $.trim(value);\n\t\t});\n\t\treturn result;\n\t}\n\t\n\tfunction lastWord(value) {\n\t\tif ( !options.multiple )\n\t\t\treturn value;\n\t\tvar words = trimWords(value);\n\t\treturn words[words.length - 1];\n\t}\n\t\n\t// fills in the input box w/the first match (assumed to be the best match)\n\t// q: the term entered\n\t// sValue: the first matching result\n\tfunction autoFill(q, sValue){\n\t\t// autofill in the complete box w/the first match as long as the user hasn't entered in more data\n\t\t// if the last user key pressed was backspace, don't autofill\n\t\tif( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {\n\t\t\t// fill in the value (keep the case the user has typed)\n\t\t\t$input.val($input.val() + sValue.substring(lastWord(previousValue).length));\n\t\t\t// select the portion of the value not typed by the user (so the next character will erase)\n\t\t\t$.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length);\n\t\t}\n\t};\n\n\tfunction hideResults() {\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(hideResultsNow, 200);\n\t};\n\n\tfunction hideResultsNow() {\n\t\tvar wasVisible = select.visible();\n\t\tselect.hide();\n\t\tclearTimeout(timeout);\n\t\tstopLoading();\n\t\tif (options.mustMatch) {\n\t\t\t// call search and run callback\n\t\t\t$input.search(\n\t\t\t\tfunction (result){\n\t\t\t\t\t// if no value found, clear the input box\n\t\t\t\t\tif( !result ) {\n\t\t\t\t\t\tif (options.multiple) {\n\t\t\t\t\t\t\tvar words = trimWords($input.val()).slice(0, -1);\n\t\t\t\t\t\t\t$input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : \"\") );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$input.val( \"\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\tif (wasVisible)\n\t\t\t// position cursor at end of input field\n\t\t\t$.Autocompleter.Selection(input, input.value.length, input.value.length);\n\t};\n\n\tfunction receiveData(q, data) {\n\t\tif ( data && data.length && hasFocus ) {\n\t\t\tstopLoading();\n\t\t\tselect.display(data, q);\n\t\t\tautoFill(q, data[0].value);\n\t\t\tselect.show();\n\t\t} else {\n\t\t\thideResultsNow();\n\t\t}\n\t};\n\n\tfunction request(term, success, failure) {\n\t\tif (!options.matchCase)\n\t\t\tterm = term.toLowerCase();\n\t\tvar data = cache.load(term);\n\t\t// recieve the cached data\n\t\tif (data && data.length) {\n\t\t\tsuccess(term, data);\n\t\t// if an AJAX url has been supplied, try loading the data now\n\t\t} else if( (typeof options.url == \"string\") && (options.url.length > 0) ){\n\t\t\t\n\t\t\tvar extraParams = {\n\t\t\t\ttimestamp: +new Date()\n\t\t\t};\n\t\t\t$.each(options.extraParams, function(key, param) {\n\t\t\t\textraParams[key] = typeof param == \"function\" ? param() : param;\n\t\t\t});\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\t// try to leverage ajaxQueue plugin to abort previous requests\n\t\t\t\tmode: \"abort\",\n\t\t\t\t// limit abortion to this input\n\t\t\t\tport: \"autocomplete\" + input.name,\n\t\t\t\tdataType: options.dataType,\n\t\t\t\turl: options.url,\n\t\t\t\tdata: $.extend({\n\t\t\t\t\tq: lastWord(term),\n\t\t\t\t\tlimit: options.max\n\t\t\t\t}, extraParams),\n\t\t\t\tsuccess: function(data) {\n\t\t\t\t\tvar parsed = options.parse && options.parse(data) || parse(data);\n\t\t\t\t\tcache.add(term, parsed);\n\t\t\t\t\tsuccess(term, parsed);\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (typeof options.url == \"function\") {\n\t\t\toptions.url(lastWord(term), function(data) {\n\t\t\t\tvar parsed = options.parse && options.parse(data) || parse(data);\n\t\t\t\tcache.add(term, parsed);\n\t\t\t\tsuccess(term, parsed);\n\t\t\t});\n\t\t} else {\n\t\t\t// if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match\n\t\t\tselect.emptyList();\n\t\t\tfailure(term);\n\t\t}\n\t};\n\t\n\tfunction parse(data) {\n\t\tvar parsed = [];\n\t\tvar rows = data.split(\"\\n\");\n\t\tfor (var i=0; i < rows.length; i++) {\n\t\t\tvar row = $.trim(rows[i]);\n\t\t\tif (row) {\n\t\t\t\trow = row.split(\"|\");\n\t\t\t\tparsed[parsed.length] = {\n\t\t\t\t\tdata: row,\n\t\t\t\t\tvalue: row[0],\n\t\t\t\t\tresult: options.formatResult && options.formatResult(row, row[0]) || row[0]\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn parsed;\n\t};\n\n\tfunction stopLoading() {\n\t\t$input.removeClass(options.loadingClass);\n\t};\n\n};\n\n$.Autocompleter.defaults = {\n\tinputClass: \"ac_input\",\n\tresultsClass: \"ac_results\",\n\tloadingClass: \"ac_loading\",\n\tminChars: 1,\n\tdelay: 400,\n\tmatchCase: false,\n\tmatchSubset: true,\n\tmatchContains: false,\n\tcacheLength: 10,\n\tmax: 100,\n\tmustMatch: false,\n\textraParams: {},\n\tselectFirst: true,\n\tformatItem: function(row) { return row[0]; },\n\tformatMatch: null,\n\tautoFill: false,\n\twidth: 0,\n\tmultiple: false,\n\tmultipleSeparator: \", \",\n\thighlight: function(value, term) {\n\t\treturn value.replace(new RegExp(\"(?![^&;]+;)(?!<[^<>]*)(\" + term.replace(/([\\^\\$\\(\\)\\[\\]\\{\\}\\*\\.\\+\\?\\|\\\\])/gi, \"\\\\$1\") + \")(?![^<>]*>)(?![^&;]+;)\", \"gi\"), \"<strong>$1</strong>\");\n\t},\n    scroll: true,\n    scrollHeight: 180\n};\n\n$.Autocompleter.Cache = function(options) {\n\n\tvar data = {};\n\tvar length = 0;\n\t\n\tfunction matchSubset(s, sub) {\n\t\tif (!options.matchCase) \n\t\t\ts = s.toLowerCase();\n\t\tvar i = s.indexOf(sub);\n\t\tif (i == -1) return false;\n\t\treturn i == 0 || options.matchContains;\n\t};\n\t\n\tfunction add(q, value) {\n\t\tif (length > options.cacheLength){\n\t\t\tflush();\n\t\t}\n\t\tif (!data[q]){ \n\t\t\tlength++;\n\t\t}\n\t\tdata[q] = value;\n\t}\n\t\n\tfunction populate(){\n\t\tif( !options.data ) return false;\n\t\t// track the matches\n\t\tvar stMatchSets = {},\n\t\t\tnullData = 0;\n\n\t\t// no url was specified, we need to adjust the cache length to make sure it fits the local data store\n\t\tif( !options.url ) options.cacheLength = 1;\n\t\t\n\t\t// track all options for minChars = 0\n\t\tstMatchSets[\"\"] = [];\n\t\t\n\t\t// loop through the array and create a lookup structure\n\t\tfor ( var i = 0, ol = options.data.length; i < ol; i++ ) {\n\t\t\tvar rawValue = options.data[i];\n\t\t\t// if rawValue is a string, make an array otherwise just reference the array\n\t\t\trawValue = (typeof rawValue == \"string\") ? [rawValue] : rawValue;\n\t\t\t\n\t\t\tvar value = options.formatMatch(rawValue, i+1, options.data.length);\n\t\t\tif ( value === false )\n\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\tvar firstChar = value.charAt(0).toLowerCase();\n\t\t\t// if no lookup array for this character exists, look it up now\n\t\t\tif( !stMatchSets[firstChar] ) \n\t\t\t\tstMatchSets[firstChar] = [];\n\n\t\t\t// if the match is a string\n\t\t\tvar row = {\n\t\t\t\tvalue: value,\n\t\t\t\tdata: rawValue,\n\t\t\t\tresult: options.formatResult && options.formatResult(rawValue) || value\n\t\t\t};\n\t\t\t\n\t\t\t// push the current match into the set list\n\t\t\tstMatchSets[firstChar].push(row);\n\n\t\t\t// keep track of minChars zero items\n\t\t\tif ( nullData++ < options.max ) {\n\t\t\t\tstMatchSets[\"\"].push(row);\n\t\t\t}\n\t\t};\n\n\t\t// add the data items to the cache\n\t\t$.each(stMatchSets, function(i, value) {\n\t\t\t// increase the cache size\n\t\t\toptions.cacheLength++;\n\t\t\t// add to the cache\n\t\t\tadd(i, value);\n\t\t});\n\t}\n\t\n\t// populate any existing data\n\tsetTimeout(populate, 25);\n\t\n\tfunction flush(){\n\t\tdata = {};\n\t\tlength = 0;\n\t}\n\t\n\treturn {\n\t\tflush: flush,\n\t\tadd: add,\n\t\tpopulate: populate,\n\t\tload: function(q) {\n\t\t\tif (!options.cacheLength || !length)\n\t\t\t\treturn null;\n\t\t\t/* \n\t\t\t * if dealing w/local data and matchContains than we must make sure\n\t\t\t * to loop through all the data collections looking for matches\n\t\t\t */\n\t\t\tif( !options.url && options.matchContains ){\n\t\t\t\t// track all matches\n\t\t\t\tvar csub = [];\n\t\t\t\t// loop through all the data grids for matches\n\t\t\t\tfor( var k in data ){\n\t\t\t\t\t// don't search through the stMatchSets[\"\"] (minChars: 0) cache\n\t\t\t\t\t// this prevents duplicates\n\t\t\t\t\tif( k.length > 0 ){\n\t\t\t\t\t\tvar c = data[k];\n\t\t\t\t\t\t$.each(c, function(i, x) {\n\t\t\t\t\t\t\t// if we've got a match, add it to the array\n\t\t\t\t\t\t\tif (matchSubset(x.value, q)) {\n\t\t\t\t\t\t\t\tcsub.push(x);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t\treturn csub;\n\t\t\t} else \n\t\t\t// if the exact item exists, use it\n\t\t\tif (data[q]){\n\t\t\t\treturn data[q];\n\t\t\t} else\n\t\t\tif (options.matchSubset) {\n\t\t\t\tfor (var i = q.length - 1; i >= options.minChars; i--) {\n\t\t\t\t\tvar c = data[q.substr(0, i)];\n\t\t\t\t\tif (c) {\n\t\t\t\t\t\tvar csub = [];\n\t\t\t\t\t\t$.each(c, function(i, x) {\n\t\t\t\t\t\t\tif (matchSubset(x.value, q)) {\n\t\t\t\t\t\t\t\tcsub[csub.length] = x;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn csub;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t};\n};\n\n$.Autocompleter.Select = function (options, input, select, config) {\n\tvar CLASSES = {\n\t\tACTIVE: \"ac_over\"\n\t};\n\t\n\tvar listItems,\n\t\tactive = -1,\n\t\tdata,\n\t\tterm = \"\",\n\t\tneedsInit = true,\n\t\telement,\n\t\tlist;\n\t\n\t// Create results\n\tfunction init() {\n\t\tif (!needsInit)\n\t\t\treturn;\n\t\telement = $(\"<div/>\")\n\t\t.hide()\n\t\t.addClass(options.resultsClass)\n\t\t.css(\"position\", \"absolute\")\n\t\t.appendTo(document.body);\n\t\n\t\tlist = $(\"<ul/>\").appendTo(element).mouseover( function(event) {\n\t\t\tif(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {\n\t            active = $(\"li\", list).removeClass(CLASSES.ACTIVE).index(target(event));\n\t\t\t    $(target(event)).addClass(CLASSES.ACTIVE);            \n\t        }\n\t\t}).click(function(event) {\n\t\t\t$(target(event)).addClass(CLASSES.ACTIVE);\n\t\t\tselect();\n\t\t\t// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus\n\t\t\tinput.focus();\n\t\t\treturn false;\n\t\t}).mousedown(function() {\n\t\t\tconfig.mouseDownOnSelect = true;\n\t\t}).mouseup(function() {\n\t\t\tconfig.mouseDownOnSelect = false;\n\t\t});\n\t\t\n\t\tif( options.width > 0 )\n\t\t\telement.css(\"width\", options.width);\n\t\t\t\n\t\tneedsInit = false;\n\t} \n\t\n\tfunction target(event) {\n\t\tvar element = event.target;\n\t\twhile(element && element.tagName != \"LI\")\n\t\t\telement = element.parentNode;\n\t\t// more fun with IE, sometimes event.target is empty, just ignore it then\n\t\tif(!element)\n\t\t\treturn [];\n\t\treturn element;\n\t}\n\n\tfunction moveSelect(step) {\n\t\tlistItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);\n\t\tmovePosition(step);\n        var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);\n        if(options.scroll) {\n            var offset = 0;\n            listItems.slice(0, active).each(function() {\n\t\t\t\toffset += this.offsetHeight;\n\t\t\t});\n            if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {\n                list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());\n            } else if(offset < list.scrollTop()) {\n                list.scrollTop(offset);\n            }\n        }\n\t};\n\t\n\tfunction movePosition(step) {\n\t\tactive += step;\n\t\tif (active < 0) {\n\t\t\tactive = listItems.size() - 1;\n\t\t} else if (active >= listItems.size()) {\n\t\t\tactive = 0;\n\t\t}\n\t}\n\t\n\tfunction limitNumberOfItems(available) {\n\t\treturn options.max && options.max < available\n\t\t\t? options.max\n\t\t\t: available;\n\t}\n\t\n\tfunction fillList() {\n\t\tlist.empty();\n\t\tvar max = limitNumberOfItems(data.length);\n\t\tfor (var i=0; i < max; i++) {\n\t\t\tif (!data[i])\n\t\t\t\tcontinue;\n\t\t\tvar formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);\n\t\t\tif ( formatted === false )\n\t\t\t\tcontinue;\n\t\t\tvar li = $(\"<li/>\").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? \"ac_even\" : \"ac_odd\").appendTo(list)[0];\n\t\t\t$.data(li, \"ac_data\", data[i]);\n\t\t}\n\t\tlistItems = list.find(\"li\");\n\t\tif ( options.selectFirst ) {\n\t\t\tlistItems.slice(0, 1).addClass(CLASSES.ACTIVE);\n\t\t\tactive = 0;\n\t\t}\n\t\t// apply bgiframe if available\n\t\tif ( $.fn.bgiframe )\n\t\t\tlist.bgiframe();\n\t}\n\t\n\treturn {\n\t\tdisplay: function(d, q) {\n\t\t\tinit();\n\t\t\tdata = d;\n\t\t\tterm = q;\n\t\t\tfillList();\n\t\t},\n\t\tnext: function() {\n\t\t\tmoveSelect(1);\n\t\t},\n\t\tprev: function() {\n\t\t\tmoveSelect(-1);\n\t\t},\n\t\tpageUp: function() {\n\t\t\tif (active != 0 && active - 8 < 0) {\n\t\t\t\tmoveSelect( -active );\n\t\t\t} else {\n\t\t\t\tmoveSelect(-8);\n\t\t\t}\n\t\t},\n\t\tpageDown: function() {\n\t\t\tif (active != listItems.size() - 1 && active + 8 > listItems.size()) {\n\t\t\t\tmoveSelect( listItems.size() - 1 - active );\n\t\t\t} else {\n\t\t\t\tmoveSelect(8);\n\t\t\t}\n\t\t},\n\t\thide: function() {\n\t\t\telement && element.hide();\n\t\t\tlistItems && listItems.removeClass(CLASSES.ACTIVE);\n\t\t\tactive = -1;\n\t\t},\n\t\tvisible : function() {\n\t\t\treturn element && element.is(\":visible\");\n\t\t},\n\t\tcurrent: function() {\n\t\t\treturn this.visible() && (listItems.filter(\".\" + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);\n\t\t},\n\t\tshow: function() {\n\t\t\tvar offset = $(input).offset();\n\t\t\telement.css({\n\t\t\t\twidth: typeof options.width == \"string\" || options.width > 0 ? options.width : $(input).width(),\n\t\t\t\ttop: offset.top + input.offsetHeight,\n\t\t\t\tleft: offset.left\n\t\t\t}).show();\n            if(options.scroll) {\n                list.scrollTop(0);\n                list.css({\n\t\t\t\t\tmaxHeight: options.scrollHeight,\n\t\t\t\t\toverflow: 'auto'\n\t\t\t\t});\n\t\t\t\t\n                if($.browser.msie && typeof document.body.style.maxHeight === \"undefined\") {\n\t\t\t\t\tvar listHeight = 0;\n\t\t\t\t\tlistItems.each(function() {\n\t\t\t\t\t\tlistHeight += this.offsetHeight;\n\t\t\t\t\t});\n\t\t\t\t\tvar scrollbarsVisible = listHeight > options.scrollHeight;\n                    list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );\n\t\t\t\t\tif (!scrollbarsVisible) {\n\t\t\t\t\t\t// IE doesn't recalculate width when scrollbar disappears\n\t\t\t\t\t\tlistItems.width( list.width() - parseInt(listItems.css(\"padding-left\")) - parseInt(listItems.css(\"padding-right\")) );\n\t\t\t\t\t}\n                }\n                \n            }\n\t\t},\n\t\tselected: function() {\n\t\t\tvar selected = listItems && listItems.filter(\".\" + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);\n\t\t\treturn selected && selected.length && $.data(selected[0], \"ac_data\");\n\t\t},\n\t\temptyList: function (){\n\t\t\tlist && list.empty();\n\t\t},\n\t\tunbind: function() {\n\t\t\telement && element.remove();\n\t\t}\n\t};\n};\n\n$.Autocompleter.Selection = function(field, start, end) {\n\tif( field.createTextRange ){\n\t\tvar selRange = field.createTextRange();\n\t\tselRange.collapse(true);\n\t\tselRange.moveStart(\"character\", start);\n\t\tselRange.moveEnd(\"character\", end);\n\t\tselRange.select();\n\t} else if( field.setSelectionRange ){\n\t\tfield.setSelectionRange(start, end);\n\t} else {\n\t\tif( field.selectionStart ){\n\t\t\tfield.selectionStart = start;\n\t\t\tfield.selectionEnd = end;\n\t\t}\n\t}\n\tfield.focus();\n};\n\n})(jQuery);"
  },
  {
    "path": "extensions/datagathering/templates/datagathering/config.phtml",
    "content": "<?php\n\n/**\n * OntoWiki sync config template\n */\n\n?>\n\n<?php if (!isset($this->errorFlag) || $this->errorFlag === false): ?>\n<fieldset>\n    <div class=\"row-input\">\n        <label for=\"modeluri\"><?php echo $this->_('Model URI') ?></label>\n        <input class=\"text\" id=\"modeluri\" type=\"text\" name=\"modeluri\" readonly=\"readonly\" value=\"<?php echo $this->modelUri ?>\" />\n        <br class=\"clearall\" />\n    </div>\n    <div class=\"row-input\">\n        <label for=\"wrappername\"><?php echo $this->_('Wrapper Name') ?></label>\n        <input class=\"text\" id=\"wrappername\" type=\"text\" name=\"wrappername\" readonly=\"readonly\" value=\"<?php echo $this->wrapperName ?>\" />\n        <br class=\"clearall\" />\n    </div>\n    <div class=\"row-input\">\n        <label for=\"resourceuri\"><?php echo $this->_('Resource URI') ?></label>\n        <input class=\"text\" id=\"resourceuri\" type=\"text\" name=\"resourceuri\" readonly=\"readonly\" value=\"<?php echo $this->uri ?>\" />\n        <br class=\"clearall\" />\n    </div>\n    <div class=\"clearall\"></div>\n</fieldset>\n\n<fieldset>\n    <div class=\"row-input\">\n        <label for=\"checkhaschanged\"><?php echo $this->_('Check for Updates') ?></label>\n        <input class=\"checkbox\" type=\"checkbox\" value=\"checkhaschanged\" name=\"checkhaschanged\" <?php echo $this->checkHasChanged ?> />\n    </div>\n</fieldset>\n\n<fieldset>\n    <div class=\"row-input\">\n        <label for=\"syncQuery\"><?php echo $this->_('Sync Query') ?></label>\n        <textarea class=\"text\" id=\"syncQuery\" type=\"text\" name=\"syncQuery\" cols=\"50\" rows=\"10\"><?php echo $this->syncQuery ?></textarea>\n        <br class=\"clearall\" />\n    </div>\n    <div class=\"clearall\"></div>\n</fieldset>\n<?php endif; ?>\n\n"
  },
  {
    "path": "extensions/datagathering/tests/DatagatheringControllerTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nclass DatagatheringControllerTest extends OntoWiki_Test_ControllerTestCase\n{\n    public function setUp()\n    {\n        $this->_extensionName = 'datagathering';\n\n        $this->setUpExtensionUnitTest();\n    }\n\n    public function testImportActionRequestTypeNotGetBadRequest()\n    {\n        $this->dispatch('/datagathering/import');\n\n        $this->assertController('error');\n        $this->assertAction('error');\n        @$this->assertResponseCode(400);\n    }\n\n    public function testImportActionNoParamsBadRequest()\n    {\n        $this->dispatch('/datagathering/import');\n\n        $this->assertController('error');\n        $this->assertAction('error');\n        @$this->assertResponseCode(400);\n    }\n\n    public function testImportActionInvalidWrapperParamBadRequest()\n    {\n        $this->request->setQuery(\n            array(\n                 'wrapper' => 'anInvalidWrapperName123456789ThisShouldNeverExist'\n            )\n        );\n\n        $this->dispatch('/datagathering/import');\n\n        $this->assertController('error');\n        $this->assertAction('error');\n        @$this->assertResponseCode(400);\n    }\n\n    public function testImportActionModelNotEditableForbidden()\n    {\n        $this->_storeAdapter->createModel('http://example.org/testModel1');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'view', 'grant');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'edit', 'deny');\n\n        $this->request->setQuery(\n            array(\n                 'uri' => 'http://example.org/testResource1',\n                 'm'   => 'http://example.org/testModel1'\n            )\n        );\n\n        $this->dispatch('/datagathering/import');\n\n        $this->assertController('error');\n        $this->assertAction('error');\n        @$this->assertResponseCode(403);\n    }\n\n    public function testImportActionWrapperResultFalse()\n    {\n        $this->_storeAdapter->createModel('http://example.org/testModel1');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'view', 'grant');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'edit', 'grant');\n\n        $this->request->setQuery(\n            array(\n                 'uri'     => 'http://example.org/testResource1',\n                 'm'       => 'http://example.org/testModel1',\n                 'wrapper' => 'Erfurt_Wrapper_Test'\n            )\n        );\n\n        $this->dispatch('/datagathering/import');\n\n        $this->assertController('datagathering');\n        $this->assertAction('import');\n        @$this->assertResponseCode(200);\n\n        $result = json_decode($this->_response->getBody(), true);\n\n        $this->assertArrayHasKey('code', $result);\n        $this->assertFalse($result['code']);\n        $this->assertArrayHasKey('message', $result);\n        $this->assertNotEmpty($result['message']);\n    }\n\n    public function testImportActionWrapperResultEmptyArray()\n    {\n        $this->_storeAdapter->createModel('http://example.org/testModel1');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'view', 'grant');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'edit', 'grant');\n\n        Erfurt_Wrapper_Test::$runResult = array();\n\n        $this->request->setQuery(\n            array(\n                 'uri'     => 'http://example.org/testResource1',\n                 'm'       => 'http://example.org/testModel1',\n                 'wrapper' => 'Erfurt_Wrapper_Test'\n            )\n        );\n\n        $this->dispatch('/datagathering/import');\n\n        $this->assertController('datagathering');\n        $this->assertAction('import');\n        @$this->assertResponseCode(200);\n\n        $result = json_decode($this->_response->getBody(), true);\n\n        $this->assertArrayHasKey('code', $result);\n        $this->assertFalse($result['code']);\n        $this->assertArrayHasKey('message', $result);\n        $this->assertNotEmpty($result['message']);\n    }\n\n    public function testImportActionWrapperResultArrayNoAdd()\n    {\n        $this->_storeAdapter->createModel('http://example.org/testModel1');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'view', 'grant');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'edit', 'grant');\n\n        Erfurt_Wrapper_Test::$runResult = array('status_codes' => array());\n\n        $this->request->setQuery(\n            array(\n                 'uri'     => 'http://example.org/testResource1',\n                 'm'       => 'http://example.org/testModel1',\n                 'wrapper' => 'Erfurt_Wrapper_Test'\n            )\n        );\n\n        $this->dispatch('/datagathering/import');\n\n        $this->assertController('datagathering');\n        $this->assertAction('import');\n        @$this->assertResponseCode(200);\n\n        $result = json_decode($this->_response->getBody(), true);\n\n        $this->assertArrayHasKey('code', $result);\n        $this->assertFalse($result['code']);\n        $this->assertArrayHasKey('message', $result);\n        $this->assertNotEmpty($result['message']);\n    }\n\n    public function testImportActionWrapperResultArrayWithAddButNothingAdded()\n    {\n        Erfurt_App::getInstance()->getVersioning()->enableVersioning(false);\n\n        $this->_storeAdapter->createModel('http://example.org/testModel1');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'view', 'grant');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'edit', 'grant');\n\n        Erfurt_Wrapper_Test::$runResult = array(\n            'status_codes' => array(Erfurt_Wrapper::RESULT_HAS_ADD),\n            'add'          => array()\n        );\n\n        $this->request->setQuery(\n            array(\n                 'uri'     => 'http://example.org/testResource1',\n                 'm'       => 'http://example.org/testModel1',\n                 'wrapper' => 'Erfurt_Wrapper_Test'\n            )\n        );\n\n        $this->dispatch('/datagathering/import');\n\n        $this->assertController('datagathering');\n        $this->assertAction('import');\n        @$this->assertResponseCode(200);\n\n        $result = json_decode($this->_response->getBody(), true);\n\n        $this->assertArrayHasKey('code', $result);\n        $this->assertFalse($result['code']);\n        $this->assertArrayHasKey('message', $result);\n        $this->assertNotEmpty($result['message']);\n    }\n\n    public function testImportActionWrapperResultArrayWithAdd()\n    {\n        Erfurt_App::getInstance()->getVersioning()->enableVersioning(false);\n\n        $this->_storeAdapter->createModel('http://example.org/testModel1');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'view', 'grant');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'edit', 'grant');\n\n        $this->_storeAdapter->addCountResult(0);\n        $this->_storeAdapter->addCountResult(2);\n\n        $add = array(\n            'http://example.org/testResource1' => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' => array(array(\n                    'type'  => 'uri',\n                    'value' => 'http://xmlns.com/foaf/0.1/Person'\n                )),\n                'http://xmlns.com/foaf/0.1/nick' => array(array(\n                    'type'  => 'literal',\n                    'value' => 'testResource1'\n                ))\n            )\n        );\n\n        Erfurt_Wrapper_Test::$runResult = array(\n            'status_codes' => array(Erfurt_Wrapper::RESULT_HAS_ADD),\n            'add'          => $add\n        );\n\n        $this->request->setQuery(\n            array(\n                 'uri'     => 'http://example.org/testResource1',\n                 'm'       => 'http://example.org/testModel1',\n                 'wrapper' => 'Erfurt_Wrapper_Test'\n            )\n        );\n\n        $this->dispatch('/datagathering/import');\n\n        $this->assertController('datagathering');\n        $this->assertAction('import');\n        @$this->assertResponseCode(200);\n\n        $result = json_decode($this->_response->getBody(), true);\n\n        $this->assertArrayHasKey('code', $result);\n        $this->assertTrue($result['code']);\n        $this->assertArrayHasKey('message', $result);\n        $this->assertNotEmpty($result['message']);\n\n        $this->assertEquals($add, $this->_storeAdapter->getStatementsForGraph('http://example.org/testModel1'));\n    }\n\n    public function testImportActionWrapperResultArrayWithAddMatchingPreset()\n    {\n        Erfurt_App::getInstance()->getVersioning()->enableVersioning(false);\n\n        $this->_storeAdapter->createModel('http://example.org/testModel1');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'view', 'grant');\n        $this->_ac->setUserModelRight('http://example.org/testModel1', 'edit', 'grant');\n\n        $this->_storeAdapter->addCountResult(0);\n        $this->_storeAdapter->addCountResult(2);\n\n        $add = array(\n            'http://dbpedia.org/resource/Leipzig' => array(\n                'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' => array(array(\n                    'type'  => 'uri',\n                    'value' => 'http://xmlns.com/foaf/0.1/Person'\n                )),\n                'http://xmlns.com/foaf/0.1/nick' => array(array(\n                    'type'  => 'literal',\n                    'value' => 'testResource1'\n                ))\n            )\n        );\n\n        Erfurt_Wrapper_Test::$runResult = array(\n            'status_codes' => array(Erfurt_Wrapper::RESULT_HAS_ADD),\n            'add'          => $add\n        );\n\n        $this->request->setQuery(\n            array(\n                 'uri'     => 'http://dbpedia.org/resource/Leipzig',\n                 'm'       => 'http://example.org/testModel1',\n                 'wrapper' => 'Erfurt_Wrapper_Test'\n            )\n        );\n\n        $this->dispatch('/datagathering/import');\n\n        $this->assertController('datagathering');\n        $this->assertAction('import');\n        @$this->assertResponseCode(200);\n\n        $result = json_decode($this->_response->getBody(), true);\n\n        $this->assertArrayHasKey('code', $result);\n        $this->assertTrue($result['code']);\n        $this->assertArrayHasKey('message', $result);\n        $this->assertNotEmpty($result['message']);\n\n        $this->assertEquals(array(), $this->_storeAdapter->getStatementsForGraph('http://example.org/testModel1'));\n    }\n}\n"
  },
  {
    "path": "extensions/defaultmodel/DefaultmodelPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Plugin.php';\n\n/**\n * Plugin to select default model if only one available or always.\n *\n * @category   OntoWiki\n * @package    Extensions_Defaultmodel\n */\nclass DefaultmodelPlugin extends OntoWiki_Plugin\n{\n    public function onAfterInitController($event)\n    {\n        //this extension should only run if no explicit model is given via request parameter \"m\"\n        $request = new Zend_Controller_Request_Http();\n        if ($request->get(\"m\")) {\n            return;\n        }\n\n        $config = $this->_privateConfig->toArray();\n        $efApp  = Erfurt_App::getInstance();\n\n        // disable model box if config value is true and modelmanangement isn't allowed\n        if ($config['modelsHide'] && !$efApp->getAc()->isActionAllowed($config['modelsExclusiveRight'])) {\n            $registry = OntoWiki_Module_Registry::getInstance();\n            $registry->disableModule('modellist', 'main.sidewindow');\n        }\n\n        //only do this once (so if the model is changed later, this plugin will not prevent it)\n        if ($config['setOnce'] && isset($_SESSION['defaultModelHasBeenSet']) && $_SESSION['defaultModelHasBeenSet']) {\n            return;\n        }\n\n        $_SESSION['defaultModelHasBeenSet'] = true;\n\n        require_once 'OntoWiki/Module/Registry.php';\n\n        $owApp           = OntoWiki::getInstance();\n        $efStore         = $efApp->getStore();\n        $availableModels = $efStore->getAvailableModels();\n\n        if (array_key_exists('modelUri', $config)\n            && array_key_exists($config['modelUri'], $availableModels)\n        ) {\n            $modelUri = $config['modelUri'];\n        } elseif (count($availableModels) === 1) {\n            $modelUri = current(array_keys($availableModels));\n        } else {\n            $modelUri = false;\n        }\n\n        // set default model if it could be determined\n        if ($modelUri && !$efApp->getAc()->isActionAllowed($config['modelsExclusiveRight'])) {\n\n            if (!($owApp->selectedModel && ($modelUri == $owApp->selectedModel->getModelUri()))) {\n                $owApp->selectedModel = $efStore->getModel($modelUri);\n                return;\n            }\n\n            if ($config['setSelectedResource']) {\n                $owApp->selectedResource = $modelUri;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/defaultmodel/default.ini",
    "content": "enabled     = false\nname        = \"Default Model\"\ndescription = \"Plugin to select default model if only one available or always\"\nauthor      = \"Christoph Rieß\"\n; url         = \n\n[events]\n1 = onAfterInitController\n\n[private]\n\n; which model should be selected by default\nmodelUri = \"http://showcase.ontowiki.net/\"\n\n; set to true if you want to set the model only on the first session use\n; this implies that you can switch to another model thereafter\n; setting it to false, means that each request sets the model, thus forcing it permanently\nsetOnce = true\n\n; set to true if you do not want to have a visible Knowledge Base module (but \"modelsExclusiveRight\", force it to appear)\nmodelsHide = true\n\n; however, the module is always shown if the user has the following\n; action-based access right (because Admins need this module)\nmodelsExclusiveRight = \"ModelManagement\"\n\n; after selecting model the selectedResource will be set to the modelUri\n; (dont use it, it will crash lists)\nsetSelectedResource = false\n\n"
  },
  {
    "path": "extensions/defaultmodel/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/defaultmodel/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :defaultmodel .\n:defaultmodel a doap:Project ;\n  doap:name \"defaultmodel\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/defaultmodel/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  rdfs:label \"Default Model\" ;\n  doap:description \"Plugin to select default model if only one available or always\" ;\n  owconfig:authorLabel \"Christoph Rieß\" ;\n  owconfig:pluginEvent event:onAfterInitController ;\n  :modelUri <http://showcase.ontowiki.net/> ;\n  :setOnce \"true\"^^xsd:boolean ;\n  :modelsHide \"true\"^^xsd:boolean ;\n  :modelsExclusiveRight \"ModelManagement\" ;\n  :setSelectedResource \"false\"^^xsd:boolean ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/exconf/Archive.php",
    "content": "<?php\r\n/**\r\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\r\n *\r\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\r\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\r\n */\r\n\r\n/*--------------------------------------------------\r\n | TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.1\r\n | By Devin Doucette\r\n | Copyright (c) 2005 Devin Doucette\r\n | Email: darksnoopy@shaw.ca\r\n | see: http://www.phpclasses.org/package/945-PHP-Create-tar-gzip-bzip2-zip-extract-tar-gzip-bzip2-.html\r\n +--------------------------------------------------\r\n | Email bugs/suggestions to darksnoopy@shaw.ca\r\n +--------------------------------------------------\r\n | This script has been created and released under\r\n | the GNU GPL and is free to use and redistribute\r\n | only if this copyright statement is not removed\r\n +--------------------------------------------------*/\r\n\r\n/**\r\n * Component controller for user account related stuff\r\n *\r\n * @category   OntoWiki\r\n * @package    Extensions_Exconf\r\n */\r\nclass archive\r\n{\r\n    function archive($name)\r\n    {\r\n        $this->options   = array(\r\n            'basedir'     => \".\",\r\n            'name'        => $name,\r\n            'prepend'     => \"\",\r\n            'inmemory'    => 0,\r\n            'overwrite'   => 0,\r\n            'recurse'     => 1,\r\n            'storepaths'  => 1,\r\n            'followlinks' => 0,\r\n            'level'       => 3,\r\n            'method'      => 1,\r\n            'sfx'         => \"\",\r\n            'type'        => \"\",\r\n            'comment'     => \"\"\r\n        );\r\n        $this->files     = array();\r\n        $this->exclude   = array();\r\n        $this->storeonly = array();\r\n        $this->error     = array();\r\n    }\r\n\r\n    function set_options($options)\r\n    {\r\n        foreach ($options as $key => $value) {\r\n            $this->options[$key] = $value;\r\n        }\r\n        if (!empty ($this->options['basedir'])) {\r\n            $this->options['basedir'] = str_replace(\"\\\\\", \"/\", $this->options['basedir']);\r\n            $this->options['basedir'] = preg_replace(\"/\\/+/\", \"/\", $this->options['basedir']);\r\n            $this->options['basedir'] = preg_replace(\"/\\/$/\", \"\", $this->options['basedir']);\r\n        }\r\n        if (!empty ($this->options['name'])) {\r\n            $this->options['name'] = str_replace(\"\\\\\", \"/\", $this->options['name']);\r\n            $this->options['name'] = preg_replace(\"/\\/+/\", \"/\", $this->options['name']);\r\n        }\r\n        if (!empty ($this->options['prepend'])) {\r\n            $this->options['prepend'] = str_replace(\"\\\\\", \"/\", $this->options['prepend']);\r\n            $this->options['prepend'] = preg_replace(\"/^(\\.*\\/+)+/\", \"\", $this->options['prepend']);\r\n            $this->options['prepend'] = preg_replace(\"/\\/+/\", \"/\", $this->options['prepend']);\r\n            $this->options['prepend'] = preg_replace(\"/\\/$/\", \"\", $this->options['prepend']) . \"/\";\r\n        }\r\n    }\r\n\r\n    function create_archive()\r\n    {\r\n        $this->make_list();\r\n\r\n        if ($this->options['inmemory'] == 0) {\r\n            $pwd = getcwd();\r\n            chdir($this->options['basedir']);\r\n            if ($this->options['overwrite'] == 0\r\n                && file_exists(\r\n                    $this->options['name'] . (\r\n                    $this->options['type'] == \"gzip\" || $this->options['type'] == \"bzip\" ? \".tmp\" : \"\")\r\n                )\r\n            ) {\r\n                $this->error[] = \"File {$this->options['name']} already exists.\";\r\n                chdir($pwd);\r\n\r\n                return 0;\r\n            } else {\r\n                if ($this->archive = @fopen(\r\n                    $this->options['name'] . (\r\n                    $this->options['type'] == \"gzip\" || $this->options['type'] == \"bzip\" ? \".tmp\" : \"\"), \"wb+\"\r\n                )\r\n                ) {\r\n                    chdir($pwd);\r\n                } else {\r\n                    $this->error[] = \"Could not open {$this->options['name']} for writing.\";\r\n                    chdir($pwd);\r\n\r\n                    return 0;\r\n                }\r\n            }\r\n        } else {\r\n            $this->archive = \"\";\r\n        }\r\n\r\n        switch ($this->options['type']) {\r\n            case \"zip\":\r\n                if (!$this->create_zip()) {\r\n                    $this->error[] = \"Could not create zip file.\";\r\n\r\n                    return 0;\r\n                }\r\n                break;\r\n            case \"bzip\":\r\n                if (!$this->create_tar()) {\r\n                    $this->error[] = \"Could not create tar file.\";\r\n\r\n                    return 0;\r\n                }\r\n                if (!$this->create_bzip()) {\r\n                    $this->error[] = \"Could not create bzip2 file.\";\r\n\r\n                    return 0;\r\n                }\r\n                break;\r\n            case \"gzip\":\r\n                if (!$this->create_tar()) {\r\n                    $this->error[] = \"Could not create tar file.\";\r\n\r\n                    return 0;\r\n                }\r\n                if (!$this->create_gzip()) {\r\n                    $this->error[] = \"Could not create gzip file.\";\r\n\r\n                    return 0;\r\n                }\r\n                break;\r\n            case \"tar\":\r\n                if (!$this->create_tar()) {\r\n                    $this->error[] = \"Could not create tar file.\";\r\n\r\n                    return 0;\r\n                }\r\n        }\r\n\r\n        if ($this->options['inmemory'] == 0) {\r\n            fclose($this->archive);\r\n            if ($this->options['type'] == \"gzip\" || $this->options['type'] == \"bzip\") {\r\n                unlink($this->options['basedir'] . \"/\" . $this->options['name'] . \".tmp\");\r\n            }\r\n        }\r\n    }\r\n\r\n    function add_data($data)\r\n    {\r\n        if ($this->options['inmemory'] == 0) {\r\n            fwrite($this->archive, $data);\r\n        } else {\r\n            $this->archive .= $data;\r\n        }\r\n    }\r\n\r\n    function make_list()\r\n    {\r\n        if (!empty ($this->exclude)) {\r\n            foreach ($this->files as $key => $value) {\r\n                foreach ($this->exclude as $current) {\r\n                    if ($value['name'] == $current['name']) {\r\n                        unset ($this->files[$key]);\r\n                    }\r\n                }\r\n            }\r\n        }\r\n        if (!empty ($this->storeonly)) {\r\n            foreach ($this->files as $key => $value) {\r\n                foreach ($this->storeonly as $current) {\r\n                    if ($value['name'] == $current['name']) {\r\n                        $this->files[$key]['method'] = 0;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n        unset ($this->exclude, $this->storeonly);\r\n    }\r\n\r\n    function add_files($list)\r\n    {\r\n        $temp = $this->list_files($list);\r\n        foreach ($temp as $current) {\r\n            $this->files[] = $current;\r\n        }\r\n    }\r\n\r\n    function exclude_files($list)\r\n    {\r\n        $temp = $this->list_files($list);\r\n        foreach ($temp as $current) {\r\n            $this->exclude[] = $current;\r\n        }\r\n    }\r\n\r\n    function store_files($list)\r\n    {\r\n        $temp = $this->list_files($list);\r\n        foreach ($temp as $current) {\r\n            $this->storeonly[] = $current;\r\n        }\r\n    }\r\n\r\n    function list_files($list)\r\n    {\r\n        if (!is_array($list)) {\r\n            $temp = $list;\r\n            $list = array($temp);\r\n            unset ($temp);\r\n        }\r\n\r\n        $files = array();\r\n\r\n        $pwd = getcwd();\r\n        chdir($this->options['basedir']);\r\n\r\n        foreach ($list as $current) {\r\n            $current = str_replace(\"\\\\\", \"/\", $current);\r\n            $current = preg_replace(\"/\\/+/\", \"/\", $current);\r\n            $current = preg_replace(\"/\\/$/\", \"\", $current);\r\n            if (strstr($current, \"*\")) {\r\n                $regex = preg_replace(\"/([\\\\\\^\\$\\.\\[\\]\\|\\(\\)\\?\\+\\{\\}\\/])/\", \"\\\\\\\\\\\\1\", $current);\r\n                $regex = str_replace(\"*\", \".*\", $regex);\r\n                $dir   = strstr($current, \"/\") ? substr($current, 0, strrpos($current, \"/\")) : \".\";\r\n                $temp  = $this->parse_dir($dir);\r\n                foreach ($temp as $current2) {\r\n                    if (preg_match(\"/^{$regex}$/i\", $current2['name'])) {\r\n                        $files[] = $current2;\r\n                    }\r\n                }\r\n                unset ($regex, $dir, $temp, $current);\r\n            } else {\r\n                if (@is_dir($current)) {\r\n                    $temp = $this->parse_dir($current);\r\n                    foreach ($temp as $file) {\r\n                        $files[] = $file;\r\n                    }\r\n                    unset ($temp, $file);\r\n                } else {\r\n                    if (@file_exists($current)) {\r\n                        $files[] = array('name' => $current, 'name2' => $this->options['prepend'] .\r\n                            preg_replace(\r\n                                \"/(\\.+\\/+)+/\", \"\", ($this->options['storepaths'] == 0 && strstr($current, \"/\")) ?\r\n                                    substr($current, strrpos($current, \"/\") + 1) : $current\r\n                            ),\r\n                                         'type' => @is_link($current) && $this->options['followlinks'] == 0 ? 2 : 0,\r\n                                         'ext'  => substr($current, strrpos($current, \".\")), 'stat' => stat($current));\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        chdir($pwd);\r\n\r\n        unset ($current, $pwd);\r\n\r\n        usort($files, array(\"archive\", \"sort_files\"));\r\n\r\n        return $files;\r\n    }\r\n\r\n    function parse_dir($dirname)\r\n    {\r\n        if ($this->options['storepaths'] == 1 && !preg_match(\"/^(\\.+\\/*)+$/\", $dirname)) {\r\n            $files = array(array('name' => $dirname, 'name2' => $this->options['prepend'] .\r\n                preg_replace(\r\n                    \"/(\\.+\\/+)+/\", \"\", ($this->options['storepaths'] == 0 && strstr($dirname, \"/\")) ?\r\n                        substr($dirname, strrpos($dirname, \"/\") + 1) : $dirname\r\n                ), 'type'               => 5, 'stat' => stat($dirname)));\r\n        } else {\r\n            $files = array();\r\n        }\r\n        $dir = @opendir($dirname);\r\n\r\n        while ($file = @readdir($dir)) {\r\n            $fullname = $dirname . \"/\" . $file;\r\n            if ($file == \".\" || $file == \"..\") {\r\n                continue;\r\n            } else {\r\n                if (@is_dir($fullname)) {\r\n                    if (empty ($this->options['recurse'])) {\r\n                        continue;\r\n                    }\r\n                    $temp = $this->parse_dir($fullname);\r\n                    foreach ($temp as $file2) {\r\n                        $files[] = $file2;\r\n                    }\r\n                } else {\r\n                    if (@file_exists($fullname)) {\r\n                        $files[] = array('name' => $fullname, 'name2' => $this->options['prepend'] .\r\n                            preg_replace(\r\n                                \"/(\\.+\\/+)+/\", \"\", ($this->options['storepaths'] == 0 && strstr($fullname, \"/\")) ?\r\n                                    substr($fullname, strrpos($fullname, \"/\") + 1) : $fullname\r\n                            ),\r\n                                         'type' => @is_link($fullname) && $this->options['followlinks'] == 0 ? 2 : 0,\r\n                                         'ext'  => substr($file, strrpos($file, \".\")), 'stat' => stat($fullname));\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        @closedir($dir);\r\n\r\n        return $files;\r\n    }\r\n\r\n    function sort_files($a, $b)\r\n    {\r\n        if ($a['type'] != $b['type']) {\r\n            if ($a['type'] == 5 || $b['type'] == 2) {\r\n                return -1;\r\n            } else {\r\n                if ($a['type'] == 2 || $b['type'] == 5) {\r\n                    return 1;\r\n                } else {\r\n                    if ($a['type'] == 5) {\r\n                        return strcmp(strtolower($a['name']), strtolower($b['name']));\r\n                    } else {\r\n                        if ($a['ext'] != $b['ext']) {\r\n                            return strcmp($a['ext'], $b['ext']);\r\n                        } else {\r\n                            if ($a['stat'][7] != $b['stat'][7]) {\r\n                                return $a['stat'][7] > $b['stat'][7] ? -1 : 1;\r\n                            } else {\r\n                                return strcmp(strtolower($a['name']), strtolower($b['name']));\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        return 0;\r\n    }\r\n\r\n    function download_file()\r\n    {\r\n        if ($this->options['inmemory'] == 0) {\r\n            $this->error[]\r\n                = \"Can only use download_file() if archive is in memory. Redirect to file otherwise, it is faster.\";\r\n\r\n            return;\r\n        }\r\n        switch ($this->options['type']) {\r\n            case \"zip\":\r\n                header(\"Content-Type: application/zip\");\r\n                break;\r\n            case \"bzip\":\r\n                header(\"Content-Type: application/x-bzip2\");\r\n                break;\r\n            case \"gzip\":\r\n                header(\"Content-Type: application/x-gzip\");\r\n                break;\r\n            case \"tar\":\r\n                header(\"Content-Type: application/x-tar\");\r\n        }\r\n        $header = \"Content-Disposition: attachment; filename=\\\"\";\r\n        $header .= strstr($this->options['name'], \"/\") ? substr(\r\n            $this->options['name'], strrpos($this->options['name'], \"/\") + 1\r\n        ) : $this->options['name'];\r\n        $header .= \"\\\"\";\r\n        header($header);\r\n        header(\"Content-Length: \" . strlen($this->archive));\r\n        header(\"Content-Transfer-Encoding: binary\");\r\n        header(\"Cache-Control: no-cache, must-revalidate, max-age=60\");\r\n        header(\"Expires: Sat, 01 Jan 2000 12:00:00 GMT\");\r\n        print($this->archive);\r\n    }\r\n}\r\n\r\nclass tar_file extends archive\r\n{\r\n    function tar_file($name)\r\n    {\r\n        $this->archive($name);\r\n        $this->options['type'] = \"tar\";\r\n    }\r\n\r\n    function create_tar()\r\n    {\r\n        $pwd = getcwd();\r\n        chdir($this->options['basedir']);\r\n\r\n        foreach ($this->files as $current) {\r\n            if ($current['name'] == $this->options['name']) {\r\n                continue;\r\n            }\r\n            if (strlen($current['name2']) > 99) {\r\n                $path             = substr(\r\n                    $current['name2'], 0, strpos($current['name2'], \"/\", strlen($current['name2']) - 100) + 1\r\n                );\r\n                $current['name2'] = substr($current['name2'], strlen($path));\r\n                if (strlen($path) > 154 || strlen($current['name2']) > 99) {\r\n                    $this->error[]\r\n                        = \"Could not add {$path}{$current['name2']} to archive because the filename is too long.\";\r\n                    continue;\r\n                }\r\n            }\r\n            $block = pack(\r\n                \"a100a8a8a8a12a12a8a1a100a6a2a32a32a8a8a155a12\", $current['name2'], sprintf(\r\n                    \"%07o\",\r\n                    $current['stat'][2]\r\n                ), sprintf(\"%07o\", $current['stat'][4]), sprintf(\"%07o\", $current['stat'][5]),\r\n                sprintf(\"%011o\", $current['type'] == 2 ? 0 : $current['stat'][7]),\r\n                sprintf(\"%011o\", $current['stat'][9]),\r\n                \"        \", $current['type'], $current['type'] == 2 ? @readlink($current['name']) : \"\", \"ustar \", \" \",\r\n                \"Unknown\", \"Unknown\", \"\", \"\", !empty ($path) ? $path : \"\", \"\"\r\n            );\r\n\r\n            $checksum = 0;\r\n            for ($i = 0; $i < 512; $i++) {\r\n                $checksum += ord(substr($block, $i, 1));\r\n            }\r\n            $checksum = pack(\"a8\", sprintf(\"%07o\", $checksum));\r\n            $block    = substr_replace($block, $checksum, 148, 8);\r\n\r\n            if ($current['type'] == 2 || $current['stat'][7] == 0) {\r\n                $this->add_data($block);\r\n            } else {\r\n                if ($fp = @fopen($current['name'], \"rb\")) {\r\n                    $this->add_data($block);\r\n                    while ($temp = fread($fp, 1048576)) {\r\n                        $this->add_data($temp);\r\n                    }\r\n                    if ($current['stat'][7] % 512 > 0) {\r\n                        $temp = \"\";\r\n                        for ($i = 0; $i < 512 - $current['stat'][7] % 512; $i++) {\r\n                            $temp .= \"\\0\";\r\n                        }\r\n                        $this->add_data($temp);\r\n                    }\r\n                    fclose($fp);\r\n                } else {\r\n                    $this->error[] = \"Could not open file {$current['name']} for reading. It was not added.\";\r\n                }\r\n            }\r\n        }\r\n\r\n        $this->add_data(pack(\"a1024\", \"\"));\r\n\r\n        chdir($pwd);\r\n\r\n        return 1;\r\n    }\r\n\r\n    function extract_files()\r\n    {\r\n        $pwd = getcwd();\r\n        chdir($this->options['basedir']);\r\n\r\n        if ($fp = $this->open_archive()) {\r\n            if ($this->options['inmemory'] == 1) {\r\n                $this->files = array();\r\n            }\r\n\r\n            while ($block = fread($fp, 512)) {\r\n                $temp = unpack(\r\n                    \"a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2temp/a32temp/a32temp/a8temp/a8temp/a155prefix/a12temp\",\r\n                    $block\r\n                );\r\n                $file = array(\r\n                    'name'     => $temp['prefix'] . $temp['name'],\r\n                    'stat'     => array(\r\n                        2 => $temp['mode'],\r\n                        4 => octdec($temp['uid']),\r\n                        5 => octdec($temp['gid']),\r\n                        7 => octdec($temp['size']),\r\n                        9 => octdec($temp['mtime']),\r\n                    ),\r\n                    'checksum' => octdec($temp['checksum']),\r\n                    'type'     => $temp['type'],\r\n                    'magic'    => $temp['magic'],\r\n                );\r\n                if ($file['checksum'] == 0x00000000) {\r\n                    break;\r\n                } else {\r\n                    if (substr($file['magic'], 0, 5) != \"ustar\") {\r\n                        $this->error[] = \"This script does not support extracting this type of tar file.\";\r\n                        break;\r\n                    }\r\n                }\r\n                $block    = substr_replace($block, \"        \", 148, 8);\r\n                $checksum = 0;\r\n                for ($i = 0; $i < 512; $i++) {\r\n                    $checksum += ord(substr($block, $i, 1));\r\n                }\r\n                if ($file['checksum'] != $checksum) {\r\n                    $this->error[] = \"Could not extract from {$this->options['name']}, it is corrupt.\";\r\n                }\r\n\r\n                if ($this->options['inmemory'] == 1) {\r\n                    $file['data'] = fread($fp, $file['stat'][7]);\r\n                    fread($fp, (512 - $file['stat'][7] % 512) == 512 ? 0 : (512 - $file['stat'][7] % 512));\r\n                    unset ($file['checksum'], $file['magic']);\r\n                    $this->files[] = $file;\r\n                } else {\r\n                    if ($file['type'] == 5) {\r\n                        if (!is_dir($file['name'])) {\r\n                            mkdir($file['name'], $file['stat'][2]);\r\n                        }\r\n                    } else {\r\n                        if ($this->options['overwrite'] == 0 && file_exists($file['name'])) {\r\n                            $this->error[] = \"{$file['name']} already exists.\";\r\n                            continue;\r\n                        } else {\r\n                            if ($file['type'] == 2) {\r\n                                symlink($temp['symlink'], $file['name']);\r\n                                chmod($file['name'], $file['stat'][2]);\r\n                            } else {\r\n                                if ($new = @fopen($file['name'], \"wb\")) {\r\n                                    fwrite($new, fread($fp, $file['stat'][7]));\r\n                                    // 0 throws a warning (?)\r\n                                    @fread(\r\n                                        $fp, (512 - $file['stat'][7] % 512) == 512 ? 0 : (512 - $file['stat'][7] % 512)\r\n                                    );\r\n                                    fclose($new);\r\n                                    chmod($file['name'], $file['stat'][2]);\r\n                                } else {\r\n                                    $this->error[] = \"Could not open {$file['name']} for writing.\";\r\n                                    continue;\r\n                                }\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n                chmod($file['name'], 0755);\r\n                touch($file['name'], $file['stat'][9]);\r\n                unset ($file);\r\n            }\r\n        } else {\r\n            $this->error[] = \"Could not open file {$this->options['name']}\";\r\n        }\r\n\r\n        chdir($pwd);\r\n    }\r\n\r\n    function open_archive()\r\n    {\r\n        return @fopen($this->options['name'], \"rb\");\r\n    }\r\n}\r\n\r\nclass gzip_file extends tar_file\r\n{\r\n    function gzip_file($name)\r\n    {\r\n        $this->tar_file($name);\r\n        $this->options['type'] = \"gzip\";\r\n    }\r\n\r\n    function create_gzip()\r\n    {\r\n        if ($this->options['inmemory'] == 0) {\r\n            $pwd = getcwd();\r\n            chdir($this->options['basedir']);\r\n            if ($fp = gzopen($this->options['name'], \"wb{$this->options['level']}\")) {\r\n                fseek($this->archive, 0);\r\n                while ($temp = fread($this->archive, 1048576)) {\r\n                    gzwrite($fp, $temp);\r\n                }\r\n                gzclose($fp);\r\n                chdir($pwd);\r\n            } else {\r\n                $this->error[] = \"Could not open {$this->options['name']} for writing.\";\r\n                chdir($pwd);\r\n\r\n                return 0;\r\n            }\r\n        } else {\r\n            $this->archive = gzencode($this->archive, $this->options['level']);\r\n        }\r\n\r\n        return 1;\r\n    }\r\n\r\n    function open_archive()\r\n    {\r\n        return @gzopen($this->options['name'], \"rb\");\r\n    }\r\n}\r\n\r\nclass bzip_file extends tar_file\r\n{\r\n    function bzip_file($name)\r\n    {\r\n        $this->tar_file($name);\r\n        $this->options['type'] = \"bzip\";\r\n    }\r\n\r\n    function create_bzip()\r\n    {\r\n        if ($this->options['inmemory'] == 0) {\r\n            $pwd = getcwd();\r\n            chdir($this->options['basedir']);\r\n            if ($fp = bzopen($this->options['name'], \"wb\")) {\r\n                fseek($this->archive, 0);\r\n                while ($temp = fread($this->archive, 1048576)) {\r\n                    bzwrite($fp, $temp);\r\n                }\r\n                bzclose($fp);\r\n                chdir($pwd);\r\n            } else {\r\n                $this->error[] = \"Could not open {$this->options['name']} for writing.\";\r\n                chdir($pwd);\r\n\r\n                return 0;\r\n            }\r\n        } else {\r\n            $this->archive = bzcompress($this->archive, $this->options['level']);\r\n        }\r\n\r\n        return 1;\r\n    }\r\n\r\n    function open_archive()\r\n    {\r\n        return @bzopen($this->options['name'], \"rb\");\r\n    }\r\n}\r\n\r\nclass zip_file extends archive\r\n{\r\n    //this function was added by Jonas Brekle\r\n    //might have problems with compatibility\r\n    function extract_files()\r\n    {\r\n        $pwd = getcwd();\r\n        chdir($this->options['basedir']);\r\n        $zip = new ZipArchive();\r\n        if ($zip->open($this->options['name'])) {\r\n            $zip->extractTo($this->options['basedir']);\r\n            $zip->close();\r\n        }\r\n        chdir($pwd);\r\n    }\r\n\r\n    function zip_file($name)\r\n    {\r\n        $this->archive($name);\r\n        $this->options['type'] = \"zip\";\r\n    }\r\n\r\n    function create_zip()\r\n    {\r\n        $files   = 0;\r\n        $offset  = 0;\r\n        $central = \"\";\r\n\r\n        if (!empty ($this->options['sfx'])) {\r\n            if ($fp = @fopen($this->options['sfx'], \"rb\")) {\r\n                $temp = fread($fp, filesize($this->options['sfx']));\r\n                fclose($fp);\r\n                $this->add_data($temp);\r\n                $offset += strlen($temp);\r\n                unset ($temp);\r\n            } else {\r\n                $this->error[] = \"Could not open sfx module from {$this->options['sfx']}.\";\r\n            }\r\n        }\r\n\r\n        $pwd = getcwd();\r\n        chdir($this->options['basedir']);\r\n\r\n        foreach ($this->files as $current) {\r\n            if ($current['name'] == $this->options['name']) {\r\n                continue;\r\n            }\r\n\r\n            $timedate = explode(\" \", date(\"Y n j G i s\", $current['stat'][9]));\r\n            $timedate = ($timedate[0] - 1980 << 25) | ($timedate[1] << 21) | ($timedate[2] << 16) |\r\n                ($timedate[3] << 11) | ($timedate[4] << 5) | ($timedate[5]);\r\n\r\n            $block = pack(\r\n                \"VvvvV\", 0x04034b50, 0x000A, 0x0000,\r\n                (isset($current['method']) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate\r\n            );\r\n\r\n            if ($current['stat'][7] == 0 && $current['type'] == 5) {\r\n                $block .= pack(\"VVVvv\", 0x00000000, 0x00000000, 0x00000000, strlen($current['name2']) + 1, 0x0000);\r\n                $block .= $current['name2'] . \"/\";\r\n                $this->add_data($block);\r\n                $central .= pack(\r\n                    \"VvvvvVVVVvvvvvVV\", 0x02014b50, 0x0014, $this->options['method'] == 0 ? 0x0000 : 0x000A, 0x0000,\r\n                    (isset($current['method']) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate,\r\n                    0x00000000, 0x00000000, 0x00000000, strlen($current['name2']) + 1, 0x0000, 0x0000, 0x0000, 0x0000,\r\n                    $current['type'] == 5 ? 0x00000010 : 0x00000000, $offset\r\n                );\r\n                $central .= $current['name2'] . \"/\";\r\n                $files++;\r\n                $offset += (31 + strlen($current['name2']));\r\n            } else {\r\n                if ($current['stat'][7] == 0) {\r\n                    $block .= pack(\"VVVvv\", 0x00000000, 0x00000000, 0x00000000, strlen($current['name2']), 0x0000);\r\n                    $block .= $current['name2'];\r\n                    $this->add_data($block);\r\n                    $central .= pack(\r\n                        \"VvvvvVVVVvvvvvVV\", 0x02014b50, 0x0014, $this->options['method'] == 0 ? 0x0000 : 0x000A, 0x0000,\r\n                        (isset($current['method']) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate,\r\n                        0x00000000, 0x00000000, 0x00000000, strlen($current['name2']), 0x0000, 0x0000, 0x0000, 0x0000,\r\n                        $current['type'] == 5 ? 0x00000010 : 0x00000000, $offset\r\n                    );\r\n                    $central .= $current['name2'];\r\n                    $files++;\r\n                    $offset += (30 + strlen($current['name2']));\r\n                } else {\r\n                    if ($fp = @fopen($current['name'], \"rb\")) {\r\n                        $temp = fread($fp, $current['stat'][7]);\r\n                        fclose($fp);\r\n                        $crc32 = crc32($temp);\r\n                        if (!isset($current['method']) && $this->options['method'] == 1) {\r\n                            $temp = gzcompress($temp, $this->options['level']);\r\n                            $size = strlen($temp) - 6;\r\n                            $temp = substr($temp, 2, $size);\r\n                        } else {\r\n                            $size = strlen($temp);\r\n                        }\r\n                        $block .= pack(\"VVVvv\", $crc32, $size, $current['stat'][7], strlen($current['name2']), 0x0000);\r\n                        $block .= $current['name2'];\r\n                        $this->add_data($block);\r\n                        $this->add_data($temp);\r\n                        unset ($temp);\r\n                        $central .= pack(\r\n                            \"VvvvvVVVVvvvvvVV\", 0x02014b50, 0x0014, $this->options['method'] == 0 ? 0x0000 : 0x000A,\r\n                            0x0000,\r\n                            (isset($current['method']) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate,\r\n                            $crc32, $size, $current['stat'][7], strlen($current['name2']), 0x0000, 0x0000, 0x0000,\r\n                            0x0000,\r\n                            0x00000000, $offset\r\n                        );\r\n                        $central .= $current['name2'];\r\n                        $files++;\r\n                        $offset += (30 + strlen($current['name2']) + $size);\r\n                    } else {\r\n                        $this->error[] = \"Could not open file {$current['name']} for reading. It was not added.\";\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        $this->add_data($central);\r\n\r\n        $this->add_data(\r\n            pack(\r\n                \"VvvvvVVv\", 0x06054b50, 0x0000, 0x0000, $files, $files, strlen($central), $offset,\r\n                !empty ($this->options['comment']) ? strlen($this->options['comment']) : 0x0000\r\n            )\r\n        );\r\n\r\n        if (!empty ($this->options['comment'])) {\r\n            $this->add_data($this->options['comment']);\r\n        }\r\n\r\n        chdir($pwd);\r\n\r\n        return 1;\r\n    }\r\n}\r\n\r\n?>\r\n"
  },
  {
    "path": "extensions/exconf/ExconfController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * edit extension configuration via a gui\n *\n * file permissions for the folders that contain a extension needs to allow modification\n * mostly that would be 0777\n *\n * @category   OntoWiki\n * @package    Extensions_Exconf\n * @author     Jonas Brekle <jonas.brekle@gmail.com>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass ExconfController extends OntoWiki_Controller_Component\n{\n    const EXTENSION_CLASS          = 'http://usefulinc.com/ns/doap#Project';\n    const VERSION_CLASS            = 'http://usefulinc.com/ns/doap#Version';\n    const EXTENSION_TITLE_PROPERTY = 'http://www.w3.org/2000/01/rdf-schema#label'; //rdfs:label\n    const EXTENSION_NAME_PROPERTY = 'http://usefulinc.com/ns/doap#name'; //doap:name\n    const EXTENSION_DESCRIPTION_PROPERTY = 'http://usefulinc.com/ns/doap#description'; //doap:description\n    const EXTENSION_RELEASELOCATION_PROPERTY = 'http://usefulinc.com/ns/doap#file-release';\n    const EXTENSION_RELEASE_PROPERTY         = 'http://usefulinc.com/ns/doap#release';\n    const EXTENSION_PAGE_PROPERTY            = 'http://usefulinc.com/ns/doap#homepage';\n    const EXTENSION_RELEASE_ID_PROPERTY      = 'http://usefulinc.com/ns/doap#revision';\n    const EXTENSION_AUTHOR_PROPERTY          = 'http://usefulinc.com/ns/doap#maintainer';\n    const EXTENSION_AUTHORLABEL_PROPERTY     = 'http://xmlns.com/foaf/0.1/name';\n    const EXTENSION_AUTHORPAGE_PROPERTY      = 'http://xmlns.com/foaf/0.1/homepage';\n    const EXTENSION_AUTHORMAIL_PROPERTY      = 'http://xmlns.com/foaf/0.1/mbox';\n    const EXTENSION_MINOWVERSION_PROPERTY    = 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/minOWVersion';\n    const EXTENSION_NS                       = 'http://ns.ontowiki.net/SysOnt/ExtensionConfig/';\n\n    protected $_useFtp = false;\n    protected $_folderWriteable = true;\n\n    protected $_connection = null;\n    protected $_sftp = null;\n\n    public function __call($method, $args)\n    {\n        $this->_forward('list');\n    }\n\n    public function init()\n    {\n        parent::init();\n        $nav = OntoWiki::getInstance()->getNavigation();\n        $nav->reset();\n\n        $nav->register(\n            'list',\n            array(\n                 'route'      => null,\n                 'action'     => 'list',\n                 'controller' => 'exconf',\n                 'name'       => 'Locally Installed'\n            )\n        );\n        $nav->register(\n            'repo',\n            array(\n                 'route'      => null,\n                 'action'     => 'explorerepo',\n                 'controller' => 'exconf',\n                 'name'       => 'Install / Upgrade from Repo'\n            )\n        );\n\n        $ow     = OntoWiki::getInstance();\n        $modMan = $ow->extensionManager;\n\n        //determine how to write to the filesystem\n        if (!is_writeable($modMan->getExtensionPath())) {\n            $con = $this->ftpConnect();\n            if ($con->connection == null) {\n                $this->_folderWriteable = false;\n                $this->_connection      = false;\n                $this->_sftp            = false;\n            } else {\n                $this->_useFtp     = true;\n                $this->_connection = $con->connection;\n                $this->_sftp       = $con->sftp;\n            }\n        }\n    }\n\n    public function listAction()\n    {\n        $this->view->placeholder('main.window.title')->set($this->_owApp->translate->_('Configure Extensions'));\n\n        $this->addModuleContext('main.window.exconf');\n\n        $ow = OntoWiki::getInstance();\n        if (!$this->_erfurt->getAc()->isActionAllowed('ExtensionConfiguration')\n            && !$this->_request->isXmlHttpRequest()\n        ) {\n            OntoWiki::getInstance()->appendMessage(\n                new OntoWiki_Message('config not allowed for this user', OntoWiki_Message::ERROR)\n            );\n            $this->view->isAllowed = false;\n            $extensions            = array();\n        } else {\n            $this->view->isAllowed = true;\n            //get extension from manager\n            $modMan     = $ow->extensionManager;\n            $extensions = $modMan->getExtensions();\n\n            //sort by name property\n            $volume = array();\n            foreach ($extensions as $key => $row) {\n                $volume[$key] = $row->title;\n            }\n            array_multisort($volume, SORT_ASC, $extensions);\n\n            //some statistics\n            $numEnabled  = 0;\n            $numDisabled = 0;\n            foreach ($extensions as $extension) {\n                if ($extension->enabled) {\n                    $numEnabled++;\n                } else {\n                    $numDisabled++;\n                }\n            }\n            $numAll = count($extensions);\n\n            //save to view\n            $this->view->numEnabled  = $numEnabled;\n            $this->view->numDisabled = $numDisabled;\n            $this->view->numAll      = $numAll;\n\n            if (!is_writeable($modMan->getExtensionPath())) {\n                if (!$this->_request->isXmlHttpRequest()) {\n                    OntoWiki::getInstance()->appendMessage(\n                        new OntoWiki_Message(\n                            \"the extension folder '\" . $modMan->getExtensionPath() . \"' is not writeable.\" .\n                            \" no changes can be made\",\n                            OntoWiki_Message::WARNING\n                        )\n                    );\n                }\n            }\n\n            $this->view->coreExtensions = $this->_config->extensions->core->toArray();\n        }\n        $this->view->extensions = $extensions;\n    }\n\n    public function confAction()\n    {\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        $this->view->placeholder('main.window.title')->set(\n            $this->_owApp->translate->_('Configure ') . ' ' . $this->_request->getParam('name')\n        );\n        if (!$this->_erfurt->getAc()->isActionAllowed('ExtensionConfiguration')) {\n            throw new OntoWiki_Exception('config not allowed for this user');\n        } else {\n            if (!isset($this->_request->name)) {\n                throw new OntoWiki_Exception(\"param 'name' needs to be passed to this action\");\n            }\n            $ow               = OntoWiki::getInstance();\n            $toolbar          = $ow->toolbar;\n            $urlList          = new OntoWiki_Url(array('controller' => 'exconf', 'action' => 'list'), array());\n            $urlConf          = new OntoWiki_Url(array('controller' => 'exconf', 'action' => 'conf'), array());\n            $urlConf->restore = 1;\n            $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'save'))\n                ->appendButton(\n                    OntoWiki_Toolbar::CANCEL,\n                    array('name' => 'back', 'class' => '', 'url' => (string)$urlList)\n                )\n                ->appendButton(\n                    OntoWiki_Toolbar::EDIT,\n                    array('name' => 'restore defaults', 'class' => '', 'url' => (string)$urlConf)\n                );\n\n            // add toolbar\n            $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n            $name    = $this->_request->getParam('name');\n            $manager = $ow->extensionManager;\n            $dirPath = $manager->getExtensionPath() . $name . DIRECTORY_SEPARATOR;\n            if (!is_dir($dirPath)) {\n                throw new OntoWiki_Exception('invalid extension - ' . $dirPath . ' does not exist or no folder');\n            }\n            $localIniPath = $manager->getExtensionPath() . $name . \".ini\";\n\n            $privateConfig               = $manager->getPrivateConfig($name);\n            $config                      = ($privateConfig != null ? $privateConfig->toArray() : array());\n            $this->view->enabled         = $manager->isExtensionActive($name);\n            $fullConfig                  = $manager->getExtensionConfig($name);\n            $this->view->isCoreExtension = isset($fullConfig->isCoreExtension) && $fullConfig->isCoreExtension;\n\n            $this->view->config = $config;\n            $this->view->name   = $name;\n\n            $this->view->coreExtensions = $this->_config->extensions->core->toArray();\n\n            if (!is_writeable($manager->getExtensionPath())) {\n                if (!$this->_request->isXmlHttpRequest()) {\n                    OntoWiki::getInstance()->appendMessage(\n                        new OntoWiki_Message(\n                            \"the extension folder '\" . $manager->getExtensionPath() . \"' is not writeable. \" .\n                            'no changes can be made',\n                            OntoWiki_Message::WARNING\n                        )\n                    );\n                }\n            } else {\n                //react on post data\n                if (isset($this->_request->remove)) {\n                    if (self::rrmdir($dirPath)) {\n                        OntoWiki::getInstance()->appendMessage(\n                            new OntoWiki_Message('extension deleted', OntoWiki_Message::SUCCESS)\n                        );\n                        $this->_redirect($this->urlBase . 'exconf/list');\n                    } else {\n                        OntoWiki::getInstance()->appendMessage(\n                            new OntoWiki_Message('extension could not be deleted', OntoWiki_Message::ERROR)\n                        );\n                    }\n                }\n                //the togglebuttons in the extension list action, send only a new enabled state\n                if (isset($this->_request->enabled)) {\n                    if (!file_exists($localIniPath)) {\n                        @touch($localIniPath);\n                        chmod($localIniPath, 0777);\n                    }\n                    $ini          = new Zend_Config_Ini($localIniPath, null, array('allowModifications' => true));\n                    $ini->enabled = $this->_request->getParam('enabled') == \"true\";\n                    $writer       = new Zend_Config_Writer_Ini(array());\n                    $writer->write($localIniPath, $ini, true);\n\n                    //invalidate the cache to get changes distributed\n                    $cache = OntoWiki::getInstance()->getCache();\n                    $cache->remove('ow_extensionConfig');\n                }\n                // the conf action sends a complete config array as json\n                if (isset($this->_request->config)) {\n                    $arr = json_decode($this->_request->getParam('config'), true);\n                    if ($arr == null) {\n                        throw new OntoWiki_Exception('invalid json: ' . $this->_request->getParam('config'));\n                    } else {\n                        if (!file_exists($localIniPath)) {\n                            @touch($localIniPath);\n                            chmod($localIniPath, 0777);\n                        }\n                        //only modification of the private section and the enabled-property are allowed\n                        foreach ($arr as $key => $val) {\n                            if ($key != 'enabled' && $key != 'private') {\n                                unset($arr[$key]);\n                            }\n                        }\n                        $writer  = new Zend_Config_Writer_Ini(array());\n                        $postIni = new Zend_Config($arr, true);\n                        $writer->write($localIniPath, $postIni, true);\n                        OntoWiki::getInstance()->appendMessage(\n                            new OntoWiki_Message('config sucessfully changed', OntoWiki_Message::SUCCESS)\n                        );\n\n                        //invalidate the cache to get changes distributed\n                        $cache = OntoWiki::getInstance()->getCache();\n                        $cache->remove('ow_extensionConfig');\n                    }\n                    $this->_redirect($this->urlBase . 'exconf/conf/?name=' . $name);\n                }\n                if (isset($this->_request->reset)) {\n                    if (@unlink($localIniPath)) {\n                        OntoWiki::getInstance()->appendMessage(\n                            new OntoWiki_Message(\n                                'config sucessfully reverted to default',\n                                OntoWiki_Message::SUCCESS\n                            )\n                        );\n                    } else {\n                        OntoWiki::getInstance()->appendMessage(\n                            new OntoWiki_Message(\n                                'config not reverted to default - not existing or not writeable',\n                                OntoWiki_Message::ERROR\n                            )\n                        );\n                    }\n                    $this->_redirect($this->urlBase . 'exconf/conf/?name=' . $name);\n                }\n            }\n        }\n\n        if ($this->_request->isXmlHttpRequest()) {\n            //no rendering\n            $this->_helper->viewRenderer->setNoRender();\n        }\n    }\n\n    public function explorerepoAction()\n    {\n        $this->view->placeholder('main.window.title')->set($this->_owApp->translate->_('Explore Repo'));\n\n        if (!$this->_erfurt->getAc()->isActionAllowed('ExtensionConfiguration')) {\n            throw new OntoWiki_Exception('config not allowed for this user');\n        }\n        $repoUrl = $this->_privateConfig->repoUrl;\n\n        if (($otherRepo = $this->getParam('repoUrl')) != null) {\n            $repoUrl = $otherRepo;\n        }\n        $graph = $this->_privateConfig->graph;\n        if (($otherGraph = $this->getParam('graph')) != null) {\n            $graph = $otherGraph;\n        }\n        $this->view->repoUrl = $repoUrl;\n        $this->view->graph   = $graph;\n        $ow                  = OntoWiki::getInstance();\n\n        $ow->appendMessage(new OntoWiki_Message('Repository: ' . $repoUrl, OntoWiki_Message::INFO));\n        //define the list on a new store, that queries a sparql endpoint\n        $adapter = new Erfurt_Store_Adapter_Sparql(array('serviceUrl' => $repoUrl, 'graphs' => array($graph)));\n        $store   = new Erfurt_Store(array('adapterInstance' => $adapter), 'sparql');\n\n        $listHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('List');\n        $listName   = 'extensions';\n        if ($listHelper->listExists($listName)) {\n            $list = $listHelper->getList($listName);\n            $list->setStore($store);\n            $list->invalidate(); //remote repo may change data\n            $listHelper->addList($listName, $list, $this->view, 'list_extensions_main');\n        } else {\n            $rdfGraphObj = new Erfurt_Rdf_Model($graph);\n            $list        = new OntoWiki_Model_Instances($store, $rdfGraphObj, array(Erfurt_Store::USE_CACHE => false));\n            $list->addTypeFilter(self::VERSION_CLASS, null, array('withChilds' => false));\n\n            //the version needs to be related to a project (inverse)\n            $projectVar = new Erfurt_Sparql_Query2_Var('project');\n            $list->addTripleFilter(\n                array(\n                     new Erfurt_Sparql_Query2_Triple(\n                         $projectVar,\n                         new Erfurt_Sparql_Query2_IriRef(self::EXTENSION_RELEASE_PROPERTY),\n                         $list->getResourceVar()\n                     )\n                )\n            );\n\n            //internal name (folder name)\n            $this->addProjectProperty(self::EXTENSION_NAME_PROPERTY, $projectVar, $list, 'name');\n            //pretty name (label)\n            $this->addProjectProperty(self::EXTENSION_TITLE_PROPERTY, $projectVar, $list, 'title');\n            $this->addProjectProperty(self::EXTENSION_DESCRIPTION_PROPERTY, $projectVar, $list);\n            $this->addProjectProperty(self::EXTENSION_PAGE_PROPERTY, $projectVar, $list);\n            $this->addProjectProperty(self::EXTENSION_AUTHOR_PROPERTY, $projectVar, $list);\n\n            $this->addAuthorProperty(self::EXTENSION_AUTHORLABEL_PROPERTY, $projectVar, $list, 'authorLabel');\n            $this->addAuthorProperty(self::EXTENSION_AUTHORPAGE_PROPERTY, $projectVar, $list);\n            $this->addAuthorProperty(self::EXTENSION_AUTHORMAIL_PROPERTY, $projectVar, $list);\n\n            //properties of the versions\n            $list->addShownProperty(self::EXTENSION_RELEASELOCATION_PROPERTY, 'zip');\n            $list->addShownProperty(self::EXTENSION_RELEASE_ID_PROPERTY, 'revision');\n            $list->addShownProperty(self::EXTENSION_MINOWVERSION_PROPERTY, 'minOwVersion');\n\n            $listHelper->addListPermanently($listName, $list, $this->view, 'list_extensions_main');\n        }\n\n    }\n\n    private function addProjectProperty($p, $projectVar, $list, $name = null)\n    {\n        $pIri = new Erfurt_Sparql_Query2_IriRef($p);\n        if ($name == null) {\n            $var = new Erfurt_Sparql_Query2_Var($pIri);\n        } else {\n            $var = new Erfurt_Sparql_Query2_Var($name);\n        }\n        $projectVar             = new Erfurt_Sparql_Query2_Var($projectVar->getName() . substr(md5($pIri), 0, 5));\n        $versionToProjectTriple = new Erfurt_Sparql_Query2_Triple(\n            $projectVar,\n            new Erfurt_Sparql_Query2_IriRef(self::EXTENSION_RELEASE_PROPERTY),\n            $list->getResourceVar()\n        );\n        $projectPropertyTriple  = new Erfurt_Sparql_Query2_Triple($projectVar, $pIri, $var);\n        $list->addShownPropertyCustom(array($versionToProjectTriple, $projectPropertyTriple), $var);\n    }\n\n    private function addAuthorProperty($p, $projectVar, $list, $name = null)\n    {\n        $pIri = new Erfurt_Sparql_Query2_IriRef($p);\n        if ($name == null) {\n            $var = new Erfurt_Sparql_Query2_Var($pIri);\n        } else {\n            $var = new Erfurt_Sparql_Query2_Var($name);\n        }\n        $projectVar = new Erfurt_Sparql_Query2_Var($projectVar->getName() . substr(md5($pIri), 0, 5));\n        //for each property a new author var\n        $authorVar              = new Erfurt_Sparql_Query2_Var('author' . substr(md5($pIri), 0, 5));\n        $versionToProjectTriple = new Erfurt_Sparql_Query2_Triple(\n            $projectVar,\n            new Erfurt_Sparql_Query2_IriRef(self::EXTENSION_RELEASE_PROPERTY),\n            $list->getResourceVar()\n        );\n        $projectToAuthorTriple  = new Erfurt_Sparql_Query2_Triple(\n            $projectVar,\n            new Erfurt_Sparql_Query2_IriRef(self::EXTENSION_AUTHOR_PROPERTY),\n            $authorVar\n        );\n        $authorPropertyTriple   = new Erfurt_Sparql_Query2_Triple($authorVar, $pIri, $var);\n        $list->addShownPropertyCustom(\n            array($versionToProjectTriple, $projectToAuthorTriple, $authorPropertyTriple),\n            $var\n        );\n    }\n\n    /**\n     * download a archive file from a remote webserver\n     */\n    public function installarchiveremoteAction()\n    {\n        $ontoWiki = OntoWiki::getInstance();\n        $url      = $this->getParam('url', '');\n        $name     = $this->getParam('name', '');\n        if ($url == '' || $name == '') {\n            $ontoWiki->appendMessage(new OntoWiki_Message('parameters url and name needed.', OntoWiki_Message::ERROR));\n        } else {\n            $fileStr = file_get_contents($url);\n            if ($fileStr != false) {\n                $tmp = sys_get_temp_dir();\n                if (!(substr($tmp, -1) == PATH_SEPARATOR)) {\n                    $tmp .= PATH_SEPARATOR;\n                }\n                $tmpfname = tempnam($tmp, 'OW_downloadedArchive.zip');\n\n                $localFilehandle = fopen($tmpfname, 'w+');\n                fwrite($localFilehandle, $fileStr);\n                rewind($localFilehandle);\n\n                $this->installArchive($tmpfname, $name);\n                fclose($localFilehandle); //deletes file\n            } else {\n                $ontoWiki->appendMessage(new OntoWiki_Message('could not download.', OntoWiki_Message::ERROR));\n            }\n        }\n    }\n\n    /**\n     * display a upload form\n     */\n    public function archiveuploadformAction()\n    {\n        $this->view->placeholder('main.window.title')->set('Upload new extension archive');\n        $this->view->formActionUrl = $this->_config->urlBase . 'exconf/installarchiveupload';\n        $this->view->formEncoding  = 'multipart/form-data';\n        $this->view->formClass     = 'simple-input input-justify-left';\n        $this->view->formMethod    = 'post';\n        $this->view->formName      = 'archiveupload';\n\n        $toolbar = $this->_owApp->toolbar;\n        $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Upload Archive', 'id' => 'archiveupload'))\n            ->appendButton(OntoWiki_Toolbar::RESET, array('name' => 'Cancel', 'id' => 'archiveupload'));\n        $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n    }\n\n    /**\n     * handle a archive upload (from browser)\n     */\n    public function installarchiveuploadAction()\n    {\n        $ontoWiki = OntoWiki::getInstance();\n\n        $upload = new Zend_File_Transfer();\n        $filesArray = $upload->getFileInfo();\n        if ($filesArray['archive_file']['error'] == UPLOAD_ERR_OK) {\n            // upload ok,\n            $tmpName = $filesArray['archive_file']['tmp_name'];\n            $cachedir = ini_get('upload_tmp_dir');\n            $name     = $this->getParam('name', \"\");\n            if ($name == '') {\n                $ontoWiki->appendMessage(\n                    new OntoWiki_Message('parameters url and name needed.', OntoWiki_Message::ERROR)\n                );\n            } else {\n                $this->installArchive($cachedir . $tmpName, $name);\n            }\n        } else {\n            $ontoWiki->appendMessage(new OntoWiki_Message('upload error.', OntoWiki_Message::ERROR));\n        }\n    }\n\n    /**\n     * handle a uploaded archive (from browser or remote webserver)\n     * extract it to extension dir\n     *\n     * @param <type> $filePath\n     * @param <type> $fileHandle\n     */\n    protected function installArchive($filePath, $name)\n    {\n        require_once 'pclzip.lib.php';\n        $ext                 = mime_content_type($filePath);\n        $this->view->success = false;\n\n        $ontoWiki = OntoWiki::getInstance();\n        switch ($ext) {\n            case 'application/zip':\n                $this->view->success = true;\n                $zip                 = new PclZip($filePath);\n\n                $modMan = $ontoWiki->extensionManager;\n                $path   = $modMan->getExtensionPath();\n\n                //check the uploaded archive\n                $content              = $zip->listContent();\n                $toplevelItem         = null;\n                $tooManyTopLevelItems = false; //only 1 allowed\n                $sumBytes             = 0;\n                foreach ($content as $key => $item) {\n                    $level = substr_count($item['filename'], '/');\n                    if ($level == 1 && substr($item['filename'], -1, 1) == DIRECTORY_SEPARATOR) {\n                        if ($toplevelItem === null) {\n                            $toplevelItem = $key;\n                        } else {\n                            $tooManyTopLevelItems = true;\n                            break;\n                        }\n                    }\n\n                    $sumBytes += $item['size'];\n                    if ($sumBytes >= 10000000) {\n                        break;\n                    }\n                }\n                // extract contents of archive to disk (extension dir)\n                //only one item at top level allowed and max. 10MioB\n                if (!$tooManyTopLevelItems && $sumBytes < 10000000) {\n                    $folderName = substr($content[$toplevelItem]['filename'], 0, -1);\n                    if (file_exists($path . $folderName)) {\n                        self::rrmdir($path . $folderName);\n                    }\n                    $zip->extract(PCLZIP_OPT_PATH, $path);\n                    if (file_exists($path . $folderName)) {\n                        if ($folderName != $name) {\n                            rename($path . $folderName, $path . $name); //move folder to expected name\n                            $folderName = $name;\n                        }\n                        // make all writable\n                        // otherwise, they can only be deleted by users www-data or root\n                        $iterator = new RecursiveIteratorIterator(\n                            new RecursiveDirectoryIterator($path . $folderName),\n                            RecursiveIteratorIterator::CHILD_FIRST\n                        );\n                        foreach ($iterator as $key => $handle) {\n                            chmod($handle->__toString(), 0777);\n                        }\n\n                        $ontoWiki->appendMessage(\n                            new OntoWiki_Message($folderName . ' extension installed.', OntoWiki_Message::SUCCESS)\n                        );\n                    } else {\n                        $ontoWiki->appendMessage(\n                            new OntoWiki_Message(\n                                'archiv could not be extracted. check permissions of extensions folder.',\n                                OntoWiki_Message::ERROR\n                            )\n                        );\n                    }\n                } else {\n                    $ontoWiki->appendMessage(\n                        new OntoWiki_Message(\n                            'uploaded archive was not accepted (must be < 10MB, and contain one folder).',\n                            OntoWiki_Message::ERROR\n                        )\n                    );\n                }\n                break;\n            default :\n                $ontoWiki->appendMessage(\n                    new OntoWiki_Message(\n                        'uploaded archive type was not accepted (must be zip).',\n                        OntoWiki_Message::ERROR\n                    )\n                );\n                break;\n        }\n\n        // invalidate ExtensionManager cache because a new extension was installed\n        $ontoWiki->getCache()->remove('ow_extensionConfig');\n\n        $url = new OntoWiki_Url(array('controller' => 'exconf', 'action' => 'explorerepo'));\n        $this->_redirect($url);\n    }\n\n    /**\n     * Get the connection to ftp-server\n     *\n     * @param unknown_type $sftp\n     * @param unknown_type $connection\n     */\n    public function ftpConnect()\n    {\n        if (isset($this->_privateConfig->ftp)) {\n            $username = $this->_privateConfig->ftp->username;\n            $password = $this->_privateConfig->ftp->password;\n            $hostname = $this->_privateConfig->ftp->hostname;\n            $connection = ssh2_connect($hostname, 22);\n            ssh2_auth_password($connection, $username, $password);\n            $sftp = ssh2_sftp($connection);\n\n            $ret             = new stdClass();\n            $ret->connection = $connection;\n            $ret->sftp       = $sftp;\n\n            return $ret;\n        } else {\n            $ret             = new stdClass();\n            $ret->connection = null;\n            $ret->sftp       = null;\n\n            return $ret;\n        }\n    }\n\n    private static function checkRightsRec($dir)\n    {\n        $right = is_writable($dir);\n        if ($right && is_dir($dir)) {\n            $objects     = scandir($dir);\n            $curObjRight = false;\n            foreach ($objects as $object) {\n                if ($object != '.' && $object != '..') {\n                    $curObjRight = self::checkRightsRec($dir . DIRECTORY_SEPARATOR . $object);\n                    if (!$curObjRight) {\n                        $right = false;\n                    }\n                }\n            }\n        }\n\n        return $right;\n    }\n\n    private static function rrmdir($dir, $check = true)\n    {\n        if ($check) {\n            if (!self::checkRightsRec($dir)) {\n                return false;\n            }\n        }\n        if (is_dir($dir)) {\n            $objects = scandir($dir);\n            foreach ($objects as $object) {\n                if ($object != '.' && $object != '..') {\n                    if (is_dir($dir . DIRECTORY_SEPARATOR . $object)) {\n                        self::rrmdir($dir . DIRECTORY_SEPARATOR . $object, false);\n                    } else {\n                        unlink($dir . DIRECTORY_SEPARATOR . $object);\n                    }\n                }\n            }\n            reset($objects);\n            rmdir($dir);\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "extensions/exconf/ExconfHelper.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Component/Helper.php';\nrequire_once 'OntoWiki/Menu/Registry.php';\n\n/**\n * @category   OntoWiki\n * @package    Extensions_Exconf\n */\nclass ExconfHelper extends OntoWiki_Component_Helper\n{\n    public function __construct()\n    {\n        if (Erfurt_App::getInstance()->getAc()->isActionAllowed('ExtensionConfiguration')) {\n            $owApp      = OntoWiki::getInstance();\n            $translate  = $owApp->translate;\n            $url        = new OntoWiki_Url(array('controller' => 'exconf', 'action' => 'list'), array());\n            $extrasMenu = OntoWiki_Menu_Registry::getInstance()->getMenu('application')->getSubMenu('Extras');\n            $extrasMenu->setEntry($translate->_('Configure Extensions'), (string)$url);\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/exconf/OutlineModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module – Extension Navigation\n *\n * @category   OntoWiki\n * @package    Extensions_Exconf\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass OutlineModule extends OntoWiki_Module\n{\n    public function init()\n    {\n    }\n\n    public function getTitle()\n    {\n        return 'Extension Outline';\n    }\n\n    /**\n     * Returns the content\n     */\n    public function getContents()\n    {\n        $this->view->headScript()->appendFile($this->view->moduleUrl . '/resources/outline.js');\n        $content = '<div class=\"outline\" />';\n\n        return $content;\n    }\n\n    public function shouldShow()\n    {\n        return true;\n    }\n}\n"
  },
  {
    "path": "extensions/exconf/default.ini",
    "content": ";;\n; Basic component configuration\n;;\nenabled    = true\nname        = \"Extensions Configuration\"\ndescription = \"provides this component to configure / toggle extensions.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\nmodules.outline.title      = \"Extension Outline\"\nmodules.outline.caching    = no\nmodules.outline.priority   = 4\nmodules.outline.contexts.0 = \"main.window.exconf\"\n\ntemplates  = \"templates\"\n; languages  = \"languages/\"\n\nisCoreExtension = true\n;;\n; Component's private configuration\n; Anything set below will be available within the component ($this->_privateConfig->key)\n;;\n[private]\nrepoUrl = \"http://extensions.ontowiki.net/index.php/service/sparql\"\ngraph = \"http://extensions.ontowiki.net/\"\n"
  },
  {
    "path": "extensions/exconf/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/exconf/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :exconf .\n:exconf a doap:Project ;\n  doap:name \"exconf\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/exconf/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Extensions Configuration\" ;\n  doap:description \"provides this component to configure / toggle extensions.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:templates \"templates\" ;\n  :isCoreExtension \"true\"^^xsd:boolean ;\n  owconfig:hasModule :Outline .\n:Outline a owconfig:Module ;\n  rdfs:label \"Extension Outline\" ;\n  owconfig:caching \"false\"^^xsd:boolean ;\n  owconfig:priority \"4\" ;\n  owconfig:context \"main.window.exconf\" .\n:exconf :repoUrl <http://extensions.ontowiki.net/index.php/service/sparql> ;\n  :graph <http://extensions.ontowiki.net/> ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/exconf/pclzip.lib.php",
    "content": "<?php\r\n// --------------------------------------------------------------------------------\r\n// PhpConcept Library - Zip Module 2.8.2\r\n// --------------------------------------------------------------------------------\r\n// License GNU/LGPL - Vincent Blavet - August 2009\r\n// http://www.phpconcept.net\r\n// --------------------------------------------------------------------------------\r\n//\r\n// Presentation :\r\n//   PclZip is a PHP library that manage ZIP archives.\r\n//   So far tests show that archives generated by PclZip are readable by\r\n//   WinZip application and other tools.\r\n//\r\n// Description :\r\n//   See readme.txt and http://www.phpconcept.net\r\n//\r\n// Warning :\r\n//   This library and the associated files are non commercial, non professional\r\n//   work.\r\n//   It should not have unexpected results. However if any damage is caused by\r\n//   this software the author can not be responsible.\r\n//   The use of this software is at the risk of the user.\r\n//\r\n// --------------------------------------------------------------------------------\r\n// $Id: pclzip.lib.php,v 1.60 2009/09/30 21:01:04 vblavet Exp $\r\n// --------------------------------------------------------------------------------\r\n\r\n// ----- Constants\r\nif (!defined('PCLZIP_READ_BLOCK_SIZE')) {\r\n    define('PCLZIP_READ_BLOCK_SIZE', 2048);\r\n}\r\n\r\n// ----- File list separator\r\n// In version 1.x of PclZip, the separator for file list is a space\r\n// (which is not a very smart choice, specifically for windows paths !).\r\n// A better separator should be a comma (,). This constant gives you the\r\n// abilty to change that.\r\n// However notice that changing this value, may have impact on existing\r\n// scripts, using space separated filenames.\r\n// Recommanded values for compatibility with older versions :\r\n//define( 'PCLZIP_SEPARATOR', ' ' );\r\n// Recommanded values for smart separation of filenames.\r\nif (!defined('PCLZIP_SEPARATOR')) {\r\n    define('PCLZIP_SEPARATOR', ',');\r\n}\r\n\r\n// ----- Error configuration\r\n// 0 : PclZip Class integrated error handling\r\n// 1 : PclError external library error handling. By enabling this\r\n//     you must ensure that you have included PclError library.\r\n// [2,...] : reserved for futur use\r\nif (!defined('PCLZIP_ERROR_EXTERNAL')) {\r\n    define('PCLZIP_ERROR_EXTERNAL', 0);\r\n}\r\n\r\n// ----- Optional static temporary directory\r\n//       By default temporary files are generated in the script current\r\n//       path.\r\n//       If defined :\r\n//       - MUST BE terminated by a '/'.\r\n//       - MUST be a valid, already created directory\r\n//       Samples :\r\n// define( 'PCLZIP_TEMPORARY_DIR', '/temp/' );\r\n// define( 'PCLZIP_TEMPORARY_DIR', 'C:/Temp/' );\r\nif (!defined('PCLZIP_TEMPORARY_DIR')) {\r\n    define('PCLZIP_TEMPORARY_DIR', '');\r\n}\r\n\r\n// ----- Optional threshold ratio for use of temporary files\r\n//       Pclzip sense the size of the file to add/extract and decide to\r\n//       use or not temporary file. The algorythm is looking for \r\n//       memory_limit of PHP and apply a ratio.\r\n//       threshold = memory_limit * ratio.\r\n//       Recommended values are under 0.5. Default 0.47.\r\n//       Samples :\r\n// define( 'PCLZIP_TEMPORARY_FILE_RATIO', 0.5 );\r\nif (!defined('PCLZIP_TEMPORARY_FILE_RATIO')) {\r\n    define('PCLZIP_TEMPORARY_FILE_RATIO', 0.47);\r\n}\r\n\r\n// --------------------------------------------------------------------------------\r\n// ***** UNDER THIS LINE NOTHING NEEDS TO BE MODIFIED *****\r\n// --------------------------------------------------------------------------------\r\n\r\n// ----- Global variables\r\n$g_pclzip_version = \"2.8.2\";\r\n\r\n// ----- Error codes\r\n//   -1 : Unable to open file in binary write mode\r\n//   -2 : Unable to open file in binary read mode\r\n//   -3 : Invalid parameters\r\n//   -4 : File does not exist\r\n//   -5 : Filename is too long (max. 255)\r\n//   -6 : Not a valid zip file\r\n//   -7 : Invalid extracted file size\r\n//   -8 : Unable to create directory\r\n//   -9 : Invalid archive extension\r\n//  -10 : Invalid archive format\r\n//  -11 : Unable to delete file (unlink)\r\n//  -12 : Unable to rename file (rename)\r\n//  -13 : Invalid header checksum\r\n//  -14 : Invalid archive size\r\ndefine('PCLZIP_ERR_USER_ABORTED', 2);\r\ndefine('PCLZIP_ERR_NO_ERROR', 0);\r\ndefine('PCLZIP_ERR_WRITE_OPEN_FAIL', -1);\r\ndefine('PCLZIP_ERR_READ_OPEN_FAIL', -2);\r\ndefine('PCLZIP_ERR_INVALID_PARAMETER', -3);\r\ndefine('PCLZIP_ERR_MISSING_FILE', -4);\r\ndefine('PCLZIP_ERR_FILENAME_TOO_LONG', -5);\r\ndefine('PCLZIP_ERR_INVALID_ZIP', -6);\r\ndefine('PCLZIP_ERR_BAD_EXTRACTED_FILE', -7);\r\ndefine('PCLZIP_ERR_DIR_CREATE_FAIL', -8);\r\ndefine('PCLZIP_ERR_BAD_EXTENSION', -9);\r\ndefine('PCLZIP_ERR_BAD_FORMAT', -10);\r\ndefine('PCLZIP_ERR_DELETE_FILE_FAIL', -11);\r\ndefine('PCLZIP_ERR_RENAME_FILE_FAIL', -12);\r\ndefine('PCLZIP_ERR_BAD_CHECKSUM', -13);\r\ndefine('PCLZIP_ERR_INVALID_ARCHIVE_ZIP', -14);\r\ndefine('PCLZIP_ERR_MISSING_OPTION_VALUE', -15);\r\ndefine('PCLZIP_ERR_INVALID_OPTION_VALUE', -16);\r\ndefine('PCLZIP_ERR_ALREADY_A_DIRECTORY', -17);\r\ndefine('PCLZIP_ERR_UNSUPPORTED_COMPRESSION', -18);\r\ndefine('PCLZIP_ERR_UNSUPPORTED_ENCRYPTION', -19);\r\ndefine('PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE', -20);\r\ndefine('PCLZIP_ERR_DIRECTORY_RESTRICTION', -21);\r\n\r\n// ----- Options values\r\ndefine('PCLZIP_OPT_PATH', 77001);\r\ndefine('PCLZIP_OPT_ADD_PATH', 77002);\r\ndefine('PCLZIP_OPT_REMOVE_PATH', 77003);\r\ndefine('PCLZIP_OPT_REMOVE_ALL_PATH', 77004);\r\ndefine('PCLZIP_OPT_SET_CHMOD', 77005);\r\ndefine('PCLZIP_OPT_EXTRACT_AS_STRING', 77006);\r\ndefine('PCLZIP_OPT_NO_COMPRESSION', 77007);\r\ndefine('PCLZIP_OPT_BY_NAME', 77008);\r\ndefine('PCLZIP_OPT_BY_INDEX', 77009);\r\ndefine('PCLZIP_OPT_BY_EREG', 77010);\r\ndefine('PCLZIP_OPT_BY_PREG', 77011);\r\ndefine('PCLZIP_OPT_COMMENT', 77012);\r\ndefine('PCLZIP_OPT_ADD_COMMENT', 77013);\r\ndefine('PCLZIP_OPT_PREPEND_COMMENT', 77014);\r\ndefine('PCLZIP_OPT_EXTRACT_IN_OUTPUT', 77015);\r\ndefine('PCLZIP_OPT_REPLACE_NEWER', 77016);\r\ndefine('PCLZIP_OPT_STOP_ON_ERROR', 77017);\r\n// Having big trouble with crypt. Need to multiply 2 long int\r\n// which is not correctly supported by PHP ...\r\n//define( 'PCLZIP_OPT_CRYPT', 77018 );\r\ndefine('PCLZIP_OPT_EXTRACT_DIR_RESTRICTION', 77019);\r\ndefine('PCLZIP_OPT_TEMP_FILE_THRESHOLD', 77020);\r\ndefine('PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD', 77020); // alias\r\ndefine('PCLZIP_OPT_TEMP_FILE_ON', 77021);\r\ndefine('PCLZIP_OPT_ADD_TEMP_FILE_ON', 77021); // alias\r\ndefine('PCLZIP_OPT_TEMP_FILE_OFF', 77022);\r\ndefine('PCLZIP_OPT_ADD_TEMP_FILE_OFF', 77022); // alias\r\n\r\n// ----- File description attributes\r\ndefine('PCLZIP_ATT_FILE_NAME', 79001);\r\ndefine('PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002);\r\ndefine('PCLZIP_ATT_FILE_NEW_FULL_NAME', 79003);\r\ndefine('PCLZIP_ATT_FILE_MTIME', 79004);\r\ndefine('PCLZIP_ATT_FILE_CONTENT', 79005);\r\ndefine('PCLZIP_ATT_FILE_COMMENT', 79006);\r\n\r\n// ----- Call backs values\r\ndefine('PCLZIP_CB_PRE_EXTRACT', 78001);\r\ndefine('PCLZIP_CB_POST_EXTRACT', 78002);\r\ndefine('PCLZIP_CB_PRE_ADD', 78003);\r\ndefine('PCLZIP_CB_POST_ADD', 78004);\r\n/* For futur use\r\n  define( 'PCLZIP_CB_PRE_LIST', 78005 );\r\n  define( 'PCLZIP_CB_POST_LIST', 78006 );\r\n  define( 'PCLZIP_CB_PRE_DELETE', 78007 );\r\n  define( 'PCLZIP_CB_POST_DELETE', 78008 );\r\n  */\r\n\r\n// --------------------------------------------------------------------------------\r\n// Class : PclZip\r\n// Description :\r\n//   PclZip is the class that represent a Zip archive.\r\n//   The public methods allow the manipulation of the archive.\r\n// Attributes :\r\n//   Attributes must not be accessed directly.\r\n// Methods :\r\n//   PclZip() : Object creator\r\n//   create() : Creates the Zip archive\r\n//   listContent() : List the content of the Zip archive\r\n//   extract() : Extract the content of the archive\r\n//   properties() : List the properties of the archive\r\n// --------------------------------------------------------------------------------\r\nclass PclZip\r\n{\r\n    // ----- Filename of the zip file\r\n    var $zipname = '';\r\n\r\n    // ----- File descriptor of the zip file\r\n    var $zip_fd = 0;\r\n\r\n    // ----- Internal error handling\r\n    var $error_code = 1;\r\n    var $error_string = '';\r\n\r\n    // ----- Current status of the magic_quotes_runtime\r\n    // This value store the php configuration for magic_quotes\r\n    // The class can then disable the magic_quotes and reset it after\r\n    var $magic_quotes_status;\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : PclZip()\r\n    // Description :\r\n    //   Creates a PclZip object and set the name of the associated Zip archive\r\n    //   filename.\r\n    //   Note that no real action is taken, if the archive does not exist it is not\r\n    //   created. Use create() for that.\r\n    // --------------------------------------------------------------------------------\r\n    function PclZip($p_zipname)\r\n    {\r\n\r\n        // ----- Tests the zlib\r\n        if (!function_exists('gzopen')) {\r\n            die('Abort ' . basename(__FILE__) . ' : Missing zlib extensions');\r\n        }\r\n\r\n        // ----- Set the attributes\r\n        $this->zipname             = $p_zipname;\r\n        $this->zip_fd              = 0;\r\n        $this->magic_quotes_status = -1;\r\n\r\n        // ----- Return\r\n        return;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function :\r\n    //   create($p_filelist, $p_add_dir=\"\", $p_remove_dir=\"\")\r\n    //   create($p_filelist, $p_option, $p_option_value, ...)\r\n    // Description :\r\n    //   This method supports two different synopsis. The first one is historical.\r\n    //   This method creates a Zip Archive. The Zip file is created in the\r\n    //   filesystem. The files and directories indicated in $p_filelist\r\n    //   are added in the archive. See the parameters description for the\r\n    //   supported format of $p_filelist.\r\n    //   When a directory is in the list, the directory and its content is added\r\n    //   in the archive.\r\n    //   In this synopsis, the function takes an optional variable list of\r\n    //   options. See bellow the supported options.\r\n    // Parameters :\r\n    //   $p_filelist : An array containing file or directory names, or\r\n    //                 a string containing one filename or one directory name, or\r\n    //                 a string containing a list of filenames and/or directory\r\n    //                 names separated by spaces.\r\n    //   $p_add_dir : A path to add before the real path of the archived file,\r\n    //                in order to have it memorized in the archive.\r\n    //   $p_remove_dir : A path to remove from the real path of the file to archive,\r\n    //                   in order to have a shorter path memorized in the archive.\r\n    //                   When $p_add_dir and $p_remove_dir are set, $p_remove_dir\r\n    //                   is removed first, before $p_add_dir is added.\r\n    // Options :\r\n    //   PCLZIP_OPT_ADD_PATH :\r\n    //   PCLZIP_OPT_REMOVE_PATH :\r\n    //   PCLZIP_OPT_REMOVE_ALL_PATH :\r\n    //   PCLZIP_OPT_COMMENT :\r\n    //   PCLZIP_CB_PRE_ADD :\r\n    //   PCLZIP_CB_POST_ADD :\r\n    // Return Values :\r\n    //   0 on failure,\r\n    //   The list of the added files, with a status of the add action.\r\n    //   (see PclZip::listContent() for list entry format)\r\n    // --------------------------------------------------------------------------------\r\n    function create($p_filelist)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Reset the error handler\r\n        $this->privErrorReset();\r\n\r\n        // ----- Set default values\r\n        $v_options                            = array();\r\n        $v_options[PCLZIP_OPT_NO_COMPRESSION] = false;\r\n\r\n        // ----- Look for variable options arguments\r\n        $v_size = func_num_args();\r\n\r\n        // ----- Look for arguments\r\n        if ($v_size > 1) {\r\n            // ----- Get the arguments\r\n            $v_arg_list = func_get_args();\r\n\r\n            // ----- Remove from the options list the first argument\r\n            array_shift($v_arg_list);\r\n            $v_size--;\r\n\r\n            // ----- Look for first arg\r\n            if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {\r\n\r\n                // ----- Parse the options\r\n                $v_result = $this->privParseOptions(\r\n                    $v_arg_list, $v_size, $v_options,\r\n                    array(PCLZIP_OPT_REMOVE_PATH         => 'optional',\r\n                          PCLZIP_OPT_REMOVE_ALL_PATH     => 'optional',\r\n                          PCLZIP_OPT_ADD_PATH            => 'optional',\r\n                          PCLZIP_CB_PRE_ADD              => 'optional',\r\n                          PCLZIP_CB_POST_ADD             => 'optional',\r\n                          PCLZIP_OPT_NO_COMPRESSION      => 'optional',\r\n                          PCLZIP_OPT_COMMENT             => 'optional',\r\n                          PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',\r\n                          PCLZIP_OPT_TEMP_FILE_ON        => 'optional',\r\n                          PCLZIP_OPT_TEMP_FILE_OFF       => 'optional'\r\n                          //, PCLZIP_OPT_CRYPT => 'optional'\r\n                    )\r\n                );\r\n                if ($v_result != 1) {\r\n                    return 0;\r\n                }\r\n            } // ----- Look for 2 args\r\n            // Here we need to support the first historic synopsis of the\r\n            // method.\r\n            else {\r\n\r\n                // ----- Get the first argument\r\n                $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0];\r\n\r\n                // ----- Look for the optional second argument\r\n                if ($v_size == 2) {\r\n                    $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];\r\n                } else {\r\n                    if ($v_size > 2) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_PARAMETER,\r\n                            \"Invalid number / type of arguments\"\r\n                        );\r\n\r\n                        return 0;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- Look for default option values\r\n        $this->privOptionDefaultThreshold($v_options);\r\n\r\n        // ----- Init\r\n        $v_string_list    = array();\r\n        $v_att_list       = array();\r\n        $v_filedescr_list = array();\r\n        $p_result_list    = array();\r\n\r\n        // ----- Look if the $p_filelist is really an array\r\n        if (is_array($p_filelist)) {\r\n\r\n            // ----- Look if the first element is also an array\r\n            //       This will mean that this is a file description entry\r\n            if (isset($p_filelist[0]) && is_array($p_filelist[0])) {\r\n                $v_att_list = $p_filelist;\r\n            } // ----- The list is a list of string names\r\n            else {\r\n                $v_string_list = $p_filelist;\r\n            }\r\n        } // ----- Look if the $p_filelist is a string\r\n        else {\r\n            if (is_string($p_filelist)) {\r\n                // ----- Create a list from the string\r\n                $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);\r\n            } // ----- Invalid variable type for $p_filelist\r\n            else {\r\n                PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid variable type p_filelist\");\r\n\r\n                return 0;\r\n            }\r\n        }\r\n\r\n        // ----- Reformat the string list\r\n        if (sizeof($v_string_list) != 0) {\r\n            foreach ($v_string_list as $v_string) {\r\n                if ($v_string != '') {\r\n                    $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;\r\n                } else {\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- For each file in the list check the attributes\r\n        $v_supported_attributes\r\n            = array(PCLZIP_ATT_FILE_NAME => 'mandatory'\r\n        , PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional'\r\n        , PCLZIP_ATT_FILE_NEW_FULL_NAME  => 'optional'\r\n        , PCLZIP_ATT_FILE_MTIME          => 'optional'\r\n        , PCLZIP_ATT_FILE_CONTENT        => 'optional'\r\n        , PCLZIP_ATT_FILE_COMMENT        => 'optional'\r\n        );\r\n        foreach ($v_att_list as $v_entry) {\r\n            $v_result = $this->privFileDescrParseAtt(\r\n                $v_entry,\r\n                $v_filedescr_list[],\r\n                $v_options,\r\n                $v_supported_attributes\r\n            );\r\n            if ($v_result != 1) {\r\n                return 0;\r\n            }\r\n        }\r\n\r\n        // ----- Expand the filelist (expand directories)\r\n        $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);\r\n        if ($v_result != 1) {\r\n            return 0;\r\n        }\r\n\r\n        // ----- Call the create fct\r\n        $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options);\r\n        if ($v_result != 1) {\r\n            return 0;\r\n        }\r\n\r\n        // ----- Return\r\n        return $p_result_list;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function :\r\n    //   add($p_filelist, $p_add_dir=\"\", $p_remove_dir=\"\")\r\n    //   add($p_filelist, $p_option, $p_option_value, ...)\r\n    // Description :\r\n    //   This method supports two synopsis. The first one is historical.\r\n    //   This methods add the list of files in an existing archive.\r\n    //   If a file with the same name already exists, it is added at the end of the\r\n    //   archive, the first one is still present.\r\n    //   If the archive does not exist, it is created.\r\n    // Parameters :\r\n    //   $p_filelist : An array containing file or directory names, or\r\n    //                 a string containing one filename or one directory name, or\r\n    //                 a string containing a list of filenames and/or directory\r\n    //                 names separated by spaces.\r\n    //   $p_add_dir : A path to add before the real path of the archived file,\r\n    //                in order to have it memorized in the archive.\r\n    //   $p_remove_dir : A path to remove from the real path of the file to archive,\r\n    //                   in order to have a shorter path memorized in the archive.\r\n    //                   When $p_add_dir and $p_remove_dir are set, $p_remove_dir\r\n    //                   is removed first, before $p_add_dir is added.\r\n    // Options :\r\n    //   PCLZIP_OPT_ADD_PATH :\r\n    //   PCLZIP_OPT_REMOVE_PATH :\r\n    //   PCLZIP_OPT_REMOVE_ALL_PATH :\r\n    //   PCLZIP_OPT_COMMENT :\r\n    //   PCLZIP_OPT_ADD_COMMENT :\r\n    //   PCLZIP_OPT_PREPEND_COMMENT :\r\n    //   PCLZIP_CB_PRE_ADD :\r\n    //   PCLZIP_CB_POST_ADD :\r\n    // Return Values :\r\n    //   0 on failure,\r\n    //   The list of the added files, with a status of the add action.\r\n    //   (see PclZip::listContent() for list entry format)\r\n    // --------------------------------------------------------------------------------\r\n    function add($p_filelist)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Reset the error handler\r\n        $this->privErrorReset();\r\n\r\n        // ----- Set default values\r\n        $v_options                            = array();\r\n        $v_options[PCLZIP_OPT_NO_COMPRESSION] = false;\r\n\r\n        // ----- Look for variable options arguments\r\n        $v_size = func_num_args();\r\n\r\n        // ----- Look for arguments\r\n        if ($v_size > 1) {\r\n            // ----- Get the arguments\r\n            $v_arg_list = func_get_args();\r\n\r\n            // ----- Remove form the options list the first argument\r\n            array_shift($v_arg_list);\r\n            $v_size--;\r\n\r\n            // ----- Look for first arg\r\n            if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {\r\n\r\n                // ----- Parse the options\r\n                $v_result = $this->privParseOptions(\r\n                    $v_arg_list, $v_size, $v_options,\r\n                    array(PCLZIP_OPT_REMOVE_PATH         => 'optional',\r\n                          PCLZIP_OPT_REMOVE_ALL_PATH     => 'optional',\r\n                          PCLZIP_OPT_ADD_PATH            => 'optional',\r\n                          PCLZIP_CB_PRE_ADD              => 'optional',\r\n                          PCLZIP_CB_POST_ADD             => 'optional',\r\n                          PCLZIP_OPT_NO_COMPRESSION      => 'optional',\r\n                          PCLZIP_OPT_COMMENT             => 'optional',\r\n                          PCLZIP_OPT_ADD_COMMENT         => 'optional',\r\n                          PCLZIP_OPT_PREPEND_COMMENT     => 'optional',\r\n                          PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',\r\n                          PCLZIP_OPT_TEMP_FILE_ON        => 'optional',\r\n                          PCLZIP_OPT_TEMP_FILE_OFF       => 'optional'\r\n                          //, PCLZIP_OPT_CRYPT => 'optional'\r\n                    )\r\n                );\r\n                if ($v_result != 1) {\r\n                    return 0;\r\n                }\r\n            } // ----- Look for 2 args\r\n            // Here we need to support the first historic synopsis of the\r\n            // method.\r\n            else {\r\n\r\n                // ----- Get the first argument\r\n                $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0];\r\n\r\n                // ----- Look for the optional second argument\r\n                if ($v_size == 2) {\r\n                    $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];\r\n                } else {\r\n                    if ($v_size > 2) {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid number / type of arguments\");\r\n\r\n                        // ----- Return\r\n                        return 0;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- Look for default option values\r\n        $this->privOptionDefaultThreshold($v_options);\r\n\r\n        // ----- Init\r\n        $v_string_list    = array();\r\n        $v_att_list       = array();\r\n        $v_filedescr_list = array();\r\n        $p_result_list    = array();\r\n\r\n        // ----- Look if the $p_filelist is really an array\r\n        if (is_array($p_filelist)) {\r\n\r\n            // ----- Look if the first element is also an array\r\n            //       This will mean that this is a file description entry\r\n            if (isset($p_filelist[0]) && is_array($p_filelist[0])) {\r\n                $v_att_list = $p_filelist;\r\n            } // ----- The list is a list of string names\r\n            else {\r\n                $v_string_list = $p_filelist;\r\n            }\r\n        } // ----- Look if the $p_filelist is a string\r\n        else {\r\n            if (is_string($p_filelist)) {\r\n                // ----- Create a list from the string\r\n                $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);\r\n            } // ----- Invalid variable type for $p_filelist\r\n            else {\r\n                PclZip::privErrorLog(\r\n                    PCLZIP_ERR_INVALID_PARAMETER, \"Invalid variable type '\" . gettype($p_filelist) . \"' for p_filelist\"\r\n                );\r\n\r\n                return 0;\r\n            }\r\n        }\r\n\r\n        // ----- Reformat the string list\r\n        if (sizeof($v_string_list) != 0) {\r\n            foreach ($v_string_list as $v_string) {\r\n                $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;\r\n            }\r\n        }\r\n\r\n        // ----- For each file in the list check the attributes\r\n        $v_supported_attributes\r\n            = array(PCLZIP_ATT_FILE_NAME => 'mandatory'\r\n        , PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional'\r\n        , PCLZIP_ATT_FILE_NEW_FULL_NAME  => 'optional'\r\n        , PCLZIP_ATT_FILE_MTIME          => 'optional'\r\n        , PCLZIP_ATT_FILE_CONTENT        => 'optional'\r\n        , PCLZIP_ATT_FILE_COMMENT        => 'optional'\r\n        );\r\n        foreach ($v_att_list as $v_entry) {\r\n            $v_result = $this->privFileDescrParseAtt(\r\n                $v_entry,\r\n                $v_filedescr_list[],\r\n                $v_options,\r\n                $v_supported_attributes\r\n            );\r\n            if ($v_result != 1) {\r\n                return 0;\r\n            }\r\n        }\r\n\r\n        // ----- Expand the filelist (expand directories)\r\n        $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);\r\n        if ($v_result != 1) {\r\n            return 0;\r\n        }\r\n\r\n        // ----- Call the create fct\r\n        $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options);\r\n        if ($v_result != 1) {\r\n            return 0;\r\n        }\r\n\r\n        // ----- Return\r\n        return $p_result_list;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : listContent()\r\n    // Description :\r\n    //   This public method, gives the list of the files and directories, with their\r\n    //   properties.\r\n    //   The properties of each entries in the list are (used also in other functions) :\r\n    //     filename : Name of the file. For a create or add action it is the filename\r\n    //                given by the user. For an extract function it is the filename\r\n    //                of the extracted file.\r\n    //     stored_filename : Name of the file / directory stored in the archive.\r\n    //     size : Size of the stored file.\r\n    //     compressed_size : Size of the file's data compressed in the archive\r\n    //                       (without the headers overhead)\r\n    //     mtime : Last known modification date of the file (UNIX timestamp)\r\n    //     comment : Comment associated with the file\r\n    //     folder : true | false\r\n    //     index : index of the file in the archive\r\n    //     status : status of the action (depending of the action) :\r\n    //              Values are :\r\n    //                ok : OK !\r\n    //                filtered : the file / dir is not extracted (filtered by user)\r\n    //                already_a_directory : the file can not be extracted because a\r\n    //                                      directory with the same name already exists\r\n    //                write_protected : the file can not be extracted because a file\r\n    //                                  with the same name already exists and is\r\n    //                                  write protected\r\n    //                newer_exist : the file was not extracted because a newer file exists\r\n    //                path_creation_fail : the file is not extracted because the folder\r\n    //                                     does not exist and can not be created\r\n    //                write_error : the file was not extracted because there was a\r\n    //                              error while writing the file\r\n    //                read_error : the file was not extracted because there was a error\r\n    //                             while reading the file\r\n    //                invalid_header : the file was not extracted because of an archive\r\n    //                                 format error (bad file header)\r\n    //   Note that each time a method can continue operating when there\r\n    //   is an action error on a file, the error is only logged in the file status.\r\n    // Return Values :\r\n    //   0 on an unrecoverable failure,\r\n    //   The list of the files in the archive.\r\n    // --------------------------------------------------------------------------------\r\n    function listContent()\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Reset the error handler\r\n        $this->privErrorReset();\r\n\r\n        // ----- Check archive\r\n        if (!$this->privCheckFormat()) {\r\n            return (0);\r\n        }\r\n\r\n        // ----- Call the extracting fct\r\n        $p_list = array();\r\n        if (($v_result = $this->privList($p_list)) != 1) {\r\n            unset($p_list);\r\n\r\n            return (0);\r\n        }\r\n\r\n        // ----- Return\r\n        return $p_list;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function :\r\n    //   extract($p_path=\"./\", $p_remove_path=\"\")\r\n    //   extract([$p_option, $p_option_value, ...])\r\n    // Description :\r\n    //   This method supports two synopsis. The first one is historical.\r\n    //   This method extract all the files / directories from the archive to the\r\n    //   folder indicated in $p_path.\r\n    //   If you want to ignore the 'root' part of path of the memorized files\r\n    //   you can indicate this in the optional $p_remove_path parameter.\r\n    //   By default, if a newer file with the same name already exists, the\r\n    //   file is not extracted.\r\n    //\r\n    //   If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions\r\n    //   are used, the path indicated in PCLZIP_OPT_ADD_PATH is append\r\n    //   at the end of the path value of PCLZIP_OPT_PATH.\r\n    // Parameters :\r\n    //   $p_path : Path where the files and directories are to be extracted\r\n    //   $p_remove_path : First part ('root' part) of the memorized path\r\n    //                    (if any similar) to remove while extracting.\r\n    // Options :\r\n    //   PCLZIP_OPT_PATH :\r\n    //   PCLZIP_OPT_ADD_PATH :\r\n    //   PCLZIP_OPT_REMOVE_PATH :\r\n    //   PCLZIP_OPT_REMOVE_ALL_PATH :\r\n    //   PCLZIP_CB_PRE_EXTRACT :\r\n    //   PCLZIP_CB_POST_EXTRACT :\r\n    // Return Values :\r\n    //   0 or a negative value on failure,\r\n    //   The list of the extracted files, with a status of the action.\r\n    //   (see PclZip::listContent() for list entry format)\r\n    // --------------------------------------------------------------------------------\r\n    function extract()\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Reset the error handler\r\n        $this->privErrorReset();\r\n\r\n        // ----- Check archive\r\n        if (!$this->privCheckFormat()) {\r\n            return (0);\r\n        }\r\n\r\n        // ----- Set default values\r\n        $v_options = array();\r\n//    $v_path = \"./\";\r\n        $v_path            = '';\r\n        $v_remove_path     = \"\";\r\n        $v_remove_all_path = false;\r\n\r\n        // ----- Look for variable options arguments\r\n        $v_size = func_num_args();\r\n\r\n        // ----- Default values for option\r\n        $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = false;\r\n\r\n        // ----- Look for arguments\r\n        if ($v_size > 0) {\r\n            // ----- Get the arguments\r\n            $v_arg_list = func_get_args();\r\n\r\n            // ----- Look for first arg\r\n            if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {\r\n\r\n                // ----- Parse the options\r\n                $v_result = $this->privParseOptions(\r\n                    $v_arg_list, $v_size, $v_options,\r\n                    array(PCLZIP_OPT_PATH                      => 'optional',\r\n                          PCLZIP_OPT_REMOVE_PATH               => 'optional',\r\n                          PCLZIP_OPT_REMOVE_ALL_PATH           => 'optional',\r\n                          PCLZIP_OPT_ADD_PATH                  => 'optional',\r\n                          PCLZIP_CB_PRE_EXTRACT                => 'optional',\r\n                          PCLZIP_CB_POST_EXTRACT               => 'optional',\r\n                          PCLZIP_OPT_SET_CHMOD                 => 'optional',\r\n                          PCLZIP_OPT_BY_NAME                   => 'optional',\r\n                          PCLZIP_OPT_BY_EREG                   => 'optional',\r\n                          PCLZIP_OPT_BY_PREG                   => 'optional',\r\n                          PCLZIP_OPT_BY_INDEX                  => 'optional',\r\n                          PCLZIP_OPT_EXTRACT_AS_STRING         => 'optional',\r\n                          PCLZIP_OPT_EXTRACT_IN_OUTPUT         => 'optional',\r\n                          PCLZIP_OPT_REPLACE_NEWER             => 'optional'\r\n                          , PCLZIP_OPT_STOP_ON_ERROR           => 'optional'\r\n                          , PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',\r\n                          PCLZIP_OPT_TEMP_FILE_THRESHOLD       => 'optional',\r\n                          PCLZIP_OPT_TEMP_FILE_ON              => 'optional',\r\n                          PCLZIP_OPT_TEMP_FILE_OFF             => 'optional'\r\n                    )\r\n                );\r\n                if ($v_result != 1) {\r\n                    return 0;\r\n                }\r\n\r\n                // ----- Set the arguments\r\n                if (isset($v_options[PCLZIP_OPT_PATH])) {\r\n                    $v_path = $v_options[PCLZIP_OPT_PATH];\r\n                }\r\n                if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {\r\n                    $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];\r\n                }\r\n                if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {\r\n                    $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];\r\n                }\r\n                if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {\r\n                    // ----- Check for '/' in last path char\r\n                    if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {\r\n                        $v_path .= '/';\r\n                    }\r\n                    $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];\r\n                }\r\n            } // ----- Look for 2 args\r\n            // Here we need to support the first historic synopsis of the\r\n            // method.\r\n            else {\r\n\r\n                // ----- Get the first argument\r\n                $v_path = $v_arg_list[0];\r\n\r\n                // ----- Look for the optional second argument\r\n                if ($v_size == 2) {\r\n                    $v_remove_path = $v_arg_list[1];\r\n                } else {\r\n                    if ($v_size > 2) {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid number / type of arguments\");\r\n\r\n                        // ----- Return\r\n                        return 0;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- Look for default option values\r\n        $this->privOptionDefaultThreshold($v_options);\r\n\r\n        // ----- Trace\r\n\r\n        // ----- Call the extracting fct\r\n        $p_list   = array();\r\n        $v_result = $this->privExtractByRule(\r\n            $p_list, $v_path, $v_remove_path,\r\n            $v_remove_all_path, $v_options\r\n        );\r\n        if ($v_result < 1) {\r\n            unset($p_list);\r\n\r\n            return (0);\r\n        }\r\n\r\n        // ----- Return\r\n        return $p_list;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function :\r\n    //   extractByIndex($p_index, $p_path=\"./\", $p_remove_path=\"\")\r\n    //   extractByIndex($p_index, [$p_option, $p_option_value, ...])\r\n    // Description :\r\n    //   This method supports two synopsis. The first one is historical.\r\n    //   This method is doing a partial extract of the archive.\r\n    //   The extracted files or folders are identified by their index in the\r\n    //   archive (from 0 to n).\r\n    //   Note that if the index identify a folder, only the folder entry is\r\n    //   extracted, not all the files included in the archive.\r\n    // Parameters :\r\n    //   $p_index : A single index (integer) or a string of indexes of files to\r\n    //              extract. The form of the string is \"0,4-6,8-12\" with only numbers\r\n    //              and '-' for range or ',' to separate ranges. No spaces or ';'\r\n    //              are allowed.\r\n    //   $p_path : Path where the files and directories are to be extracted\r\n    //   $p_remove_path : First part ('root' part) of the memorized path\r\n    //                    (if any similar) to remove while extracting.\r\n    // Options :\r\n    //   PCLZIP_OPT_PATH :\r\n    //   PCLZIP_OPT_ADD_PATH :\r\n    //   PCLZIP_OPT_REMOVE_PATH :\r\n    //   PCLZIP_OPT_REMOVE_ALL_PATH :\r\n    //   PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and\r\n    //     not as files.\r\n    //     The resulting content is in a new field 'content' in the file\r\n    //     structure.\r\n    //     This option must be used alone (any other options are ignored).\r\n    //   PCLZIP_CB_PRE_EXTRACT :\r\n    //   PCLZIP_CB_POST_EXTRACT :\r\n    // Return Values :\r\n    //   0 on failure,\r\n    //   The list of the extracted files, with a status of the action.\r\n    //   (see PclZip::listContent() for list entry format)\r\n    // --------------------------------------------------------------------------------\r\n    //function extractByIndex($p_index, options...)\r\n    function extractByIndex($p_index)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Reset the error handler\r\n        $this->privErrorReset();\r\n\r\n        // ----- Check archive\r\n        if (!$this->privCheckFormat()) {\r\n            return (0);\r\n        }\r\n\r\n        // ----- Set default values\r\n        $v_options = array();\r\n//    $v_path = \"./\";\r\n        $v_path            = '';\r\n        $v_remove_path     = \"\";\r\n        $v_remove_all_path = false;\r\n\r\n        // ----- Look for variable options arguments\r\n        $v_size = func_num_args();\r\n\r\n        // ----- Default values for option\r\n        $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = false;\r\n\r\n        // ----- Look for arguments\r\n        if ($v_size > 1) {\r\n            // ----- Get the arguments\r\n            $v_arg_list = func_get_args();\r\n\r\n            // ----- Remove form the options list the first argument\r\n            array_shift($v_arg_list);\r\n            $v_size--;\r\n\r\n            // ----- Look for first arg\r\n            if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {\r\n\r\n                // ----- Parse the options\r\n                $v_result = $this->privParseOptions(\r\n                    $v_arg_list, $v_size, $v_options,\r\n                    array(PCLZIP_OPT_PATH                      => 'optional',\r\n                          PCLZIP_OPT_REMOVE_PATH               => 'optional',\r\n                          PCLZIP_OPT_REMOVE_ALL_PATH           => 'optional',\r\n                          PCLZIP_OPT_EXTRACT_AS_STRING         => 'optional',\r\n                          PCLZIP_OPT_ADD_PATH                  => 'optional',\r\n                          PCLZIP_CB_PRE_EXTRACT                => 'optional',\r\n                          PCLZIP_CB_POST_EXTRACT               => 'optional',\r\n                          PCLZIP_OPT_SET_CHMOD                 => 'optional',\r\n                          PCLZIP_OPT_REPLACE_NEWER             => 'optional'\r\n                          , PCLZIP_OPT_STOP_ON_ERROR           => 'optional'\r\n                          , PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',\r\n                          PCLZIP_OPT_TEMP_FILE_THRESHOLD       => 'optional',\r\n                          PCLZIP_OPT_TEMP_FILE_ON              => 'optional',\r\n                          PCLZIP_OPT_TEMP_FILE_OFF             => 'optional'\r\n                    )\r\n                );\r\n                if ($v_result != 1) {\r\n                    return 0;\r\n                }\r\n\r\n                // ----- Set the arguments\r\n                if (isset($v_options[PCLZIP_OPT_PATH])) {\r\n                    $v_path = $v_options[PCLZIP_OPT_PATH];\r\n                }\r\n                if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {\r\n                    $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];\r\n                }\r\n                if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {\r\n                    $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];\r\n                }\r\n                if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {\r\n                    // ----- Check for '/' in last path char\r\n                    if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {\r\n                        $v_path .= '/';\r\n                    }\r\n                    $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];\r\n                }\r\n                if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) {\r\n                    $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = false;\r\n                } else {\r\n                }\r\n            } // ----- Look for 2 args\r\n            // Here we need to support the first historic synopsis of the\r\n            // method.\r\n            else {\r\n\r\n                // ----- Get the first argument\r\n                $v_path = $v_arg_list[0];\r\n\r\n                // ----- Look for the optional second argument\r\n                if ($v_size == 2) {\r\n                    $v_remove_path = $v_arg_list[1];\r\n                } else {\r\n                    if ($v_size > 2) {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid number / type of arguments\");\r\n\r\n                        // ----- Return\r\n                        return 0;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- Trace\r\n\r\n        // ----- Trick\r\n        // Here I want to reuse extractByRule(), so I need to parse the $p_index\r\n        // with privParseOptions()\r\n        $v_arg_trick     = array(PCLZIP_OPT_BY_INDEX, $p_index);\r\n        $v_options_trick = array();\r\n        $v_result        = $this->privParseOptions(\r\n            $v_arg_trick, sizeof($v_arg_trick), $v_options_trick,\r\n            array(PCLZIP_OPT_BY_INDEX => 'optional')\r\n        );\r\n        if ($v_result != 1) {\r\n            return 0;\r\n        }\r\n        $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX];\r\n\r\n        // ----- Look for default option values\r\n        $this->privOptionDefaultThreshold($v_options);\r\n\r\n        // ----- Call the extracting fct\r\n        if (\r\n            ($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1\r\n        ) {\r\n            return (0);\r\n        }\r\n\r\n        // ----- Return\r\n        return $p_list;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function :\r\n    //   delete([$p_option, $p_option_value, ...])\r\n    // Description :\r\n    //   This method removes files from the archive.\r\n    //   If no parameters are given, then all the archive is emptied.\r\n    // Parameters :\r\n    //   None or optional arguments.\r\n    // Options :\r\n    //   PCLZIP_OPT_BY_INDEX :\r\n    //   PCLZIP_OPT_BY_NAME :\r\n    //   PCLZIP_OPT_BY_EREG : \r\n    //   PCLZIP_OPT_BY_PREG :\r\n    // Return Values :\r\n    //   0 on failure,\r\n    //   The list of the files which are still present in the archive.\r\n    //   (see PclZip::listContent() for list entry format)\r\n    // --------------------------------------------------------------------------------\r\n    function delete()\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Reset the error handler\r\n        $this->privErrorReset();\r\n\r\n        // ----- Check archive\r\n        if (!$this->privCheckFormat()) {\r\n            return (0);\r\n        }\r\n\r\n        // ----- Set default values\r\n        $v_options = array();\r\n\r\n        // ----- Look for variable options arguments\r\n        $v_size = func_num_args();\r\n\r\n        // ----- Look for arguments\r\n        if ($v_size > 0) {\r\n            // ----- Get the arguments\r\n            $v_arg_list = func_get_args();\r\n\r\n            // ----- Parse the options\r\n            $v_result = $this->privParseOptions(\r\n                $v_arg_list, $v_size, $v_options,\r\n                array(PCLZIP_OPT_BY_NAME  => 'optional',\r\n                      PCLZIP_OPT_BY_EREG  => 'optional',\r\n                      PCLZIP_OPT_BY_PREG  => 'optional',\r\n                      PCLZIP_OPT_BY_INDEX => 'optional')\r\n            );\r\n            if ($v_result != 1) {\r\n                return 0;\r\n            }\r\n        }\r\n\r\n        // ----- Magic quotes trick\r\n        $this->privDisableMagicQuotes();\r\n\r\n        // ----- Call the delete fct\r\n        $v_list = array();\r\n        if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) {\r\n            $this->privSwapBackMagicQuotes();\r\n            unset($v_list);\r\n\r\n            return (0);\r\n        }\r\n\r\n        // ----- Magic quotes trick\r\n        $this->privSwapBackMagicQuotes();\r\n\r\n        // ----- Return\r\n        return $v_list;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : deleteByIndex()\r\n    // Description :\r\n    //   ***** Deprecated *****\r\n    //   delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered.\r\n    // --------------------------------------------------------------------------------\r\n    function deleteByIndex($p_index)\r\n    {\r\n\r\n        $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index);\r\n\r\n        // ----- Return\r\n        return $p_list;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : properties()\r\n    // Description :\r\n    //   This method gives the properties of the archive.\r\n    //   The properties are :\r\n    //     nb : Number of files in the archive\r\n    //     comment : Comment associated with the archive file\r\n    //     status : not_exist, ok\r\n    // Parameters :\r\n    //   None\r\n    // Return Values :\r\n    //   0 on failure,\r\n    //   An array with the archive properties.\r\n    // --------------------------------------------------------------------------------\r\n    function properties()\r\n    {\r\n\r\n        // ----- Reset the error handler\r\n        $this->privErrorReset();\r\n\r\n        // ----- Magic quotes trick\r\n        $this->privDisableMagicQuotes();\r\n\r\n        // ----- Check archive\r\n        if (!$this->privCheckFormat()) {\r\n            $this->privSwapBackMagicQuotes();\r\n\r\n            return (0);\r\n        }\r\n\r\n        // ----- Default properties\r\n        $v_prop            = array();\r\n        $v_prop['comment'] = '';\r\n        $v_prop['nb']      = 0;\r\n        $v_prop['status']  = 'not_exist';\r\n\r\n        // ----- Look if file exists\r\n        if (@is_file($this->zipname)) {\r\n            // ----- Open the zip file\r\n            if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) {\r\n                $this->privSwapBackMagicQuotes();\r\n\r\n                // ----- Error log\r\n                PclZip::privErrorLog(\r\n                    PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \\'' . $this->zipname . '\\' in binary read mode'\r\n                );\r\n\r\n                // ----- Return\r\n                return 0;\r\n            }\r\n\r\n            // ----- Read the central directory informations\r\n            $v_central_dir = array();\r\n            if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) {\r\n                $this->privSwapBackMagicQuotes();\r\n\r\n                return 0;\r\n            }\r\n\r\n            // ----- Close the zip file\r\n            $this->privCloseFd();\r\n\r\n            // ----- Set the user attributes\r\n            $v_prop['comment'] = $v_central_dir['comment'];\r\n            $v_prop['nb']      = $v_central_dir['entries'];\r\n            $v_prop['status']  = 'ok';\r\n        }\r\n\r\n        // ----- Magic quotes trick\r\n        $this->privSwapBackMagicQuotes();\r\n\r\n        // ----- Return\r\n        return $v_prop;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : duplicate()\r\n    // Description :\r\n    //   This method creates an archive by copying the content of an other one. If\r\n    //   the archive already exist, it is replaced by the new one without any warning.\r\n    // Parameters :\r\n    //   $p_archive : The filename of a valid archive, or\r\n    //                a valid PclZip object.\r\n    // Return Values :\r\n    //   1 on success.\r\n    //   0 or a negative value on error (error code).\r\n    // --------------------------------------------------------------------------------\r\n    function duplicate($p_archive)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Reset the error handler\r\n        $this->privErrorReset();\r\n\r\n        // ----- Look if the $p_archive is a PclZip object\r\n        if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) {\r\n\r\n            // ----- Duplicate the archive\r\n            $v_result = $this->privDuplicate($p_archive->zipname);\r\n        } // ----- Look if the $p_archive is a string (so a filename)\r\n        else {\r\n            if (is_string($p_archive)) {\r\n\r\n                // ----- Check that $p_archive is a valid zip file\r\n                // TBC : Should also check the archive format\r\n                if (!is_file($p_archive)) {\r\n                    // ----- Error log\r\n                    PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, \"No file with filename '\" . $p_archive . \"'\");\r\n                    $v_result = PCLZIP_ERR_MISSING_FILE;\r\n                } else {\r\n                    // ----- Duplicate the archive\r\n                    $v_result = $this->privDuplicate($p_archive);\r\n                }\r\n            } // ----- Invalid variable\r\n            else {\r\n                // ----- Error log\r\n                PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid variable type p_archive_to_add\");\r\n                $v_result = PCLZIP_ERR_INVALID_PARAMETER;\r\n            }\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : merge()\r\n    // Description :\r\n    //   This method merge the $p_archive_to_add archive at the end of the current\r\n    //   one ($this).\r\n    //   If the archive ($this) does not exist, the merge becomes a duplicate.\r\n    //   If the $p_archive_to_add archive does not exist, the merge is a success.\r\n    // Parameters :\r\n    //   $p_archive_to_add : It can be directly the filename of a valid zip archive,\r\n    //                       or a PclZip object archive.\r\n    // Return Values :\r\n    //   1 on success,\r\n    //   0 or negative values on error (see below).\r\n    // --------------------------------------------------------------------------------\r\n    function merge($p_archive_to_add)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Reset the error handler\r\n        $this->privErrorReset();\r\n\r\n        // ----- Check archive\r\n        if (!$this->privCheckFormat()) {\r\n            return (0);\r\n        }\r\n\r\n        // ----- Look if the $p_archive_to_add is a PclZip object\r\n        if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) {\r\n\r\n            // ----- Merge the archive\r\n            $v_result = $this->privMerge($p_archive_to_add);\r\n        } // ----- Look if the $p_archive_to_add is a string (so a filename)\r\n        else {\r\n            if (is_string($p_archive_to_add)) {\r\n\r\n                // ----- Create a temporary archive\r\n                $v_object_archive = new PclZip($p_archive_to_add);\r\n\r\n                // ----- Merge the archive\r\n                $v_result = $this->privMerge($v_object_archive);\r\n            } // ----- Invalid variable\r\n            else {\r\n                // ----- Error log\r\n                PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid variable type p_archive_to_add\");\r\n                $v_result = PCLZIP_ERR_INVALID_PARAMETER;\r\n            }\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : errorCode()\r\n    // Description :\r\n    // Parameters :\r\n    // --------------------------------------------------------------------------------\r\n    function errorCode()\r\n    {\r\n        if (PCLZIP_ERROR_EXTERNAL == 1) {\r\n            return (PclErrorCode());\r\n        } else {\r\n            return ($this->error_code);\r\n        }\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : errorName()\r\n    // Description :\r\n    // Parameters :\r\n    // --------------------------------------------------------------------------------\r\n    function errorName($p_with_code = false)\r\n    {\r\n        $v_name = array(PCLZIP_ERR_NO_ERROR                => 'PCLZIP_ERR_NO_ERROR',\r\n                        PCLZIP_ERR_WRITE_OPEN_FAIL         => 'PCLZIP_ERR_WRITE_OPEN_FAIL',\r\n                        PCLZIP_ERR_READ_OPEN_FAIL          => 'PCLZIP_ERR_READ_OPEN_FAIL',\r\n                        PCLZIP_ERR_INVALID_PARAMETER       => 'PCLZIP_ERR_INVALID_PARAMETER',\r\n                        PCLZIP_ERR_MISSING_FILE            => 'PCLZIP_ERR_MISSING_FILE',\r\n                        PCLZIP_ERR_FILENAME_TOO_LONG       => 'PCLZIP_ERR_FILENAME_TOO_LONG',\r\n                        PCLZIP_ERR_INVALID_ZIP             => 'PCLZIP_ERR_INVALID_ZIP',\r\n                        PCLZIP_ERR_BAD_EXTRACTED_FILE      => 'PCLZIP_ERR_BAD_EXTRACTED_FILE',\r\n                        PCLZIP_ERR_DIR_CREATE_FAIL         => 'PCLZIP_ERR_DIR_CREATE_FAIL',\r\n                        PCLZIP_ERR_BAD_EXTENSION           => 'PCLZIP_ERR_BAD_EXTENSION',\r\n                        PCLZIP_ERR_BAD_FORMAT              => 'PCLZIP_ERR_BAD_FORMAT',\r\n                        PCLZIP_ERR_DELETE_FILE_FAIL        => 'PCLZIP_ERR_DELETE_FILE_FAIL',\r\n                        PCLZIP_ERR_RENAME_FILE_FAIL        => 'PCLZIP_ERR_RENAME_FILE_FAIL',\r\n                        PCLZIP_ERR_BAD_CHECKSUM            => 'PCLZIP_ERR_BAD_CHECKSUM',\r\n                        PCLZIP_ERR_INVALID_ARCHIVE_ZIP     => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP',\r\n                        PCLZIP_ERR_MISSING_OPTION_VALUE    => 'PCLZIP_ERR_MISSING_OPTION_VALUE',\r\n                        PCLZIP_ERR_INVALID_OPTION_VALUE    => 'PCLZIP_ERR_INVALID_OPTION_VALUE',\r\n                        PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION',\r\n                        PCLZIP_ERR_UNSUPPORTED_ENCRYPTION  => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION'\r\n        , PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE               => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE'\r\n        , PCLZIP_ERR_DIRECTORY_RESTRICTION                 => 'PCLZIP_ERR_DIRECTORY_RESTRICTION'\r\n        );\r\n\r\n        if (isset($v_name[$this->error_code])) {\r\n            $v_value = $v_name[$this->error_code];\r\n        } else {\r\n            $v_value = 'NoName';\r\n        }\r\n\r\n        if ($p_with_code) {\r\n            return ($v_value . ' (' . $this->error_code . ')');\r\n        } else {\r\n            return ($v_value);\r\n        }\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : errorInfo()\r\n    // Description :\r\n    // Parameters :\r\n    // --------------------------------------------------------------------------------\r\n    function errorInfo($p_full = false)\r\n    {\r\n        if (PCLZIP_ERROR_EXTERNAL == 1) {\r\n            return (PclErrorString());\r\n        } else {\r\n            if ($p_full) {\r\n                return ($this->errorName(true) . \" : \" . $this->error_string);\r\n            } else {\r\n                return ($this->error_string . \" [code \" . $this->error_code . \"]\");\r\n            }\r\n        }\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n\r\n// --------------------------------------------------------------------------------\r\n// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS *****\r\n// *****                                                        *****\r\n// *****       THESES FUNCTIONS MUST NOT BE USED DIRECTLY       *****\r\n// --------------------------------------------------------------------------------\r\n\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privCheckFormat()\r\n    // Description :\r\n    //   This method check that the archive exists and is a valid zip archive.\r\n    //   Several level of check exists. (futur)\r\n    // Parameters :\r\n    //   $p_level : Level of check. Default 0.\r\n    //              0 : Check the first bytes (magic codes) (default value))\r\n    //              1 : 0 + Check the central directory (futur)\r\n    //              2 : 1 + Check each file header (futur)\r\n    // Return Values :\r\n    //   true on success,\r\n    //   false on error, the error code is set.\r\n    // --------------------------------------------------------------------------------\r\n    function privCheckFormat($p_level = 0)\r\n    {\r\n        $v_result = true;\r\n\r\n        // ----- Reset the file system cache\r\n        clearstatcache();\r\n\r\n        // ----- Reset the error handler\r\n        $this->privErrorReset();\r\n\r\n        // ----- Look if the file exits\r\n        if (!is_file($this->zipname)) {\r\n            // ----- Error log\r\n            PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, \"Missing archive file '\" . $this->zipname . \"'\");\r\n\r\n            return (false);\r\n        }\r\n\r\n        // ----- Check that the file is readeable\r\n        if (!is_readable($this->zipname)) {\r\n            // ----- Error log\r\n            PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, \"Unable to read archive '\" . $this->zipname . \"'\");\r\n\r\n            return (false);\r\n        }\r\n\r\n        // ----- Check the magic code\r\n        // TBC\r\n\r\n        // ----- Check the central header\r\n        // TBC\r\n\r\n        // ----- Check each file header\r\n        // TBC\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privParseOptions()\r\n    // Description :\r\n    //   This internal methods reads the variable list of arguments ($p_options_list,\r\n    //   $p_size) and generate an array with the options and values ($v_result_list).\r\n    //   $v_requested_options contains the options that can be present and those that\r\n    //   must be present.\r\n    //   $v_requested_options is an array, with the option value as key, and 'optional',\r\n    //   or 'mandatory' as value.\r\n    // Parameters :\r\n    //   See above.\r\n    // Return Values :\r\n    //   1 on success.\r\n    //   0 on failure.\r\n    // --------------------------------------------------------------------------------\r\n    function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options = false)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Read the options\r\n        $i = 0;\r\n        while ($i < $p_size) {\r\n\r\n            // ----- Check if the option is supported\r\n            if (!isset($v_requested_options[$p_options_list[$i]])) {\r\n                // ----- Error log\r\n                PclZip::privErrorLog(\r\n                    PCLZIP_ERR_INVALID_PARAMETER,\r\n                    \"Invalid optional parameter '\" . $p_options_list[$i] . \"' for this method\"\r\n                );\r\n\r\n                // ----- Return\r\n                return PclZip::errorCode();\r\n            }\r\n\r\n            // ----- Look for next option\r\n            switch ($p_options_list[$i]) {\r\n                // ----- Look for options that request a path value\r\n                case PCLZIP_OPT_PATH :\r\n                case PCLZIP_OPT_REMOVE_PATH :\r\n                case PCLZIP_OPT_ADD_PATH :\r\n                    // ----- Check the number of parameters\r\n                    if (($i + 1) >= $p_size) {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_MISSING_OPTION_VALUE,\r\n                            \"Missing parameter value for option '\" . PclZipUtilOptionText($p_options_list[$i]) . \"'\"\r\n                        );\r\n\r\n                        // ----- Return\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    // ----- Get the value\r\n                    $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i + 1], false);\r\n                    $i++;\r\n                    break;\r\n\r\n                case PCLZIP_OPT_TEMP_FILE_THRESHOLD :\r\n                    // ----- Check the number of parameters\r\n                    if (($i + 1) >= $p_size) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_MISSING_OPTION_VALUE,\r\n                            \"Missing parameter value for option '\" . PclZipUtilOptionText($p_options_list[$i]) . \"'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    // ----- Check for incompatible options\r\n                    if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_PARAMETER, \"Option '\" . PclZipUtilOptionText($p_options_list[$i])\r\n                            . \"' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    // ----- Check the value\r\n                    $v_value = $p_options_list[$i + 1];\r\n                    if ((!is_integer($v_value)) || ($v_value < 0)) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_OPTION_VALUE,\r\n                            \"Integer expected for option '\" . PclZipUtilOptionText($p_options_list[$i]) . \"'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    // ----- Get the value (and convert it in bytes)\r\n                    $v_result_list[$p_options_list[$i]] = $v_value * 1048576;\r\n                    $i++;\r\n                    break;\r\n\r\n                case PCLZIP_OPT_TEMP_FILE_ON :\r\n                    // ----- Check for incompatible options\r\n                    if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_PARAMETER, \"Option '\" . PclZipUtilOptionText($p_options_list[$i])\r\n                            . \"' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    $v_result_list[$p_options_list[$i]] = true;\r\n                    break;\r\n\r\n                case PCLZIP_OPT_TEMP_FILE_OFF :\r\n                    // ----- Check for incompatible options\r\n                    if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_ON])) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_PARAMETER, \"Option '\" . PclZipUtilOptionText($p_options_list[$i])\r\n                            . \"' can not be used with option 'PCLZIP_OPT_TEMP_FILE_ON'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n                    // ----- Check for incompatible options\r\n                    if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_PARAMETER, \"Option '\" . PclZipUtilOptionText($p_options_list[$i])\r\n                            . \"' can not be used with option 'PCLZIP_OPT_TEMP_FILE_THRESHOLD'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    $v_result_list[$p_options_list[$i]] = true;\r\n                    break;\r\n\r\n                case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION :\r\n                    // ----- Check the number of parameters\r\n                    if (($i + 1) >= $p_size) {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_MISSING_OPTION_VALUE,\r\n                            \"Missing parameter value for option '\" . PclZipUtilOptionText($p_options_list[$i]) . \"'\"\r\n                        );\r\n\r\n                        // ----- Return\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    // ----- Get the value\r\n                    if (is_string($p_options_list[$i + 1])\r\n                        && ($p_options_list[$i + 1] != '')\r\n                    ) {\r\n                        $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath(\r\n                            $p_options_list[$i + 1], false\r\n                        );\r\n                        $i++;\r\n                    } else {\r\n                    }\r\n                    break;\r\n\r\n                // ----- Look for options that request an array of string for value\r\n                case PCLZIP_OPT_BY_NAME :\r\n                    // ----- Check the number of parameters\r\n                    if (($i + 1) >= $p_size) {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_MISSING_OPTION_VALUE,\r\n                            \"Missing parameter value for option '\" . PclZipUtilOptionText($p_options_list[$i]) . \"'\"\r\n                        );\r\n\r\n                        // ----- Return\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    // ----- Get the value\r\n                    if (is_string($p_options_list[$i + 1])) {\r\n                        $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i + 1];\r\n                    } else {\r\n                        if (is_array($p_options_list[$i + 1])) {\r\n                            $v_result_list[$p_options_list[$i]] = $p_options_list[$i + 1];\r\n                        } else {\r\n                            // ----- Error log\r\n                            PclZip::privErrorLog(\r\n                                PCLZIP_ERR_INVALID_OPTION_VALUE,\r\n                                \"Wrong parameter value for option '\" . PclZipUtilOptionText($p_options_list[$i]) . \"'\"\r\n                            );\r\n\r\n                            // ----- Return\r\n                            return PclZip::errorCode();\r\n                        }\r\n                    }\r\n                    $i++;\r\n                    break;\r\n\r\n                // ----- Look for options that request an EREG or PREG expression\r\n                case PCLZIP_OPT_BY_EREG :\r\n                    // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG\r\n                    // to PCLZIP_OPT_BY_PREG\r\n                    $p_options_list[$i] = PCLZIP_OPT_BY_PREG;\r\n                case PCLZIP_OPT_BY_PREG :\r\n                    //case PCLZIP_OPT_CRYPT :\r\n                    // ----- Check the number of parameters\r\n                    if (($i + 1) >= $p_size) {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_MISSING_OPTION_VALUE,\r\n                            \"Missing parameter value for option '\" . PclZipUtilOptionText($p_options_list[$i]) . \"'\"\r\n                        );\r\n\r\n                        // ----- Return\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    // ----- Get the value\r\n                    if (is_string($p_options_list[$i + 1])) {\r\n                        $v_result_list[$p_options_list[$i]] = $p_options_list[$i + 1];\r\n                    } else {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_OPTION_VALUE,\r\n                            \"Wrong parameter value for option '\" . PclZipUtilOptionText($p_options_list[$i]) . \"'\"\r\n                        );\r\n\r\n                        // ----- Return\r\n                        return PclZip::errorCode();\r\n                    }\r\n                    $i++;\r\n                    break;\r\n\r\n                // ----- Look for options that takes a string\r\n                case PCLZIP_OPT_COMMENT :\r\n                case PCLZIP_OPT_ADD_COMMENT :\r\n                case PCLZIP_OPT_PREPEND_COMMENT :\r\n                    // ----- Check the number of parameters\r\n                    if (($i + 1) >= $p_size) {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_MISSING_OPTION_VALUE,\r\n                            \"Missing parameter value for option '\"\r\n                                . PclZipUtilOptionText($p_options_list[$i])\r\n                                . \"'\"\r\n                        );\r\n\r\n                        // ----- Return\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    // ----- Get the value\r\n                    if (is_string($p_options_list[$i + 1])) {\r\n                        $v_result_list[$p_options_list[$i]] = $p_options_list[$i + 1];\r\n                    } else {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_OPTION_VALUE,\r\n                            \"Wrong parameter value for option '\"\r\n                                . PclZipUtilOptionText($p_options_list[$i])\r\n                                . \"'\"\r\n                        );\r\n\r\n                        // ----- Return\r\n                        return PclZip::errorCode();\r\n                    }\r\n                    $i++;\r\n                    break;\r\n\r\n                // ----- Look for options that request an array of index\r\n                case PCLZIP_OPT_BY_INDEX :\r\n                    // ----- Check the number of parameters\r\n                    if (($i + 1) >= $p_size) {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_MISSING_OPTION_VALUE,\r\n                            \"Missing parameter value for option '\" . PclZipUtilOptionText($p_options_list[$i]) . \"'\"\r\n                        );\r\n\r\n                        // ----- Return\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    // ----- Get the value\r\n                    $v_work_list = array();\r\n                    if (is_string($p_options_list[$i + 1])) {\r\n\r\n                        // ----- Remove spaces\r\n                        $p_options_list[$i + 1] = strtr($p_options_list[$i + 1], ' ', '');\r\n\r\n                        // ----- Parse items\r\n                        $v_work_list = explode(\",\", $p_options_list[$i + 1]);\r\n                    } else {\r\n                        if (is_integer($p_options_list[$i + 1])) {\r\n                            $v_work_list[0] = $p_options_list[$i + 1] . '-' . $p_options_list[$i + 1];\r\n                        } else {\r\n                            if (is_array($p_options_list[$i + 1])) {\r\n                                $v_work_list = $p_options_list[$i + 1];\r\n                            } else {\r\n                                // ----- Error log\r\n                                PclZip::privErrorLog(\r\n                                    PCLZIP_ERR_INVALID_OPTION_VALUE,\r\n                                    \"Value must be integer, string or array for option '\" . PclZipUtilOptionText(\r\n                                        $p_options_list[$i]\r\n                                    ) . \"'\"\r\n                                );\r\n\r\n                                // ----- Return\r\n                                return PclZip::errorCode();\r\n                            }\r\n                        }\r\n                    }\r\n\r\n                    // ----- Reduce the index list\r\n                    // each index item in the list must be a couple with a start and\r\n                    // an end value : [0,3], [5-5], [8-10], ...\r\n                    // ----- Check the format of each item\r\n                    $v_sort_flag  = false;\r\n                    $v_sort_value = 0;\r\n                    for ($j = 0; $j < sizeof($v_work_list); $j++) {\r\n                        // ----- Explode the item\r\n                        $v_item_list      = explode(\"-\", $v_work_list[$j]);\r\n                        $v_size_item_list = sizeof($v_item_list);\r\n\r\n                        // ----- TBC : Here we might check that each item is a\r\n                        // real integer ...\r\n\r\n                        // ----- Look for single value\r\n                        if ($v_size_item_list == 1) {\r\n                            // ----- Set the option value\r\n                            $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];\r\n                            $v_result_list[$p_options_list[$i]][$j]['end']   = $v_item_list[0];\r\n                        } elseif ($v_size_item_list == 2) {\r\n                            // ----- Set the option value\r\n                            $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];\r\n                            $v_result_list[$p_options_list[$i]][$j]['end']   = $v_item_list[1];\r\n                        } else {\r\n                            // ----- Error log\r\n                            PclZip::privErrorLog(\r\n                                PCLZIP_ERR_INVALID_OPTION_VALUE,\r\n                                \"Too many values in index range for option '\" . PclZipUtilOptionText(\r\n                                    $p_options_list[$i]\r\n                                ) . \"'\"\r\n                            );\r\n\r\n                            // ----- Return\r\n                            return PclZip::errorCode();\r\n                        }\r\n\r\n\r\n                        // ----- Look for list sort\r\n                        if ($v_result_list[$p_options_list[$i]][$j]['start'] < $v_sort_value) {\r\n                            $v_sort_flag = true;\r\n\r\n                            // ----- TBC : An automatic sort should be writen ...\r\n                            // ----- Error log\r\n                            PclZip::privErrorLog(\r\n                                PCLZIP_ERR_INVALID_OPTION_VALUE,\r\n                                \"Invalid order of index range for option '\" . PclZipUtilOptionText($p_options_list[$i])\r\n                                    . \"'\"\r\n                            );\r\n\r\n                            // ----- Return\r\n                            return PclZip::errorCode();\r\n                        }\r\n                        $v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start'];\r\n                    }\r\n\r\n                    // ----- Sort the items\r\n                    if ($v_sort_flag) {\r\n                        // TBC : To Be Completed\r\n                    }\r\n\r\n                    // ----- Next option\r\n                    $i++;\r\n                    break;\r\n\r\n                // ----- Look for options that request no value\r\n                case PCLZIP_OPT_REMOVE_ALL_PATH :\r\n                case PCLZIP_OPT_EXTRACT_AS_STRING :\r\n                case PCLZIP_OPT_NO_COMPRESSION :\r\n                case PCLZIP_OPT_EXTRACT_IN_OUTPUT :\r\n                case PCLZIP_OPT_REPLACE_NEWER :\r\n                case PCLZIP_OPT_STOP_ON_ERROR :\r\n                    $v_result_list[$p_options_list[$i]] = true;\r\n                    break;\r\n\r\n                // ----- Look for options that request an octal value\r\n                case PCLZIP_OPT_SET_CHMOD :\r\n                    // ----- Check the number of parameters\r\n                    if (($i + 1) >= $p_size) {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_MISSING_OPTION_VALUE,\r\n                            \"Missing parameter value for option '\" . PclZipUtilOptionText($p_options_list[$i]) . \"'\"\r\n                        );\r\n\r\n                        // ----- Return\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    // ----- Get the value\r\n                    $v_result_list[$p_options_list[$i]] = $p_options_list[$i + 1];\r\n                    $i++;\r\n                    break;\r\n\r\n                // ----- Look for options that request a call-back\r\n                case PCLZIP_CB_PRE_EXTRACT :\r\n                case PCLZIP_CB_POST_EXTRACT :\r\n                case PCLZIP_CB_PRE_ADD :\r\n                case PCLZIP_CB_POST_ADD :\r\n                    /* for futur use\r\n        case PCLZIP_CB_PRE_DELETE :\r\n        case PCLZIP_CB_POST_DELETE :\r\n        case PCLZIP_CB_PRE_LIST :\r\n        case PCLZIP_CB_POST_LIST :\r\n        */\r\n                    // ----- Check the number of parameters\r\n                    if (($i + 1) >= $p_size) {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_MISSING_OPTION_VALUE,\r\n                            \"Missing parameter value for option '\" . PclZipUtilOptionText($p_options_list[$i]) . \"'\"\r\n                        );\r\n\r\n                        // ----- Return\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    // ----- Get the value\r\n                    $v_function_name = $p_options_list[$i + 1];\r\n\r\n                    // ----- Check that the value is a valid existing function\r\n                    if (!function_exists($v_function_name)) {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_OPTION_VALUE,\r\n                            \"Function '\" . $v_function_name . \"()' is not an existing function for option '\"\r\n                                . PclZipUtilOptionText($p_options_list[$i]) . \"'\"\r\n                        );\r\n\r\n                        // ----- Return\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    // ----- Set the attribute\r\n                    $v_result_list[$p_options_list[$i]] = $v_function_name;\r\n                    $i++;\r\n                    break;\r\n\r\n                default :\r\n                    // ----- Error log\r\n                    PclZip::privErrorLog(\r\n                        PCLZIP_ERR_INVALID_PARAMETER,\r\n                        \"Unknown parameter '\"\r\n                            . $p_options_list[$i] . \"'\"\r\n                    );\r\n\r\n                    // ----- Return\r\n                    return PclZip::errorCode();\r\n            }\r\n\r\n            // ----- Next options\r\n            $i++;\r\n        }\r\n\r\n        // ----- Look for mandatory options\r\n        if ($v_requested_options !== false) {\r\n            for (\r\n                $key = reset($v_requested_options); $key = key($v_requested_options); $key = next($v_requested_options)\r\n            ) {\r\n                // ----- Look for mandatory option\r\n                if ($v_requested_options[$key] == 'mandatory') {\r\n                    // ----- Look if present\r\n                    if (!isset($v_result_list[$key])) {\r\n                        // ----- Error log\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_PARAMETER,\r\n                            \"Missing mandatory parameter \" . PclZipUtilOptionText($key) . \"(\" . $key . \")\"\r\n                        );\r\n\r\n                        // ----- Return\r\n                        return PclZip::errorCode();\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- Look for default values\r\n        if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {\r\n\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privOptionDefaultThreshold()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privOptionDefaultThreshold(&$p_options)\r\n    {\r\n        $v_result = 1;\r\n\r\n        if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])\r\n            || isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])\r\n        ) {\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Get 'memory_limit' configuration value\r\n        $v_memory_limit = ini_get('memory_limit');\r\n        $v_memory_limit = trim($v_memory_limit);\r\n        $last           = strtolower(substr($v_memory_limit, -1));\r\n\r\n        if ($last == 'g') //$v_memory_limit = $v_memory_limit*1024*1024*1024;\r\n        {\r\n            $v_memory_limit = $v_memory_limit * 1073741824;\r\n        }\r\n        if ($last == 'm') //$v_memory_limit = $v_memory_limit*1024*1024;\r\n        {\r\n            $v_memory_limit = $v_memory_limit * 1048576;\r\n        }\r\n        if ($last == 'k') {\r\n            $v_memory_limit = $v_memory_limit * 1024;\r\n        }\r\n\r\n        $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit * PCLZIP_TEMPORARY_FILE_RATIO);\r\n\r\n\r\n        // ----- Sanity check : No threshold if value lower than 1M\r\n        if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) {\r\n            unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]);\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privFileDescrParseAtt()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    //   1 on success.\r\n    //   0 on failure.\r\n    // --------------------------------------------------------------------------------\r\n    function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options = false)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- For each file in the list check the attributes\r\n        foreach ($p_file_list as $v_key => $v_value) {\r\n\r\n            // ----- Check if the option is supported\r\n            if (!isset($v_requested_options[$v_key])) {\r\n                // ----- Error log\r\n                PclZip::privErrorLog(\r\n                    PCLZIP_ERR_INVALID_PARAMETER, \"Invalid file attribute '\" . $v_key . \"' for this file\"\r\n                );\r\n\r\n                // ----- Return\r\n                return PclZip::errorCode();\r\n            }\r\n\r\n            // ----- Look for attribute\r\n            switch ($v_key) {\r\n                case PCLZIP_ATT_FILE_NAME :\r\n                    if (!is_string($v_value)) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE,\r\n                            \"Invalid type \" . gettype($v_value) . \". String expected for attribute '\"\r\n                                . PclZipUtilOptionText($v_key) . \"'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    $p_filedescr['filename'] = PclZipUtilPathReduction($v_value);\r\n\r\n                    if ($p_filedescr['filename'] == '') {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE,\r\n                            \"Invalid empty filename for attribute '\" . PclZipUtilOptionText($v_key) . \"'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    break;\r\n\r\n                case PCLZIP_ATT_FILE_NEW_SHORT_NAME :\r\n                    if (!is_string($v_value)) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE,\r\n                            \"Invalid type \" . gettype($v_value) . \". String expected for attribute '\"\r\n                                . PclZipUtilOptionText($v_key) . \"'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value);\r\n\r\n                    if ($p_filedescr['new_short_name'] == '') {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE,\r\n                            \"Invalid empty short filename for attribute '\" . PclZipUtilOptionText($v_key) . \"'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n                    break;\r\n\r\n                case PCLZIP_ATT_FILE_NEW_FULL_NAME :\r\n                    if (!is_string($v_value)) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE,\r\n                            \"Invalid type \" . gettype($v_value) . \". String expected for attribute '\"\r\n                                . PclZipUtilOptionText($v_key) . \"'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value);\r\n\r\n                    if ($p_filedescr['new_full_name'] == '') {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE,\r\n                            \"Invalid empty full filename for attribute '\" . PclZipUtilOptionText($v_key) . \"'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n                    break;\r\n\r\n                // ----- Look for options that takes a string\r\n                case PCLZIP_ATT_FILE_COMMENT :\r\n                    if (!is_string($v_value)) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE,\r\n                            \"Invalid type \" . gettype($v_value) . \". String expected for attribute '\"\r\n                                . PclZipUtilOptionText($v_key) . \"'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    $p_filedescr['comment'] = $v_value;\r\n                    break;\r\n\r\n                case PCLZIP_ATT_FILE_MTIME :\r\n                    if (!is_integer($v_value)) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE,\r\n                            \"Invalid type \" . gettype($v_value) . \". Integer expected for attribute '\"\r\n                                . PclZipUtilOptionText($v_key) . \"'\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    $p_filedescr['mtime'] = $v_value;\r\n                    break;\r\n\r\n                case PCLZIP_ATT_FILE_CONTENT :\r\n                    $p_filedescr['content'] = $v_value;\r\n                    break;\r\n\r\n                default :\r\n                    // ----- Error log\r\n                    PclZip::privErrorLog(\r\n                        PCLZIP_ERR_INVALID_PARAMETER,\r\n                        \"Unknown parameter '\" . $v_key . \"'\"\r\n                    );\r\n\r\n                    // ----- Return\r\n                    return PclZip::errorCode();\r\n            }\r\n\r\n            // ----- Look for mandatory options\r\n            if ($v_requested_options !== false) {\r\n                for (\r\n                    $key = reset($v_requested_options); $key = key($v_requested_options);\r\n                    $key = next($v_requested_options)\r\n                ) {\r\n                    // ----- Look for mandatory option\r\n                    if ($v_requested_options[$key] == 'mandatory') {\r\n                        // ----- Look if present\r\n                        if (!isset($p_file_list[$key])) {\r\n                            PclZip::privErrorLog(\r\n                                PCLZIP_ERR_INVALID_PARAMETER,\r\n                                \"Missing mandatory parameter \" . PclZipUtilOptionText($key) . \"(\" . $key . \")\"\r\n                            );\r\n\r\n                            return PclZip::errorCode();\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n\r\n            // end foreach\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privFileDescrExpand()\r\n    // Description :\r\n    //   This method look for each item of the list to see if its a file, a folder\r\n    //   or a string to be added as file. For any other type of files (link, other)\r\n    //   just ignore the item.\r\n    //   Then prepare the information that will be stored for that file.\r\n    //   When its a folder, expand the folder with all the files that are in that \r\n    //   folder (recursively).\r\n    // Parameters :\r\n    // Return Values :\r\n    //   1 on success.\r\n    //   0 on failure.\r\n    // --------------------------------------------------------------------------------\r\n    function privFileDescrExpand(&$p_filedescr_list, &$p_options)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Create a result list\r\n        $v_result_list = array();\r\n\r\n        // ----- Look each entry\r\n        for ($i = 0; $i < sizeof($p_filedescr_list); $i++) {\r\n\r\n            // ----- Get filedescr\r\n            $v_descr = $p_filedescr_list[$i];\r\n\r\n            // ----- Reduce the filename\r\n            $v_descr['filename'] = PclZipUtilTranslateWinPath($v_descr['filename'], false);\r\n            $v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']);\r\n\r\n            // ----- Look for real file or folder\r\n            if (file_exists($v_descr['filename'])) {\r\n                if (@is_file($v_descr['filename'])) {\r\n                    $v_descr['type'] = 'file';\r\n                } else {\r\n                    if (@is_dir($v_descr['filename'])) {\r\n                        $v_descr['type'] = 'folder';\r\n                    } else {\r\n                        if (@is_link($v_descr['filename'])) {\r\n                            // skip\r\n                            continue;\r\n                        } else {\r\n                            // skip\r\n                            continue;\r\n                        }\r\n                    }\r\n                }\r\n            } // ----- Look for string added as file\r\n            else {\r\n                if (isset($v_descr['content'])) {\r\n                    $v_descr['type'] = 'virtual_file';\r\n                } // ----- Missing file\r\n                else {\r\n                    // ----- Error log\r\n                    PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, \"File '\" . $v_descr['filename'] . \"' does not exist\");\r\n\r\n                    // ----- Return\r\n                    return PclZip::errorCode();\r\n                }\r\n            }\r\n\r\n            // ----- Calculate the stored filename\r\n            $this->privCalculateStoredFilename($v_descr, $p_options);\r\n\r\n            // ----- Add the descriptor in result list\r\n            $v_result_list[sizeof($v_result_list)] = $v_descr;\r\n\r\n            // ----- Look for folder\r\n            if ($v_descr['type'] == 'folder') {\r\n                // ----- List of items in folder\r\n                $v_dirlist_descr = array();\r\n                $v_dirlist_nb    = 0;\r\n                if ($v_folder_handler = @opendir($v_descr['filename'])) {\r\n                    while (($v_item_handler = @readdir($v_folder_handler)) !== false) {\r\n\r\n                        // ----- Skip '.' and '..'\r\n                        if (($v_item_handler == '.') || ($v_item_handler == '..')) {\r\n                            continue;\r\n                        }\r\n\r\n                        // ----- Compose the full filename\r\n                        $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'] . '/' . $v_item_handler;\r\n\r\n                        // ----- Look for different stored filename\r\n                        // Because the name of the folder was changed, the name of the\r\n                        // files/sub-folders also change\r\n                        if (($v_descr['stored_filename'] != $v_descr['filename'])\r\n                            && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))\r\n                        ) {\r\n                            if ($v_descr['stored_filename'] != '') {\r\n                                $v_dirlist_descr[$v_dirlist_nb]['new_full_name']\r\n                                    = $v_descr['stored_filename'] . '/' . $v_item_handler;\r\n                            } else {\r\n                                $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler;\r\n                            }\r\n                        }\r\n\r\n                        $v_dirlist_nb++;\r\n                    }\r\n\r\n                    @closedir($v_folder_handler);\r\n                } else {\r\n                    // TBC : unable to open folder in read mode\r\n                }\r\n\r\n                // ----- Expand each element of the list\r\n                if ($v_dirlist_nb != 0) {\r\n                    // ----- Expand\r\n                    if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) {\r\n                        return $v_result;\r\n                    }\r\n\r\n                    // ----- Concat the resulting list\r\n                    $v_result_list = array_merge($v_result_list, $v_dirlist_descr);\r\n                } else {\r\n                }\r\n\r\n                // ----- Free local array\r\n                unset($v_dirlist_descr);\r\n            }\r\n        }\r\n\r\n        // ----- Get the result list\r\n        $p_filedescr_list = $v_result_list;\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privCreate()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privCreate($p_filedescr_list, &$p_result_list, &$p_options)\r\n    {\r\n        $v_result      = 1;\r\n        $v_list_detail = array();\r\n\r\n        // ----- Magic quotes trick\r\n        $this->privDisableMagicQuotes();\r\n\r\n        // ----- Open the file in write mode\r\n        if (($v_result = $this->privOpenFd('wb')) != 1) {\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Add the list of files\r\n        $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options);\r\n\r\n        // ----- Close\r\n        $this->privCloseFd();\r\n\r\n        // ----- Magic quotes trick\r\n        $this->privSwapBackMagicQuotes();\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privAdd()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privAdd($p_filedescr_list, &$p_result_list, &$p_options)\r\n    {\r\n        $v_result      = 1;\r\n        $v_list_detail = array();\r\n\r\n        // ----- Look if the archive exists or is empty\r\n        if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0)) {\r\n\r\n            // ----- Do a create\r\n            $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options);\r\n\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n        // ----- Magic quotes trick\r\n        $this->privDisableMagicQuotes();\r\n\r\n        // ----- Open the zip file\r\n        if (($v_result = $this->privOpenFd('rb')) != 1) {\r\n            // ----- Magic quotes trick\r\n            $this->privSwapBackMagicQuotes();\r\n\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Read the central directory informations\r\n        $v_central_dir = array();\r\n        if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) {\r\n            $this->privCloseFd();\r\n            $this->privSwapBackMagicQuotes();\r\n\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Go to beginning of File\r\n        @rewind($this->zip_fd);\r\n\r\n        // ----- Creates a temporay file\r\n        $v_zip_temp_name = PCLZIP_TEMPORARY_DIR . uniqid('pclzip-') . '.tmp';\r\n\r\n        // ----- Open the temporary file in write mode\r\n        if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) {\r\n            $this->privCloseFd();\r\n            $this->privSwapBackMagicQuotes();\r\n\r\n            PclZip::privErrorLog(\r\n                PCLZIP_ERR_READ_OPEN_FAIL,\r\n                'Unable to open temporary file \\'' . $v_zip_temp_name . '\\' in binary write mode'\r\n            );\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Copy the files from the archive to the temporary file\r\n        // TBC : Here I should better append the file and go back to erase the central dir\r\n        $v_size = $v_central_dir['offset'];\r\n        while ($v_size != 0) {\r\n            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\r\n            $v_buffer    = fread($this->zip_fd, $v_read_size);\r\n            @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\r\n            $v_size -= $v_read_size;\r\n        }\r\n\r\n        // ----- Swap the file descriptor\r\n        // Here is a trick : I swap the temporary fd with the zip fd, in order to use\r\n        // the following methods on the temporary fil and not the real archive\r\n        $v_swap        = $this->zip_fd;\r\n        $this->zip_fd  = $v_zip_temp_fd;\r\n        $v_zip_temp_fd = $v_swap;\r\n\r\n        // ----- Add the files\r\n        $v_header_list = array();\r\n        if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) {\r\n            fclose($v_zip_temp_fd);\r\n            $this->privCloseFd();\r\n            @unlink($v_zip_temp_name);\r\n            $this->privSwapBackMagicQuotes();\r\n\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Store the offset of the central dir\r\n        $v_offset = @ftell($this->zip_fd);\r\n\r\n        // ----- Copy the block of file headers from the old archive\r\n        $v_size = $v_central_dir['size'];\r\n        while ($v_size != 0) {\r\n            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\r\n            $v_buffer    = @fread($v_zip_temp_fd, $v_read_size);\r\n            @fwrite($this->zip_fd, $v_buffer, $v_read_size);\r\n            $v_size -= $v_read_size;\r\n        }\r\n\r\n        // ----- Create the Central Dir files header\r\n        for ($i = 0, $v_count = 0; $i < sizeof($v_header_list); $i++) {\r\n            // ----- Create the file header\r\n            if ($v_header_list[$i]['status'] == 'ok') {\r\n                if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {\r\n                    fclose($v_zip_temp_fd);\r\n                    $this->privCloseFd();\r\n                    @unlink($v_zip_temp_name);\r\n                    $this->privSwapBackMagicQuotes();\r\n\r\n                    // ----- Return\r\n                    return $v_result;\r\n                }\r\n                $v_count++;\r\n            }\r\n\r\n            // ----- Transform the header to a 'usable' info\r\n            $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);\r\n        }\r\n\r\n        // ----- Zip file comment\r\n        $v_comment = $v_central_dir['comment'];\r\n        if (isset($p_options[PCLZIP_OPT_COMMENT])) {\r\n            $v_comment = $p_options[PCLZIP_OPT_COMMENT];\r\n        }\r\n        if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) {\r\n            $v_comment = $v_comment . $p_options[PCLZIP_OPT_ADD_COMMENT];\r\n        }\r\n        if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) {\r\n            $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT] . $v_comment;\r\n        }\r\n\r\n        // ----- Calculate the size of the central header\r\n        $v_size = @ftell($this->zip_fd) - $v_offset;\r\n\r\n        // ----- Create the central dir footer\r\n        if ((\r\n        $v_result = $this->privWriteCentralHeader($v_count + $v_central_dir['entries'], $v_size, $v_offset, $v_comment))\r\n            != 1\r\n        ) {\r\n            // ----- Reset the file list\r\n            unset($v_header_list);\r\n            $this->privSwapBackMagicQuotes();\r\n\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Swap back the file descriptor\r\n        $v_swap        = $this->zip_fd;\r\n        $this->zip_fd  = $v_zip_temp_fd;\r\n        $v_zip_temp_fd = $v_swap;\r\n\r\n        // ----- Close\r\n        $this->privCloseFd();\r\n\r\n        // ----- Close the temporary file\r\n        @fclose($v_zip_temp_fd);\r\n\r\n        // ----- Magic quotes trick\r\n        $this->privSwapBackMagicQuotes();\r\n\r\n        // ----- Delete the zip file\r\n        // TBC : I should test the result ...\r\n        @unlink($this->zipname);\r\n\r\n        // ----- Rename the temporary file\r\n        // TBC : I should test the result ...\r\n        //@rename($v_zip_temp_name, $this->zipname);\r\n        PclZipUtilRename($v_zip_temp_name, $this->zipname);\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privOpenFd()\r\n    // Description :\r\n    // Parameters :\r\n    // --------------------------------------------------------------------------------\r\n    function privOpenFd($p_mode)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Look if already open\r\n        if ($this->zip_fd != 0) {\r\n            // ----- Error log\r\n            PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \\'' . $this->zipname . '\\' already open');\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Open the zip file\r\n        if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0) {\r\n            // ----- Error log\r\n            PclZip::privErrorLog(\r\n                PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \\'' . $this->zipname . '\\' in ' . $p_mode . ' mode'\r\n            );\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privCloseFd()\r\n    // Description :\r\n    // Parameters :\r\n    // --------------------------------------------------------------------------------\r\n    function privCloseFd()\r\n    {\r\n        $v_result = 1;\r\n\r\n        if ($this->zip_fd != 0) {\r\n            @fclose($this->zip_fd);\r\n        }\r\n        $this->zip_fd = 0;\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privAddList()\r\n    // Description :\r\n    //   $p_add_dir and $p_remove_dir will give the ability to memorize a path which is\r\n    //   different from the real path of the file. This is usefull if you want to have PclTar\r\n    //   running in any directory, and memorize relative path from an other directory.\r\n    // Parameters :\r\n    //   $p_list : An array containing the file or directory names to add in the tar\r\n    //   $p_result_list : list of added files with their properties (specially the status field)\r\n    //   $p_add_dir : Path to add in the filename path archived\r\n    //   $p_remove_dir : Path to remove in the filename path archived\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n//  function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options)\r\n    function privAddList($p_filedescr_list, &$p_result_list, &$p_options)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Add the files\r\n        $v_header_list = array();\r\n        if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) {\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Store the offset of the central dir\r\n        $v_offset = @ftell($this->zip_fd);\r\n\r\n        // ----- Create the Central Dir files header\r\n        for ($i = 0, $v_count = 0; $i < sizeof($v_header_list); $i++) {\r\n            // ----- Create the file header\r\n            if ($v_header_list[$i]['status'] == 'ok') {\r\n                if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {\r\n                    // ----- Return\r\n                    return $v_result;\r\n                }\r\n                $v_count++;\r\n            }\r\n\r\n            // ----- Transform the header to a 'usable' info\r\n            $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);\r\n        }\r\n\r\n        // ----- Zip file comment\r\n        $v_comment = '';\r\n        if (isset($p_options[PCLZIP_OPT_COMMENT])) {\r\n            $v_comment = $p_options[PCLZIP_OPT_COMMENT];\r\n        }\r\n\r\n        // ----- Calculate the size of the central header\r\n        $v_size = @ftell($this->zip_fd) - $v_offset;\r\n\r\n        // ----- Create the central dir footer\r\n        if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1) {\r\n            // ----- Reset the file list\r\n            unset($v_header_list);\r\n\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privAddFileList()\r\n    // Description :\r\n    // Parameters :\r\n    //   $p_filedescr_list : An array containing the file description \r\n    //                      or directory names to add in the zip\r\n    //   $p_result_list : list of added files with their properties (specially the status field)\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options)\r\n    {\r\n        $v_result = 1;\r\n        $v_header = array();\r\n\r\n        // ----- Recuperate the current number of elt in list\r\n        $v_nb = sizeof($p_result_list);\r\n\r\n        // ----- Loop on the files\r\n        for ($j = 0; ($j < sizeof($p_filedescr_list)) && ($v_result == 1); $j++) {\r\n            // ----- Format the filename\r\n            $p_filedescr_list[$j]['filename']\r\n                = PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false);\r\n\r\n\r\n            // ----- Skip empty file names\r\n            // TBC : Can this be possible ? not checked in DescrParseAtt ?\r\n            if ($p_filedescr_list[$j]['filename'] == \"\") {\r\n                continue;\r\n            }\r\n\r\n            // ----- Check the filename\r\n            if (($p_filedescr_list[$j]['type'] != 'virtual_file')\r\n                && (!file_exists($p_filedescr_list[$j]['filename']))\r\n            ) {\r\n                PclZip::privErrorLog(\r\n                    PCLZIP_ERR_MISSING_FILE, \"File '\" . $p_filedescr_list[$j]['filename'] . \"' does not exist\"\r\n                );\r\n\r\n                return PclZip::errorCode();\r\n            }\r\n\r\n            // ----- Look if it is a file or a dir with no all path remove option\r\n            // or a dir with all its path removed\r\n//      if (   (is_file($p_filedescr_list[$j]['filename']))\r\n//          || (   is_dir($p_filedescr_list[$j]['filename'])\r\n            if (($p_filedescr_list[$j]['type'] == 'file')\r\n                || ($p_filedescr_list[$j]['type'] == 'virtual_file')\r\n                || (($p_filedescr_list[$j]['type'] == 'folder')\r\n                    && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])\r\n                        || !$p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))\r\n            ) {\r\n\r\n                // ----- Add the file\r\n                $v_result = $this->privAddFile(\r\n                    $p_filedescr_list[$j], $v_header,\r\n                    $p_options\r\n                );\r\n                if ($v_result != 1) {\r\n                    return $v_result;\r\n                }\r\n\r\n                // ----- Store the file infos\r\n                $p_result_list[$v_nb++] = $v_header;\r\n            }\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privAddFile()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privAddFile($p_filedescr, &$p_header, &$p_options)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Working variable\r\n        $p_filename = $p_filedescr['filename'];\r\n\r\n        // TBC : Already done in the fileAtt check ... ?\r\n        if ($p_filename == \"\") {\r\n            // ----- Error log\r\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid file list parameter (invalid or empty list)\");\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Look for a stored different filename \r\n        /* TBC : Removed\r\n    if (isset($p_filedescr['stored_filename'])) {\r\n      $v_stored_filename = $p_filedescr['stored_filename'];\r\n    }\r\n    else {\r\n      $v_stored_filename = $p_filedescr['stored_filename'];\r\n    }\r\n    */\r\n\r\n        // ----- Set the file properties\r\n        clearstatcache();\r\n        $p_header['version']           = 20;\r\n        $p_header['version_extracted'] = 10;\r\n        $p_header['flag']              = 0;\r\n        $p_header['compression']       = 0;\r\n        $p_header['crc']               = 0;\r\n        $p_header['compressed_size']   = 0;\r\n        $p_header['filename_len']      = strlen($p_filename);\r\n        $p_header['extra_len']         = 0;\r\n        $p_header['disk']              = 0;\r\n        $p_header['internal']          = 0;\r\n        $p_header['offset']            = 0;\r\n        $p_header['filename']          = $p_filename;\r\n// TBC : Removed    $p_header['stored_filename'] = $v_stored_filename;\r\n        $p_header['stored_filename'] = $p_filedescr['stored_filename'];\r\n        $p_header['extra']           = '';\r\n        $p_header['status']          = 'ok';\r\n        $p_header['index']           = -1;\r\n\r\n        // ----- Look for regular file\r\n        if ($p_filedescr['type'] == 'file') {\r\n            $p_header['external'] = 0x00000000;\r\n            $p_header['size']     = filesize($p_filename);\r\n        } // ----- Look for regular folder\r\n        else {\r\n            if ($p_filedescr['type'] == 'folder') {\r\n                $p_header['external'] = 0x00000010;\r\n                $p_header['mtime']    = filemtime($p_filename);\r\n                $p_header['size']     = filesize($p_filename);\r\n            } // ----- Look for virtual file\r\n            else {\r\n                if ($p_filedescr['type'] == 'virtual_file') {\r\n                    $p_header['external'] = 0x00000000;\r\n                    $p_header['size']     = strlen($p_filedescr['content']);\r\n                }\r\n            }\r\n        }\r\n\r\n\r\n        // ----- Look for filetime\r\n        if (isset($p_filedescr['mtime'])) {\r\n            $p_header['mtime'] = $p_filedescr['mtime'];\r\n        } else {\r\n            if ($p_filedescr['type'] == 'virtual_file') {\r\n                $p_header['mtime'] = time();\r\n            } else {\r\n                $p_header['mtime'] = filemtime($p_filename);\r\n            }\r\n        }\r\n\r\n        // ------ Look for file comment\r\n        if (isset($p_filedescr['comment'])) {\r\n            $p_header['comment_len'] = strlen($p_filedescr['comment']);\r\n            $p_header['comment']     = $p_filedescr['comment'];\r\n        } else {\r\n            $p_header['comment_len'] = 0;\r\n            $p_header['comment']     = '';\r\n        }\r\n\r\n        // ----- Look for pre-add callback\r\n        if (isset($p_options[PCLZIP_CB_PRE_ADD])) {\r\n\r\n            // ----- Generate a local information\r\n            $v_local_header = array();\r\n            $this->privConvertHeader2FileInfo($p_header, $v_local_header);\r\n\r\n            // ----- Call the callback\r\n            // Here I do not use call_user_func() because I need to send a reference to the\r\n            // header.\r\n//      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);');\r\n            $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header);\r\n            if ($v_result == 0) {\r\n                // ----- Change the file status\r\n                $p_header['status'] = \"skipped\";\r\n                $v_result           = 1;\r\n            }\r\n\r\n            // ----- Update the informations\r\n            // Only some fields can be modified\r\n            if ($p_header['stored_filename'] != $v_local_header['stored_filename']) {\r\n                $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']);\r\n            }\r\n        }\r\n\r\n        // ----- Look for empty stored filename\r\n        if ($p_header['stored_filename'] == \"\") {\r\n            $p_header['status'] = \"filtered\";\r\n        }\r\n\r\n        // ----- Check the path length\r\n        if (strlen($p_header['stored_filename']) > 0xFF) {\r\n            $p_header['status'] = 'filename_too_long';\r\n        }\r\n\r\n        // ----- Look if no error, or file not skipped\r\n        if ($p_header['status'] == 'ok') {\r\n\r\n            // ----- Look for a file\r\n            if ($p_filedescr['type'] == 'file') {\r\n                // ----- Look for using temporary file to zip\r\n                if ((!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))\r\n                    && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])\r\n                        || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])\r\n                            && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])))\r\n                ) {\r\n                    $v_result = $this->privAddFileUsingTempFile($p_filedescr, $p_header, $p_options);\r\n                    if ($v_result < PCLZIP_ERR_NO_ERROR) {\r\n                        return $v_result;\r\n                    }\r\n                } // ----- Use \"in memory\" zip algo\r\n                else {\r\n\r\n                    // ----- Open the source file\r\n                    if (($v_file = @fopen($p_filename, \"rb\")) == 0) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_READ_OPEN_FAIL, \"Unable to open file '$p_filename' in binary read mode\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n                    // ----- Read the file content\r\n                    $v_content = @fread($v_file, $p_header['size']);\r\n\r\n                    // ----- Close the file\r\n                    @fclose($v_file);\r\n\r\n                    // ----- Calculate the CRC\r\n                    $p_header['crc'] = @crc32($v_content);\r\n\r\n                    // ----- Look for no compression\r\n                    if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {\r\n                        // ----- Set header parameters\r\n                        $p_header['compressed_size'] = $p_header['size'];\r\n                        $p_header['compression']     = 0;\r\n                    } // ----- Look for normal compression\r\n                    else {\r\n                        // ----- Compress the content\r\n                        $v_content = @gzdeflate($v_content);\r\n\r\n                        // ----- Set header parameters\r\n                        $p_header['compressed_size'] = strlen($v_content);\r\n                        $p_header['compression']     = 8;\r\n                    }\r\n\r\n                    // ----- Call the header generation\r\n                    if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {\r\n                        @fclose($v_file);\r\n\r\n                        return $v_result;\r\n                    }\r\n\r\n                    // ----- Write the compressed (or not) content\r\n                    @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);\r\n\r\n                }\r\n\r\n            } // ----- Look for a virtual file (a file from string)\r\n            else {\r\n                if ($p_filedescr['type'] == 'virtual_file') {\r\n\r\n                    $v_content = $p_filedescr['content'];\r\n\r\n                    // ----- Calculate the CRC\r\n                    $p_header['crc'] = @crc32($v_content);\r\n\r\n                    // ----- Look for no compression\r\n                    if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {\r\n                        // ----- Set header parameters\r\n                        $p_header['compressed_size'] = $p_header['size'];\r\n                        $p_header['compression']     = 0;\r\n                    } // ----- Look for normal compression\r\n                    else {\r\n                        // ----- Compress the content\r\n                        $v_content = @gzdeflate($v_content);\r\n\r\n                        // ----- Set header parameters\r\n                        $p_header['compressed_size'] = strlen($v_content);\r\n                        $p_header['compression']     = 8;\r\n                    }\r\n\r\n                    // ----- Call the header generation\r\n                    if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {\r\n                        @fclose($v_file);\r\n\r\n                        return $v_result;\r\n                    }\r\n\r\n                    // ----- Write the compressed (or not) content\r\n                    @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);\r\n                } // ----- Look for a directory\r\n                else {\r\n                    if ($p_filedescr['type'] == 'folder') {\r\n                        // ----- Look for directory last '/'\r\n                        if (@substr($p_header['stored_filename'], -1) != '/') {\r\n                            $p_header['stored_filename'] .= '/';\r\n                        }\r\n\r\n                        // ----- Set the file properties\r\n                        $p_header['size'] = 0;\r\n                        //$p_header['external'] = 0x41FF0010;   // Value for a folder : to be checked\r\n                        $p_header['external'] = 0x00000010; // Value for a folder : to be checked\r\n\r\n                        // ----- Call the header generation\r\n                        if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {\r\n                            return $v_result;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- Look for post-add callback\r\n        if (isset($p_options[PCLZIP_CB_POST_ADD])) {\r\n\r\n            // ----- Generate a local information\r\n            $v_local_header = array();\r\n            $this->privConvertHeader2FileInfo($p_header, $v_local_header);\r\n\r\n            // ----- Call the callback\r\n            // Here I do not use call_user_func() because I need to send a reference to the\r\n            // header.\r\n//      eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);');\r\n            $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header);\r\n            if ($v_result == 0) {\r\n                // ----- Ignored\r\n                $v_result = 1;\r\n            }\r\n\r\n            // ----- Update the informations\r\n            // Nothing can be modified\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privAddFileUsingTempFile()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options)\r\n    {\r\n        $v_result = PCLZIP_ERR_NO_ERROR;\r\n\r\n        // ----- Working variable\r\n        $p_filename = $p_filedescr['filename'];\r\n\r\n\r\n        // ----- Open the source file\r\n        if (($v_file = @fopen($p_filename, \"rb\")) == 0) {\r\n            PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, \"Unable to open file '$p_filename' in binary read mode\");\r\n\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Creates a compressed temporary file\r\n        $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR . uniqid('pclzip-') . '.gz';\r\n        if (($v_file_compressed = @gzopen($v_gzip_temp_name, \"wb\")) == 0) {\r\n            fclose($v_file);\r\n            PclZip::privErrorLog(\r\n                PCLZIP_ERR_WRITE_OPEN_FAIL,\r\n                'Unable to open temporary file \\'' . $v_gzip_temp_name . '\\' in binary write mode'\r\n            );\r\n\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks\r\n        $v_size = filesize($p_filename);\r\n        while ($v_size != 0) {\r\n            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\r\n            $v_buffer    = @fread($v_file, $v_read_size);\r\n            //$v_binary_data = pack('a'.$v_read_size, $v_buffer);\r\n            @gzputs($v_file_compressed, $v_buffer, $v_read_size);\r\n            $v_size -= $v_read_size;\r\n        }\r\n\r\n        // ----- Close the file\r\n        @fclose($v_file);\r\n        @gzclose($v_file_compressed);\r\n\r\n        // ----- Check the minimum file size\r\n        if (filesize($v_gzip_temp_name) < 18) {\r\n            PclZip::privErrorLog(\r\n                PCLZIP_ERR_BAD_FORMAT,\r\n                'gzip temporary file \\'' . $v_gzip_temp_name . '\\' has invalid filesize - should be minimum 18 bytes'\r\n            );\r\n\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Extract the compressed attributes\r\n        if (($v_file_compressed = @fopen($v_gzip_temp_name, \"rb\")) == 0) {\r\n            PclZip::privErrorLog(\r\n                PCLZIP_ERR_READ_OPEN_FAIL,\r\n                'Unable to open temporary file \\'' . $v_gzip_temp_name . '\\' in binary read mode'\r\n            );\r\n\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Read the gzip file header\r\n        $v_binary_data = @fread($v_file_compressed, 10);\r\n        $v_data_header = unpack('a1id1/a1id2/a1cm/a1flag/Vmtime/a1xfl/a1os', $v_binary_data);\r\n\r\n        // ----- Check some parameters\r\n        $v_data_header['os'] = bin2hex($v_data_header['os']);\r\n\r\n        // ----- Read the gzip file footer\r\n        @fseek($v_file_compressed, filesize($v_gzip_temp_name) - 8);\r\n        $v_binary_data = @fread($v_file_compressed, 8);\r\n        $v_data_footer = unpack('Vcrc/Vcompressed_size', $v_binary_data);\r\n\r\n        // ----- Set the attributes\r\n        $p_header['compression'] = ord($v_data_header['cm']);\r\n        //$p_header['mtime'] = $v_data_header['mtime'];\r\n        $p_header['crc']             = $v_data_footer['crc'];\r\n        $p_header['compressed_size'] = filesize($v_gzip_temp_name) - 18;\r\n\r\n        // ----- Close the file\r\n        @fclose($v_file_compressed);\r\n\r\n        // ----- Call the header generation\r\n        if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Add the compressed data\r\n        if (($v_file_compressed = @fopen($v_gzip_temp_name, \"rb\")) == 0) {\r\n            PclZip::privErrorLog(\r\n                PCLZIP_ERR_READ_OPEN_FAIL,\r\n                'Unable to open temporary file \\'' . $v_gzip_temp_name . '\\' in binary read mode'\r\n            );\r\n\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks\r\n        fseek($v_file_compressed, 10);\r\n        $v_size = $p_header['compressed_size'];\r\n        while ($v_size != 0) {\r\n            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\r\n            $v_buffer    = @fread($v_file_compressed, $v_read_size);\r\n            //$v_binary_data = pack('a'.$v_read_size, $v_buffer);\r\n            @fwrite($this->zip_fd, $v_buffer, $v_read_size);\r\n            $v_size -= $v_read_size;\r\n        }\r\n\r\n        // ----- Close the file\r\n        @fclose($v_file_compressed);\r\n\r\n        // ----- Unlink the temporary file\r\n        @unlink($v_gzip_temp_name);\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privCalculateStoredFilename()\r\n    // Description :\r\n    //   Based on file descriptor properties and global options, this method\r\n    //   calculate the filename that will be stored in the archive.\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privCalculateStoredFilename(&$p_filedescr, &$p_options)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Working variables\r\n        $p_filename = $p_filedescr['filename'];\r\n        if (isset($p_options[PCLZIP_OPT_ADD_PATH])) {\r\n            $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH];\r\n        } else {\r\n            $p_add_dir = '';\r\n        }\r\n        if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) {\r\n            $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH];\r\n        } else {\r\n            $p_remove_dir = '';\r\n        }\r\n        if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {\r\n            $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH];\r\n        } else {\r\n            $p_remove_all_dir = 0;\r\n        }\r\n\r\n\r\n        // ----- Look for full name change\r\n        if (isset($p_filedescr['new_full_name'])) {\r\n            // ----- Remove drive letter if any\r\n            $v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']);\r\n        } // ----- Look for path and/or short name change\r\n        else {\r\n\r\n            // ----- Look for short name change\r\n            // Its when we cahnge just the filename but not the path\r\n            if (isset($p_filedescr['new_short_name'])) {\r\n                $v_path_info = pathinfo($p_filename);\r\n                $v_dir       = '';\r\n                if ($v_path_info['dirname'] != '') {\r\n                    $v_dir = $v_path_info['dirname'] . '/';\r\n                }\r\n                $v_stored_filename = $v_dir . $p_filedescr['new_short_name'];\r\n            } else {\r\n                // ----- Calculate the stored filename\r\n                $v_stored_filename = $p_filename;\r\n            }\r\n\r\n            // ----- Look for all path to remove\r\n            if ($p_remove_all_dir) {\r\n                $v_stored_filename = basename($p_filename);\r\n            } // ----- Look for partial path remove\r\n            else {\r\n                if ($p_remove_dir != \"\") {\r\n                    if (substr($p_remove_dir, -1) != '/') {\r\n                        $p_remove_dir .= \"/\";\r\n                    }\r\n\r\n                    if ((substr($p_filename, 0, 2) == \"./\")\r\n                        || (substr($p_remove_dir, 0, 2) == \"./\")\r\n                    ) {\r\n\r\n                        if ((substr($p_filename, 0, 2) == \"./\")\r\n                            && (substr($p_remove_dir, 0, 2) != \"./\")\r\n                        ) {\r\n                            $p_remove_dir = \"./\" . $p_remove_dir;\r\n                        }\r\n                        if ((substr($p_filename, 0, 2) != \"./\")\r\n                            && (substr($p_remove_dir, 0, 2) == \"./\")\r\n                        ) {\r\n                            $p_remove_dir = substr($p_remove_dir, 2);\r\n                        }\r\n                    }\r\n\r\n                    $v_compare = PclZipUtilPathInclusion(\r\n                        $p_remove_dir,\r\n                        $v_stored_filename\r\n                    );\r\n                    if ($v_compare > 0) {\r\n                        if ($v_compare == 2) {\r\n                            $v_stored_filename = \"\";\r\n                        } else {\r\n                            $v_stored_filename = substr(\r\n                                $v_stored_filename,\r\n                                strlen($p_remove_dir)\r\n                            );\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n\r\n            // ----- Remove drive letter if any\r\n            $v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename);\r\n\r\n            // ----- Look for path to add\r\n            if ($p_add_dir != \"\") {\r\n                if (substr($p_add_dir, -1) == \"/\") {\r\n                    $v_stored_filename = $p_add_dir . $v_stored_filename;\r\n                } else {\r\n                    $v_stored_filename = $p_add_dir . \"/\" . $v_stored_filename;\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- Filename (reduce the path of stored name)\r\n        $v_stored_filename              = PclZipUtilPathReduction($v_stored_filename);\r\n        $p_filedescr['stored_filename'] = $v_stored_filename;\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privWriteFileHeader()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privWriteFileHeader(&$p_header)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Store the offset position of the file\r\n        $p_header['offset'] = ftell($this->zip_fd);\r\n\r\n        // ----- Transform UNIX mtime to DOS format mdate/mtime\r\n        $v_date  = getdate($p_header['mtime']);\r\n        $v_mtime = ($v_date['hours'] << 11) + ($v_date['minutes'] << 5) + $v_date['seconds'] / 2;\r\n        $v_mdate = (($v_date['year'] - 1980) << 9) + ($v_date['mon'] << 5) + $v_date['mday'];\r\n\r\n        // ----- Packed data\r\n        $v_binary_data = pack(\r\n            \"VvvvvvVVVvv\", 0x04034b50,\r\n            $p_header['version_extracted'], $p_header['flag'],\r\n            $p_header['compression'], $v_mtime, $v_mdate,\r\n            $p_header['crc'], $p_header['compressed_size'],\r\n            $p_header['size'],\r\n            strlen($p_header['stored_filename']),\r\n            $p_header['extra_len']\r\n        );\r\n\r\n        // ----- Write the first 148 bytes of the header in the archive\r\n        fputs($this->zip_fd, $v_binary_data, 30);\r\n\r\n        // ----- Write the variable fields\r\n        if (strlen($p_header['stored_filename']) != 0) {\r\n            fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));\r\n        }\r\n        if ($p_header['extra_len'] != 0) {\r\n            fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privWriteCentralFileHeader()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privWriteCentralFileHeader(&$p_header)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // TBC\r\n        //for(reset($p_header); $key = key($p_header); next($p_header)) {\r\n        //}\r\n\r\n        // ----- Transform UNIX mtime to DOS format mdate/mtime\r\n        $v_date  = getdate($p_header['mtime']);\r\n        $v_mtime = ($v_date['hours'] << 11) + ($v_date['minutes'] << 5) + $v_date['seconds'] / 2;\r\n        $v_mdate = (($v_date['year'] - 1980) << 9) + ($v_date['mon'] << 5) + $v_date['mday'];\r\n\r\n\r\n        // ----- Packed data\r\n        $v_binary_data = pack(\r\n            \"VvvvvvvVVVvvvvvVV\", 0x02014b50,\r\n            $p_header['version'], $p_header['version_extracted'],\r\n            $p_header['flag'], $p_header['compression'],\r\n            $v_mtime, $v_mdate, $p_header['crc'],\r\n            $p_header['compressed_size'], $p_header['size'],\r\n            strlen($p_header['stored_filename']),\r\n            $p_header['extra_len'], $p_header['comment_len'],\r\n            $p_header['disk'], $p_header['internal'],\r\n            $p_header['external'], $p_header['offset']\r\n        );\r\n\r\n        // ----- Write the 42 bytes of the header in the zip file\r\n        fputs($this->zip_fd, $v_binary_data, 46);\r\n\r\n        // ----- Write the variable fields\r\n        if (strlen($p_header['stored_filename']) != 0) {\r\n            fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));\r\n        }\r\n        if ($p_header['extra_len'] != 0) {\r\n            fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);\r\n        }\r\n        if ($p_header['comment_len'] != 0) {\r\n            fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']);\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privWriteCentralHeader()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Packed data\r\n        $v_binary_data = pack(\r\n            \"VvvvvVVv\", 0x06054b50, 0, 0, $p_nb_entries,\r\n            $p_nb_entries, $p_size,\r\n            $p_offset, strlen($p_comment)\r\n        );\r\n\r\n        // ----- Write the 22 bytes of the header in the zip file\r\n        fputs($this->zip_fd, $v_binary_data, 22);\r\n\r\n        // ----- Write the variable fields\r\n        if (strlen($p_comment) != 0) {\r\n            fputs($this->zip_fd, $p_comment, strlen($p_comment));\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privList()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privList(&$p_list)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Magic quotes trick\r\n        $this->privDisableMagicQuotes();\r\n\r\n        // ----- Open the zip file\r\n        if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) {\r\n            // ----- Magic quotes trick\r\n            $this->privSwapBackMagicQuotes();\r\n\r\n            // ----- Error log\r\n            PclZip::privErrorLog(\r\n                PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \\'' . $this->zipname . '\\' in binary read mode'\r\n            );\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Read the central directory informations\r\n        $v_central_dir = array();\r\n        if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) {\r\n            $this->privSwapBackMagicQuotes();\r\n\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Go to beginning of Central Dir\r\n        @rewind($this->zip_fd);\r\n        if (@fseek($this->zip_fd, $v_central_dir['offset'])) {\r\n            $this->privSwapBackMagicQuotes();\r\n\r\n            // ----- Error log\r\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Read each entry\r\n        for ($i = 0; $i < $v_central_dir['entries']; $i++) {\r\n            // ----- Read the file header\r\n            if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) {\r\n                $this->privSwapBackMagicQuotes();\r\n\r\n                return $v_result;\r\n            }\r\n            $v_header['index'] = $i;\r\n\r\n            // ----- Get the only interesting attributes\r\n            $this->privConvertHeader2FileInfo($v_header, $p_list[$i]);\r\n            unset($v_header);\r\n        }\r\n\r\n        // ----- Close the zip file\r\n        $this->privCloseFd();\r\n\r\n        // ----- Magic quotes trick\r\n        $this->privSwapBackMagicQuotes();\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privConvertHeader2FileInfo()\r\n    // Description :\r\n    //   This function takes the file informations from the central directory\r\n    //   entries and extract the interesting parameters that will be given back.\r\n    //   The resulting file infos are set in the array $p_info\r\n    //     $p_info['filename'] : Filename with full path. Given by user (add),\r\n    //                           extracted in the filesystem (extract).\r\n    //     $p_info['stored_filename'] : Stored filename in the archive.\r\n    //     $p_info['size'] = Size of the file.\r\n    //     $p_info['compressed_size'] = Compressed size of the file.\r\n    //     $p_info['mtime'] = Last modification date of the file.\r\n    //     $p_info['comment'] = Comment associated with the file.\r\n    //     $p_info['folder'] = true/false : indicates if the entry is a folder or not.\r\n    //     $p_info['status'] = status of the action on the file.\r\n    //     $p_info['crc'] = CRC of the file content.\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privConvertHeader2FileInfo($p_header, &$p_info)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Get the interesting attributes\r\n        $v_temp_path               = PclZipUtilPathReduction($p_header['filename']);\r\n        $p_info['filename']        = $v_temp_path;\r\n        $v_temp_path               = PclZipUtilPathReduction($p_header['stored_filename']);\r\n        $p_info['stored_filename'] = $v_temp_path;\r\n        $p_info['size']            = $p_header['size'];\r\n        $p_info['compressed_size'] = $p_header['compressed_size'];\r\n        $p_info['mtime']           = $p_header['mtime'];\r\n        $p_info['comment']         = $p_header['comment'];\r\n        $p_info['folder']          = (($p_header['external'] & 0x00000010) == 0x00000010);\r\n        $p_info['index']           = $p_header['index'];\r\n        $p_info['status']          = $p_header['status'];\r\n        $p_info['crc']             = $p_header['crc'];\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privExtractByRule()\r\n    // Description :\r\n    //   Extract a file or directory depending of rules (by index, by name, ...)\r\n    // Parameters :\r\n    //   $p_file_list : An array where will be placed the properties of each\r\n    //                  extracted file\r\n    //   $p_path : Path to add while writing the extracted files\r\n    //   $p_remove_path : Path to remove (from the file memorized path) while writing the\r\n    //                    extracted files. If the path does not match the file path,\r\n    //                    the file is extracted with its memorized path.\r\n    //                    $p_remove_path does not apply to 'list' mode.\r\n    //                    $p_path and $p_remove_path are commulative.\r\n    // Return Values :\r\n    //   1 on success,0 or less on error (see error code list)\r\n    // --------------------------------------------------------------------------------\r\n    function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Magic quotes trick\r\n        $this->privDisableMagicQuotes();\r\n\r\n        // ----- Check the path\r\n        if (($p_path == \"\")\r\n            || ((substr($p_path, 0, 1) != \"/\")\r\n                && (substr($p_path, 0, 3) != \"../\")\r\n                && (substr($p_path, 1, 2) != \":/\"))\r\n        ) {\r\n            $p_path = \"./\" . $p_path;\r\n        }\r\n\r\n        // ----- Reduce the path last (and duplicated) '/'\r\n        if (($p_path != \"./\") && ($p_path != \"/\")) {\r\n            // ----- Look for the path end '/'\r\n            while (substr($p_path, -1) == \"/\") {\r\n                $p_path = substr($p_path, 0, strlen($p_path) - 1);\r\n            }\r\n        }\r\n\r\n        // ----- Look for path to remove format (should end by /)\r\n        if (($p_remove_path != \"\") && (substr($p_remove_path, -1) != '/')) {\r\n            $p_remove_path .= '/';\r\n        }\r\n        $p_remove_path_size = strlen($p_remove_path);\r\n\r\n        // ----- Open the zip file\r\n        if (($v_result = $this->privOpenFd('rb')) != 1) {\r\n            $this->privSwapBackMagicQuotes();\r\n\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Read the central directory informations\r\n        $v_central_dir = array();\r\n        if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) {\r\n            // ----- Close the zip file\r\n            $this->privCloseFd();\r\n            $this->privSwapBackMagicQuotes();\r\n\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Start at beginning of Central Dir\r\n        $v_pos_entry = $v_central_dir['offset'];\r\n\r\n        // ----- Read each entry\r\n        $j_start = 0;\r\n        for ($i = 0, $v_nb_extracted = 0; $i < $v_central_dir['entries']; $i++) {\r\n\r\n            // ----- Read next Central dir entry\r\n            @rewind($this->zip_fd);\r\n            if (@fseek($this->zip_fd, $v_pos_entry)) {\r\n                // ----- Close the zip file\r\n                $this->privCloseFd();\r\n                $this->privSwapBackMagicQuotes();\r\n\r\n                // ----- Error log\r\n                PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');\r\n\r\n                // ----- Return\r\n                return PclZip::errorCode();\r\n            }\r\n\r\n            // ----- Read the file header\r\n            $v_header = array();\r\n            if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) {\r\n                // ----- Close the zip file\r\n                $this->privCloseFd();\r\n                $this->privSwapBackMagicQuotes();\r\n\r\n                return $v_result;\r\n            }\r\n\r\n            // ----- Store the index\r\n            $v_header['index'] = $i;\r\n\r\n            // ----- Store the file position\r\n            $v_pos_entry = ftell($this->zip_fd);\r\n\r\n            // ----- Look for the specific extract rules\r\n            $v_extract = false;\r\n\r\n            // ----- Look for extract by name rule\r\n            if ((isset($p_options[PCLZIP_OPT_BY_NAME]))\r\n                && ($p_options[PCLZIP_OPT_BY_NAME] != 0)\r\n            ) {\r\n\r\n                // ----- Look if the filename is in the list\r\n                for ($j = 0; ($j < sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_extract); $j++) {\r\n\r\n                    // ----- Look for a directory\r\n                    if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == \"/\") {\r\n\r\n                        // ----- Look if the directory is in the filename path\r\n                        if ((strlen($v_header['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))\r\n                            && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))\r\n                                == $p_options[PCLZIP_OPT_BY_NAME][$j])\r\n                        ) {\r\n                            $v_extract = true;\r\n                        }\r\n                    } // ----- Look for a filename\r\n                    elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {\r\n                        $v_extract = true;\r\n                    }\r\n                }\r\n            } // ----- Look for extract by ereg rule\r\n            // ereg() is deprecated with PHP 5.3\r\n            /* \r\n      else if (   (isset($p_options[PCLZIP_OPT_BY_EREG]))\r\n               && ($p_options[PCLZIP_OPT_BY_EREG] != \"\")) {\r\n\r\n          if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) {\r\n              $v_extract = true;\r\n          }\r\n      }\r\n      */\r\n\r\n            // ----- Look for extract by preg rule\r\n            else {\r\n                if ((isset($p_options[PCLZIP_OPT_BY_PREG]))\r\n                    && ($p_options[PCLZIP_OPT_BY_PREG] != \"\")\r\n                ) {\r\n\r\n                    if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) {\r\n                        $v_extract = true;\r\n                    }\r\n                } // ----- Look for extract by index rule\r\n                else {\r\n                    if ((isset($p_options[PCLZIP_OPT_BY_INDEX]))\r\n                        && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)\r\n                    ) {\r\n\r\n                        // ----- Look if the index is in the list\r\n                        for ($j = $j_start; ($j < sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) {\r\n\r\n                            if (($i >= $p_options[PCLZIP_OPT_BY_INDEX][$j]['start'])\r\n                                && ($i <= $p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])\r\n                            ) {\r\n                                $v_extract = true;\r\n                            }\r\n                            if ($i >= $p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {\r\n                                $j_start = $j + 1;\r\n                            }\r\n\r\n                            if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start'] > $i) {\r\n                                break;\r\n                            }\r\n                        }\r\n                    } // ----- Look for no rule, which means extract all the archive\r\n                    else {\r\n                        $v_extract = true;\r\n                    }\r\n                }\r\n            }\r\n\r\n            // ----- Check compression method\r\n            if (($v_extract)\r\n                && (($v_header['compression'] != 8)\r\n                    && ($v_header['compression'] != 0))\r\n            ) {\r\n                $v_header['status'] = 'unsupported_compression';\r\n\r\n                // ----- Look for PCLZIP_OPT_STOP_ON_ERROR\r\n                if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))\r\n                    && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)\r\n                ) {\r\n\r\n                    $this->privSwapBackMagicQuotes();\r\n\r\n                    PclZip::privErrorLog(\r\n                        PCLZIP_ERR_UNSUPPORTED_COMPRESSION,\r\n                        \"Filename '\" . $v_header['stored_filename'] . \"' is \"\r\n                            . \"compressed by an unsupported compression \"\r\n                            . \"method (\" . $v_header['compression'] . \") \"\r\n                    );\r\n\r\n                    return PclZip::errorCode();\r\n                }\r\n            }\r\n\r\n            // ----- Check encrypted files\r\n            if (($v_extract) && (($v_header['flag'] & 1) == 1)) {\r\n                $v_header['status'] = 'unsupported_encryption';\r\n\r\n                // ----- Look for PCLZIP_OPT_STOP_ON_ERROR\r\n                if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))\r\n                    && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)\r\n                ) {\r\n\r\n                    $this->privSwapBackMagicQuotes();\r\n\r\n                    PclZip::privErrorLog(\r\n                        PCLZIP_ERR_UNSUPPORTED_ENCRYPTION,\r\n                        \"Unsupported encryption for \"\r\n                            . \" filename '\" . $v_header['stored_filename']\r\n                            . \"'\"\r\n                    );\r\n\r\n                    return PclZip::errorCode();\r\n                }\r\n            }\r\n\r\n            // ----- Look for real extraction\r\n            if (($v_extract) && ($v_header['status'] != 'ok')) {\r\n                $v_result = $this->privConvertHeader2FileInfo(\r\n                    $v_header,\r\n                    $p_file_list[$v_nb_extracted++]\r\n                );\r\n                if ($v_result != 1) {\r\n                    $this->privCloseFd();\r\n                    $this->privSwapBackMagicQuotes();\r\n\r\n                    return $v_result;\r\n                }\r\n\r\n                $v_extract = false;\r\n            }\r\n\r\n            // ----- Look for real extraction\r\n            if ($v_extract) {\r\n\r\n                // ----- Go to the file position\r\n                @rewind($this->zip_fd);\r\n                if (@fseek($this->zip_fd, $v_header['offset'])) {\r\n                    // ----- Close the zip file\r\n                    $this->privCloseFd();\r\n\r\n                    $this->privSwapBackMagicQuotes();\r\n\r\n                    // ----- Error log\r\n                    PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');\r\n\r\n                    // ----- Return\r\n                    return PclZip::errorCode();\r\n                }\r\n\r\n                // ----- Look for extraction as string\r\n                if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) {\r\n\r\n                    $v_string = '';\r\n\r\n                    // ----- Extracting the file\r\n                    $v_result1 = $this->privExtractFileAsString($v_header, $v_string, $p_options);\r\n                    if ($v_result1 < 1) {\r\n                        $this->privCloseFd();\r\n                        $this->privSwapBackMagicQuotes();\r\n\r\n                        return $v_result1;\r\n                    }\r\n\r\n                    // ----- Get the only interesting attributes\r\n                    if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1\r\n                    ) {\r\n                        // ----- Close the zip file\r\n                        $this->privCloseFd();\r\n                        $this->privSwapBackMagicQuotes();\r\n\r\n                        return $v_result;\r\n                    }\r\n\r\n                    // ----- Set the file content\r\n                    $p_file_list[$v_nb_extracted]['content'] = $v_string;\r\n\r\n                    // ----- Next extracted file\r\n                    $v_nb_extracted++;\r\n\r\n                    // ----- Look for user callback abort\r\n                    if ($v_result1 == 2) {\r\n                        break;\r\n                    }\r\n                } // ----- Look for extraction in standard output\r\n                elseif ((isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT]))\r\n                    && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])\r\n                ) {\r\n                    // ----- Extracting the file in standard output\r\n                    $v_result1 = $this->privExtractFileInOutput($v_header, $p_options);\r\n                    if ($v_result1 < 1) {\r\n                        $this->privCloseFd();\r\n                        $this->privSwapBackMagicQuotes();\r\n\r\n                        return $v_result1;\r\n                    }\r\n\r\n                    // ----- Get the only interesting attributes\r\n                    if (\r\n                        ($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1\r\n                    ) {\r\n                        $this->privCloseFd();\r\n                        $this->privSwapBackMagicQuotes();\r\n\r\n                        return $v_result;\r\n                    }\r\n\r\n                    // ----- Look for user callback abort\r\n                    if ($v_result1 == 2) {\r\n                        break;\r\n                    }\r\n                } // ----- Look for normal extraction\r\n                else {\r\n                    // ----- Extracting the file\r\n                    $v_result1 = $this->privExtractFile(\r\n                        $v_header,\r\n                        $p_path, $p_remove_path,\r\n                        $p_remove_all_path,\r\n                        $p_options\r\n                    );\r\n                    if ($v_result1 < 1) {\r\n                        $this->privCloseFd();\r\n                        $this->privSwapBackMagicQuotes();\r\n\r\n                        return $v_result1;\r\n                    }\r\n\r\n                    // ----- Get the only interesting attributes\r\n                    if (\r\n                        ($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1\r\n                    ) {\r\n                        // ----- Close the zip file\r\n                        $this->privCloseFd();\r\n                        $this->privSwapBackMagicQuotes();\r\n\r\n                        return $v_result;\r\n                    }\r\n\r\n                    // ----- Look for user callback abort\r\n                    if ($v_result1 == 2) {\r\n                        break;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- Close the zip file\r\n        $this->privCloseFd();\r\n        $this->privSwapBackMagicQuotes();\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privExtractFile()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    //\r\n    // 1 : ... ?\r\n    // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback\r\n    // --------------------------------------------------------------------------------\r\n    function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Read the file header\r\n        if (($v_result = $this->privReadFileHeader($v_header)) != 1) {\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n\r\n        // ----- Check that the file header is coherent with $p_entry info\r\n        if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {\r\n            // TBC\r\n        }\r\n\r\n        // ----- Look for all path to remove\r\n        if ($p_remove_all_path == true) {\r\n            // ----- Look for folder entry that not need to be extracted\r\n            if (($p_entry['external'] & 0x00000010) == 0x00000010) {\r\n\r\n                $p_entry['status'] = \"filtered\";\r\n\r\n                return $v_result;\r\n            }\r\n\r\n            // ----- Get the basename of the path\r\n            $p_entry['filename'] = basename($p_entry['filename']);\r\n        } // ----- Look for path to remove\r\n        else {\r\n            if ($p_remove_path != \"\") {\r\n                if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) {\r\n\r\n                    // ----- Change the file status\r\n                    $p_entry['status'] = \"filtered\";\r\n\r\n                    // ----- Return\r\n                    return $v_result;\r\n                }\r\n\r\n                $p_remove_path_size = strlen($p_remove_path);\r\n                if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path) {\r\n\r\n                    // ----- Remove the path\r\n                    $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size);\r\n\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- Add the path\r\n        if ($p_path != '') {\r\n            $p_entry['filename'] = $p_path . \"/\" . $p_entry['filename'];\r\n        }\r\n\r\n        // ----- Check a base_dir_restriction\r\n        if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) {\r\n            $v_inclusion\r\n                = PclZipUtilPathInclusion(\r\n                $p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION],\r\n                $p_entry['filename']\r\n            );\r\n            if ($v_inclusion == 0) {\r\n\r\n                PclZip::privErrorLog(\r\n                    PCLZIP_ERR_DIRECTORY_RESTRICTION,\r\n                    \"Filename '\" . $p_entry['filename'] . \"' is \"\r\n                        . \"outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION\"\r\n                );\r\n\r\n                return PclZip::errorCode();\r\n            }\r\n        }\r\n\r\n        // ----- Look for pre-extract callback\r\n        if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {\r\n\r\n            // ----- Generate a local information\r\n            $v_local_header = array();\r\n            $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\r\n\r\n            // ----- Call the callback\r\n            // Here I do not use call_user_func() because I need to send a reference to the\r\n            // header.\r\n//      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');\r\n            $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);\r\n            if ($v_result == 0) {\r\n                // ----- Change the file status\r\n                $p_entry['status'] = \"skipped\";\r\n                $v_result          = 1;\r\n            }\r\n\r\n            // ----- Look for abort result\r\n            if ($v_result == 2) {\r\n                // ----- This status is internal and will be changed in 'skipped'\r\n                $p_entry['status'] = \"aborted\";\r\n                $v_result          = PCLZIP_ERR_USER_ABORTED;\r\n            }\r\n\r\n            // ----- Update the informations\r\n            // Only some fields can be modified\r\n            $p_entry['filename'] = $v_local_header['filename'];\r\n        }\r\n\r\n\r\n        // ----- Look if extraction should be done\r\n        if ($p_entry['status'] == 'ok') {\r\n\r\n            // ----- Look for specific actions while the file exist\r\n            if (file_exists($p_entry['filename'])) {\r\n\r\n                // ----- Look if file is a directory\r\n                if (is_dir($p_entry['filename'])) {\r\n\r\n                    // ----- Change the file status\r\n                    $p_entry['status'] = \"already_a_directory\";\r\n\r\n                    // ----- Look for PCLZIP_OPT_STOP_ON_ERROR\r\n                    // For historical reason first PclZip implementation does not stop\r\n                    // when this kind of error occurs.\r\n                    if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))\r\n                        && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)\r\n                    ) {\r\n\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_ALREADY_A_DIRECTORY,\r\n                            \"Filename '\" . $p_entry['filename'] . \"' is \"\r\n                                . \"already used by an existing directory\"\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n                } // ----- Look if file is write protected\r\n                else {\r\n                    if (!is_writeable($p_entry['filename'])) {\r\n\r\n                        // ----- Change the file status\r\n                        $p_entry['status'] = \"write_protected\";\r\n\r\n                        // ----- Look for PCLZIP_OPT_STOP_ON_ERROR\r\n                        // For historical reason first PclZip implementation does not stop\r\n                        // when this kind of error occurs.\r\n                        if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))\r\n                            && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)\r\n                        ) {\r\n\r\n                            PclZip::privErrorLog(\r\n                                PCLZIP_ERR_WRITE_OPEN_FAIL,\r\n                                \"Filename '\" . $p_entry['filename'] . \"' exists \"\r\n                                    . \"and is write protected\"\r\n                            );\r\n\r\n                            return PclZip::errorCode();\r\n                        }\r\n                    } // ----- Look if the extracted file is older\r\n                    else {\r\n                        if (filemtime($p_entry['filename']) > $p_entry['mtime']) {\r\n                            // ----- Change the file status\r\n                            if ((isset($p_options[PCLZIP_OPT_REPLACE_NEWER]))\r\n                                && ($p_options[PCLZIP_OPT_REPLACE_NEWER] === true)\r\n                            ) {\r\n                            } else {\r\n                                $p_entry['status'] = \"newer_exist\";\r\n\r\n                                // ----- Look for PCLZIP_OPT_STOP_ON_ERROR\r\n                                // For historical reason first PclZip implementation does not stop\r\n                                // when this kind of error occurs.\r\n                                if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))\r\n                                    && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)\r\n                                ) {\r\n\r\n                                    PclZip::privErrorLog(\r\n                                        PCLZIP_ERR_WRITE_OPEN_FAIL,\r\n                                        \"Newer version of '\" . $p_entry['filename'] . \"' exists \"\r\n                                            . \"and option PCLZIP_OPT_REPLACE_NEWER is not selected\"\r\n                                    );\r\n\r\n                                    return PclZip::errorCode();\r\n                                }\r\n                            }\r\n                        } else {\r\n                        }\r\n                    }\r\n                }\r\n            } // ----- Check the directory availability and create it if necessary\r\n            else {\r\n                if ((($p_entry['external'] & 0x00000010) == 0x00000010) || (substr($p_entry['filename'], -1) == '/')) {\r\n                    $v_dir_to_check = $p_entry['filename'];\r\n                } else {\r\n                    if (!strstr($p_entry['filename'], \"/\")) {\r\n                        $v_dir_to_check = \"\";\r\n                    } else {\r\n                        $v_dir_to_check = dirname($p_entry['filename']);\r\n                    }\r\n                }\r\n\r\n                if ((\r\n                $v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external'] & 0x00000010) == 0x00000010)))\r\n                    != 1\r\n                ) {\r\n\r\n                    // ----- Change the file status\r\n                    $p_entry['status'] = \"path_creation_fail\";\r\n\r\n                    // ----- Return\r\n                    //return $v_result;\r\n                    $v_result = 1;\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- Look if extraction should be done\r\n        if ($p_entry['status'] == 'ok') {\r\n\r\n            // ----- Do the extraction (if not a folder)\r\n            if (!(($p_entry['external'] & 0x00000010) == 0x00000010)) {\r\n                // ----- Look for not compressed file\r\n                if ($p_entry['compression'] == 0) {\r\n\r\n                    // ----- Opening destination file\r\n                    if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {\r\n\r\n                        // ----- Change the file status\r\n                        $p_entry['status'] = \"write_error\";\r\n\r\n                        // ----- Return\r\n                        return $v_result;\r\n                    }\r\n\r\n\r\n                    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks\r\n                    $v_size = $p_entry['compressed_size'];\r\n                    while ($v_size != 0) {\r\n                        $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\r\n                        $v_buffer    = @fread($this->zip_fd, $v_read_size);\r\n                        /* Try to speed up the code\r\n            $v_binary_data = pack('a'.$v_read_size, $v_buffer);\r\n            @fwrite($v_dest_file, $v_binary_data, $v_read_size);\r\n            */\r\n                        @fwrite($v_dest_file, $v_buffer, $v_read_size);\r\n                        $v_size -= $v_read_size;\r\n                    }\r\n\r\n                    // ----- Closing the destination file\r\n                    fclose($v_dest_file);\r\n\r\n                    // ----- Change the file mtime\r\n                    touch($p_entry['filename'], $p_entry['mtime']);\r\n\r\n\r\n                } else {\r\n                    // ----- TBC\r\n                    // Need to be finished\r\n                    if (($p_entry['flag'] & 1) == 1) {\r\n                        PclZip::privErrorLog(\r\n                            PCLZIP_ERR_UNSUPPORTED_ENCRYPTION,\r\n                            'File \\'' . $p_entry['filename'] . '\\' is encrypted. Encrypted files are not supported.'\r\n                        );\r\n\r\n                        return PclZip::errorCode();\r\n                    }\r\n\r\n\r\n                    // ----- Look for using temporary file to unzip\r\n                    if ((!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))\r\n                        && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])\r\n                            || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])\r\n                                && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])))\r\n                    ) {\r\n                        $v_result = $this->privExtractFileUsingTempFile($p_entry, $p_options);\r\n                        if ($v_result < PCLZIP_ERR_NO_ERROR) {\r\n                            return $v_result;\r\n                        }\r\n                    } // ----- Look for extract in memory\r\n                    else {\r\n\r\n\r\n                        // ----- Read the compressed file in a buffer (one shot)\r\n                        $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);\r\n\r\n                        // ----- Decompress the file\r\n                        $v_file_content = @gzinflate($v_buffer);\r\n                        unset($v_buffer);\r\n                        if ($v_file_content === false) {\r\n\r\n                            // ----- Change the file status\r\n                            // TBC\r\n                            $p_entry['status'] = \"error\";\r\n\r\n                            return $v_result;\r\n                        }\r\n\r\n                        // ----- Opening destination file\r\n                        if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {\r\n\r\n                            // ----- Change the file status\r\n                            $p_entry['status'] = \"write_error\";\r\n\r\n                            return $v_result;\r\n                        }\r\n\r\n                        // ----- Write the uncompressed data\r\n                        @fwrite($v_dest_file, $v_file_content, $p_entry['size']);\r\n                        unset($v_file_content);\r\n\r\n                        // ----- Closing the destination file\r\n                        @fclose($v_dest_file);\r\n\r\n                    }\r\n\r\n                    // ----- Change the file mtime\r\n                    @touch($p_entry['filename'], $p_entry['mtime']);\r\n                }\r\n\r\n                // ----- Look for chmod option\r\n                if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) {\r\n\r\n                    // ----- Change the mode of the file\r\n                    @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]);\r\n                }\r\n\r\n            }\r\n        }\r\n\r\n        // ----- Change abort status\r\n        if ($p_entry['status'] == \"aborted\") {\r\n            $p_entry['status'] = \"skipped\";\r\n        } // ----- Look for post-extract callback\r\n        elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {\r\n\r\n            // ----- Generate a local information\r\n            $v_local_header = array();\r\n            $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\r\n\r\n            // ----- Call the callback\r\n            // Here I do not use call_user_func() because I need to send a reference to the\r\n            // header.\r\n//      eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');\r\n            $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);\r\n\r\n            // ----- Look for abort result\r\n            if ($v_result == 2) {\r\n                $v_result = PCLZIP_ERR_USER_ABORTED;\r\n            }\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privExtractFileUsingTempFile()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privExtractFileUsingTempFile(&$p_entry, &$p_options)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Creates a temporary file\r\n        $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR . uniqid('pclzip-') . '.gz';\r\n        if (($v_dest_file = @fopen($v_gzip_temp_name, \"wb\")) == 0) {\r\n            fclose($v_file);\r\n            PclZip::privErrorLog(\r\n                PCLZIP_ERR_WRITE_OPEN_FAIL,\r\n                'Unable to open temporary file \\'' . $v_gzip_temp_name . '\\' in binary write mode'\r\n            );\r\n\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n\r\n        // ----- Write gz file format header\r\n        $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3));\r\n        @fwrite($v_dest_file, $v_binary_data, 10);\r\n\r\n        // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks\r\n        $v_size = $p_entry['compressed_size'];\r\n        while ($v_size != 0) {\r\n            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\r\n            $v_buffer    = @fread($this->zip_fd, $v_read_size);\r\n            //$v_binary_data = pack('a'.$v_read_size, $v_buffer);\r\n            @fwrite($v_dest_file, $v_buffer, $v_read_size);\r\n            $v_size -= $v_read_size;\r\n        }\r\n\r\n        // ----- Write gz file format footer\r\n        $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']);\r\n        @fwrite($v_dest_file, $v_binary_data, 8);\r\n\r\n        // ----- Close the temporary file\r\n        @fclose($v_dest_file);\r\n\r\n        // ----- Opening destination file\r\n        if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {\r\n            $p_entry['status'] = \"write_error\";\r\n\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Open the temporary gz file\r\n        if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) {\r\n            @fclose($v_dest_file);\r\n            $p_entry['status'] = \"read_error\";\r\n            PclZip::privErrorLog(\r\n                PCLZIP_ERR_READ_OPEN_FAIL,\r\n                'Unable to open temporary file \\'' . $v_gzip_temp_name . '\\' in binary read mode'\r\n            );\r\n\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n\r\n        // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks\r\n        $v_size = $p_entry['size'];\r\n        while ($v_size != 0) {\r\n            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\r\n            $v_buffer    = @gzread($v_src_file, $v_read_size);\r\n            //$v_binary_data = pack('a'.$v_read_size, $v_buffer);\r\n            @fwrite($v_dest_file, $v_buffer, $v_read_size);\r\n            $v_size -= $v_read_size;\r\n        }\r\n        @fclose($v_dest_file);\r\n        @gzclose($v_src_file);\r\n\r\n        // ----- Delete the temporary file\r\n        @unlink($v_gzip_temp_name);\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privExtractFileInOutput()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privExtractFileInOutput(&$p_entry, &$p_options)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Read the file header\r\n        if (($v_result = $this->privReadFileHeader($v_header)) != 1) {\r\n            return $v_result;\r\n        }\r\n\r\n\r\n        // ----- Check that the file header is coherent with $p_entry info\r\n        if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {\r\n            // TBC\r\n        }\r\n\r\n        // ----- Look for pre-extract callback\r\n        if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {\r\n\r\n            // ----- Generate a local information\r\n            $v_local_header = array();\r\n            $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\r\n\r\n            // ----- Call the callback\r\n            // Here I do not use call_user_func() because I need to send a reference to the\r\n            // header.\r\n//      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');\r\n            $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);\r\n            if ($v_result == 0) {\r\n                // ----- Change the file status\r\n                $p_entry['status'] = \"skipped\";\r\n                $v_result          = 1;\r\n            }\r\n\r\n            // ----- Look for abort result\r\n            if ($v_result == 2) {\r\n                // ----- This status is internal and will be changed in 'skipped'\r\n                $p_entry['status'] = \"aborted\";\r\n                $v_result          = PCLZIP_ERR_USER_ABORTED;\r\n            }\r\n\r\n            // ----- Update the informations\r\n            // Only some fields can be modified\r\n            $p_entry['filename'] = $v_local_header['filename'];\r\n        }\r\n\r\n        // ----- Trace\r\n\r\n        // ----- Look if extraction should be done\r\n        if ($p_entry['status'] == 'ok') {\r\n\r\n            // ----- Do the extraction (if not a folder)\r\n            if (!(($p_entry['external'] & 0x00000010) == 0x00000010)) {\r\n                // ----- Look for not compressed file\r\n                if ($p_entry['compressed_size'] == $p_entry['size']) {\r\n\r\n                    // ----- Read the file in a buffer (one shot)\r\n                    $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);\r\n\r\n                    // ----- Send the file to the output\r\n                    echo $v_buffer;\r\n                    unset($v_buffer);\r\n                } else {\r\n\r\n                    // ----- Read the compressed file in a buffer (one shot)\r\n                    $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);\r\n\r\n                    // ----- Decompress the file\r\n                    $v_file_content = gzinflate($v_buffer);\r\n                    unset($v_buffer);\r\n\r\n                    // ----- Send the file to the output\r\n                    echo $v_file_content;\r\n                    unset($v_file_content);\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- Change abort status\r\n        if ($p_entry['status'] == \"aborted\") {\r\n            $p_entry['status'] = \"skipped\";\r\n        } // ----- Look for post-extract callback\r\n        elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {\r\n\r\n            // ----- Generate a local information\r\n            $v_local_header = array();\r\n            $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\r\n\r\n            // ----- Call the callback\r\n            // Here I do not use call_user_func() because I need to send a reference to the\r\n            // header.\r\n//      eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');\r\n            $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);\r\n\r\n            // ----- Look for abort result\r\n            if ($v_result == 2) {\r\n                $v_result = PCLZIP_ERR_USER_ABORTED;\r\n            }\r\n        }\r\n\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privExtractFileAsString()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privExtractFileAsString(&$p_entry, &$p_string, &$p_options)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Read the file header\r\n        $v_header = array();\r\n        if (($v_result = $this->privReadFileHeader($v_header)) != 1) {\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n\r\n        // ----- Check that the file header is coherent with $p_entry info\r\n        if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {\r\n            // TBC\r\n        }\r\n\r\n        // ----- Look for pre-extract callback\r\n        if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {\r\n\r\n            // ----- Generate a local information\r\n            $v_local_header = array();\r\n            $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\r\n\r\n            // ----- Call the callback\r\n            // Here I do not use call_user_func() because I need to send a reference to the\r\n            // header.\r\n//      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');\r\n            $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);\r\n            if ($v_result == 0) {\r\n                // ----- Change the file status\r\n                $p_entry['status'] = \"skipped\";\r\n                $v_result          = 1;\r\n            }\r\n\r\n            // ----- Look for abort result\r\n            if ($v_result == 2) {\r\n                // ----- This status is internal and will be changed in 'skipped'\r\n                $p_entry['status'] = \"aborted\";\r\n                $v_result          = PCLZIP_ERR_USER_ABORTED;\r\n            }\r\n\r\n            // ----- Update the informations\r\n            // Only some fields can be modified\r\n            $p_entry['filename'] = $v_local_header['filename'];\r\n        }\r\n\r\n\r\n        // ----- Look if extraction should be done\r\n        if ($p_entry['status'] == 'ok') {\r\n\r\n            // ----- Do the extraction (if not a folder)\r\n            if (!(($p_entry['external'] & 0x00000010) == 0x00000010)) {\r\n                // ----- Look for not compressed file\r\n                //      if ($p_entry['compressed_size'] == $p_entry['size'])\r\n                if ($p_entry['compression'] == 0) {\r\n\r\n                    // ----- Reading the file\r\n                    $p_string = @fread($this->zip_fd, $p_entry['compressed_size']);\r\n                } else {\r\n\r\n                    // ----- Reading the file\r\n                    $v_data = @fread($this->zip_fd, $p_entry['compressed_size']);\r\n\r\n                    // ----- Decompress the file\r\n                    if (($p_string = @gzinflate($v_data)) === false) {\r\n                        // TBC\r\n                    }\r\n                }\r\n\r\n                // ----- Trace\r\n            } else {\r\n                // TBC : error : can not extract a folder in a string\r\n            }\r\n\r\n        }\r\n\r\n        // ----- Change abort status\r\n        if ($p_entry['status'] == \"aborted\") {\r\n            $p_entry['status'] = \"skipped\";\r\n        } // ----- Look for post-extract callback\r\n        elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {\r\n\r\n            // ----- Generate a local information\r\n            $v_local_header = array();\r\n            $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\r\n\r\n            // ----- Swap the content to header\r\n            $v_local_header['content'] = $p_string;\r\n            $p_string                  = '';\r\n\r\n            // ----- Call the callback\r\n            // Here I do not use call_user_func() because I need to send a reference to the\r\n            // header.\r\n//      eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');\r\n            $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);\r\n\r\n            // ----- Swap back the content to header\r\n            $p_string = $v_local_header['content'];\r\n            unset($v_local_header['content']);\r\n\r\n            // ----- Look for abort result\r\n            if ($v_result == 2) {\r\n                $v_result = PCLZIP_ERR_USER_ABORTED;\r\n            }\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privReadFileHeader()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privReadFileHeader(&$p_header)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Read the 4 bytes signature\r\n        $v_binary_data = @fread($this->zip_fd, 4);\r\n        $v_data        = unpack('Vid', $v_binary_data);\r\n\r\n        // ----- Check signature\r\n        if ($v_data['id'] != 0x04034b50) {\r\n\r\n            // ----- Error log\r\n            PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Read the first 42 bytes of the header\r\n        $v_binary_data = fread($this->zip_fd, 26);\r\n\r\n        // ----- Look for invalid block size\r\n        if (strlen($v_binary_data) != 26) {\r\n            $p_header['filename'] = \"\";\r\n            $p_header['status']   = \"invalid_header\";\r\n\r\n            // ----- Error log\r\n            PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Invalid block size : \" . strlen($v_binary_data));\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Extract the values\r\n        $v_data = unpack(\r\n            'vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len',\r\n            $v_binary_data\r\n        );\r\n\r\n        // ----- Get filename\r\n        $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']);\r\n\r\n        // ----- Get extra_fields\r\n        if ($v_data['extra_len'] != 0) {\r\n            $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']);\r\n        } else {\r\n            $p_header['extra'] = '';\r\n        }\r\n\r\n        // ----- Extract properties\r\n        $p_header['version_extracted'] = $v_data['version'];\r\n        $p_header['compression']       = $v_data['compression'];\r\n        $p_header['size']              = $v_data['size'];\r\n        $p_header['compressed_size']   = $v_data['compressed_size'];\r\n        $p_header['crc']               = $v_data['crc'];\r\n        $p_header['flag']              = $v_data['flag'];\r\n        $p_header['filename_len']      = $v_data['filename_len'];\r\n\r\n        // ----- Recuperate date in UNIX format\r\n        $p_header['mdate'] = $v_data['mdate'];\r\n        $p_header['mtime'] = $v_data['mtime'];\r\n        if ($p_header['mdate'] && $p_header['mtime']) {\r\n            // ----- Extract time\r\n            $v_hour    = ($p_header['mtime'] & 0xF800) >> 11;\r\n            $v_minute  = ($p_header['mtime'] & 0x07E0) >> 5;\r\n            $v_seconde = ($p_header['mtime'] & 0x001F) * 2;\r\n\r\n            // ----- Extract date\r\n            $v_year  = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;\r\n            $v_month = ($p_header['mdate'] & 0x01E0) >> 5;\r\n            $v_day   = $p_header['mdate'] & 0x001F;\r\n\r\n            // ----- Get UNIX date format\r\n            $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);\r\n\r\n        } else {\r\n            $p_header['mtime'] = time();\r\n        }\r\n\r\n        // TBC\r\n        //for(reset($v_data); $key = key($v_data); next($v_data)) {\r\n        //}\r\n\r\n        // ----- Set the stored filename\r\n        $p_header['stored_filename'] = $p_header['filename'];\r\n\r\n        // ----- Set the status field\r\n        $p_header['status'] = \"ok\";\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privReadCentralFileHeader()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privReadCentralFileHeader(&$p_header)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Read the 4 bytes signature\r\n        $v_binary_data = @fread($this->zip_fd, 4);\r\n        $v_data        = unpack('Vid', $v_binary_data);\r\n\r\n        // ----- Check signature\r\n        if ($v_data['id'] != 0x02014b50) {\r\n\r\n            // ----- Error log\r\n            PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Read the first 42 bytes of the header\r\n        $v_binary_data = fread($this->zip_fd, 42);\r\n\r\n        // ----- Look for invalid block size\r\n        if (strlen($v_binary_data) != 42) {\r\n            $p_header['filename'] = \"\";\r\n            $p_header['status']   = \"invalid_header\";\r\n\r\n            // ----- Error log\r\n            PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Invalid block size : \" . strlen($v_binary_data));\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Extract the values\r\n        $p_header = unpack(\r\n            'vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset',\r\n            $v_binary_data\r\n        );\r\n\r\n        // ----- Get filename\r\n        if ($p_header['filename_len'] != 0) {\r\n            $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']);\r\n        } else {\r\n            $p_header['filename'] = '';\r\n        }\r\n\r\n        // ----- Get extra\r\n        if ($p_header['extra_len'] != 0) {\r\n            $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']);\r\n        } else {\r\n            $p_header['extra'] = '';\r\n        }\r\n\r\n        // ----- Get comment\r\n        if ($p_header['comment_len'] != 0) {\r\n            $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']);\r\n        } else {\r\n            $p_header['comment'] = '';\r\n        }\r\n\r\n        // ----- Extract properties\r\n\r\n        // ----- Recuperate date in UNIX format\r\n        //if ($p_header['mdate'] && $p_header['mtime'])\r\n        // TBC : bug : this was ignoring time with 0/0/0\r\n        if (1) {\r\n            // ----- Extract time\r\n            $v_hour    = ($p_header['mtime'] & 0xF800) >> 11;\r\n            $v_minute  = ($p_header['mtime'] & 0x07E0) >> 5;\r\n            $v_seconde = ($p_header['mtime'] & 0x001F) * 2;\r\n\r\n            // ----- Extract date\r\n            $v_year  = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;\r\n            $v_month = ($p_header['mdate'] & 0x01E0) >> 5;\r\n            $v_day   = $p_header['mdate'] & 0x001F;\r\n\r\n            // ----- Get UNIX date format\r\n            $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);\r\n\r\n        } else {\r\n            $p_header['mtime'] = time();\r\n        }\r\n\r\n        // ----- Set the stored filename\r\n        $p_header['stored_filename'] = $p_header['filename'];\r\n\r\n        // ----- Set default status to ok\r\n        $p_header['status'] = 'ok';\r\n\r\n        // ----- Look if it is a directory\r\n        if (substr($p_header['filename'], -1) == '/') {\r\n            //$p_header['external'] = 0x41FF0010;\r\n            $p_header['external'] = 0x00000010;\r\n        }\r\n\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privCheckFileHeaders()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    //   1 on success,\r\n    //   0 on error;\r\n    // --------------------------------------------------------------------------------\r\n    function privCheckFileHeaders(&$p_local_header, &$p_central_header)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Check the static values\r\n        // TBC\r\n        if ($p_local_header['filename'] != $p_central_header['filename']) {\r\n        }\r\n        if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) {\r\n        }\r\n        if ($p_local_header['flag'] != $p_central_header['flag']) {\r\n        }\r\n        if ($p_local_header['compression'] != $p_central_header['compression']) {\r\n        }\r\n        if ($p_local_header['mtime'] != $p_central_header['mtime']) {\r\n        }\r\n        if ($p_local_header['filename_len'] != $p_central_header['filename_len']) {\r\n        }\r\n\r\n        // ----- Look for flag bit 3\r\n        if (($p_local_header['flag'] & 8) == 8) {\r\n            $p_local_header['size']            = $p_central_header['size'];\r\n            $p_local_header['compressed_size'] = $p_central_header['compressed_size'];\r\n            $p_local_header['crc']             = $p_central_header['crc'];\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privReadEndCentralDir()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privReadEndCentralDir(&$p_central_dir)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Go to the end of the zip file\r\n        $v_size = filesize($this->zipname);\r\n        @fseek($this->zip_fd, $v_size);\r\n        if (@ftell($this->zip_fd) != $v_size) {\r\n            // ----- Error log\r\n            PclZip::privErrorLog(\r\n                PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \\'' . $this->zipname . '\\''\r\n            );\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- First try : look if this is an archive with no commentaries (most of the time)\r\n        // in this case the end of central dir is at 22 bytes of the file end\r\n        $v_found = 0;\r\n        if ($v_size > 26) {\r\n            @fseek($this->zip_fd, $v_size - 22);\r\n            if (($v_pos = @ftell($this->zip_fd)) != ($v_size - 22)) {\r\n                // ----- Error log\r\n                PclZip::privErrorLog(\r\n                    PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \\'' . $this->zipname . '\\''\r\n                );\r\n\r\n                // ----- Return\r\n                return PclZip::errorCode();\r\n            }\r\n\r\n            // ----- Read for bytes\r\n            $v_binary_data = @fread($this->zip_fd, 4);\r\n            $v_data        = @unpack('Vid', $v_binary_data);\r\n\r\n            // ----- Check signature\r\n            if ($v_data['id'] == 0x06054b50) {\r\n                $v_found = 1;\r\n            }\r\n\r\n            $v_pos = ftell($this->zip_fd);\r\n        }\r\n\r\n        // ----- Go back to the maximum possible size of the Central Dir End Record\r\n        if (!$v_found) {\r\n            $v_maximum_size = 65557; // 0xFFFF + 22;\r\n            if ($v_maximum_size > $v_size) {\r\n                $v_maximum_size = $v_size;\r\n            }\r\n            @fseek($this->zip_fd, $v_size - $v_maximum_size);\r\n            if (@ftell($this->zip_fd) != ($v_size - $v_maximum_size)) {\r\n                // ----- Error log\r\n                PclZip::privErrorLog(\r\n                    PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \\'' . $this->zipname . '\\''\r\n                );\r\n\r\n                // ----- Return\r\n                return PclZip::errorCode();\r\n            }\r\n\r\n            // ----- Read byte per byte in order to find the signature\r\n            $v_pos   = ftell($this->zip_fd);\r\n            $v_bytes = 0x00000000;\r\n            while ($v_pos < $v_size) {\r\n                // ----- Read a byte\r\n                $v_byte = @fread($this->zip_fd, 1);\r\n\r\n                // -----  Add the byte\r\n                //$v_bytes = ($v_bytes << 8) | Ord($v_byte);\r\n                // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number \r\n                // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. \r\n                $v_bytes = (($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);\r\n\r\n                // ----- Compare the bytes\r\n                if ($v_bytes == 0x504b0506) {\r\n                    $v_pos++;\r\n                    break;\r\n                }\r\n\r\n                $v_pos++;\r\n            }\r\n\r\n            // ----- Look if not found end of central dir\r\n            if ($v_pos == $v_size) {\r\n\r\n                // ----- Error log\r\n                PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Unable to find End of Central Dir Record signature\");\r\n\r\n                // ----- Return\r\n                return PclZip::errorCode();\r\n            }\r\n        }\r\n\r\n        // ----- Read the first 18 bytes of the header\r\n        $v_binary_data = fread($this->zip_fd, 18);\r\n\r\n        // ----- Look for invalid block size\r\n        if (strlen($v_binary_data) != 18) {\r\n\r\n            // ----- Error log\r\n            PclZip::privErrorLog(\r\n                PCLZIP_ERR_BAD_FORMAT, \"Invalid End of Central Dir Record size : \" . strlen($v_binary_data)\r\n            );\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Extract the values\r\n        $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data);\r\n\r\n        // ----- Check the global size\r\n        if (($v_pos + $v_data['comment_size'] + 18) != $v_size) {\r\n\r\n            // ----- Removed in release 2.2 see readme file\r\n            // The check of the file size is a little too strict.\r\n            // Some bugs where found when a zip is encrypted/decrypted with 'crypt'.\r\n            // While decrypted, zip has training 0 bytes\r\n            if (0) {\r\n                // ----- Error log\r\n                PclZip::privErrorLog(\r\n                    PCLZIP_ERR_BAD_FORMAT,\r\n                    'The central dir is not at the end of the archive.'\r\n                        . ' Some trailing bytes exists after the archive.'\r\n                );\r\n\r\n                // ----- Return\r\n                return PclZip::errorCode();\r\n            }\r\n        }\r\n\r\n        // ----- Get comment\r\n        if ($v_data['comment_size'] != 0) {\r\n            $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']);\r\n        } else {\r\n            $p_central_dir['comment'] = '';\r\n        }\r\n\r\n        $p_central_dir['entries']      = $v_data['entries'];\r\n        $p_central_dir['disk_entries'] = $v_data['disk_entries'];\r\n        $p_central_dir['offset']       = $v_data['offset'];\r\n        $p_central_dir['size']         = $v_data['size'];\r\n        $p_central_dir['disk']         = $v_data['disk'];\r\n        $p_central_dir['disk_start']   = $v_data['disk_start'];\r\n\r\n        // TBC\r\n        //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) {\r\n        //}\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privDeleteByRule()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privDeleteByRule(&$p_result_list, &$p_options)\r\n    {\r\n        $v_result      = 1;\r\n        $v_list_detail = array();\r\n\r\n        // ----- Open the zip file\r\n        if (($v_result = $this->privOpenFd('rb')) != 1) {\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Read the central directory informations\r\n        $v_central_dir = array();\r\n        if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) {\r\n            $this->privCloseFd();\r\n\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Go to beginning of File\r\n        @rewind($this->zip_fd);\r\n\r\n        // ----- Scan all the files\r\n        // ----- Start at beginning of Central Dir\r\n        $v_pos_entry = $v_central_dir['offset'];\r\n        @rewind($this->zip_fd);\r\n        if (@fseek($this->zip_fd, $v_pos_entry)) {\r\n            // ----- Close the zip file\r\n            $this->privCloseFd();\r\n\r\n            // ----- Error log\r\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Read each entry\r\n        $v_header_list = array();\r\n        $j_start       = 0;\r\n        for ($i = 0, $v_nb_extracted = 0; $i < $v_central_dir['entries']; $i++) {\r\n\r\n            // ----- Read the file header\r\n            $v_header_list[$v_nb_extracted] = array();\r\n            if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1) {\r\n                // ----- Close the zip file\r\n                $this->privCloseFd();\r\n\r\n                return $v_result;\r\n            }\r\n\r\n\r\n            // ----- Store the index\r\n            $v_header_list[$v_nb_extracted]['index'] = $i;\r\n\r\n            // ----- Look for the specific extract rules\r\n            $v_found = false;\r\n\r\n            // ----- Look for extract by name rule\r\n            if ((isset($p_options[PCLZIP_OPT_BY_NAME]))\r\n                && ($p_options[PCLZIP_OPT_BY_NAME] != 0)\r\n            ) {\r\n\r\n                // ----- Look if the filename is in the list\r\n                for ($j = 0; ($j < sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_found); $j++) {\r\n\r\n                    // ----- Look for a directory\r\n                    if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == \"/\") {\r\n\r\n                        // ----- Look if the directory is in the filename path\r\n                        if ((strlen($v_header_list[$v_nb_extracted]['stored_filename']) > strlen(\r\n                            $p_options[PCLZIP_OPT_BY_NAME][$j]\r\n                        ))\r\n                            && (substr(\r\n                                $v_header_list[$v_nb_extracted]['stored_filename'], 0,\r\n                                strlen($p_options[PCLZIP_OPT_BY_NAME][$j])\r\n                            ) == $p_options[PCLZIP_OPT_BY_NAME][$j])\r\n                        ) {\r\n                            $v_found = true;\r\n                        } elseif ((($v_header_list[$v_nb_extracted]['external'] & 0x00000010) == 0x00000010)\r\n                            /* Indicates a folder */\r\n                            && ($v_header_list[$v_nb_extracted]['stored_filename'] . '/'\r\n                                == $p_options[PCLZIP_OPT_BY_NAME][$j])\r\n                        ) {\r\n                            $v_found = true;\r\n                        }\r\n                    } // ----- Look for a filename\r\n                    elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {\r\n                        $v_found = true;\r\n                    }\r\n                }\r\n            } // ----- Look for extract by ereg rule\r\n            // ereg() is deprecated with PHP 5.3\r\n            /*\r\n      else if (   (isset($p_options[PCLZIP_OPT_BY_EREG]))\r\n               && ($p_options[PCLZIP_OPT_BY_EREG] != \"\")) {\r\n\r\n          if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {\r\n              $v_found = true;\r\n          }\r\n      }\r\n      */\r\n\r\n            // ----- Look for extract by preg rule\r\n            else {\r\n                if ((isset($p_options[PCLZIP_OPT_BY_PREG]))\r\n                    && ($p_options[PCLZIP_OPT_BY_PREG] != \"\")\r\n                ) {\r\n\r\n                    if (preg_match(\r\n                        $p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename']\r\n                    )\r\n                    ) {\r\n                        $v_found = true;\r\n                    }\r\n                } // ----- Look for extract by index rule\r\n                else {\r\n                    if ((isset($p_options[PCLZIP_OPT_BY_INDEX]))\r\n                        && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)\r\n                    ) {\r\n\r\n                        // ----- Look if the index is in the list\r\n                        for ($j = $j_start; ($j < sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_found); $j++) {\r\n\r\n                            if (($i >= $p_options[PCLZIP_OPT_BY_INDEX][$j]['start'])\r\n                                && ($i <= $p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])\r\n                            ) {\r\n                                $v_found = true;\r\n                            }\r\n                            if ($i >= $p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {\r\n                                $j_start = $j + 1;\r\n                            }\r\n\r\n                            if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start'] > $i) {\r\n                                break;\r\n                            }\r\n                        }\r\n                    } else {\r\n                        $v_found = true;\r\n                    }\r\n                }\r\n            }\r\n\r\n            // ----- Look for deletion\r\n            if ($v_found) {\r\n                unset($v_header_list[$v_nb_extracted]);\r\n            } else {\r\n                $v_nb_extracted++;\r\n            }\r\n        }\r\n\r\n        // ----- Look if something need to be deleted\r\n        if ($v_nb_extracted > 0) {\r\n\r\n            // ----- Creates a temporay file\r\n            $v_zip_temp_name = PCLZIP_TEMPORARY_DIR . uniqid('pclzip-') . '.tmp';\r\n\r\n            // ----- Creates a temporary zip archive\r\n            $v_temp_zip = new PclZip($v_zip_temp_name);\r\n\r\n            // ----- Open the temporary zip file in write mode\r\n            if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) {\r\n                $this->privCloseFd();\r\n\r\n                // ----- Return\r\n                return $v_result;\r\n            }\r\n\r\n            // ----- Look which file need to be kept\r\n            for ($i = 0; $i < sizeof($v_header_list); $i++) {\r\n\r\n                // ----- Calculate the position of the header\r\n                @rewind($this->zip_fd);\r\n                if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) {\r\n                    // ----- Close the zip file\r\n                    $this->privCloseFd();\r\n                    $v_temp_zip->privCloseFd();\r\n                    @unlink($v_zip_temp_name);\r\n\r\n                    // ----- Error log\r\n                    PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');\r\n\r\n                    // ----- Return\r\n                    return PclZip::errorCode();\r\n                }\r\n\r\n                // ----- Read the file header\r\n                $v_local_header = array();\r\n                if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) {\r\n                    // ----- Close the zip file\r\n                    $this->privCloseFd();\r\n                    $v_temp_zip->privCloseFd();\r\n                    @unlink($v_zip_temp_name);\r\n\r\n                    // ----- Return\r\n                    return $v_result;\r\n                }\r\n\r\n                // ----- Check that local file header is same as central file header\r\n                if ($this->privCheckFileHeaders(\r\n                    $v_local_header,\r\n                    $v_header_list[$i]\r\n                ) != 1\r\n                ) {\r\n                    // TBC\r\n                }\r\n                unset($v_local_header);\r\n\r\n                // ----- Write the file header\r\n                if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) {\r\n                    // ----- Close the zip file\r\n                    $this->privCloseFd();\r\n                    $v_temp_zip->privCloseFd();\r\n                    @unlink($v_zip_temp_name);\r\n\r\n                    // ----- Return\r\n                    return $v_result;\r\n                }\r\n\r\n                // ----- Read/write the data block\r\n                if (($v_result = PclZipUtilCopyBlock(\r\n                    $this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size']\r\n                )) != 1\r\n                ) {\r\n                    // ----- Close the zip file\r\n                    $this->privCloseFd();\r\n                    $v_temp_zip->privCloseFd();\r\n                    @unlink($v_zip_temp_name);\r\n\r\n                    // ----- Return\r\n                    return $v_result;\r\n                }\r\n            }\r\n\r\n            // ----- Store the offset of the central dir\r\n            $v_offset = @ftell($v_temp_zip->zip_fd);\r\n\r\n            // ----- Re-Create the Central Dir files header\r\n            for ($i = 0; $i < sizeof($v_header_list); $i++) {\r\n                // ----- Create the file header\r\n                if (($v_result = $v_temp_zip->privWriteCentralFileHeader($v_header_list[$i])) != 1) {\r\n                    $v_temp_zip->privCloseFd();\r\n                    $this->privCloseFd();\r\n                    @unlink($v_zip_temp_name);\r\n\r\n                    // ----- Return\r\n                    return $v_result;\r\n                }\r\n\r\n                // ----- Transform the header to a 'usable' info\r\n                $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);\r\n            }\r\n\r\n\r\n            // ----- Zip file comment\r\n            $v_comment = '';\r\n            if (isset($p_options[PCLZIP_OPT_COMMENT])) {\r\n                $v_comment = $p_options[PCLZIP_OPT_COMMENT];\r\n            }\r\n\r\n            // ----- Calculate the size of the central header\r\n            $v_size = @ftell($v_temp_zip->zip_fd) - $v_offset;\r\n\r\n            // ----- Create the central dir footer\r\n            if ((\r\n            $v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment))\r\n                != 1\r\n            ) {\r\n                // ----- Reset the file list\r\n                unset($v_header_list);\r\n                $v_temp_zip->privCloseFd();\r\n                $this->privCloseFd();\r\n                @unlink($v_zip_temp_name);\r\n\r\n                // ----- Return\r\n                return $v_result;\r\n            }\r\n\r\n            // ----- Close\r\n            $v_temp_zip->privCloseFd();\r\n            $this->privCloseFd();\r\n\r\n            // ----- Delete the zip file\r\n            // TBC : I should test the result ...\r\n            @unlink($this->zipname);\r\n\r\n            // ----- Rename the temporary file\r\n            // TBC : I should test the result ...\r\n            //@rename($v_zip_temp_name, $this->zipname);\r\n            PclZipUtilRename($v_zip_temp_name, $this->zipname);\r\n\r\n            // ----- Destroy the temporary archive\r\n            unset($v_temp_zip);\r\n        } // ----- Remove every files : reset the file\r\n        else {\r\n            if ($v_central_dir['entries'] != 0) {\r\n                $this->privCloseFd();\r\n\r\n                if (($v_result = $this->privOpenFd('wb')) != 1) {\r\n                    return $v_result;\r\n                }\r\n\r\n                if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) {\r\n                    return $v_result;\r\n                }\r\n\r\n                $this->privCloseFd();\r\n            }\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privDirCheck()\r\n    // Description :\r\n    //   Check if a directory exists, if not it creates it and all the parents directory\r\n    //   which may be useful.\r\n    // Parameters :\r\n    //   $p_dir : Directory path to check.\r\n    // Return Values :\r\n    //    1 : OK\r\n    //   -1 : Unable to create directory\r\n    // --------------------------------------------------------------------------------\r\n    function privDirCheck($p_dir, $p_is_dir = false)\r\n    {\r\n        $v_result = 1;\r\n\r\n\r\n        // ----- Remove the final '/'\r\n        if (($p_is_dir) && (substr($p_dir, -1) == '/')) {\r\n            $p_dir = substr($p_dir, 0, strlen($p_dir) - 1);\r\n        }\r\n\r\n        // ----- Check the directory availability\r\n        if ((is_dir($p_dir)) || ($p_dir == \"\")) {\r\n            return 1;\r\n        }\r\n\r\n        // ----- Extract parent directory\r\n        $p_parent_dir = dirname($p_dir);\r\n\r\n        // ----- Just a check\r\n        if ($p_parent_dir != $p_dir) {\r\n            // ----- Look for parent directory\r\n            if ($p_parent_dir != \"\") {\r\n                if (($v_result = $this->privDirCheck($p_parent_dir)) != 1) {\r\n                    return $v_result;\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- Create the directory\r\n        if (!@mkdir($p_dir, 0777)) {\r\n            // ----- Error log\r\n            PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, \"Unable to create directory '$p_dir'\");\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privMerge()\r\n    // Description :\r\n    //   If $p_archive_to_add does not exist, the function exit with a success result.\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privMerge(&$p_archive_to_add)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Look if the archive_to_add exists\r\n        if (!is_file($p_archive_to_add->zipname)) {\r\n\r\n            // ----- Nothing to merge, so merge is a success\r\n            $v_result = 1;\r\n\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Look if the archive exists\r\n        if (!is_file($this->zipname)) {\r\n\r\n            // ----- Do a duplicate\r\n            $v_result = $this->privDuplicate($p_archive_to_add->zipname);\r\n\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Open the zip file\r\n        if (($v_result = $this->privOpenFd('rb')) != 1) {\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Read the central directory informations\r\n        $v_central_dir = array();\r\n        if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) {\r\n            $this->privCloseFd();\r\n\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Go to beginning of File\r\n        @rewind($this->zip_fd);\r\n\r\n        // ----- Open the archive_to_add file\r\n        if (($v_result = $p_archive_to_add->privOpenFd('rb')) != 1) {\r\n            $this->privCloseFd();\r\n\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Read the central directory informations\r\n        $v_central_dir_to_add = array();\r\n        if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1) {\r\n            $this->privCloseFd();\r\n            $p_archive_to_add->privCloseFd();\r\n\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Go to beginning of File\r\n        @rewind($p_archive_to_add->zip_fd);\r\n\r\n        // ----- Creates a temporay file\r\n        $v_zip_temp_name = PCLZIP_TEMPORARY_DIR . uniqid('pclzip-') . '.tmp';\r\n\r\n        // ----- Open the temporary file in write mode\r\n        if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) {\r\n            $this->privCloseFd();\r\n            $p_archive_to_add->privCloseFd();\r\n\r\n            PclZip::privErrorLog(\r\n                PCLZIP_ERR_READ_OPEN_FAIL,\r\n                'Unable to open temporary file \\'' . $v_zip_temp_name . '\\' in binary write mode'\r\n            );\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Copy the files from the archive to the temporary file\r\n        // TBC : Here I should better append the file and go back to erase the central dir\r\n        $v_size = $v_central_dir['offset'];\r\n        while ($v_size != 0) {\r\n            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\r\n            $v_buffer    = fread($this->zip_fd, $v_read_size);\r\n            @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\r\n            $v_size -= $v_read_size;\r\n        }\r\n\r\n        // ----- Copy the files from the archive_to_add into the temporary file\r\n        $v_size = $v_central_dir_to_add['offset'];\r\n        while ($v_size != 0) {\r\n            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\r\n            $v_buffer    = fread($p_archive_to_add->zip_fd, $v_read_size);\r\n            @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\r\n            $v_size -= $v_read_size;\r\n        }\r\n\r\n        // ----- Store the offset of the central dir\r\n        $v_offset = @ftell($v_zip_temp_fd);\r\n\r\n        // ----- Copy the block of file headers from the old archive\r\n        $v_size = $v_central_dir['size'];\r\n        while ($v_size != 0) {\r\n            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\r\n            $v_buffer    = @fread($this->zip_fd, $v_read_size);\r\n            @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\r\n            $v_size -= $v_read_size;\r\n        }\r\n\r\n        // ----- Copy the block of file headers from the archive_to_add\r\n        $v_size = $v_central_dir_to_add['size'];\r\n        while ($v_size != 0) {\r\n            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\r\n            $v_buffer    = @fread($p_archive_to_add->zip_fd, $v_read_size);\r\n            @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\r\n            $v_size -= $v_read_size;\r\n        }\r\n\r\n        // ----- Merge the file comments\r\n        $v_comment = $v_central_dir['comment'] . ' ' . $v_central_dir_to_add['comment'];\r\n\r\n        // ----- Calculate the size of the (new) central header\r\n        $v_size = @ftell($v_zip_temp_fd) - $v_offset;\r\n\r\n        // ----- Swap the file descriptor\r\n        // Here is a trick : I swap the temporary fd with the zip fd, in order to use\r\n        // the following methods on the temporary fil and not the real archive fd\r\n        $v_swap        = $this->zip_fd;\r\n        $this->zip_fd  = $v_zip_temp_fd;\r\n        $v_zip_temp_fd = $v_swap;\r\n\r\n        // ----- Create the central dir footer\r\n        if (($v_result = $this->privWriteCentralHeader(\r\n            $v_central_dir['entries'] + $v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment\r\n        )) != 1\r\n        ) {\r\n            $this->privCloseFd();\r\n            $p_archive_to_add->privCloseFd();\r\n            @fclose($v_zip_temp_fd);\r\n            $this->zip_fd = null;\r\n\r\n            // ----- Reset the file list\r\n            unset($v_header_list);\r\n\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Swap back the file descriptor\r\n        $v_swap        = $this->zip_fd;\r\n        $this->zip_fd  = $v_zip_temp_fd;\r\n        $v_zip_temp_fd = $v_swap;\r\n\r\n        // ----- Close\r\n        $this->privCloseFd();\r\n        $p_archive_to_add->privCloseFd();\r\n\r\n        // ----- Close the temporary file\r\n        @fclose($v_zip_temp_fd);\r\n\r\n        // ----- Delete the zip file\r\n        // TBC : I should test the result ...\r\n        @unlink($this->zipname);\r\n\r\n        // ----- Rename the temporary file\r\n        // TBC : I should test the result ...\r\n        //@rename($v_zip_temp_name, $this->zipname);\r\n        PclZipUtilRename($v_zip_temp_name, $this->zipname);\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privDuplicate()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privDuplicate($p_archive_filename)\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Look if the $p_archive_filename exists\r\n        if (!is_file($p_archive_filename)) {\r\n\r\n            // ----- Nothing to duplicate, so duplicate is a success.\r\n            $v_result = 1;\r\n\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Open the zip file\r\n        if (($v_result = $this->privOpenFd('wb')) != 1) {\r\n            // ----- Return\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Open the temporary file in write mode\r\n        if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0) {\r\n            $this->privCloseFd();\r\n\r\n            PclZip::privErrorLog(\r\n                PCLZIP_ERR_READ_OPEN_FAIL,\r\n                'Unable to open archive file \\'' . $p_archive_filename . '\\' in binary write mode'\r\n            );\r\n\r\n            // ----- Return\r\n            return PclZip::errorCode();\r\n        }\r\n\r\n        // ----- Copy the files from the archive to the temporary file\r\n        // TBC : Here I should better append the file and go back to erase the central dir\r\n        $v_size = filesize($p_archive_filename);\r\n        while ($v_size != 0) {\r\n            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\r\n            $v_buffer    = fread($v_zip_temp_fd, $v_read_size);\r\n            @fwrite($this->zip_fd, $v_buffer, $v_read_size);\r\n            $v_size -= $v_read_size;\r\n        }\r\n\r\n        // ----- Close\r\n        $this->privCloseFd();\r\n\r\n        // ----- Close the temporary file\r\n        @fclose($v_zip_temp_fd);\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privErrorLog()\r\n    // Description :\r\n    // Parameters :\r\n    // --------------------------------------------------------------------------------\r\n    function privErrorLog($p_error_code = 0, $p_error_string = '')\r\n    {\r\n        if (PCLZIP_ERROR_EXTERNAL == 1) {\r\n            PclError($p_error_code, $p_error_string);\r\n        } else {\r\n            $this->error_code   = $p_error_code;\r\n            $this->error_string = $p_error_string;\r\n        }\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privErrorReset()\r\n    // Description :\r\n    // Parameters :\r\n    // --------------------------------------------------------------------------------\r\n    function privErrorReset()\r\n    {\r\n        if (PCLZIP_ERROR_EXTERNAL == 1) {\r\n            PclErrorReset();\r\n        } else {\r\n            $this->error_code   = 0;\r\n            $this->error_string = '';\r\n        }\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privDisableMagicQuotes()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privDisableMagicQuotes()\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Look if function exists\r\n        if ((!function_exists(\"get_magic_quotes_runtime\"))\r\n            || (!function_exists(\"set_magic_quotes_runtime\"))\r\n        ) {\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Look if already done\r\n        if ($this->magic_quotes_status != -1) {\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Get and memorize the magic_quote value\r\n        $this->magic_quotes_status = @get_magic_quotes_runtime();\r\n\r\n        // ----- Disable magic_quotes\r\n        if ($this->magic_quotes_status == 1) {\r\n            @set_magic_quotes_runtime(0);\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n\r\n    // --------------------------------------------------------------------------------\r\n\r\n    // --------------------------------------------------------------------------------\r\n    // Function : privSwapBackMagicQuotes()\r\n    // Description :\r\n    // Parameters :\r\n    // Return Values :\r\n    // --------------------------------------------------------------------------------\r\n    function privSwapBackMagicQuotes()\r\n    {\r\n        $v_result = 1;\r\n\r\n        // ----- Look if function exists\r\n        if ((!function_exists(\"get_magic_quotes_runtime\"))\r\n            || (!function_exists(\"set_magic_quotes_runtime\"))\r\n        ) {\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Look if something to do\r\n        if ($this->magic_quotes_status != -1) {\r\n            return $v_result;\r\n        }\r\n\r\n        // ----- Swap back magic_quotes\r\n        if ($this->magic_quotes_status == 1) {\r\n            @set_magic_quotes_runtime($this->magic_quotes_status);\r\n        }\r\n\r\n        // ----- Return\r\n        return $v_result;\r\n    }\r\n    // --------------------------------------------------------------------------------\r\n\r\n}\r\n\r\n// End of class\r\n// --------------------------------------------------------------------------------\r\n\r\n// --------------------------------------------------------------------------------\r\n// Function : PclZipUtilPathReduction()\r\n// Description :\r\n// Parameters :\r\n// Return Values :\r\n// --------------------------------------------------------------------------------\r\nfunction PclZipUtilPathReduction($p_dir)\r\n{\r\n    $v_result = \"\";\r\n\r\n    // ----- Look for not empty path\r\n    if ($p_dir != \"\") {\r\n        // ----- Explode path by directory names\r\n        $v_list = explode(\"/\", $p_dir);\r\n\r\n        // ----- Study directories from last to first\r\n        $v_skip = 0;\r\n        for ($i = sizeof($v_list) - 1; $i >= 0; $i--) {\r\n            // ----- Look for current path\r\n            if ($v_list[$i] == \".\") {\r\n                // ----- Ignore this directory\r\n                // Should be the first $i=0, but no check is done\r\n            } else {\r\n                if ($v_list[$i] == \"..\") {\r\n                    $v_skip++;\r\n                } else {\r\n                    if ($v_list[$i] == \"\") {\r\n                        // ----- First '/' i.e. root slash\r\n                        if ($i == 0) {\r\n                            $v_result = \"/\" . $v_result;\r\n                            if ($v_skip > 0) {\r\n                                // ----- It is an invalid path, so the path is not modified\r\n                                // TBC\r\n                                $v_result = $p_dir;\r\n                                $v_skip   = 0;\r\n                            }\r\n                        } // ----- Last '/' i.e. indicates a directory\r\n                        else {\r\n                            if ($i == (sizeof($v_list) - 1)) {\r\n                                $v_result = $v_list[$i];\r\n                            } // ----- Double '/' inside the path\r\n                            else {\r\n                                // ----- Ignore only the double '//' in path,\r\n                                // but not the first and last '/'\r\n                            }\r\n                        }\r\n                    } else {\r\n                        // ----- Look for item to skip\r\n                        if ($v_skip > 0) {\r\n                            $v_skip--;\r\n                        } else {\r\n                            $v_result = $v_list[$i] . ($i != (sizeof($v_list) - 1) ? \"/\" . $v_result : \"\");\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        // ----- Look for skip\r\n        if ($v_skip > 0) {\r\n            while ($v_skip > 0) {\r\n                $v_result = '../' . $v_result;\r\n                $v_skip--;\r\n            }\r\n        }\r\n    }\r\n\r\n    // ----- Return\r\n    return $v_result;\r\n}\r\n\r\n// --------------------------------------------------------------------------------\r\n\r\n// --------------------------------------------------------------------------------\r\n// Function : PclZipUtilPathInclusion()\r\n// Description :\r\n//   This function indicates if the path $p_path is under the $p_dir tree. Or,\r\n//   said in an other way, if the file or sub-dir $p_path is inside the dir\r\n//   $p_dir.\r\n//   The function indicates also if the path is exactly the same as the dir.\r\n//   This function supports path with duplicated '/' like '//', but does not\r\n//   support '.' or '..' statements.\r\n// Parameters :\r\n// Return Values :\r\n//   0 if $p_path is not inside directory $p_dir\r\n//   1 if $p_path is inside directory $p_dir\r\n//   2 if $p_path is exactly the same as $p_dir\r\n// --------------------------------------------------------------------------------\r\nfunction PclZipUtilPathInclusion($p_dir, $p_path)\r\n{\r\n    $v_result = 1;\r\n\r\n    // ----- Look for path beginning by ./\r\n    if (($p_dir == '.')\r\n        || ((strlen($p_dir) >= 2) && (substr($p_dir, 0, 2) == './'))\r\n    ) {\r\n        $p_dir = PclZipUtilTranslateWinPath(getcwd(), false) . '/' . substr($p_dir, 1);\r\n    }\r\n    if (($p_path == '.')\r\n        || ((strlen($p_path) >= 2) && (substr($p_path, 0, 2) == './'))\r\n    ) {\r\n        $p_path = PclZipUtilTranslateWinPath(getcwd(), false) . '/' . substr($p_path, 1);\r\n    }\r\n\r\n    // ----- Explode dir and path by directory separator\r\n    $v_list_dir       = explode(\"/\", $p_dir);\r\n    $v_list_dir_size  = sizeof($v_list_dir);\r\n    $v_list_path      = explode(\"/\", $p_path);\r\n    $v_list_path_size = sizeof($v_list_path);\r\n\r\n    // ----- Study directories paths\r\n    $i = 0;\r\n    $j = 0;\r\n    while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) {\r\n\r\n        // ----- Look for empty dir (path reduction)\r\n        if ($v_list_dir[$i] == '') {\r\n            $i++;\r\n            continue;\r\n        }\r\n        if ($v_list_path[$j] == '') {\r\n            $j++;\r\n            continue;\r\n        }\r\n\r\n        // ----- Compare the items\r\n        if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ($v_list_path[$j] != '')) {\r\n            $v_result = 0;\r\n        }\r\n\r\n        // ----- Next items\r\n        $i++;\r\n        $j++;\r\n    }\r\n\r\n    // ----- Look if everything seems to be the same\r\n    if ($v_result) {\r\n        // ----- Skip all the empty items\r\n        while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) {\r\n            $j++;\r\n        }\r\n        while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) {\r\n            $i++;\r\n        }\r\n\r\n        if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) {\r\n            // ----- There are exactly the same\r\n            $v_result = 2;\r\n        } else {\r\n            if ($i < $v_list_dir_size) {\r\n                // ----- The path is shorter than the dir\r\n                $v_result = 0;\r\n            }\r\n        }\r\n    }\r\n\r\n    // ----- Return\r\n    return $v_result;\r\n}\r\n\r\n// --------------------------------------------------------------------------------\r\n\r\n// --------------------------------------------------------------------------------\r\n// Function : PclZipUtilCopyBlock()\r\n// Description :\r\n// Parameters :\r\n//   $p_mode : read/write compression mode\r\n//             0 : src & dest normal\r\n//             1 : src gzip, dest normal\r\n//             2 : src normal, dest gzip\r\n//             3 : src & dest gzip\r\n// Return Values :\r\n// --------------------------------------------------------------------------------\r\nfunction PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode = 0)\r\n{\r\n    $v_result = 1;\r\n\r\n    if ($p_mode == 0) {\r\n        while ($p_size != 0) {\r\n            $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);\r\n            $v_buffer    = @fread($p_src, $v_read_size);\r\n            @fwrite($p_dest, $v_buffer, $v_read_size);\r\n            $p_size -= $v_read_size;\r\n        }\r\n    } else {\r\n        if ($p_mode == 1) {\r\n            while ($p_size != 0) {\r\n                $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);\r\n                $v_buffer    = @gzread($p_src, $v_read_size);\r\n                @fwrite($p_dest, $v_buffer, $v_read_size);\r\n                $p_size -= $v_read_size;\r\n            }\r\n        } else {\r\n            if ($p_mode == 2) {\r\n                while ($p_size != 0) {\r\n                    $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);\r\n                    $v_buffer    = @fread($p_src, $v_read_size);\r\n                    @gzwrite($p_dest, $v_buffer, $v_read_size);\r\n                    $p_size -= $v_read_size;\r\n                }\r\n            } else {\r\n                if ($p_mode == 3) {\r\n                    while ($p_size != 0) {\r\n                        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);\r\n                        $v_buffer    = @gzread($p_src, $v_read_size);\r\n                        @gzwrite($p_dest, $v_buffer, $v_read_size);\r\n                        $p_size -= $v_read_size;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    // ----- Return\r\n    return $v_result;\r\n}\r\n\r\n// --------------------------------------------------------------------------------\r\n\r\n// --------------------------------------------------------------------------------\r\n// Function : PclZipUtilRename()\r\n// Description :\r\n//   This function tries to do a simple rename() function. If it fails, it\r\n//   tries to copy the $p_src file in a new $p_dest file and then unlink the\r\n//   first one.\r\n// Parameters :\r\n//   $p_src : Old filename\r\n//   $p_dest : New filename\r\n// Return Values :\r\n//   1 on success, 0 on failure.\r\n// --------------------------------------------------------------------------------\r\nfunction PclZipUtilRename($p_src, $p_dest)\r\n{\r\n    $v_result = 1;\r\n\r\n    // ----- Try to rename the files\r\n    if (!@rename($p_src, $p_dest)) {\r\n\r\n        // ----- Try to copy & unlink the src\r\n        if (!@copy($p_src, $p_dest)) {\r\n            $v_result = 0;\r\n        } else {\r\n            if (!@unlink($p_src)) {\r\n                $v_result = 0;\r\n            }\r\n        }\r\n    }\r\n\r\n    // ----- Return\r\n    return $v_result;\r\n}\r\n\r\n// --------------------------------------------------------------------------------\r\n\r\n// --------------------------------------------------------------------------------\r\n// Function : PclZipUtilOptionText()\r\n// Description :\r\n//   Translate option value in text. Mainly for debug purpose.\r\n// Parameters :\r\n//   $p_option : the option value.\r\n// Return Values :\r\n//   The option text value.\r\n// --------------------------------------------------------------------------------\r\nfunction PclZipUtilOptionText($p_option)\r\n{\r\n\r\n    $v_list = get_defined_constants();\r\n    for (reset($v_list); $v_key = key($v_list); next($v_list)) {\r\n        $v_prefix = substr($v_key, 0, 10);\r\n        if ((($v_prefix == 'PCLZIP_OPT')\r\n            || ($v_prefix == 'PCLZIP_CB_')\r\n            || ($v_prefix == 'PCLZIP_ATT'))\r\n            && ($v_list[$v_key] == $p_option)\r\n        ) {\r\n            return $v_key;\r\n        }\r\n    }\r\n\r\n    $v_result = 'Unknown';\r\n\r\n    return $v_result;\r\n}\r\n\r\n// --------------------------------------------------------------------------------\r\n\r\n// --------------------------------------------------------------------------------\r\n// Function : PclZipUtilTranslateWinPath()\r\n// Description :\r\n//   Translate windows path by replacing '\\' by '/' and optionally removing\r\n//   drive letter.\r\n// Parameters :\r\n//   $p_path : path to translate.\r\n//   $p_remove_disk_letter : true | false\r\n// Return Values :\r\n//   The path translated.\r\n// --------------------------------------------------------------------------------\r\nfunction PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter = true)\r\n{\r\n    if (stristr(php_uname(), 'windows')) {\r\n        // ----- Look for potential disk letter\r\n        if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) {\r\n            $p_path = substr($p_path, $v_position + 1);\r\n        }\r\n        // ----- Change potential windows directory separator\r\n        if ((strpos($p_path, '\\\\') > 0) || (substr($p_path, 0, 1) == '\\\\')) {\r\n            $p_path = strtr($p_path, '\\\\', '/');\r\n        }\r\n    }\r\n\r\n    return $p_path;\r\n}\r\n\r\n// --------------------------------------------------------------------------------\r\n\r\n\r\n?>\r\n"
  },
  {
    "path": "extensions/exconf/resources/Examples.rdf",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE rdf:RDF [\n  <!ENTITY ExtensionRepo \"http://ns.ontowiki.net/Extensions/\">\n  <!ENTITY SysOnt \"http://ns.ontowiki.net/SysOnt/\">\n  <!ENTITY dc \"http://purl.org/dc/elements/1.1/\">\n  <!ENTITY doap \"http://usefulinc.com/ns/doap#\">\n  <!ENTITY foaf \"http://xmlns.com/foaf/0.1/\">\n  <!ENTITY ns \"http://rdfs.org/sioc/ns#\">\n  <!ENTITY owl \"http://www.w3.org/2002/07/owl#\">\n  <!ENTITY rdf \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n  <!ENTITY rdfs \"http://www.w3.org/2000/01/rdf-schema#\">\n  <!ENTITY terms \"http://purl.org/dc/terms/\">\n  <!ENTITY xsd \"http://www.w3.org/2001/XMLSchema#\">\n  <!ENTITY qf \"http://ontowiki.net/\">\n]>\n<rdf:RDF xml:base=\"&ExtensionRepo;\"\n         xmlns:ExtensionRepo=\"&ExtensionRepo;\"\n         xmlns:SysOnt=\"&SysOnt;\"\n         xmlns:dc=\"&dc;\"\n         xmlns:doap=\"&doap;\"\n         xmlns:foaf=\"&foaf;\"\n         xmlns:ns=\"&ns;\"\n         xmlns:owl=\"&owl;\"\n         xmlns:rdf=\"&rdf;\"\n         xmlns:rdfs=\"&rdfs;\"\n         xmlns:terms=\"&terms;\"\n         xmlns:qf=\"&qf;\">\n         \n<!-- Ontology Information -->\n<owl:Ontology rdf:about=\"\"\n                rdfs:label=\"Extension Repopository\"\n                owl:versionInfo=\"0.4\">\n    <rdfs:comment xml:lang=\"en\">OWL for the Miniworld of the Extension Repository Scheme</rdfs:comment>\n    <owl:imports>\n      <owl:Ontology rdf:about=\"http://rdfs.org/sioc/ns#\"/>\n    </owl:imports>\n    <owl:imports>\n      <owl:Ontology rdf:about=\"http://usefulinc.com/ns/doap#\"/>\n    </owl:imports>\n  </owl:Ontology>\n\n<!-- Classes -->\n  <owl:Class rdf:about=\"Extension\"\n             rdfs:label=\"Extension\">\n    <rdfs:comment>a Extension pluggable script that interacts with Ontowiki to provide a certain, usually very specific, function \"on demand\".</rdfs:comment>\n    <rdfs:subClassOf rdf:resource=\"&doap;Project\"/>\n  </owl:Class>\n\n  <owl:Class rdf:about=\"&ns;User\"/>\n  <owl:Class rdf:about=\"&doap;Project\"/>\n  <owl:Class rdf:about=\"&doap;Version\"/>\n  <owl:Class rdf:about=\"&rdfs;Literal\"/>\n  <owl:Class rdf:about=\"&foaf;Person\"/>\n\n<!-- Datatypes -->\n  <rdfs:Datatype rdf:about=\"&xsd;dateTime\"/>\n  <rdfs:Datatype rdf:about=\"&xsd;string\"/>\n\n<!-- Annotation Properties -->\n  <owl:AnnotationProperty rdf:about=\"&rdfs;comment\"/>\n  <owl:AnnotationProperty rdf:about=\"&rdfs;label\"/>\n  <owl:AnnotationProperty rdf:about=\"&owl;versionInfo\"/>\n\n<!-- Datatype Properties -->\n  <owl:DatatypeProperty rdf:about=\"&SysOnt;userPassword\">\n    <rdf:type rdf:resource=\"&owl;FunctionalProperty\"/>\n    <rdfs:comment xml:lang=\"en\">Every developer must have a password together with nickname for the authentificaiton</rdfs:comment>\n    <rdfs:domain rdf:resource=\"&ns;User\"/>\n    <rdfs:range rdf:resource=\"&xsd;string\"/>\n  </owl:DatatypeProperty>\n\n  <owl:DatatypeProperty rdf:about=\"&dc;description\"/>\n  <owl:DatatypeProperty rdf:about=\"&terms;modified\">\n    <rdfs:comment xml:lang=\"en\">time of last metadata change of the Extension</rdfs:comment>\n    <rdfs:range rdf:resource=\"&xsd;dateTime\"/>\n  </owl:DatatypeProperty>\n\n  <owl:DatatypeProperty rdf:about=\"&ns;first_name\">\n    <rdfs:range rdf:resource=\"&xsd;string\"/>\n  </owl:DatatypeProperty>\n\n  <owl:DatatypeProperty rdf:about=\"&ns;last_name\"/>\n  <owl:DatatypeProperty rdf:about=\"&ns;name\"/>\n  <owl:DatatypeProperty rdf:about=\"&doap;fileRelase\"/>\n  <owl:DatatypeProperty rdf:about=\"&doap;revision\"/>\n\n<!-- Object Properties -->\n  <owl:ObjectProperty rdf:about=\"excludes\"\n                      rdfs:label=\"excludes\">\n    <rdfs:comment>mark extensions that can not coexist with this one. maybe because they are interchangeable but contradictionary.</rdfs:comment>\n    <rdfs:domain rdf:resource=\"Extension\"/>\n    <rdfs:range rdf:resource=\"&doap;Project\"/>\n  </owl:ObjectProperty>\n\n  <owl:ObjectProperty rdf:about=\"requires\"\n                      rdfs:label=\"requires\">\n    <rdf:type rdf:resource=\"&owl;TransitiveProperty\"/>\n    <rdfs:comment>mark extensions that are needed by this extension to work properly.</rdfs:comment>\n    <rdfs:domain rdf:resource=\"Extension\"/>\n    <rdfs:range rdf:resource=\"&doap;Project\"/>\n  </owl:ObjectProperty>\n\n  <owl:ObjectProperty rdf:about=\"&ns;account_of\"/>\n  <owl:ObjectProperty rdf:about=\"&doap;developer\"/>\n  <owl:ObjectProperty rdf:about=\"&doap;release\"/>\n\n\n<!-- Instances -->\n\n  <owl:Thing rdf:about=\"#string\"/>\n  <ns:User rdf:about=\"account_1\"\n           rdfs:label=\"The account of developer_1\">\n    <SysOnt:userPassword rdf:datatype=\"&xsd;string\">qiufeng</SysOnt:userPassword>\n    <ns:account_of>\n      <foaf:Person rdf:about=\"developer_1\"/>\n    </ns:account_of>\n    <ns:first_name rdf:datatype=\"&xsd;string\">Feng</ns:first_name>\n    <ns:last_name rdf:datatype=\"&xsd;string\">Qiu</ns:last_name>\n    <foaf:accountName rdf:datatype=\"&xsd;string\">account_1</foaf:accountName>\n  </ns:User>\n\n  <ns:User rdf:about=\"account_2\"\n           rdfs:label=\"The account of developer_2\">\n    <SysOnt:userPassword rdf:datatype=\"&xsd;string\">qiufeng</SysOnt:userPassword>           \n    <ns:account_of rdf:resource=\"developer_2\"/>\n    <ns:first_name rdf:datatype=\"&xsd;string\">Aric</ns:first_name>\n    <ns:last_name rdf:datatype=\"&xsd;string\">Qiu</ns:last_name>\n    <foaf:accountName rdf:datatype=\"&xsd;string\">account_1</foaf:accountName>\n  </ns:User>\n  \n  <ns:User rdf:about=\"account_3\"\n           rdfs:label=\"The account of Maier Christian\">\n    <SysOnt:userPassword rdf:datatype=\"&xsd;string\">informatik</SysOnt:userPassword>\n    <ns:account_of>\n      <foaf:Person rdf:about=\"maier_christian\"/>\n    </ns:account_of>\n    <ns:first_name rdf:datatype=\"&xsd;string\">Christian</ns:first_name>\n    <ns:last_name rdf:datatype=\"&xsd;string\">Maier</ns:last_name>\n    <foaf:accountName rdf:datatype=\"&xsd;string\">account_3</foaf:accountName>\n  </ns:User>\n\n  <foaf:Person rdf:about=\"developer_1\"\n               rdfs:label=\"the first developer of plugins\"/>\n  <foaf:Person rdf:about=\"developer_2\"\n               rdfs:label=\"The second developer for the plugins\"/>\n  <foaf:Person rdf:about=\"maier_christian\"\n               rdfs:label=\"Maier Christian, a developer of the plugins for Ontowiki\"/>\n               \n  <ExtensionRepo:Extension rdf:about=\"test_plugin_1\"\n                            rdfs:label=\"The first testplugin\">\n    <dc:description rdf:datatype=\"&xsd;string\">This is a very very very very very svery very very very very very very very very short desciption for test_plugin_1</dc:description>\n    <terms:modified rdf:datatype=\"&xsd;dateTime\">2009-03-15T13:00:00.000</terms:modified>\n    <ns:has_owner>\n      <ns:User rdf:about=\"account_1\"/>\n    </ns:has_owner>\n    <ns:name rdf:datatype=\"&xsd;string\">test_plugin_1</ns:name>\n    <doap:developer rdf:resource=\"developer_1\"/>\n    <doap:release rdf:resource=\"p1_v1\"/>\n  </ExtensionRepo:Extension>\n\n  <ExtensionRepo:Extension rdf:about=\"test_plugin_2\"\n                            rdfs:label=\"The second test plugin\">\n    <ExtensionRepo:requires rdf:resource=\"test_plugin_1\"/>\n    <dc:description rdf:datatype=\"&xsd;string\">This is a very svery very very very very svery very very very very very very short description for test_plugin_2</dc:description>\n    <terms:modified rdf:datatype=\"&xsd;dateTime\">2009-03-15T12:51:36.000</terms:modified>\n    <ns:has_owner>\n      <ns:User rdf:about=\"account_2\"/>\n    </ns:has_owner>\n    <ns:name rdf:datatype=\"&xsd;string\">test_plugin_2</ns:name>\n    <doap:developer rdf:resource=\"developer_2\"/>\n    <doap:release rdf:resource=\"p2_v1\"/>\n  </ExtensionRepo:Extension>\n\n  <ExtensionRepo:Extension rdf:about=\"test_plugin_3\"\n                            rdfs:label=\"The third test plugin\">\n    <ExtensionRepo:excludes rdf:resource=\"test_plugin_1\"/>\n    <dc:description rdf:datatype=\"&xsd;string\">This is a very very svery very very very very svery very very very very very very short description for test_plugin_3</dc:description>\n    <terms:modified rdf:datatype=\"&xsd;dateTime\">2009-03-15T12:51:36.000</terms:modified>\n    <ns:has_owner>\n      <ns:User rdf:about=\"account_1\"/>\n    </ns:has_owner>\n    <ns:name rdf:datatype=\"&xsd;string\">test_plugin_3</ns:name>\n    <doap:developer rdf:resource=\"developer_1\"/>\n    <doap:release rdf:resource=\"p3_v1\"/>\n  </ExtensionRepo:Extension>\n  \n  \n  <ExtensionRepo:Extension rdf:about=\"audiolink\"\n                            rdfs:label=\"Audiolink\">\n    <dc:description rdf:datatype=\"&xsd;string\">A plugin that renders values of certain properties as audio.</dc:description>\n    <terms:modified rdf:datatype=\"&xsd;dateTime\">2009-05-02T13:00:00.000</terms:modified>\n    <ns:has_owner>\n      <ns:User rdf:about=\"account_3\"/>\n    </ns:has_owner>\n    <ns:name rdf:datatype=\"&xsd;string\">audiolink</ns:name>\n    <doap:developer rdf:resource=\"maier_christian\"/>\n    <doap:release rdf:resource=\"http://ns.ontowiki.net/audiolink/v1\"/>\n  </ExtensionRepo:Extension>\n  \n  <ExtensionRepo:Extension rdf:about=\"videolink\"\n                            rdfs:label=\"Videolink\">\n    <dc:description rdf:datatype=\"&xsd;string\">A plugin that renders values of certain properties as video.</dc:description>\n    <terms:modified rdf:datatype=\"&xsd;dateTime\">2009-05-02T13:00:00.000</terms:modified>\n    <ns:has_owner>\n      <ns:User rdf:about=\"account_3\"/>\n    </ns:has_owner>\n    <ns:name rdf:datatype=\"&xsd;string\">videolink</ns:name>\n    <doap:developer rdf:resource=\"maier_christian\"/>\n    <doap:release rdf:resource=\"http://ns.ontowiki.net/videolink/v1\"/>\n  </ExtensionRepo:Extension>\n\n\n  <doap:Version rdf:about=\"p1_v1\"\n                rdfs:label=\"Version of test plugin 1\">\n    <doap:file-release rdf:datatype=\"&doap;anyURI\">http://stinfwww.informatik.uni-leipzig.de/~bss03kpx/testplugin1.zip</doap:file-release>\n    <doap:revision rdf:datatype=\"&xsd;string\">1.0</doap:revision>\n    <qf:tag rdf:datatype=\"&xsd;string\">Test</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Plugin</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Ontowiki</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Extension</qf:tag>\n  </doap:Version>\n\n  <doap:Version rdf:about=\"p2_v1\"\n                rdfs:label=\"Version of test plugin 2\">\n    <doap:file-release rdf:datatype=\"&doap;anyURI\">http://stinfwww.informatik.uni-leipzig.de/~bss03kpx/testplugin2.zip</doap:file-release>\n    <doap:revision rdf:datatype=\"&xsd;string\">1.0</doap:revision>\n    <qf:tag rdf:datatype=\"&xsd;string\">Test</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Plugin</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Ontowiki</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Extension</qf:tag>\n  </doap:Version>\n\n  <doap:Version rdf:about=\"p3_v1\"\n                rdfs:label=\"Version of test plugin 3\">\n    <doap:file-release rdf:datatype=\"&doap;anyURI\">http://stinfwww.informatik.uni-leipzig.de/~bss03kpx/testplugin3.zip</doap:file-release>\n    <doap:revision rdf:datatype=\"&xsd;string\">1.0</doap:revision>\n    <qf:tag rdf:datatype=\"&xsd;string\">Test</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Plugin</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Ontowiki</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Extension</qf:tag>\n  </doap:Version>\n  \n  <doap:Version rdf:about=\"http://ns.ontowiki.net/audiolink/v1\"\n                rdfs:label=\"release of extension audiolink\">\n    <doap:file-release rdf:datatype=\"&doap;anyURI\">http://stinfwww.informatik.uni-leipzig.de/~bss03kpx/audiolink.zip</doap:file-release>\n    <doap:revision rdf:datatype=\"&xsd;string\">1.0</doap:revision>\n    <qf:tag rdf:datatype=\"&xsd;string\">Audio</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Plugin</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Ontowiki</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Extension</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Link</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Christian</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Maier</qf:tag>\n  </doap:Version>\n  \n  <doap:Version rdf:about=\"http://ns.ontowiki.net/videolink/v1\"\n                rdfs:label=\"release of extension videolink\">\n    <doap:file-release rdf:datatype=\"&doap;anyURI\">http://stinfwww.informatik.uni-leipzig.de/~bss03kpx/videolink.zip</doap:file-release>\n    <doap:revision rdf:datatype=\"&xsd;string\">1.0</doap:revision>\n    <qf:tag rdf:datatype=\"&xsd;string\">Video</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Plugin</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Ontowiki</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Extension</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Link</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Christian</qf:tag>\n    <qf:tag rdf:datatype=\"&xsd;string\">Maier</qf:tag>\n  </doap:Version>\n  \n</rdf:RDF>\n\n"
  },
  {
    "path": "extensions/exconf/resources/PluginRepository.rdf",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE rdf:RDF [\n  <!ENTITY ExtensionRepo \"http://ns.ontowiki.net/Extensions/\">\n  <!ENTITY SysOnt \"http://ns.ontowiki.net/SysOnt/\">\n  <!ENTITY dc \"http://purl.org/dc/elements/1.1/\">\n  <!ENTITY doap \"http://usefulinc.com/ns/doap#\">\n  <!ENTITY foaf \"http://xmlns.com/foaf/0.1/\">\n  <!ENTITY ns \"http://rdfs.org/sioc/ns#\">\n  <!ENTITY owl \"http://www.w3.org/2002/07/owl#\">\n  <!ENTITY rdf \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n  <!ENTITY rdfs \"http://www.w3.org/2000/01/rdf-schema#\">\n  <!ENTITY terms \"http://purl.org/dc/terms/\">\n  <!ENTITY xsd \"http://www.w3.org/2001/XMLSchema#\">\n]>\n<rdf:RDF xml:base=\"&ExtensionRepo;\"\n         xmlns:ExtensionRepo=\"&ExtensionRepo;\"\n         xmlns:SysOnt=\"&SysOnt;\"\n         xmlns:dc=\"&dc;\"\n         xmlns:doap=\"&doap;\"\n         xmlns:foaf=\"&foaf;\"\n         xmlns:ns=\"&ns;\"\n         xmlns:owl=\"&owl;\"\n         xmlns:rdf=\"&rdf;\"\n         xmlns:rdfs=\"&rdfs;\"\n         xmlns:terms=\"&terms;\">\n\n<!-- Ontology Information -->\n  <owl:Ontology rdf:about=\"\"\n                rdfs:label=\"Extension Repopository\"\n                owl:versionInfo=\"0.4\">\n    <rdfs:comment xml:lang=\"en\">OWL for the Miniworld of the Extension Repository Scheme</rdfs:comment>\n    <owl:imports>\n      <owl:Ontology rdf:about=\"http://rdfs.org/sioc/ns#\"/>\n    </owl:imports>\n    <owl:imports>\n      <owl:Ontology rdf:about=\"http://usefulinc.com/ns/doap#\"/>\n    </owl:imports>\n  </owl:Ontology>\n\n<!-- Classes -->\n  <owl:Class rdf:about=\"Extension\"\n             rdfs:label=\"Extension\">\n    <rdfs:comment>a Extension pluggable script that interacts with Ontowiki to provide a certain, usually very specific, function \"on demand\".</rdfs:comment>\n    <rdfs:subClassOf rdf:resource=\"&doap;Project\"/>\n  </owl:Class>\n\n  <owl:Class rdf:about=\"&ns;User\"/>\n  <owl:Class rdf:about=\"&doap;Project\"/>\n  <owl:Class rdf:about=\"&doap;Version\"/>\n  <owl:Class rdf:about=\"&rdfs;Literal\"/>\n  <owl:Class rdf:about=\"&foaf;Person\"/>\n\n<!-- Datatypes -->\n  <rdfs:Datatype rdf:about=\"&xsd;dateTime\"/>\n  <rdfs:Datatype rdf:about=\"&xsd;string\"/>\n\n<!-- Annotation Properties -->\n  <owl:AnnotationProperty rdf:about=\"&rdfs;comment\"/>\n  <owl:AnnotationProperty rdf:about=\"&rdfs;label\"/>\n  <owl:AnnotationProperty rdf:about=\"&owl;versionInfo\"/>\n\n<!-- Datatype Properties -->\n  <owl:DatatypeProperty rdf:about=\"&SysOnt;userPassword\">\n    <rdf:type rdf:resource=\"&owl;FunctionalProperty\"/>\n    <rdfs:comment xml:lang=\"en\">Every developer must have a password together with nickname for the authentificaiton</rdfs:comment>\n    <rdfs:domain rdf:resource=\"&ns;User\"/>\n    <rdfs:range rdf:resource=\"&xsd;string\"/>\n  </owl:DatatypeProperty>\n\n  <owl:DatatypeProperty rdf:about=\"&dc;description\"/>\n  <owl:DatatypeProperty rdf:about=\"&terms;modified\">\n    <rdfs:comment xml:lang=\"en\">time of last metadata change of the Extension</rdfs:comment>\n    <rdfs:range rdf:resource=\"&xsd;dateTime\"/>\n  </owl:DatatypeProperty>\n\n  <owl:DatatypeProperty rdf:about=\"&ns;first_name\">\n    <rdfs:range rdf:resource=\"&xsd;string\"/>\n  </owl:DatatypeProperty>\n\n  <owl:DatatypeProperty rdf:about=\"&ns;last_name\"/>\n  <owl:DatatypeProperty rdf:about=\"&ns;name\"/>\n  <owl:DatatypeProperty rdf:about=\"&doap;fileRelase\"/>\n  <owl:DatatypeProperty rdf:about=\"&doap;revision\"/>\n\n<!-- Object Properties -->\n  <owl:ObjectProperty rdf:about=\"excludes\"\n                      rdfs:label=\"excludes\">\n    <rdfs:comment>mark extensions that can not coexist with this one. maybe because they are interchangeable but contradictionary.</rdfs:comment>\n    <rdfs:domain rdf:resource=\"Extension\"/>\n    <rdfs:range rdf:resource=\"&doap;Project\"/>\n  </owl:ObjectProperty>\n\n  <owl:ObjectProperty rdf:about=\"requires\"\n                      rdfs:label=\"requires\">\n    <rdf:type rdf:resource=\"&owl;TransitiveProperty\"/>\n    <rdfs:comment>mark extensions that are needed by this extension to work properly.</rdfs:comment>\n    <rdfs:domain rdf:resource=\"Extension\"/>\n    <rdfs:range rdf:resource=\"&doap;Project\"/>\n  </owl:ObjectProperty>\n\n  <owl:ObjectProperty rdf:about=\"&ns;account_of\"/>\n  <owl:ObjectProperty rdf:about=\"&doap;developer\"/>\n  <owl:ObjectProperty rdf:about=\"&doap;release\"/>\n\n<!-- Instances -->\n  \n</rdf:RDF>\n"
  },
  {
    "path": "extensions/exconf/resources/exconf.css",
    "content": "/**\n * Defines special elements for the extension configurator\n * @author    haschek\n * @since     03.02.2011, 19:29:44\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n#show_extension input, legend\n{\n    position:absolute;\n    left:-5000em;\n}\n\n#show_extension fieldset\n{\n    margin-top: 0.5em;\n    list-style: none;\n    margin-left: 0;\n    padding: 0 0.5em;\n    overflow:hidden;\n    border-bottom:solid 1px #666;\n    position:relative;\n}\n\n#show_extension label\n{\n    float: left;\n    white-space: nowrap;\n    display: block;\n    position: relative;\n    top: 0.1em;\n    border-color: #999;\n    border-bottom-color: #666;\n    border-width: 1px 1px 0.1em 1px;\n    border-style: solid;\n    border-left-style: none;\n    padding: 0.5em 1em;\n    text-decoration: none;\n    color: #333;\n    background: url(./../../themes/silverblue/images/layout-tab-gradient.png) repeat-x bottom center #dfdfdf;\n    cursor: pointer;\n}\n\n#show_extension fieldset legend + input + label\n{\n    border-left-style: solid;\n\n}\n\n#show_extension label.active\n{\n    border-color: #666;\n    border-bottom: none;\n    padding-bottom: 0.6em;\n    background: url(./../../themes/silverblue/images/layout-tabactive-gradient.png) repeat-x top center #fff;\n    z-index: 1;\n    color: #333;\n    font-weight: bold;\n\n}\n\n#show_extension label.toggler_view\n{\n    float:right;\n    padding:0;\n    margin:0;\n    border:none;\n    width:45px;\n    height:25px;\n    position:absolute;\n    right:1em; top:50%; margin-top:-13px;\n    background:url(viewtoggler.png) no-repeat left top transparent;\n    text-indent: -5000em;\n    cursor:pointer;\n}\n\n#show_extension label.toggler_view:hover,\n.view_compact #show_extension label.toggler_view\n{\n    background-position:left bottom;\n}\n\n.view_compact #show_extension label.toggler_view:hover\n{\n    background-position:left top;\n}\n\n#extensions li\n{\n    padding:0.5em 0.5em 0.5em 1.5em;\n    position:relative;\n}\n\n#extensions li > .icon\n{\n    position:absolute;\n    left:0;\n    top:0.5em;\n}\n\n#extensions h3\n{\n    margin:0;\n    display:inline-block;\n}\n\n#extensions h3 em\n{\n    font-size: 0.8em;\n}\n\nli.compact div.extension > *\n{\n    display:none;\n}\n\nli.compact div.extension h3\n{\n    display:inline-block;\n    font-size:1em;\n    font-weight:bold;\n    padding-right: 0.25em;\n}\n\nli.compact div.extension h3 em\n{\n    display:none;\n}\n\nli.compact div.extension .togglebutton\n{\n    display:inline-block;\n}\n\nli.compact .togglebutton .slider { display:none; }\n\n"
  },
  {
    "path": "extensions/exconf/resources/exconf.js",
    "content": "/**\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n$(function()\n{\n\n    function postToggle(button)\n    {\n        var name = $(button).parent().attr(\"id\").replace('extension-', '');\n        var enabled = $(button).prop(\"selected\");\n        $.post(urlBase + \"exconf/conf/?name=\"+name+\"&enabled=\"+enabled,function(data){if(data==\"\"){$(\"#numEnabled\").html(parseInt($(\"#numEnabled\").html())+( enabled == \"true\" ? 1 : -1));$(\"#numDisabled\").html(parseInt($(\"#numDisabled\").html())+( enabled == \"true\" ? -1 : 1));}});\n    }\n\n    $(\".togglebutton\").togglebutton(\n        {\"onEnable\":\n            postToggle,\n         \"onDisable\":\n            postToggle\n        }\n    );\n\n    $(\"#show_extension input#viewCompact\").change(function()\n    {\n        if ($(this).is(\":checked\"))\n        {\n            $(\"div.view_extended\").addClass(\"view_compact\").removeClass(\"view_extended\");\n            $(\"#extensions li\").addClass(\"compact\");\n            $(\"#extensions li a.toggle\").addClass('icon-arrow-next').removeClass('icon-arrow-down');\n        }\n        else\n        {\n            $(\"div.view_compact\").addClass(\"view_extended\").removeClass(\"view_compact\");\n            $(\"#extensions li\").removeClass(\"compact\");\n            $(\"#extensions li a.toggle\").addClass('icon-arrow-down').removeClass('icon-arrow-next');\n        }\n    });\n\n    $(\"#extensions a.toggle\").click(function()\n    {\n        if ($(this).is('.icon-arrow-down'))\n        {\n            $(this).parent('li').addClass('compact');\n            $(this).addClass('icon-arrow-next').removeClass('icon-arrow-down');\n        }\n        else\n        {\n            $(this).parent('li').removeClass('compact');\n            $(this).addClass('icon-arrow-down').removeClass('icon-arrow-next');\n        }\n    });\n\n    $(\"#show_extension input:radio\").change(function()\n    {\n       $(\"#show_extension label\").removeClass(\"active\");\n       switch($(\"#show_extension input:checked\").val()){\n             case \"all\" :\n                $(\"#show_extension label[for=showAll]\").addClass(\"active\");\n                $(\"#extensions li\").each(function(){\n                    $(this).show();\n                })\n             break;\n             case \"enabled\" :\n                $(\"#show_extension label[for=showEnabled]\").addClass(\"active\");\n                $(\"#extensions li\").each(function(){if($(this).find(\".togglebutton\").prop(\"selected\") == \"true\"){\n                    $(this).show();\n                } else {\n                    $(this).hide();\n                }})\n             break;\n             case \"disabled\" :\n                $(\"#show_extension label[for=showDisabled]\").addClass(\"active\");\n                $(\"#extensions li\").each(function(){if($(this).find(\".togglebutton\").prop(\"selected\") == \"true\"){\n                    $(this).hide();\n                } else {\n                    $(this).show();\n                }})\n             break;\n         }\n\n         // re-populate the outline\n         extensionOutline();\n\n         //fix odd even style\n         var even = true;\n         $(\"#extensions li:visible\").each(function(){\n            if(even){\n               $(this).addClass(\"even\").removeClass(\"odd\");\n            } else {\n                $(this).addClass(\"odd\").removeClass(\"even\");\n            }\n            even = !even;\n         })\n    }\n    );\n\n});\n"
  },
  {
    "path": "extensions/exconf/resources/jquery.togglebutton.js",
    "content": "/*\n  turn a div or checkbox into a sliding toggle switch (like the apple slide to unlock)\n*/\n\n/*# AVOID COLLISIONS #*/\nif(window.jQuery) (function($){\n/*# AVOID COLLISIONS #*/\n\n\t// plugin initialization\n\t$.fn.togglebutton = function(options){\n                \n\t\t// Initialize options for this call\n\t\tvar options = $.extend(\n\t\t\t{}/* new object */,\n\t\t\t$.fn.togglebutton.options/* default options */,\n\t\t\toptions || {} /* just-in-time options */\n\t\t);\n\n\n                function enable(button, withCallback){\n                    var realChange = false;\n                    if(button.prop(\"selected\") != \"true\"){\n                        realChange = true;\n                    }\n                    button.prop(\"selected\", \"true\");\n                    button.css(\"background-color\", \"#a0e876\");\n                    var slider = button.find(\"> .slider\").eq(0);\n                    slider.animate({left:0}, parseInt(100,10));\n                    if(realChange && withCallback && options.onEnable && typeof options.onEnable == \"function\"){\n                        options.onEnable(button);\n                    }\n                }\n\n                function disable(button, withCallback){\n                    var realChange = false;\n                    if(button.prop(\"selected\") != \"false\"){\n                        realChange = true;\n                    }\n                    button.prop(\"selected\", \"false\");\n                    button.css(\"background-color\", \"#e95d46\");\n                    var slider = button.find(\"> .slider\").eq(0);\n                    slider.animate({left:button.width() - slider.width()}, parseInt(100,10));\n                    if(realChange && withCallback && options.onDisable && typeof options.onDisable == \"function\"){\n                        options.onDisable(button);\n                    }\n                }\n\n\t\t// loop through each matched element\n\t\tthis.each(function(){\n                    var container = $(this);\n                    if(!container.is(\"div\")){\n                        var newNode = $(\"<div/>\");\n                        container.replaceWith(newNode); //returns the old node\n                        // initialize property based on attribute\n                        if(container.is(\":checked\") || container.attr(\"selected\") == \"selected\"){\n                            newNode.prop(\"selected\", \"true\");\n                        }\n                        container = newNode;\n                    }\n\n                    container.addClass('togglebutton');\n\n                    var slider = $(\"<div></div>\").addClass(\"slider\");\n                    container.append(slider);\n                    if(!container.hasClass(\"frozen\")){\n                        slider.draggable({\n                            axis:\"x\",\n                            containment:\"parent\",\n                            snapMode:\"inner\",\n                            snapTolerance:10,\n                            scroll: false\n                        });\n                    }\n                    \n                    var ref = slider.position().left;\n                    \n                    // initialize property based on attribute\n                    if(options.enabled || container.is(\":checked\") || container.attr(\"selected\") == \"selected\"){\n                    \tcontainer.prop(\"selected\",\"true\");\n                        enable(container, false);\n                    } else {\n                    \tcontainer.prop(\"selected\",\"false\");\n                        disable(container, false);\n                    }\n                    \n                    container.droppable({\n                        accept: \".slider\",\n                        drop: function(){\n                            if(container.hasClass(\"frozen\")){\n                                return;\n                            }\n                            var l = slider.position().left  - ref;\n\n                            var r = container.width() - l - slider.width();\n                            if(l < r){\n                                enable(container, true);\n                            } else {\n                                disable(container, true);\n                            }\n                        }\n                    });\n                    \n                    container.click(function(){\n                        if(container.hasClass(\"frozen\")){\n                            return;\n                        }\n                        if(container.prop('selected')=='true'){\n                            disable(container, true);\n                        } else  {\n                            enable(container, true);\n                        }\n                    });\n                    \n                }); // each element\n                \n\n\t\treturn this; // don't break the chain...\n\t};\n\n\t/*--------------------------------------------------------*/\n\n\t/*\n\t\t### Core functionality and API ###\n\t*/\n\t$.extend($.fn.togglebutton, {\n                selected: function(){\n                    return $(this).prop(\"selected\") == \"true\";\n                }\n });\n\n\t/*--------------------------------------------------------*/\n\n\t/*\n\t\t### Default Settings ###\n\t\teg.: You can override default control like this:\n\t\t$.fn.rating.options.cancel = 'Clear';\n\t*/\n\t$.fn.togglebutton.options = {  };\n\n\t/*--------------------------------------------------------*/\n\n\t/*\n\t\t### Default implementation ###\n\t\tThe plugin will attach itself to divs with class togglebutton when the page loads\n\t*/\n\t$(function(){\n\t   \n\t});\n\n\n\n/*# AVOID COLLISIONS #*/\n})(jQuery);\n/*# AVOID COLLISIONS #*/\n\n\n"
  },
  {
    "path": "extensions/exconf/resources/outline.js",
    "content": "/**\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n$(document).ready(function() {\n    extensionOutline();\n});\n\nfunction extensionOutline() {\n    var target = $('div.outline').empty();\n    target = target.append('<ol class=\"bullets-none separated\" />').children('ol');\n\n    var even = true;\n    $('div.extension:visible').each(function(){\n        var title = $(this).find('.name').text();\n        var id = $(this).attr('id');\n        if(even){\n            target.append('<li><a title=\"' +title+ '\" href=\"#' +id+ '\">' +title+ '</a></li>');\n        } else {\n            target.append('<li class=\"odd\"><a title=\"' +title+ '\" href=\"#' +id+ '\">' +title+ '</a></li>');\n        }\n        even = !even;\n    });\n};\n"
  },
  {
    "path": "extensions/exconf/resources/togglebutton.css",
    "content": "/**\n * Style for the jquery.togglebutton plugin.\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author    jonas\n * @since     21.08.205, 21:39:53\n */\n.togglebutton {\n    border: none;\n    background: transparent;\n    width: 3em;\n    height: 1.5em;\n    -moz-border-radius: 0.75em !important;\n    -webkit-border-radius: 0.75em !important;\n    border-radius: 0.75em !important;\n    display:inline-block;\n    vertical-align:text-bottom;\n    opacity:0.5;\n}\n.togglebutton:hover {opacity:1;}\nli.compact .togglebutton {width:1em; height:1em; vertical-align:middle; cursor: pointer; }\n.togglebutton .slider\n{\n    border: none;\n    background-color: #999;\n    width: 1.5em;\n    height: 1.5em;\n    -moz-border-radius: 0.75em !important;\n    -webkit-border-radius: 0.75em !important;\n    border-radius: 0.75em !important;\n    -moz-box-shadow:inset 0 0 0.75em #000;\n    -webkit-box-shadow:inset 0 0 0.75em #000;\n    box-shadow:inset 0 0 0.75em #000;\n    cursor: pointer;\n}\n"
  },
  {
    "path": "extensions/exconf/templates/exconf/archiveuploadform.phtml",
    "content": "<fieldset class=\"activeForm\" id=\"upload\">\n    <div>\n        <label for=\"file-input\">\n            <?php echo sprintf($this->_('File (max. %1$sB)'), preg_replace('/([kMG])/', ' $1', min(array(ini_get('upload_max_filesize'), ini_get('post_max_size'))))) ?>\n        </label>\n        <input type=\"file\" id=\"file-input\" name=\"archive_file\" />\n        <input type=\"text\" id=\"name\" name=\"name\" />\n    </div>\n</fieldset>"
  },
  {
    "path": "extensions/exconf/templates/exconf/conf.phtml",
    "content": "<?php\nfunction array2form($confArr){\n    if(count($confArr) == 0){\n        ?>&nbsp;[empty]&nbsp;<a class=\"addPropertyEmpty\">+</a><?php\n        return;\n    }\n    ?> <table border=\"1\">\n    <?php\n    foreach($confArr as $key => $value){ ?>\n        <tr>\n            <td width=\"15%\"><input class=\"text\" type=\"text\" name=\"key\" value =\"<?php echo $key; ?>\">&nbsp;<a class=\"removeProperty\" title=\"remove this property\">-</a></td>\n            <td>\n                <?php\n                    if(!is_array($value)){\n                        if(is_bool($value)){ ?>\n                            <div class=\"togglebutton\" <?php if($value){ echo \"selected=\\\"true\\\"\"; } ?>></div>\n                        <?php } else { ?>\n                            <input class=\"text\" type=\"text\" name=\"value\" value=\"<?php echo $value; ?>\">&nbsp;<a class=\"splitProperty\" title=\"split this value to an array\">&equiv;</a>\n                        <?php }\n                    } else {\n                        array2form($value);\n                    } ?>\n\n            </td>\n        </tr><?php\n    }\n    ?>\n    </table>\n    <a class=\"addProperty\" title=\"add a property\">+</a>\n    <?php\n}\n$ow = OntoWiki::getInstance();\n$this->headScript()->appendFile($ow->extensionManager->getComponentUrl('exconf').\"resources/jquery.togglebutton.js\");\n$this->headLink()->appendStylesheet($ow->extensionManager->getComponentUrl('exconf').\"resources/togglebutton.css\");\n$this->headScript()->appendScript('var exconfConfig = '.  json_encode($this->config).';\n    $(document).ready(function(){\n        function postToggle(button)\n        {\n            //no posting here, will be submitted with the form\n        }\n\n        $(\".togglebutton\").togglebutton(\n            {\"onEnable\":\n                postToggle,\n             \"onDisable\":\n                postToggle\n            }\n        );\n        //handle the form myself\n        $(\"div.toolbar a.button.submit\").unbind(\"click\");\n        $(\"div.toolbar a.button.submit\").click(function(){\n            var arr = form2array($(\"#topConfTable\"));\n            $(\"#exConf input[name=config]\").val($.toJSON(arr));\n            $(\"#exConf\").submit();\n            //old get method cause problems with too long URIs\n            //window.location = urlBase+\"exconf/conf?name='.$this->name.'&config=\"+encodeURIComponent($.toJSON(arr));\n        });\n        \n        $(\".addProperty\").submit(function(){return false;});\n        $(\".addProperty\").live(\"click\",function(){\n            var lastKey = $(this).parent().find(\">table>tbody>tr:last>td:first>input\").val();\n            var lastKeyInt = parseInt(lastKey);\n            if(!isNaN(lastKeyInt)){\n                var key = lastKeyInt+1;\n            } else {\n                var key = lastKey+\"x\";\n            }\n            $(this).prev().append(\"<tr><td width=\\\"15%\\\"><input class=\\\"text\\\" type=\\\"text\\\" name=\\\"key\\\" value=\\\"\"+key+\"\\\">&nbsp;<a class=\\\"removeProperty\\\">-</a></td><td><input class=\\\"text\\\" type=\\\"text\\\" name=\\\"data\\\">&nbsp;<a class=\\\"splitProperty\\\">&equiv;</a></td></tr>\");\n        });\n        $(\".addPropertyEmpty\").submit(function(){return false;});\n        $(\".addPropertyEmpty\").live(\"click\",function(){\n            $(this).parent().html(\"<table border=\\\"1\\\"><tr><td width=\\\"15%\\\"><input class=\\\"text\\\" type=\\\"text\\\" name=\\\"key\\\" value=\\\"key\\\">&nbsp;<a class=\\\"removeProperty\\\">-</a></td><td><input class=\\\"text\\\" type=\\\"text\\\" name=\\\"data\\\" value =\\\"data\\\">&nbsp;<a class=\\\"splitProperty\\\">&equiv;</a></td></tr></table><a class=\\\"addProperty\\\">+</a>\");\n        });\n        $(\".removeProperty\").submit(function(){return false;});\n        $(\".removeProperty\").live(\"click\",function(){\n            if($(this).parent().parent().parent().children().size() == 1){\n                $(this).parent().parent().parent().parent().next().remove();\n                $(this).parent().parent().parent().parent().replaceWith(\"<input class=\\\"text\\\" type=\\\"text\\\" name=\\\"data\\\">&nbsp;<a class=\\\"splitProperty\\\">&equiv;</a>\");\n            } else {\n                $(this).parent().parent().remove();\n            }\n        });\n        $(\".splitProperty\").submit(function(){return false;});\n        $(\".splitProperty\").live(\"click\",function(){\n            $(this).prev().replaceWith(\"<table border=\\\"1\\\"><tr><td width=\\\"15%\\\"><input class=\\\"text\\\" type=\\\"text\\\" name=\\\"key\\\" value=\\\"key\\\">&nbsp;<a class=\\\"removeProperty\\\">-</a></td><td><input class=\\\"text\\\" type=\\\"text\\\" name=\\\"data\\\" value =\\\"data\\\">&nbsp;<a class=\\\"splitProperty\\\">&equiv;</a></td></tr></table><a class=\\\"addProperty\\\">+</a>\");\n            $(this).remove();\n        });\n        \n    });\n   \nfunction form2array(node){\n    var arr = {};\n    node.find(\"> tbody > tr\").each(function(){\n        var field = $(this);\n        var key = $(this).find(\">td:first\");\n        if($(key).find(\"input\").is(\"input\")){\n            var name = $(key).find(\"input\").val();\n        } else {\n            var name = key.html();\n        }\n        var nameInt = parseInt(name);\n        if(!isNaN(nameInt)){\n            name = nameInt;\n        }\n        var value = $(this).find(\"> td\").eq(1).find(\"> *:first\");\n        if($(value).is(\"table\")){\n            value = form2array(value);\n        } else if( $(value).text() == \"[empty]+\"){\n            value = {};\n        } else if( $(value).is(\"input[type=checkbox]\")){\n            value = $(value).is(\":checked\");\n        } else if( $(value).is(\"div.togglebutton\")){\n            value = ($(value).prop(\"selected\") == \"true\");\n        } else if( $(value).is(\"input.text\")){\n            value = $(value).val();\n        }\n        arr[name] = value;\n        \n    });\n    return arr;\n}');\n?>\n<p class=\"info\">you can change values of your local config here. <br/>you can also change the structure of the config, but only do it when you really know what you are doing.</p>\n<form id=\"exConf\" action=\"<?php echo $this->urlBase;?>/exconf/conf/?name=<?php echo $this->name; ?>\" method=\"post\">\n    <input type=\"hidden\" name=\"name\" value=\"<?php echo $this->name; ?>\"/>\n    <input type=\"hidden\" name=\"config\" value=\"\"/>\n    <table border=\"1\" id=\"topConfTable\">\n        <?php if(!in_array($this->name, $this->coreExtensions)){ ?>\n        <tr>\n            <td width=\"15%\">enabled</td>\n            <td><div id=\"extEnabledSwitch\" class=\"togglebutton\" <?php if($this->enabled){ echo \"selected=\\\"true\\\"\"; } ?>></div></td>\n        </tr>\n        <?php } ?>\n        <tr>\n            <td width=\"15%\">private</td>\n            <td> <?php array2form($this->config); ?> </td>\n        </tr>\n    </table>\n</form>\n"
  },
  {
    "path": "extensions/exconf/templates/exconf/explorerepo.phtml",
    "content": "<?php /*<input type=\"text\" name=\"repoUrl\" value=\"<?php echo $this->repoUrl; ?>\" />*/?>\n\n\n"
  },
  {
    "path": "extensions/exconf/templates/exconf/installarchiveremote.phtml",
    "content": "<?php\n?>\n"
  },
  {
    "path": "extensions/exconf/templates/exconf/installarchiveupload.phtml",
    "content": "<?php\n/* \n * To change this template, choose Tools | Templates\n * and open the template in the editor.\n */\n\n?>\n"
  },
  {
    "path": "extensions/exconf/templates/exconf/list.phtml",
    "content": "<?php\nif($this->isAllowed){\n$ow = OntoWiki::getInstance();\n$this->headLink()->appendStylesheet($ow->extensionManager->getComponentUrl('exconf').\"resources/exconf.css\");\n$this->headScript()->appendFile($ow->extensionManager->getComponentUrl('exconf').\"resources/exconf.js\");\n$this->headScript()->appendFile($ow->extensionManager->getComponentUrl('exconf').\"resources/jquery.togglebutton.js\");\n$this->headLink()->appendStylesheet($ow->extensionManager->getComponentUrl('exconf').\"resources/togglebutton.css\");\n\n?>\n<div class=\"view_extended\">\n<form id=\"show_extension\">\n    <fieldset><legend>Show extensions</legend>\n        <input id=\"showAll\" type=\"radio\" name=\"show\" value=\"all\" checked=\"checked\"> <label for=\"showAll\" class=\"active\">All (<span id=\"numAll\"><?php echo $this->numAll; ?></span>)</label>\n        <input id=\"showEnabled\" type=\"radio\" name=\"show\" value=\"enabled\"> <label for=\"showEnabled\">Enabled (<span id=\"numEnabled\"><?php echo $this->numEnabled; ?></span>)</label>\n        <input id=\"showDisabled\" type=\"radio\" name=\"show\" value=\"disabled\"> <label for=\"showDisabled\">Disabled (<span id=\"numDisabled\"><?php echo $this->numDisabled; ?></span>)</label>\n        <input id=\"viewCompact\" type=\"checkbox\" value=\"compact\"/> <label title=\"Compact/Extended View\" for=\"viewCompact\" class=\"toggler_view\">Compact view</label>\n    </fieldset>\n</form>\n<h2 class=\"onlyAural\">Extensions</h2>\n<ol id=\"extensions\" class=\"bullets-none separated\">\n<?php \n$odd = false; \nforeach($this->extensions as $name => $extension){  \n    if(in_array($name, $this->coreExtensions)){\n        $isCoreExtension = true;\n    } else {\n        $isCoreExtension = false;\n    }\n    ?>\n    <li class=\"<?php echo $odd ? \"odd\" : \"even\"; ?>\">\n        <a class=\"toggle icon icon-arrow-down\" title=\"Close\"><span>Close</span></a>\n        <div class=\"extension has-contextmenu-area\" id=\"extension-<?php echo $name; ?>\">\n            <?php $confUrl = $this->urlBase.(!isset($extension->confAction) ? 'exconf/conf/?name='. $name : $extension->confAction); ?>\n                <h3><span class=\"name\"><a href=\"<?php echo $confUrl; ?>\"><?php echo $extension->title; ?></a></span>\n                    <?php\n                        if (isset($extension->author)) {\n                            echo '<em class=\"author\">by '.(isset($extension->authorUrl)?'<a href=\"'.$extension->authorUrl.'\">'.$extension->author.'</a>':$extension->author).'</em>';\n                        }\n                    ?>\n                </h3>\n                <div class=\"togglebutton <?php if($isCoreExtension){echo 'frozen';} ?>\" <?php if(isset($extension->enabled) && $extension->enabled){ echo \"selected=\\\"true\\\"\"; } ?>></div>\n                <p class=\"description\"><?php echo isset($extension->description) ? $extension->description : \"Extension does not provide a description.\"; ?></p>\n                <div class=\"contextmenu\">\n                <?php if(isset($extension->homepage)) : ?>\n                    <a href=\"<?php echo $extension->homepage ?>\" class=\"item\">\n                        <span title=\"Go to plugin homepage\" class=\"icon icon-homepage\">\n                            <span>Go to plugin homepage</span>\n                        </span>\n                    </a>\n                <?php endif; ?>\n                    <a href=\"<?php echo $confUrl; ?>\" class=\"item\">\n                        <span title=\"Configure\" class=\"icon icon-edit\">\n                            <span>Configure</span>\n                        </span>\n                    </a>\n                    <?php if(!$isCoreExtension){ ?>\n                    <a href=\"<?php echo $this->urlBase; ?>exconf/conf/?name=<?php echo $name; ?>&remove=1\" class=\"item\">\n                        <span title=\"Remove permanently\" class=\"icon icon-delete\">\n                            <span>Remove permanently</span>\n                        </span>\n                    </a>\n                    <?php } ?>\n                </div>\n        </div>\n    </li>\n<?php \n$odd = !$odd; \n} \n?>\n</ol>\n</div>\n<?php } ?>\n"
  },
  {
    "path": "extensions/exconf/templates/partials/list_extensions_main.phtml",
    "content": "<?php \n$odd = true;\n\nif ($this->instances->hasData()): ?>\n    <ol class=\"bullets-none separated\">\n    <?php\n    \n    $highestVersions = array(); \n    foreach ($this->instanceInfo as $instance){\n        $instanceUri = $instance['uri'];\n        if(isset($this->instanceData[$instanceUri]['name'])){\n            $name = $this->instanceData[$instanceUri]['name'][0]['origvalue'];\n        } else {\n            $name = $instanceUri;\n        }\n        if(isset($this->instanceData[$instanceUri]['revision'])){\n            $revision = $this->instanceData[$instanceUri]['revision'][0]['value'];\n        } else {\n            continue;\n        }\n        $owVersion = '0.9.6';\n        $minVersion = !isset($this->instanceData[$instanceUri]['minOwVersion']) ? null : $this->instanceData[$instanceUri]['minOwVersion'][0]['value'];\n        $installable = ($minVersion == null || version_compare($minVersion, $owVersion, '<='));\n        if(!$installable){\n            continue; //skip\n        }\n        if(!isset($highestVersions[$name]) || version_compare($highestVersions[$name], $revision, '<')){\n            $highestVersions[$name] = $revision;\n        }\n    }\n    \n    foreach ($this->instanceInfo as $instance){\n       ?><li class=\"<?php echo $odd ? 'odd' : 'even'; ?>\">\n        <?php \n        $instanceUri = $instance['uri'];\n            if(isset($this->instanceData[$instanceUri]['name'])){\n                $name = $this->instanceData[$instanceUri]['name'][0]['origvalue'];\n            } else {\n                $name =  $instanceUri; //TODO title helper\n            }\n\n            if(isset($this->instanceData[$instanceUri]['title'])){\n                $title = $this->instanceData[$instanceUri]['title'][0]['value'];\n            }  else {\n                $title = $name;\n            }\n\n            if(isset($this->instanceData[$instanceUri]['description'])){\n                $description = $this->instanceData[$instanceUri]['description'][0]['value'];\n            } else {\n                $description =  'no description';\n            }\n\n            if(isset($this->instanceData[$instanceUri]['page'])){\n                $page = $this->instanceData[$instanceUri]['page'][0]['origvalue'];\n            } else {\n                $page =  null;\n            }\n\n            if(isset($this->instanceData[$instanceUri]['author'])){\n                $author = $this->instanceData[$instanceUri]['author'][0]['url'];\n            } else {\n                $author =  null;\n            }\n\n            if(isset($this->instanceData[$instanceUri]['authorLabel'])){\n                $authorLabel = $this->instanceData[$instanceUri]['authorLabel'][0]['value'];\n            } else {\n                if(isset($this->instanceData[$instanceUri]['author'][0])){\n                    $authorLabel = $this->instanceData[$instanceUri]['author'][0]['value'];\n                } else {\n                    $authorLabel =  'unknown author';\n                }\n            }\n            if(isset($this->instanceData[$instanceUri]['homepage'])){\n                $authorPage = $this->instanceData[$instanceUri]['homepage'][0]['origvalue'];\n            } else {\n                $authorPage =  null;\n            }\n            if(isset($this->instanceData[$instanceUri]['mbox'])){\n                $authorMail = $this->instanceData[$instanceUri]['mbox'][0]['value'];\n            } else {\n                $authorMail =  null;\n            }\n\n            if (isset($this->instanceData[$instanceUri]['zip'])) {\n                $location = $this->instanceData[$instanceUri]['zip'][0]['uri'];\n            } else {\n                if(strpos($instanceUri, 'https://github.com/AKSW') === 0){\n                    $location = implode('/', array_slice(explode('/', $instanceUri), 0, 5)) . '/zipball/master';\n                } else {\n                    $location = null;\n                }\n            }\n            if(isset($this->instanceData[$instanceUri]['revision'])){\n                $revision = $this->instanceData[$instanceUri]['revision'][0]['value'];\n            } else {\n                $revision =  null;\n            }\n\n            //only display the highest revision\n            if(!isset($highestVersions[$name]) || $highestVersions[$name] != $revision){\n                continue;\n            }\n\n            $ow = OntoWiki::getInstance();\n            $manager        = $ow->extensionManager;\n            $configs = $manager->getExtensions();\n\n            $installed    = $manager->isExtensionRegistered($name);\n\n            $updateable   = $installed && \n            $location != null && \n            $revision != null && version_compare($configs[$name]->version, $revision, '<');\n            ?>\n                <div class=\"extension has-contextmenu-area\" id=\"<?php echo $name; ?>\">\n                    <h3><span class=\"name\">\n                        <?php if ($page != null) { ?>\n                            <a href=\"<?php echo $page; ?>\" >\n                        <?php } \n                        echo $title . ($revision != null ? ' (version '.$revision.')' : '');\n                        if ($page != null) { ?>\n                            </a>\n                        <?php } ?>\n                    </span></h3>\n                    <span class=\"author\">by \n                        <?php if ($authorPage !== null) { ?>\n                            <a href=\"<?php echo $authorPage;?>\"><?php echo $authorLabel;?></a> \n                        <?php } else echo $authorLabel;\n                    if($authorMail != null){\n                        ?>&nbsp;<a href=\"<?php echo $authorMail; ?>\">mail</a>\n                    <?php } ?>\n                    </span>\n                <p class=\"description\"><?php echo $description; ?></p>\n                <?php\n                if($location !== null){\n                    $url = new OntoWiki_Url(array('controller' => 'exconf', 'action'=>'installarchiveremote'));\n                    $url->url = $location;\n                    $url->name = $name;\n                    $action = false;\n                    if(!$installed){\n                        $label = 'install';\n                        $action = true;\n                    } else if($updateable){\n                        $label = 'update';\n                        $action = true;\n                    }\n                    if($action){\n                    ?>\n                        <div class=\"contextmenu\">\n                            <a href=\"<?php echo $url; ?>\" class=\"item\">\n                                <span title=\"<?php echo $label; ?>\" class=\"icon icon-add\">\n                                    <span><?php echo $label; ?></span>\n                                </span>\n                            </a>\n                        </diV>\n                    <?php\n                    } else {\n                        ?><p class=\"messagebox info\">installed and up to date</p><?php\n                    }\n                } else {\n                    ?><p class=\"messagebox info\">missing doap:file-release link on newest doap:Version</p>\n                    <?php\n                }\n            ?>\n            </div>\n        </li>\n        <?php\n            $odd = !$odd;\n        } ?>\n    </ol>\n    <?php else: ?>\n        <p class=\"messagebox info\"><?php echo $this->_('No extensions found.') ?></p>\n    <?php endif; ?>\n\n\n"
  },
  {
    "path": "extensions/filter/CustomfilterModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Module.php';\n\n/**\n * OntoWiki module – filter\n *\n * Add instance properties to the list view\n *\n * @category   OntoWiki\n * @package    Extensions_Filter\n * @author     Norman Heino <norman.heino@gmail.com>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass CustomfilterModule extends OntoWiki_Module\n{\n    protected $_instances = null;\n\n    public function init()\n    {\n\n    }\n\n\n    public function getTitle()\n    {\n        return 'Custom Filter';\n    }\n\n    public function getContents()\n    {\n        $listHelper       = Zend_Controller_Action_HelperBroker::getStaticHelper('List');\n        $this->_instances = $listHelper->getLastList();\n\n        if (!($this->_instances instanceof OntoWiki_Model_Instances)) {\n            return \"Error: List not found\";\n        }\n\n        $this->store       = $this->_owApp->erfurt->getStore();\n        $this->model       = $this->_owApp->selectedModel;\n        $this->titleHelper = new OntoWiki_Model_TitleHelper($this->_owApp->selectedModel);\n\n        $this->view->headLink()->appendStylesheet($this->view->moduleUrl . 'resources/filter.css');\n        $this->view->headScript()->appendFile($this->view->moduleUrl . 'resources/jquery.dump.js');\n\n        $this->view->headScript()->appendFile($this->view->moduleUrl . 'resources/filter.js');\n\n        $this->view->definedfilters = $this->_privateConfig->customfilter->toArray();\n\n        $content = $this->render('filter/complexfilter');\n\n        return $content;\n    }\n\n\n}\n\n"
  },
  {
    "path": "extensions/filter/FilterController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Controller/Component.php';\n\n/**\n * Controller for OntoWiki Filter Module\n * the filter module is a gui for list modification which takes place in the ListSetupHelper\n * this controller is a helper for this module to supply possible values for a property\n *\n * @category   OntoWiki\n * @package    Extensions_Filter\n * @author     Jonas Brekle <jonas.brekle@gmail.com>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass FilterController extends OntoWiki_Controller_Component\n{\n    public function getpossiblevaluesAction()\n    {\n        $listHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('List');\n        $listName   = $this->_request->getParam('list');\n        if ($listHelper->listExists($listName)) {\n            $list = $listHelper->getList($listName);\n            //TODO the store is not serialized anymore. it is missing by default. Controllers have to set it\n            //how to determine here?\n            //use the default store here - but also Sparql-Adapters are possible\n            $list->setStore($this->_erfurt->getStore());\n        } else {\n            $this->view->values = array();\n\n            return;\n        }\n\n        $predicate = $this->_request->getParam('predicate', '');\n        $inverse   = $this->_request->getParam('inverse', '');\n\n        $this->view->values = $list->getPossibleValues($predicate, true, $inverse == \"true\");\n\n        require_once 'OntoWiki/Model/TitleHelper.php';\n        $titleHelper = new OntoWiki_Model_TitleHelper($this->_owApp->selectedModel);\n        foreach ($this->view->values as $value) {\n            if ($value['type'] == 'uri') {\n                $titleHelper->addResource($value['value']);\n            }\n        }\n\n        foreach ($this->view->values as $key => $value) {\n            if ($value['type'] == 'uri') {\n                $this->view->values[$key]['title'] = $titleHelper->getTitle($value['value']);\n            } else {\n                $this->view->values[$key]['title'] = $value['value'];\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "extensions/filter/FilterModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Module.php';\n\n/**\n * OntoWiki module – filter\n *\n * Add instance properties to the list view\n *\n * @category   OntoWiki\n * @package    Extensions_Filter\n * @author     Norman Heino <norman.heino@gmail.com>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass FilterModule extends OntoWiki_Module\n{\n    protected $_instances = null;\n\n    public function init()\n    {\n\n    }\n\n\n    public function getTitle()\n    {\n        return 'Filter';\n    }\n\n    public function getContents()\n    {\n        $listHelper       = Zend_Controller_Action_HelperBroker::getStaticHelper('List');\n        $this->_instances = $listHelper->getLastList();\n\n        if (!($this->_instances instanceof OntoWiki_Model_Instances)) {\n            return \"Error: List not found\";\n        }\n\n        $this->store       = $this->_owApp->erfurt->getStore();\n        $this->model       = $this->_owApp->selectedModel;\n        $this->titleHelper = new OntoWiki_Model_TitleHelper($this->_owApp->selectedModel);\n\n        $this->view->headLink()->appendStylesheet($this->view->moduleUrl . 'resources/filter.css');\n        //$this->view->headScript()->appendFile($this->view->moduleUrl . 'resources/jquery.dump.js');\n\n        $this->view->properties        = $this->_instances->getAllProperties(false);\n        $this->view->inverseProperties = $this->_instances->getAllProperties(true);\n\n        $this->view->actionUrl = $this->_config->staticUrlBase . 'index.php/list/';\n        $this->view->s         = $this->_request->s;\n\n        $this->view->filter = $this->_instances->getFilter();\n        if (is_array($this->view->filter)) {\n            foreach ($this->view->filter as $key => $filter) {\n                switch ($filter['mode']) {\n                    case 'box':\n                        if ($filter['property']) {\n                            $this->view->filter[$key]['property'] = trim($filter['property']);\n                            $this->titleHelper->addResource($filter['property']);\n                        }\n                        if ($filter['valuetype'] == 'uri' && !empty($filter['value1'])) {\n                            $this->titleHelper->addResource($filter['value1']);\n                        }\n                        if ($filter['valuetype'] == 'uri' && !empty($filter['value2'])) {\n                            $this->titleHelper->addResource($filter['value2']);\n                        }\n                        break;\n                    case 'rdfsclass':\n                        $this->titleHelper->addResource($filter['rdfsclass']);\n                        break;\n                }\n            }\n        }\n\n        $this->view->titleHelper = $this->titleHelper;\n\n        $this->view->headScript()->appendFile($this->view->moduleUrl . 'resources/filter.js');\n\n        $content = $this->render('filter/filter');\n\n        return $content;\n    }\n\n    public function getMenu()\n    {\n        $edit = new OntoWiki_Menu();\n        $edit->setEntry('Add', 'javascript:showAddFilterBox()')\n            ->setEntry('Remove all', 'javascript:removeAllFilters()');\n\n        $help = new OntoWiki_Menu();\n        $help->setEntry('Toggle help', 'javascript:toggleHelp()');\n\n        $main = new OntoWiki_Menu();\n        $main->setEntry('Edit', $edit);\n        $main->setEntry('Help', $help);\n\n        return $main;\n    }\n}\n\n"
  },
  {
    "path": "extensions/filter/default.ini",
    "content": ";;\n; Basic component configuration\n;;\ntemplates  = \"templates\"\nenabled    = true\nname       = \"Filter Resource Lists\"\ndescription = \"provides a GUI to apply filters on a list of resources.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\nmodules.filter.priority   = 30\nmodules.filter.contexts.0 = \"main.window.list\"\n\n;modules.customfilter.enabled = false\n;modules.customfilter.priority   = 40\n;modules.customfilter.contexts.0 = \"main.window.list\"\n\n\n;;\n; Component's private configuration\n; Anything set below will be available within the component ($this->_privateConfig->key)\n;;\n[private]\ncustomfilter.prop1.uri = \"http://example.com/aProp1/\"\ncustomfilter.prop1.label = \"prop1\"\ncustomfilter.prop1.value1.uri = \"http://example.com/aVal11/\"\ncustomfilter.prop1.value1.label = \"val11\"\ncustomfilter.prop1.value2.uri = \"http://example.com/aVal12/\"\ncustomfilter.prop1.value2.label = \"val12\"\ncustomfilter.prop2.uri = \"http://example.com/aProp2/\"\ncustomfilter.prop2.label = \"prop2\"\ncustomfilter.prop2.value1.uri = \"http://example.com/aVal21/\"\ncustomfilter.prop2.value1.label = \"val21\"\ncustomfilter.prop2.value2.uri = \"http://example.com/aVal22/\"\ncustomfilter.prop2.value2.label = \"val22\"\n"
  },
  {
    "path": "extensions/filter/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/filter/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :filter .\n:filter a doap:Project ;\n  doap:name \"filter\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/filter/raw/master/doap.n3#> ;\n  owconfig:templates \"templates\" ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Filter Resource Lists\" ;\n  doap:description \"provides a GUI to apply filters on a list of resources.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:hasModule :Filter .\n:Filter a owconfig:Module ;\n  rdfs:label \"Filter\" ;\n  owconfig:priority \"30\" ;\n  owconfig:context \"main.window.list\" .\n:filter owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"customfilter\";\n      owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"prop1\";\n          :uri <http://example.com/aProp1/> ;\n          :label \"prop1\" ;\n          owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"value1\";\n              :uri <http://example.com/aVal11/> ;\n              :label \"val11\"\n        ];\n owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"value2\";\n              :uri <http://example.com/aVal12/> ;\n              :label \"val12\"\n        ]\n    ];\n owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"prop2\";\n          :uri <http://example.com/aProp2/> ;\n          :label \"prop2\" ;\n          owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"value1\";\n              :uri <http://example.com/aVal21/> ;\n              :label \"val21\"\n        ];\n owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"value2\";\n              :uri <http://example.com/aVal22/> ;\n              :label \"val22\"\n        ]\n    ]\n] .\n:filter doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/filter/resources/FilterAPI.js",
    "content": "/**\n * @class\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nfunction FilterAPI(){\n\n    /*\n     * @var\n     */\n\n    this.uri = reloadUrl;\n    /*\n     *@var array\n     */\n\n    this.callbacks = new Array();\n    /**\n     * @var array\n     */\n    this.filters = filtersFromSession;\n\n    /**\n     * @var int\n     */\n    this.count = 0;\n    for(onefilter in filtersFromSession){\n        this.count++;\n    }\n\n    /**\n     *@method\n     *\n     */\n    this.addCallback = function(callback){\n        if(typeof callback == 'function' || typeof callback == 'object')\n            this.callbacks.push(callback);\n    };\n\n    /**\n     *@method\n     *\n     */\n    this.removeAllFiltersOfProperty = function(uri){\n        var data = { filter: [] }\n        for(afilterName in this.filters){\n            if(this.filters[afilterName].property == uri){\n                data.filter.push({\n                    \"mode\" : \"box\",\n                    \"action\" : \"remove\",\n                    \"id\" : this.filters[afilterName].id\n                })\n            }\n        }\n        var dataserialized = $.toJSON(data);\n        var url = this.uri + \"?instancesconfig=\" + encodeURIComponent(dataserialized)+\"&list=\"+listName;\n        //alert(dataserialized)\n        window.location = url;\n    };\n\n    /**\n     * add a filter\n     * @method\n     * @param id int,string\n     * @param property string an iri (predicate) which values should be filtered\n     * @param isInverse boolean if the property is inverse\n     * @param propertyLabel string a label for the property (will be displayed instead)\n     * @param filter string can be \"contains\" or \"equals\" . going to be enhanced\n     * @param value1 mixed the value applied to the filter\n     * @param value2 mixed the value applied to the filter. often optional (used for \"between\")\n     * @param valuetype string may be \"uri\" or \"literal\" or \"typedliteral\" or \"langtaggedliteral\"\n     * @param literaltype string if valuetype is \"typedliteral\" or \"langtaggedliteral\": you can put stuff like \"de\" or \"xsd:int\" here...\n     * @param callback function will be called on success\n     * @param hidden boolean will not show up in filterbox if true\n     * @param negate \n     * @param dontReload prevent page reloading\n     */\n    this.add = function(id, property, isInverse, propertyLabel, filter, value1, value2, valuetype, literaltype, callback, hidden, negate, dontReload){\n        if(typeof callback != 'function' && typeof callback != 'object'){\n            callback = function(){};\n        }\n\n        if(id == null){\n            id  = \"filterbox\"+this.count\n        }\n        var data =\n            {\n            filter:\n                [\n                    {\n                        \"mode\" : \"box\",\n                        \"action\" : \"add\",\n                        \"id\" : id,\n                        \"property\" : property,\n                        \"isInverse\" : typeof isInverse != 'undefined' ? isInverse : false,\n                        \"propertyLabel\" : typeof propertyLabel != 'undefined' ? propertyLabel : null,\n                        \"filter\" : filter,\n                        \"value1\": value1,\n                        \"value2\": typeof value2 != 'undefined' ? value2 : null,\n                        \"valuetype\": typeof valuetype != 'undefined' ? valuetype : null,\n                        \"literaltype\" : typeof literaltype != 'undefined' ? literaltype : null,\n                        \"hidden\" : typeof hidden != 'undefined' ? hidden : false,\n                        \"negate\" : typeof negate != 'undefined' ? negate : false\n                    }\n                ]\n        };\n\n        var dataserialized = $.toJSON(data);\n        var url = this.uri + \"?instancesconfig=\" + encodeURIComponent(dataserialized)+\"&list=\"+listName;\n\n        this.count++;\n\n        if(dontReload == true){\n            $.ajax(\n              {\n                  \"url\": url,\n                  \"type\" : \"POST\"\n              }\n            );\n        } else {\n            window.location = url;\n        }\n    };\n\n    this.reloadInstances = function(){\n        //$('.content .innercontent').load(document.URL);\n        //window.location = this.uri;\n    };\n\n    this.filterExists = function(id){\n        return (typeof this.filters[id] != 'undefined');\n    }\n\n    this.getFilterById = function(id){\n        return this.filters[id];\n    }\n\n    this.remove = function(id, callback){\n        if(typeof callback != 'function' && typeof callback != 'object')\n            callback = function(){};\n\n        var data = {\n            filter: [\n                {\n                    \"action\" : \"remove\",\n                    \"id\" : id\n                }\n            ]\n        };\n\n        var dataserialized = $.toJSON(data);\n\n        this.count--;\n        window.location = this.uri + \"?instancesconfig=\" + encodeURIComponent(dataserialized);\n    };\n\n    this.removeAll = function(){\n        this.count = 0;\n        window.location = this.uri+\"?init\"\n    };\n}\n\nvar filter = new FilterAPI();"
  },
  {
    "path": "extensions/filter/resources/filter.css",
    "content": "/**\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n#cancelrestrictionbutton {\n\tcolor: red;\n}\n\n.gqbclassrestrictionvalueselector {\n\twidth: 60px;\n}\n\n#gqbclassrestrictionsnotexist {\n\tfont-style: italic;\n\tcolor: grey;\n}\n\n.gqb-button-add\t{\n\tbackground: url(images/icon-add-grey.png) 0 0 no-repeat center; \n}\n\n.gqb-button-add:hover  {\n\tbackground: url(images/icon-add.png) 0 0 no-repeat center; \n}\n\nspan.gqb-button-delete\t{\n\tbackground: url(../extensions/components/graphicalquerybuilder/resources/images/icon-delete-grey.png) no-repeat center; \n}\n\nspan.gqb-button-delete:hover  {\n\tbackground: url(../extensions/components/graphicalquerybuilder/resources/images/icon-delete.png)  no-repeat center; \n}\n\nspan.gqb-button-edit\t{\n\tbackground: url(images/icon-edit-grey.png) no-repeat center; \n}\n\nspan.gqb-button-edit:hover  {\n\tbackground: url(images/icon-edit.png)  no-repeat center; \n}"
  },
  {
    "path": "extensions/filter/resources/filter.js",
    "content": "/*\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nvar filterboxcounter = 0; // dont overwrite previous filters\n\nfunction showAddFilterBox(){\n    // $(\"#addFilterWindowOverlay\").show();\n    $(\"#addFilterWindowOverlay\").modal({\n        overlay: 80,\n        overlayCss: {backgroundColor: '#000'},\n        overlayClose: true, \n        onOpen: function (dialog) {\n            dialog.overlay.fadeIn(effectTime, function () {\n                dialog.data.show();\n                dialog.container.fadeIn(effectTime);\n            })\n        },\n        onClose: function (dialog) {\n            dialog.container.fadeOut(effectTime, function() {\n                dialog.overlay.fadeOut(effectTime, function() {\n                    $.modal.close();\n                });\n            });\n        }\n    });\n}\nfunction updatePossibleValues() {\n      if($(\"#property option:selected\").length == 0) {return;}\n\n      $(\"#addwindow #possiblevalues\").addClass(\"is-processing\");\n      $(\"#property option:selected\").each(function () {\n            var inverse = $(this).hasClass(\"InverseProperty\") ? \"true\" : \"false\";\n            $(\"#possiblevalues\").load(urlBase+\"filter/getpossiblevalues?predicate=\"+escape($(this).attr(\"about\"))+\"&inverse=\"+inverse+\"&list=\"+listName, {}, function(){\n                 $(\"#addwindow #possiblevalues\").removeClass(\"is-processing\");\n            });\n          });\n    }\nfunction removeAllFilters(){\n    // $(\"#addFilterWindowOverlay\").hide();\n    $.modal.close();\n    filter.removeAll(function() {\n\n    });\n}\n\nfunction toggleHelp(){\n    $(\"#helptext\").slideToggle();\n}\n\n$(document).ready(function(){\n    //initial layout\n    $(\"#gqbclassrestrictionsexist\").hide();\n    $(\"#addFilterWindowOverlay\").hide();\n    $(\"#filterbox #clear\").hide();\n\n    $('#filter').droppable({\n        accept: '.show-property',\n        scope: 'Resource',\n        activeClass: 'ui-droppable-accepted-window',\n        hoverClass: 'ui-droppable-hovered',\n        drop:\n        function(event, ui) {\n             $(\"#property option:selected\").each(function () {\n                 $(this).attr('selected', false);\n             });\n             $(\"#property option[about=\"+$(ui.draggable).attr('about')+\"]\").attr('selected', true);\n            $(\"#property option:selected\").each(updatePossibleValues);\n            showAddFilterBox();\n     }});\n\n    $(\"#addwindowhide\").click(function(){\n        $.modal.close();\n    });\n\n    $(\"#addwindow #add\").click( function(){\n        $.modal.close();\n\n        var prop = $(\"#addwindow #property option:selected\").attr(\"about\");\n        var propLabel = $(\"#addwindow #property option:selected\").html();\n        var inverse = $(\"#addwindow #property option:selected\").hasClass(\"InverseProperty\");\n\n        var filtertype = $(\"#addwindow #resttype option:selected\").html();\n        var negate = $(\"#negate\").is(':checked');\n        var value1 = $(\"#addwindow #value1\").val();\n        if(typeof value1 == \"undefined\"){\n            value1 = null;\n        }\n\n        var value2 = $(\"#addwindow #value2\").val();\n        if(typeof value2 == \"undefined\"){\n            value2 = null;\n        }\n\n        var type = \"literal\";\n        var typedata = null;\n\n        // if value entering is possible but nothing entered: check if user selected something in the possible values box\n        if(value1 == \"\" && $(\"#valueboxes\").children().length == 1){\n            if($(\"#addwindow #possiblevalues option:selected\").length == 0){\n                return; // block add button\n            }\n            value1 = $(\"#addwindow #possiblevalues option:selected\").attr(\"value\");\n            filtertype = \"equals\";\n            type = $(\"#addwindow #possiblevalues option:selected\").attr(\"type\");\n            var language = $(\"#addwindow #possiblevalues option:selected\").attr(\"language\");\n            var datatype = $(\"#addwindow #possiblevalues option:selected\").attr(\"datatype\");\n\n            if(type == \"literal\" && typeof language != 'undefined'){\n                typedata = language;\n            } else if(type == \"typed-literal\"){\n                typedata = datatype;\n            }\n        }\n\n        filter.add(\"filterbox\"+filter.counter, prop, inverse, propLabel, filtertype, value1, value2, type, typedata, function(newfilter) {\n            //react in filter box\n            //$(\"#addwindow\").hide();\n        }, false, negate);\n    });\n\n    //show possible values for select property\n    $(\"#property\").change(updatePossibleValues);\n\n    //different filter types need different value input fields\n    // bound: none\n    // contains, larger, smaller: one\n    // between: two - not implemented\n    // date: datepicker - not implemented\n    $(\"#resttype\").change(function () {\n      var type = $(\"#resttype option:selected\").val();\n      if(type == \"contains\" || type == \"larger\" || type == \"smaller\"){\n          if($(\"#valueboxes\").children().length != 1){\n              $(\"#valueboxes\").empty();\n              $(\"#valueboxes\").append(\"<input type=\\\"text\\\" id=\\\"value1\\\"/>\");\n          }\n      }\n      if(type == \"between\"){\n          if($(\"#valueboxes\").children().length != 2){\n              $(\"#valueboxes\").empty();\n              $(\"#valueboxes\").append(\"<input type=\\\"text\\\" id=\\\"value1\\\"/>\");\n              $(\"#valueboxes\").append(\"<input type=\\\"text\\\" id=\\\"value2\\\"/>\");\n        }\n      }\n      if(type == \"bound\"){\n          if($(\"#valueboxes\").children().length != 0){\n              $(\"#valueboxes\").empty();\n          }\n      }\n    });\n\n    //$.dump(filter);\n    //register the filter box for (other) filter events\n    //filter.addCallback(function(newfilter){ showFilter() });\n\n    $('.filter .delete').click(function(){\n        filter.remove($(this).parents('.filter').attr('id'));\n    })\n});\n\n"
  },
  {
    "path": "extensions/filter/resources/jquery.dump.js",
    "content": "/**\r\n * @copyright   Copyright (c) 2014, {@link http://aksw.org AKSW}\r\n * @license     http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\r\n */\r\njQuery.fn.dump = function(showTypes, showAttributes) {\r\n    jQuery.dump($(this), showTypes, showAttributes);\r\n    return this;\r\n};\r\n\r\njQuery.dump = function(object, showTypes, showAttributes) {\r\n    var dump = '';\r\n    var st = typeof showTypes == 'undefined' ? true : showTypes;\r\n    var sa = typeof showAttributes == 'undefined' ? true : showAttributes;\r\n    var winName = 'dumpWin';\r\n    var w = 760;\r\n    var h = 500;\r\n    var leftPos = screen.width ? (screen.width - w) / 2 : 0;\r\n    var topPos = screen.height ? (screen.height - h) / 2 : 0;\r\n    var settings = 'height=' + h + ',width=' + w + ',top=' + topPos + ',left=' + leftPos + ',scrollbars=yes,menubar=yes,status=yes,resizable=yes';\r\n    var title = 'Dump';\r\n    var script = 'function tRow(s) {t = s.parentNode.lastChild;tTarget(t, tSource(s)) ;}function tTable(s) {var switchToState = tSource(s) ;var table = s.parentNode.parentNode;for (var i = 1; i < table.childNodes.length; i++) {t = table.childNodes[i] ;if (t.style) {tTarget(t, switchToState);}}}function tSource(s) {if (s.style.fontStyle == \"italic\" || s.style.fontStyle == null) {s.style.fontStyle = \"normal\";s.title = \"click to collapse\";return \"open\";} else {s.style.fontStyle = \"italic\";s.title = \"click to expand\";return \"closed\" ;}}function tTarget (t, switchToState) {if (switchToState == \"open\") {t.style.display = \"\";} else {t.style.display = \"none\";}}';        \r\n\r\n    var _recurse = function (o, type) {\r\n        var i;\r\n        var j = 0;\r\n        var r = '';\r\n        type = _dumpType(o);\r\n        switch (type) {\r\n            case 'regexp':\r\n                var t = type;\r\n                r += '<table' + _dumpStyles(t,'table') + '><tr><th colspan=\"2\"' + _dumpStyles(t,'th') + '>' + t + '</th></tr>';\r\n                r += '<tr><td colspan=\"2\"' + _dumpStyles(t,'td-value') + '><table' + _dumpStyles('arguments','table') + '><tr><td' + _dumpStyles('arguments','td-key') + '><i>RegExp: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o + '</td></tr></table>';    \r\n                j++;\r\n                break;\r\n            case 'date':\r\n                var t = type;\r\n                r += '<table' + _dumpStyles(t,'table') + '><tr><th colspan=\"2\"' + _dumpStyles(t,'th') + '>' + t + '</th></tr>';\r\n                r += '<tr><td colspan=\"2\"' + _dumpStyles(t,'td-value') + '><table' + _dumpStyles('arguments','table') + '><tr><td' + _dumpStyles('arguments','td-key') + '><i>Date: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o + '</td></tr></table>';    \r\n                j++;\r\n                break;\r\n            case 'function':\r\n                var t = type;\r\n                var a = o.toString().match(/^.*function.*?\\((.*?)\\)/im); \r\n                var args = (a == null || typeof a[1] == 'undefined' || a[1] == '') ? 'none' : a[1];\r\n                r += '<table' + _dumpStyles(t,'table') + '><tr><th colspan=\"2\"' + _dumpStyles(t,'th') + '>' + t + '</th></tr>';\r\n                r += '<tr><td colspan=\"2\"' + _dumpStyles(t,'td-value') + '><table' + _dumpStyles('arguments','table') + '><tr><td' + _dumpStyles('arguments','td-key') + '><i>Arguments: </i></td><td' + _dumpStyles(type,'td-value') + '>' + args + '</td></tr><tr><td' + _dumpStyles('arguments','td-key') + '><i>Function: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o + '</td></tr></table>';    \r\n                j++;\r\n                break;\r\n            case 'domelement':\r\n                var t = type;\r\n                var attr = '';\r\n                if (sa) {\r\n                    for (i in o) {if (!/innerHTML|outerHTML/i.test(i)) {attr += i + ': ' + o[i] + '<br />';}}\r\n                }\r\n                r += '<table' + _dumpStyles(t,'table') + '><tr><th colspan=\"2\"' + _dumpStyles(t,'th') + '>' + t + '</th></tr>';\r\n                r += '<tr><td' + _dumpStyles(t,'td-key') + '><i>Node Name: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.nodeName.toLowerCase() + '</td></tr>';    \r\n                r += '<tr><td' + _dumpStyles(t,'td-key') + '><i>Node Type: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.nodeType + '</td></tr>'; \r\n                r += '<tr><td' + _dumpStyles(t,'td-key') + '><i>Node Value: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.nodeValue + '</td></tr>';\r\n                if (sa) {\r\n                    r += '<tr><td' + _dumpStyles(t,'td-key') + '><i>Attributes: </i></td><td' + _dumpStyles(type,'td-value') + '>' + attr + '</td></tr>';                    \r\n                    r += '<tr><td' + _dumpStyles(t,'td-key') + '><i>innerHTML: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.innerHTML + '</td></tr>'; \r\n                    if (typeof o.outerHTML != 'undefined') {\r\n                        r += '<tr><td' + _dumpStyles(t,'td-key') + '><i>outerHTML: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.outerHTML + '</td></tr>'; \r\n                    }\r\n                }\r\n                j++;\r\n                break;\r\n        }\r\n        if (/object|array/.test(type)) {\r\n            for (i in o) {\r\n                var t = _dumpType(o[i]);\r\n                if (j < 1) {\r\n                    r += '<table' + _dumpStyles(type,'table') + '><tr><th colspan=\"2\"' + _dumpStyles(type,'th') + '>' + type + '</th></tr>';\r\n                    j++;\r\n                }\r\n                if (typeof o[i] == 'object' && o[i] != null) { \r\n                    r += '<tr><td' + _dumpStyles(type,'td-key') + '>' + i + (st ? ' [' + t + ']' : '') + '</td><td' + _dumpStyles(type,'td-value') + '>' + _recurse(o[i], t) + '</td></tr>';        \r\n                } else if (typeof o[i] == 'function') {\r\n                    r += '<tr><td' + _dumpStyles(type ,'td-key') + '>' + i + (st ? ' [' + t + ']' : '') + '</td><td' + _dumpStyles(type,'td-value') + '>' + _recurse(o[i], t) + '</td></tr>';            \r\n                } else {\r\n                    r += '<tr><td' + _dumpStyles(type,'td-key') + '>' + i + (st ? ' [' + t + ']' : '') + '</td><td' + _dumpStyles(type,'td-value') + '>' + o[i] + '</td></tr>';    \r\n                }\r\n            }\r\n        }\r\n        if (j == 0) {\r\n            r += '<table' + _dumpStyles(type,'table') + '><tr><th colspan=\"2\"' + _dumpStyles(type,'th') + '>' + type + ' [empty]</th></tr>';         \r\n        }\r\n        r += '</table>';\r\n        return r;\r\n    };\r\n    var _dumpStyles = function(type, use) {\r\n    var r = '';\r\n    var table = 'font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;cell-spacing:2px;';\r\n    var th = 'font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;text-align:left;color: white;padding: 5px;vertical-align :top;cursor:hand;cursor:pointer;';\r\n    var td = 'font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;vertical-align:top;padding:3px;';\r\n    var thScript = 'onClick=\"tTable(this);\" title=\"click to collapse\"';\r\n    var tdScript = 'onClick=\"tRow(this);\" title=\"click to collapse\"';\r\n    switch (type) {\r\n        case 'string':\r\n        case 'number':\r\n        case 'boolean':\r\n        case 'undefined':\r\n        case 'object':\r\n            switch (use) {\r\n                case 'table':    \r\n                    r = ' style=\"' + table + 'background-color:#0000cc;\"';\r\n                    break;\r\n                case 'th':\r\n                    r = ' style=\"' + th + 'background-color:#4444cc;\"' + thScript;\r\n                    break;\r\n                case 'td-key':\r\n                    r = ' style=\"' + td + 'background-color:#ccddff;cursor:hand;cursor:pointer;\"' + tdScript;\r\n                    break;\r\n                case 'td-value':\r\n                    r = ' style=\"' + td + 'background-color:#fff;\"';\r\n                    break;\r\n            }\r\n            break;\r\n        case 'array':\r\n            switch (use) {\r\n                case 'table':    \r\n                    r = ' style=\"' + table + 'background-color:#006600;\"';\r\n                    break;\r\n                case 'th':\r\n                    r = ' style=\"' + th + 'background-color:#009900;\"' + thScript;\r\n                    break;\r\n                case 'td-key':\r\n                    r = ' style=\"' + td + 'background-color:#ccffcc;cursor:hand;cursor:pointer;\"' + tdScript;\r\n                    break;\r\n                case 'td-value':\r\n                    r = ' style=\"' + td + 'background-color:#fff;\"';\r\n                    break;\r\n            }\r\n            break;\r\n        case 'function':\r\n            switch (use) {\r\n                case 'table':    \r\n                    r = ' style=\"' + table + 'background-color:#aa4400;\"';\r\n                    break;\r\n                case 'th':\r\n                    r = ' style=\"' + th + 'background-color:#cc6600;\"' + thScript;\r\n                    break;\r\n                case 'td-key':\r\n                    r = ' style=\"' + td + 'background-color:#fff;cursor:hand;cursor:pointer;\"' + tdScript;\r\n                    break;\r\n                case 'td-value':\r\n                    r = ' style=\"' + td + 'background-color:#fff;\"';\r\n                    break;\r\n            }\r\n            break;\r\n        case 'arguments':\r\n            switch (use) {\r\n                case 'table':    \r\n                    r = ' style=\"' + table + 'background-color:#dddddd;cell-spacing:3;\"';\r\n                    break;\r\n                case 'td-key':\r\n                    r = ' style=\"' + th + 'background-color:#eeeeee;color:#000000;cursor:hand;cursor:pointer;\"' + tdScript;\r\n                    break;\r\n            }\r\n            break;\r\n        case 'regexp':\r\n            switch (use) {\r\n                case 'table':\r\n                    r = ' style=\"' + table + 'background-color:#CC0000;cell-spacing:3;\"';\r\n                    break;\r\n                case 'th':\r\n                    r = ' style=\"' + th + 'background-color:#FF0000;\"' + thScript;\r\n                    break;\r\n                case 'td-key':\r\n                    r = ' style=\"' + th + 'background-color:#FF5757;color:#000000;cursor:hand;cursor:pointer;\"' + tdScript;\r\n                    break;\r\n                case 'td-value':\r\n                    r = ' style=\"' + td + 'background-color:#fff;\"';\r\n                    break;\r\n            }\r\n            break;\r\n        case 'date':\r\n            switch (use) {\r\n                case 'table':\r\n                    r = ' style=\"' + table + 'background-color:#663399;cell-spacing:3;\"';\r\n                    break;\r\n                case 'th':\r\n                    r = ' style=\"' + th + 'background-color:#9966CC;\"' + thScript;\r\n                    break;\r\n                case 'td-key':\r\n                    r = ' style=\"' + th + 'background-color:#B266FF;color:#000000;cursor:hand;cursor:pointer;\"' + tdScript;\r\n                    break;\r\n                case 'td-value':\r\n                    r = ' style=\"' + td + 'background-color:#fff;\"';\r\n                    break;\r\n            }        \r\n            break;\r\n        case 'domelement':\r\n        case 'document':\r\n        case 'window':\r\n            switch (use) {\r\n                case 'table':\r\n                    r = ' style=\"' + table + 'background-color:#FFCC33;cell-spacing:3;\"';\r\n                    break;\r\n                case 'th':\r\n                    r = ' style=\"' + th + 'background-color:#FFD966;\"' + thScript;\r\n                    break;\r\n                case 'td-key':\r\n                    r = ' style=\"' + th + 'background-color:#FFF2CC;color:#000000;cursor:hand;cursor:pointer;\"' + tdScript;\r\n                    break;\r\n                case 'td-value':\r\n                    r = ' style=\"' + td + 'background-color:#fff;\"';\r\n                    break;\r\n            }\r\n            break;\r\n    }\r\n    return r;\r\n    };\r\n    var _dumpType = function (obj) {\r\n        var t = typeof(obj);\r\n        if (t == 'function') {\r\n            var f = obj.toString();\r\n            if ( ( /^\\/.*\\/[gi]??[gi]??$/ ).test(f)) {\r\n                return 'regexp';\r\n            } else if ((/^\\[object.*\\]$/i ).test(f)) {\r\n                t = 'object'\r\n            }\r\n        }\r\n        if (t != 'object') {\r\n            return t;\r\n        }\r\n        switch (obj) {\r\n            case null:\r\n                return 'null';\r\n            case window:\r\n                return 'window';\r\n            case document:\r\n                return 'document';\r\n            case window.event:\r\n                return 'event';\r\n        }\r\n        if (window.event && (event.type == obj.type)) {\r\n            return 'event';\r\n        }\r\n        var c = obj.constructor;\r\n        if (c != null) {\r\n            switch(c) {\r\n                case Array:\r\n                    t = 'array';\r\n                    break;\r\n                case Date:\r\n                    return 'date';\r\n                case RegExp:\r\n                    return 'regexp';\r\n                case Object:\r\n                    t = 'object';\r\n                break;\r\n                case ReferenceError:\r\n                    return 'error';\r\n                default:\r\n                    var sc = c.toString();\r\n                    var m = sc.match(/\\s*function (.*)\\(/);\r\n                    if (m != null) {\r\n                        return 'object';\r\n                    }\r\n            }\r\n        }\r\n        var nt = obj.nodeType;\r\n        if (nt != null) {\r\n            switch(nt) {\r\n                case 1:\r\n                    return 'domelement';\r\n                case 3:\r\n                    return 'string';\r\n            }\r\n        }\r\n        if (obj.toString != null) {\r\n            var ex = obj.toString();\r\n            var am = ex.match(/^\\[object (.*)\\]$/i);\r\n            if (am != null) {\r\n                var am = am[1];\r\n                switch(am.toLowerCase()) {\r\n                    case 'event':\r\n                        return 'event';\r\n                    case 'nodelist':\r\n                    case 'htmlcollection':\r\n                    case 'elementarray':\r\n                        return 'array';\r\n                    case 'htmldocument':\r\n                        return 'htmldocument';\r\n                }\r\n            }\r\n        }\r\n        return t;\r\n    };    \r\n    dump += (/string|number|undefined|boolean/.test(typeof(object)) || object == null) ? object : _recurse(object, typeof object);\r\n    winName = window.open('', '', settings);\r\n    if (jQuery.browser.msie || jQuery.browser.browser == 'opera' || jQuery.browser.browser == 'safari') {\r\n        winName.document.write('<html><head><title> ' + title + ' </title><script type=\"text/javascript\">' + script + '</script><head>');\r\n        winName.document.write('<body>' + dump + '</body></html>');\r\n    } else {\r\n        winName.document.body.innerHTML = dump;\r\n        winName.document.title = title;\r\n        var ffs = winName.document.createElement('script');\r\n        ffs.setAttribute('type', 'text/javascript');\r\n        ffs.appendChild(document.createTextNode(script));\r\n        winName.document.getElementsByTagName('head')[0].appendChild(ffs);\r\n    }\r\n    winName.focus();\r\n};"
  },
  {
    "path": "extensions/filter/resources/jquery.treeview.css",
    "content": ".treeview, .treeview ul { \r\n\tpadding: 0;\r\n\tmargin: 0;\r\n\tlist-style: none;\r\n}\r\n\r\n.treeview ul {\r\n\tbackground-color: white;\r\n\tmargin-top: 4px;\r\n}\r\n\r\n.treeview .hitarea {\r\n\tbackground: url(images/treeview-default.gif) -64px -25px no-repeat;\r\n\theight: 16px;\r\n\twidth: 16px;\r\n\tmargin-left: -16px;\r\n\tfloat: left;\r\n\tcursor: pointer;\r\n}\r\n/* fix for IE6 */\r\n* html .hitarea {\r\n\tdisplay: inline;\r\n\tfloat:none;\r\n}\r\n\r\n.treeview li { \r\n\tmargin: 0;\r\n\tpadding: 3px 0pt 3px 16px;\r\n}\r\n\r\n.treeview a.selected {\r\n\tbackground-color: #eee;\r\n}\r\n\r\n#treecontrol { margin: 1em 0; display: none; }\r\n\r\n.treeview .hover { color: red; cursor: pointer; }\r\n\r\n.treeview li { background: url(images/treeview-default-line.gif) 0 0 no-repeat; }\r\n.treeview li.jqtvcollapsable, .treeview li.jqtvexpandable { background-position: 0 -176px; }\r\n\r\n.treeview .expandable-hitarea { background-position: -80px -3px; }\r\n\r\n.treeview li.last { background-position: 0 -1766px }\r\n.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(images/treeview-default.gif); }  \r\n.treeview li.lastCollapsable { background-position: 0 -111px }\r\n.treeview li.lastExpandable { background-position: -32px -67px }\r\n\r\n.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; }\r\n\r\n.treeview-red li { background-image: url(images/treeview-red-line.gif); }\r\n.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(images/treeview-red.gif); } \r\n\r\n.treeview-black li { background-image: url(images/treeview-black-line.gif); }\r\n.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(images/treeview-black.gif); }  \r\n\r\n.treeview-gray li { background-image: url(images/treeview-gray-line.gif); }\r\n.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(images/treeview-gray.gif); } \r\n\r\n.treeview-famfamfam li { background-image: url(images/treeview-famfamfam-line.gif); }\r\n.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(images/treeview-famfamfam.gif); } \r\n\r\n\r\n.filetree li { padding: 3px 0 2px 16px; }\r\n.filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; }\r\n.filetree span.folder { background: url(images/folder.gif) 0 0 no-repeat; }\r\n.filetree li.jqtvexpandable span.folder { background: url(images/folder-closed.gif) 0 0 no-repeat; }\r\n.filetree span.file { background: url(images/file.gif) 0 0 no-repeat; cursor: move;  }\r\n"
  },
  {
    "path": "extensions/filter/resources/jquery.treeview.js",
    "content": "/*\n * Treeview 1.4 - jQuery plugin to hide and show branches of a tree\n * \n * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/\n * http://docs.jquery.com/Plugins/Treeview\n *\n * Copyright (c) 2007 Jörn Zaefferer\n *\n * Dual licensed under the MIT and GPL licenses:\n *   http://www.opensource.org/licenses/mit-license.php\n *   http://www.gnu.org/licenses/gpl.html\n *\n * Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $\n *\n */\n\n;(function($) {\n\n\t$.extend($.fn, {\n\t\tswapClass: function(c1, c2) {\n\t\t\tvar c1Elements = this.filter('.' + c1);\n\t\t\tthis.filter('.' + c2).removeClass(c2).addClass(c1);\n\t\t\tc1Elements.removeClass(c1).addClass(c2);\n\t\t\treturn this;\n\t\t},\n\t\treplaceClass: function(c1, c2) {\n\t\t\treturn this.filter('.' + c1).removeClass(c1).addClass(c2).end();\n\t\t},\n\t\thoverClass: function(className) {\n\t\t\tclassName = className || \"hover\";\n\t\t\treturn this.hover(function() {\n\t\t\t\t$(this).addClass(className);\n\t\t\t}, function() {\n\t\t\t\t$(this).removeClass(className);\n\t\t\t});\n\t\t},\n\t\theightToggle: function(animated, callback) {\n\t\t\tanimated ?\n\t\t\t\tthis.animate({ height: \"toggle\" }, animated, callback) :\n\t\t\t\tthis.each(function(){\n\t\t\t\t\tjQuery(this)[ jQuery(this).is(\":hidden\") ? \"show\" : \"hide\" ]();\n\t\t\t\t\tif(callback)\n\t\t\t\t\t\tcallback.apply(this, arguments);\n\t\t\t\t});\n\t\t},\n\t\theightHide: function(animated, callback) {\n\t\t\tif (animated) {\n\t\t\t\tthis.animate({ height: \"hide\" }, animated, callback);\n\t\t\t} else {\n\t\t\t\tthis.hide();\n\t\t\t\tif (callback)\n\t\t\t\t\tthis.each(callback);\t\t\t\t\n\t\t\t}\n\t\t},\n\t\tprepareBranches: function(settings) {\n\t\t\tif (!settings.prerendered) {\n\t\t\t\t// mark last tree items\n\t\t\t\tthis.filter(\":last-child:not(ul)\").addClass(CLASSES.last);\n\t\t\t\t// collapse whole tree, or only those marked as closed, anyway except those marked as open\n\t\t\t\tthis.filter((settings.collapsed ? \"\" : \".\" + CLASSES.closed) + \":not(.\" + CLASSES.open + \")\").find(\">ul\").hide();\n\t\t\t}\n\t\t\t// return all items with sublists\n\t\t\treturn this.filter(\":has(>ul)\");\n\t\t},\n\t\tapplyClasses: function(settings, toggler) {\n\t\t\tthis.filter(\":has(>ul):not(:has(>a))\").find(\">span\").click(function(event) {\n\t\t\t\ttoggler.apply($(this).next());\n\t\t\t}).add( $(\"a\", this) ).hoverClass();\n\t\t\t\n\t\t\tif (!settings.prerendered) {\n\t\t\t\t// handle closed ones first\n\t\t\t\tthis.filter(\":has(>ul:hidden)\")\n\t\t\t\t\t\t.addClass(CLASSES.expandable)\n\t\t\t\t\t\t.replaceClass(CLASSES.last, CLASSES.lastExpandable);\n\t\t\t\t\t\t\n\t\t\t\t// handle open ones\n\t\t\t\tthis.not(\":has(>ul:hidden)\")\n\t\t\t\t\t\t.addClass(CLASSES.collapsable)\n\t\t\t\t\t\t.replaceClass(CLASSES.last, CLASSES.lastCollapsable);\n\t\t\t\t\t\t\n\t            // create hitarea\n\t\t\t\tthis.prepend(\"<div class=\\\"\" + CLASSES.hitarea + \"\\\"/>\").find(\"div.\" + CLASSES.hitarea).each(function() {\n\t\t\t\t\tvar classes = \"\";\n\t\t\t\t\t$.each($(this).parent().attr(\"class\").split(\" \"), function() {\n\t\t\t\t\t\tclasses += this + \"-hitarea \";\n\t\t\t\t\t});\n\t\t\t\t\t$(this).addClass( classes );\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\t// apply event to hitarea\n\t\t\tthis.find(\"div.\" + CLASSES.hitarea).click( toggler );\n\t\t},\n\t\ttreeview: function(settings) {\n\t\t\t\n\t\t\tsettings = $.extend({\n\t\t\t\tcookieId: \"treeview\"\n\t\t\t}, settings);\n\t\t\t\n\t\t\tif (settings.add) {\n\t\t\t\treturn this.trigger(\"add\", [settings.add]);\n\t\t\t}\n\t\t\t\n\t\t\tif ( settings.toggle ) {\n\t\t\t\tvar callback = settings.toggle;\n\t\t\t\tsettings.toggle = function() {\n\t\t\t\t\treturn callback.apply($(this).parent()[0], arguments);\n\t\t\t\t};\n\t\t\t}\n\t\t\n\t\t\t// factory for treecontroller\n\t\t\tfunction treeController(tree, control) {\n\t\t\t\t// factory for click handlers\n\t\t\t\tfunction handler(filter) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\t// reuse toggle event handler, applying the elements to toggle\n\t\t\t\t\t\t// start searching for all hitareas\n\t\t\t\t\t\ttoggler.apply( $(\"div.\" + CLASSES.hitarea, tree).filter(function() {\n\t\t\t\t\t\t\t// for plain toggle, no filter is provided, otherwise we need to check the parent element\n\t\t\t\t\t\t\treturn filter ? $(this).parent(\".\" + filter).length : true;\n\t\t\t\t\t\t}) );\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t// click on first element to collapse tree\n\t\t\t\t$(\"a:eq(0)\", control).click( handler(CLASSES.collapsable) );\n\t\t\t\t// click on second to expand tree\n\t\t\t\t$(\"a:eq(1)\", control).click( handler(CLASSES.expandable) );\n\t\t\t\t// click on third to toggle tree\n\t\t\t\t$(\"a:eq(2)\", control).click( handler() ); \n\t\t\t}\n\t\t\n\t\t\t// handle toggle event\n\t\t\tfunction toggler() {\n\t\t\t\t$(this)\n\t\t\t\t\t.parent()\n\t\t\t\t\t// swap classes for hitarea\n\t\t\t\t\t.find(\">.hitarea\")\n\t\t\t\t\t\t.swapClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea )\n\t\t\t\t\t\t.swapClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea )\n\t\t\t\t\t.end()\n\t\t\t\t\t// swap classes for parent li\n\t\t\t\t\t.swapClass( CLASSES.collapsable, CLASSES.expandable )\n\t\t\t\t\t.swapClass( CLASSES.lastCollapsable, CLASSES.lastExpandable )\n\t\t\t\t\t// find child lists\n\t\t\t\t\t.find( \">ul\" )\n\t\t\t\t\t// toggle them\n\t\t\t\t\t.heightToggle( settings.animated, settings.toggle );\n\t\t\t\tif ( settings.unique ) {\n\t\t\t\t\t$(this).parent()\n\t\t\t\t\t\t.siblings()\n\t\t\t\t\t\t// swap classes for hitarea\n\t\t\t\t\t\t.find(\">.hitarea\")\n\t\t\t\t\t\t\t.replaceClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea )\n\t\t\t\t\t\t\t.replaceClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea )\n\t\t\t\t\t\t.end()\n\t\t\t\t\t\t.replaceClass( CLASSES.collapsable, CLASSES.expandable )\n\t\t\t\t\t\t.replaceClass( CLASSES.lastCollapsable, CLASSES.lastExpandable )\n\t\t\t\t\t\t.find( \">ul\" )\n\t\t\t\t\t\t.heightHide( settings.animated, settings.toggle );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfunction serialize() {\n\t\t\t\tfunction binary(arg) {\n\t\t\t\t\treturn arg ? 1 : 0;\n\t\t\t\t}\n\t\t\t\tvar data = [];\n\t\t\t\tbranches.each(function(i, e) {\n\t\t\t\t\tdata[i] = $(e).is(\":has(>ul:visible)\") ? 1 : 0;\n\t\t\t\t});\n\t\t\t\t$.cookie(settings.cookieId, data.join(\"\") );\n\t\t\t}\n\t\t\t\n\t\t\tfunction deserialize() {\n\t\t\t\tvar stored = $.cookie(settings.cookieId);\n\t\t\t\tif ( stored ) {\n\t\t\t\t\tvar data = stored.split(\"\");\n\t\t\t\t\tbranches.each(function(i, e) {\n\t\t\t\t\t\t$(e).find(\">ul\")[ parseInt(data[i]) ? \"show\" : \"hide\" ]();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// add treeview class to activate styles\n\t\t\tthis.addClass(\"treeview\");\n\t\t\t\n\t\t\t// prepare branches and find all tree items with child lists\n\t\t\tvar branches = this.find(\"li\").prepareBranches(settings);\n\t\t\t\n\t\t\tswitch(settings.persist) {\n\t\t\tcase \"cookie\":\n\t\t\t\tvar toggleCallback = settings.toggle;\n\t\t\t\tsettings.toggle = function() {\n\t\t\t\t\tserialize();\n\t\t\t\t\tif (toggleCallback) {\n\t\t\t\t\t\ttoggleCallback.apply(this, arguments);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tdeserialize();\n\t\t\t\tbreak;\n\t\t\tcase \"location\":\n\t\t\t\tvar current = this.find(\"a\").filter(function() { return this.href.toLowerCase() == location.href.toLowerCase(); });\n\t\t\t\tif ( current.length ) {\n\t\t\t\t\tcurrent.addClass(\"selected\").parents(\"ul, li\").add( current.next() ).show();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tbranches.applyClasses(settings, toggler);\n\t\t\t\t\n\t\t\t// if control option is set, create the treecontroller and show it\n\t\t\tif ( settings.control ) {\n\t\t\t\ttreeController(this, settings.control);\n\t\t\t\t$(settings.control).show();\n\t\t\t}\n\t\t\t\n\t\t\treturn this.bind(\"add\", function(event, branches) {\n\t\t\t\t$(branches).prev()\n\t\t\t\t\t.removeClass(CLASSES.last)\n\t\t\t\t\t.removeClass(CLASSES.lastCollapsable)\n\t\t\t\t\t.removeClass(CLASSES.lastExpandable)\n\t\t\t\t.find(\">.hitarea\")\n\t\t\t\t\t.removeClass(CLASSES.lastCollapsableHitarea)\n\t\t\t\t\t.removeClass(CLASSES.lastExpandableHitarea);\n\t\t\t\t$(branches).find(\"li\").andSelf().prepareBranches(settings).applyClasses(settings, toggler);\n\t\t\t});\n\t\t}\n\t});\n\t\n\t// classes used by the plugin\n\t// need to be styled via external stylesheet, see first example\n\tvar CLASSES = $.fn.treeview.classes = {\n\t\topen: \"open\",\n\t\tclosed: \"closed\",\n\t\texpandable: \"jqtvexpandable\",\n\t\texpandableHitarea: \"expandable-hitarea\",\n\t\tlastExpandableHitarea: \"lastExpandable-hitarea\",\n\t\tcollapsable: \"jqtvcollapsable\",\n\t\tcollapsableHitarea: \"collapsable-hitarea\",\n\t\tlastCollapsableHitarea: \"lastCollapsable-hitarea\",\n\t\tlastCollapsable: \"lastCollapsable\",\n\t\tlastExpandable: \"lastExpandable\",\n\t\tlast: \"last\",\n\t\thitarea: \"hitarea\"\n\t};\n\t\n\t// provide backwards compability\n\t$.fn.Treeview = $.fn.treeview;\n\t\n})(jQuery);"
  },
  {
    "path": "extensions/filter/templates/filter/complexfilter.phtml",
    "content": "<?php\n/**\n * OntoWiki custom filter module template\n */\n?>\n<div id=\"customfilterbox\">\n    <a onclick=\"javascript:filter.removeAll()\" >remove all filter</a><br/>\n    <?php \n    foreach($this->definedfilters as $prop){\n        echo $prop[\"label\"].\":\";\n        ?> <a onclick=\"javascript:filter.removeAllFiltersOfProperty('<?php echo $prop[\"uri\"]; ?>')\">All</a><?php\n        foreach($prop as $key => $value){\n            if($key != \"label\" && $key != \"uri\"){\n                ?> <a onclick=\"javascript:filter.add(null, '<?php echo $prop[\"uri\"]; ?>', false, '<?php echo $prop[\"label\"]; ?>', 'equals', '<?php echo $value[\"uri\"]; ?>', null, 'uri')\"><?php echo $value[\"label\"]; ?></a><?php\n            }\n        }\n        echo \"<br/>\";\n    }\n    ?>\n</div>\n"
  },
  {
    "path": "extensions/filter/templates/filter/filter.phtml",
    "content": "<?php\n/**\n * OntoWiki filter module template\n */\n$odd = true;\n$translate = OntoWiki::getInstance()->translate;\n?>\n<div id=\"filterbox\">\n    <form name=\"search\" method=\"get\" action=\"<?php echo $this->actionUrl ?>\">\n    <p class=\"width98\">\n        <label class=\"display-block\" for=\"filtersearchtext-input\"><?php echo $this->_('Search in list') ?></label>\n        <input class=\"text width99 inner-label\" type=\"text\" id=\"filtersearchtext-input\" name=\"s\" value=\"<?php echo $this->s ?>\" />\n    </p>\n    </form>\n    <?php if ($this->filter) : ?>\n    <?php $linkurl = new OntoWiki_Url(array('route' => 'properties'), array('r')) ?>\n    <?php echo $this->_('Active Filters') ?>:\n    <ul class=\"bullets-none separated\">\n        <?php foreach ($this->filter as $filter) :\n            if ( isset($filter['hidden'] ) && $filter['hidden'] ) {\n                continue;\n            }\n        ?>\n        <li id=\"<?php echo $filter['id'] ?>\"\n            class=\"<?php echo $odd ? 'odd' : 'even'; $odd = !$odd; ?> filter has-contextmenu-area\"\n            >\n            <?php if($filter['mode'] == \"box\"): ?>\n                <a  class=\"hasMenu\"\n                    about=\"<?php echo $filter['property'] ?>\"\n                    href=\"<?php echo (string) $linkurl->setParam('r', $filter['property'], true) ?>\">\n                    <?php echo $this->titleHelper->getTitle($filter['property']) ?>\n                </a>\n                <?php if ($filter['isInverse']) : ?>\n                    <sup>-1</sup>\n                <?php endif ?>\n                <?php if ($filter['negate']) : ?> not <?php endif ?>\n                <?php echo $filter['filter'] ?>\n                <?php if ($filter['value1']) : ?>\n                    <?php if ($filter['valuetype'] == 'uri') : ?>\n                        <a  class=\"hasMenu\"\n                            about=\"<?php echo $filter['value1']; ?>\"\n                            href=\"<?php echo (string) $linkurl->setParam('r', $filter['value1'], true) ?>\">\n                            <?php echo $this->titleHelper->getTitle($filter['value1']); ?>\n                        </a>\n                    <?php else : ?>\n                        <strong>\"<?php echo $filter['value1'] ?>\"</strong>\n                    <?php endif ?>\n                <?php endif ?>\n                <?php if ($filter['value2']) : ?>\n                    and\n                    <?php if ($filter['valuetype'] == 'uri') : ?>\n                        <a  class=\"hasMenu\"\n                            about=\"<?php echo $filter['value2']; ?>\"\n                            href=\"<?php echo (string) $linkurl->setParam('r', $filter['value2'], true) ?>\">\n                            <?php echo $this->titleHelper->getTitle($filter['value2']); ?>\n                        </a>\n                    <?php else : ?>\n                        <strong>\"<?php echo $filter['value2'] ?>\"</strong>\n                    <?php endif ?>\n                <?php endif ?>\n\n            <?php endif; if($filter['mode'] == \"rdfsclass\") : ?>\n                    Type: <a  class=\"hasMenu\"\n                        about=\"<?php echo $filter['rdfsclass']; ?>\"\n                        href=\"<?php echo (string) $linkurl->setParam('r', $filter['rdfsclass'], true) ?>\">\n                        <?php echo $this->titleHelper->getTitle($filter['rdfsclass']); ?>\n                    </a>\n            <?php endif; if($filter['mode'] == \"search\") : ?>\n                    Search: <?php echo $filter['searchText']; ?>\n            <?php endif; if($filter['mode'] == \"triples\") : ?>\n                    Base Query\n            <?php endif; ?>\n            <div class=\"contextmenu\">\n                <span class=\"item delete\">\n                    <span class=\"icon icon-close\" title=\"Remove Filter\">\n                        <span>Remove Filter</span>\n                    </span>\n                </span>\n            </div>\n        </li>\n        <?php endforeach ?>\n    </ul>\n    <div id=\"helptext\" style=\"display: none;\">\n    <h3><?= $translate->translate('Help') ?></h3>\n    <ul class=\"separated\">\n       <li><?= $translate->translate('filter_help1'); ?></li>\n       <li><?= $translate->translate('filter_help2'); ?></li>\n       <li><?= $translate->translate('filter_help3'); ?></li>\n       <li><?= $translate->translate('filter_help4'); ?>\n       (<a href=\"http://docs.openlinksw.com/virtuoso/queryingftcols.html\"><?= $translate->translate('Further info'); ?></a>)</li>\n    </ul>\n    </div>\n    <?php endif ?>\n\n   \n    <div id=\"addFilterWindowOverlay\">\n        <div class=\"window\" id=\"addwindow\">\n            <h2 class=\"title\">Add Filter</h2>\n            <table>\n                <tr>\n                    <td>\n                        <select id=\"property\" size=\"7\">\n                            <?php foreach($this->properties as $key => $property){ ?>\n                            <option about=\"<?php echo $property['uri']; ?>\" class=\"Resource\"><?php echo $property[\"title\"]; ?></option>\n                            <?php } ?>\n                            <?php foreach($this->inverseProperties as $key => $property){ ?>\n                            }\n                            <option about=\"<?php echo $property['uri']; ?>\" class=\"Resource InverseProperty\"><?php echo $property[\"title\"]; ?> (inverse)</option>\n                            <?php } ?>\n                        </select>\n                    </td>\n                    <td style=\"vertical-align:middle\">\n                        equals\n                    </td>\n                    <td>\n                        <select id=\"possiblevalues\" size=\"7\">\n                                <option>none loaded</option>\n                        </select>\n                    </td>\n                </tr>\n            </table>\n            <div style=\"padding:10px;\">\n                or<br/>\n                <input type=\"checkbox\" id=\"negate\"/> not\n                <select id=\"resttype\">\n                        <option>contains</option>\n                        <option>larger</option>\n                        <option>smaller</option>\n                        <option>between</option>\n                        <option>bound</option>\n                </select>\n                <div id=\"valueboxes\">\n                <input type=\"text\" id=\"value1\"/>\n                </div>\n                <formset><a id=\"add\" class=\"button minibutton\">set</a>\n                <a id=\"addwindowhide\" class=\"button minibutton\">cancel</a></formset>\n            </div>\n        </div>\n    </div>\n</div>\n"
  },
  {
    "path": "extensions/filter/templates/filter/getpossiblevalues.phtml",
    "content": "<?php foreach($this->values as $value) : ?>\n    <option\n        value=\"<?php echo $value['value']; ?>\"\n        type=\"<?php echo $value['type']; ?>\"\n        <?php\n            if($value['type']=='uri') {\n                echo ' about=\"'.$value['value'].'\"';\n            } elseif ($value['type']=='typed-literal') {\n                echo ' datatype='.$value['datatype'];\n            }\n\n            if (!empty($value['xml:lang'])) {\n                echo ' language=\"'.$value['xml:lang'].'\"';\n            }\n        ?>\n    >\n       <?php  echo isset($value['title']) ? $value['title'] : $value['value']; ?>\n    </option>\n<?php endforeach ?>\n\n<?php\nif (empty($this->values)) {\n    echo 'Error: no values found ';\n}\n?>"
  },
  {
    "path": "extensions/googletracking/GoogletrackingPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Plugin.php';\nrequire_once 'OntoWiki/Utils.php';\n\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @category   OntoWiki\n * @package    Extensions_Googletracking\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass GoogletrackingPlugin extends OntoWiki_Plugin\n{\n\n\n    public function onAfterInitController($event)\n    {\n        if (isset($this->_privateConfig->trackingID)) {\n            $this->view->headScript()->appendScript(\n                \"\n        var gaJsHost = ((\\\"https:\\\" == document.location.protocol) ? \\\"https://ssl.\\\" : \\\"http://www.\\\");\n        document.write(unescape(\\\"%3Cscript src='\\\" + gaJsHost + \\\"google-analytics.com/ga.js' type=\" .\n                \"'text/javascript'%3E%3C/script%3E\\\"));\"\n            );\n            $this->view->headScript()->appendScript(\n                \"\n        try {\n        var pageTracker = _gat._getTracker(\\\"\" . $this->_privateConfig->trackingID . \"\\\");\n        pageTracker._trackPageview();\n        } catch(err) {}\"\n            );\n        }\n\n    }\n}\n\n"
  },
  {
    "path": "extensions/googletracking/default.ini",
    "content": "enabled     = false\nname        = \"Google Analytics\"\ndescription = \"A plug-in that adds a Google Analytics Tracking Code to every page.\"\nauthor      = \"Niederstätter Michael\"\n\n[events]\n1 = onAfterInitController\n\n[private]\n\n;trackingID = \"UA-XXXXXXX-8\"\n\n\n\n"
  },
  {
    "path": "extensions/googletracking/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/googletracking/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :googletracking .\n:googletracking a doap:Project ;\n  doap:name \"googletracking\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/googletracking/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  rdfs:label \"Google Analytics\" ;\n  doap:description \"A plug-in that adds a Google Analytics Tracking Code to every page.\" ;\n  owconfig:authorLabel \"Niederstätter Michael\" ;\n  owconfig:pluginEvent event:onAfterInitController ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/hideproperties/HidepropertiesPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Plugin to hide property data on PropertiesAction.\n *\n * @category   OntoWiki\n * @package    Extensions_Hideproperties\n */\nclass HidepropertiesPlugin extends OntoWiki_Plugin\n{\n\n    public function onPropertiesActionData($event)\n    {\n        if ($this->_privateConfig->hide->property) {\n\n            $store  = Erfurt_App::getInstance()->getStore();\n            $config = Erfurt_App::getInstance()->getConfig();\n\n            $data = $event->predicates;\n\n            foreach ($data as $graphUri => $predicates) {\n                $query = new Erfurt_Sparql_SimpleQuery();\n                $query->setSelectClause('SELECT DISTINCT *')\n                    ->addFrom((string)$graphUri)\n                    ->setWherePart('WHERE { ?p <' . $this->_privateConfig->hide->property . '> ?o . }');\n\n                $results = $store->sparqlQuery($query);\n\n                if (!empty($results)) {\n\n                    $publicPredicates = Array();\n                    foreach ($data as $element) {\n                        foreach ($element as $propertykey => $property) {\n                            $hide = false;\n                            foreach ($results as $result) {\n                                if ($result['p'] == $property['uri']) {\n                                    $hide = true;\n                                    break;\n                                }\n                            }\n                            if (!$hide) {\n                                $publicPredicates[$propertykey] = $property;\n                            }\n                        }\n                    }\n                    $data[$graphUri] = $publicPredicates;\n                }\n\n            }\n        }\n        $event->predicates = $data;\n\n        return true;\n    }\n\n}\n"
  },
  {
    "path": "extensions/hideproperties/default.ini",
    "content": "enabled     = false\nname        = HideProperties\ndescription = \"A plug-in that hides defined Properties in the ressourceview\"\nauthor      = \"Niederstaetter Michael ,  Maier Christian\"\n[events]\n1 = onPropertiesActionData\n\n[private]\nhide.property   = \"http://ns.ontowiki.net/SysOnt/hidden\"\n"
  },
  {
    "path": "extensions/hideproperties/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/hideproperties/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :hideproperties .\n:hideproperties a doap:Project ;\n  doap:name \"hideproperties\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/hideproperties/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  rdfs:label \"HideProperties\" ;\n  doap:description \"A plug-in that hides defined Properties in the ressourceview\" ;\n  owconfig:authorLabel \"Niederstaetter Michael ,  Maier Christian\" ;\n  owconfig:pluginEvent event:onPropertiesActionData ;\n  owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"hide\";\n      :property <http://ns.ontowiki.net/SysOnt/hidden>\n] ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/history/HistoryController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * History component controller.\n *\n * @category   OntoWiki\n * @package    Extensions_History\n * @author     Christoph Rieß <c.riess.dev@googlemail.com>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass HistoryController extends OntoWiki_Controller_Component\n{\n    public function feedAction()\n    {\n        $model       = $this->_owApp->selectedModel;\n        $resource    = $this->_owApp->selectedResource;\n        $limit       = 20;\n        $rUri        = (string)$resource;\n        $rUriEncoded = urlencode($rUri);\n        $mUri        = (string)$model;\n        $mUriEncoded = urlencode($mUri);\n        $translate   = $this->_owApp->translate;\n\n        $store       = $this->_erfurt->getStore();\n\n        $ac          = $this->_erfurt->getAc();\n        $params      = $this->_request->getParams();\n\n        if (!$model || !$resource) {\n            throw new Ontowiki_Exception('need parameters m and r');\n        }\n\n        $versioning = $this->_erfurt->getVersioning();\n        $versioning->setLimit($limit);\n        if (!$versioning->isVersioningEnabled()) {\n            throw new Ontowiki_Exception('versioning disabled in config');\n        }\n\n        $title = $resource->getTitle();\n        if (null == $title) {\n            $title = OntoWiki_Utils::contractNamespace($resource->getIri());\n        }\n        $feedTitle = sprintf($translate->_('Versions for %1$s'), $title);\n\n        $historyArray = $versioning->getHistoryForResource((string)$resource, (string)$model, 1);\n\n        $idArray = array();\n        $userArray = $this->_erfurt->getUsers();\n        $titleHelper = new OntoWiki_Model_TitleHelper();\n        // Load IDs for rollback and Username Labels for view\n        foreach ($historyArray as $key => $entry) {\n            $idArray[] = (int)$entry['id'];\n            if ($entry['useruri'] == $this->_erfurt->getConfig()->ac->user->anonymousUser) {\n                $userArray[$entry['useruri']] = 'Anonymous';\n            } elseif ($entry['useruri'] == $this->_erfurt->getConfig()->ac->user->superAdmin) {\n                $userArray[$entry['useruri']] = 'SuperAdmin';\n            } elseif (is_array($userArray[$entry['useruri']]) &&\n                array_key_exists('userName', $userArray[$entry['useruri']])\n            ) {\n                $userArray[$entry['useruri']] = $userArray[$entry['useruri']]['userName'];\n            }\n        }\n\n        $linkUrl = $this->_config->urlBase . \"history/list?r=$rUriEncoded&mUriEncoded\";\n        $feedUrl = $this->_config->urlBase . \"history/feed?r=$rUriEncoded&mUriEncoded\";\n        $feed = new Zend_Feed_Writer_Feed();\n        $feed->setTitle($feedTitle);\n        $feed->setLink($linkUrl);\n        $feed->setFeedLink($feedUrl, 'atom');\n        $feed->addAuthor(\n            array(\n                'name' => 'OntoWiki',\n                'uri'  => $feedUrl\n            )\n        );\n        $feed->setDateModified(time());\n\n        foreach ($historyArray as $historyItem) {\n            $title = $translate->_('HISTORY_ACTIONTYPE_'.$historyItem['action_type']);\n\n            $entry = $feed->createEntry();\n            $entry->setTitle($title);\n            $entry->setLink($this->_config->urlBase . 'view?r='.$rUriEncoded.\"&id=\".$historyItem['id']);\n            $entry->addAuthor(\n                array(\n                    'name' => $userArray[$historyItem['useruri']],\n                    'uri'  => $historyItem['useruri']\n                )\n            );\n\n            $entry->setDateModified($historyItem['tstamp']);\n            $entry->setDateCreated($historyItem['tstamp']);\n            $entry->setDescription($title);\n\n            $content = '';\n            $result = $this->getActionTriple($historyItem['id']);\n            $content .= json_encode($result);\n\n            $entry->setContent(htmlentities($content));\n\n            $feed->addEntry($entry);\n        }\n\n        $this->_helper->layout()->disableLayout();\n        $this->_helper->viewRenderer->setNoRender();\n        $this->getResponse()->setHeader('Content-Type', 'application/atom+xml');\n\n        $out = $feed->export('atom');\n\n        $pattern = '/updated>\\n(.+?)link rel=\"alternate\"/';\n        $replace = \"updated>\\n$1link\";\n        $out = preg_replace($pattern, $replace, $out);\n\n        echo $out;\n\n        return;\n    }\n\n    /**\n     *  Listing history for selected Resource\n     */\n    public function listAction()\n    {\n        $model       = $this->_owApp->selectedModel;\n        $translate   = $this->_owApp->translate;\n        $store       = $this->_erfurt->getStore();\n        $resource    = $this->_owApp->selectedResource;\n        $ac          = $this->_erfurt->getAc();\n        $params      = $this->_request->getParams();\n        $limit       = 20;\n\n        $rUriEncoded = urlencode((string)$resource);\n        $mUriEncoded = urlencode((string)$model);\n        $feedUrl = $this->_config->urlBase . \"history/feed?r=$rUriEncoded&mUriEncoded\";\n\n        $this->view->headLink()->appendAlternate($feedUrl, 'application/atom+xml', 'History Feed');\n\n        // redirecting to home if no model/resource is selected\n        if (empty($model)\n            || (\n            empty($this->_owApp->selectedResource)\n            && empty($params['r'])\n            && ($this->_owApp->lastRoute !== 'instances')\n            )\n        ) {\n            $this->_abort('No model/resource selected.', OntoWiki_Message::ERROR);\n        }\n\n        // getting page (from and for paging)\n        if (!empty($params['page']) && (int)$params['page'] > 0) {\n            $page = (int)$params['page'];\n        } else {\n            $page = 1;\n        }\n\n        // enabling versioning\n        $versioning = $this->_erfurt->getVersioning();\n        $versioning->setLimit($limit);\n\n        if (!$versioning->isVersioningEnabled()) {\n            $this->_abort('Versioning/History is currently disabled', null, false);\n        }\n\n        $singleResource = true;\n        // setting if class or instances\n        if ($this->_owApp->lastRoute === 'instances') {\n            // setting default title\n            if (!empty($resource->getTitle())) {\n                $title = $resource->getTitle();\n            } else {\n                $title = OntoWiki_Utils::contractNamespace($resource->getIri());\n            }\n            $windowTitle = $translate->_('Versions for elements of the list');\n\n            $listHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('List');\n            $listName = \"instances\";\n            if ($listHelper->listExists($listName)) {\n                $list = $listHelper->getList($listName);\n                $list->setStore($store);\n            } else {\n                $this->_owApp->appendMessage(\n                    new OntoWiki_Message('something went wrong with the list of instances', OntoWiki_Message::ERROR)\n                );\n            }\n\n            $query = clone $list->getResourceQuery();\n            $query->setLimit(0);\n            $query->setOffset(0);\n\n            $results = $model->sparqlQuery($query);\n            $resourceVar = $list->getResourceVar()->getName();\n\n            $resources = array();\n            foreach ($results as $result) {\n                $resources[] = $result[$resourceVar];\n            }\n\n            $historyArray = $versioning->getHistoryForResourceList(\n                $resources,\n                (string)$this->_owApp->selectedModel,\n                $page\n            );\n\n            $singleResource = false;\n        } else {\n            // setting default title\n            if (!empty($resource->getTitle())) {\n                $title = $resource->getTitle();\n            } else {\n                $title = OntoWiki_Utils::contractNamespace($resource->getIri());\n            }\n            $windowTitle = sprintf($translate->_('Versions for %1$s'), $title);\n\n            $historyArray = $versioning->getHistoryForResource(\n                (string)$resource,\n                (string)$this->_owApp->selectedModel,\n                $page\n            );\n        }\n\n        $historyArrayCount = count($historyArray);\n        if ($historyArrayCount === ($limit + 1)) {\n            $count = $page * $limit + 1;\n            unset($historyArray[$limit]);\n        } else {\n            $count = ($page - 1) * $limit + $historyArrayCount;\n        }\n\n        $idArray = array();\n        $userArray = $this->_erfurt->getUsers();\n        $titleHelper = new OntoWiki_Model_TitleHelper();\n        // Load IDs for rollback and Username Labels for view\n        foreach ($historyArray as $key => $entry) {\n            $idArray[] = (int)$entry['id'];\n            if (!$singleResource) {\n                $historyArray[$key]['url'] = $this->_config->urlBase . \"view?r=\" . urlencode($entry['resource']);\n                $titleHelper->addResource($entry['resource']);\n            }\n\n            if ($entry['useruri'] == $this->_erfurt->getConfig()->ac->user->anonymousUser) {\n                $userArray[$entry['useruri']] = 'Anonymous';\n            } else if ($entry['useruri'] == $this->_erfurt->getConfig()->ac->user->superAdmin) {\n                $userArray[$entry['useruri']] = 'SuperAdmin';\n            } else if (is_array($userArray[$entry['useruri']])) {\n                if (isset($userArray[$entry['useruri']]['userName'])) {\n                    $userArray[$entry['useruri']] = $userArray[$entry['useruri']]['userName'];\n                } else {\n                    $titleHelper->addResource($entry['useruri']);\n                    $userArray[$entry['useruri']] = $titleHelper->getTitle($entry['useruri']);\n                }\n            }\n        }\n        $this->view->userArray = $userArray;\n        $this->view->idArray = $idArray;\n        $this->view->historyArray = $historyArray;\n        $this->view->singleResource = $singleResource;\n        $this->view->titleHelper = $titleHelper;\n\n        if (empty($historyArray)) {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message(\n                    'No history for the selected resource(s).',\n                    OntoWiki_Message::INFO\n                )\n            );\n        }\n\n        if ($this->_erfurt->getAc()->isActionAllowed('Rollback')) {\n            $this->view->rollbackAllowed = true;\n            // adding submit button for rollback-action\n            $toolbar = $this->_owApp->toolbar;\n            $toolbar->appendButton(\n                OntoWiki_Toolbar::SUBMIT,\n                array('name' => $translate->_('Rollback changes'), 'id' => 'history-rollback')\n            );\n            $this->view->placeholder('main.window.toolbar')->set($toolbar);\n        } else {\n            $this->view->rollbackAllowed = false;\n        }\n\n        // paging\n        $statusBar = $this->view->placeholder('main.window.statusbar');\n        // the normal page_param p collides with the generic-list param p\n        OntoWiki_Pager::setOptions(array('page_param' => 'page'));\n        $statusBar->append(OntoWiki_Pager::get($count, $limit));\n\n        // setting view variables\n        $url = new OntoWiki_Url(array('controller' => 'history', 'action' => 'rollback'));\n\n        $this->view->placeholder('main.window.title')->set($windowTitle);\n\n        $this->view->formActionUrl = (string)$url;\n        $this->view->formMethod    = 'post';\n        $this->view->formName      = 'history-rollback';\n        $this->view->formEncoding  = 'multipart/form-data';\n    }\n\n    /**\n     *  Restoring actions that are specified within the POST parameter\n     */\n    public function rollbackAction()\n    {\n        $resource    = $this->_owApp->selectedResource;\n        $graphuri    = (string)$this->_owApp->selectedModel;\n        $translate   = $this->_owApp->translate;\n        $params      = $this->_request->getParams();\n\n        // abort on missing parameters\n        if (!array_key_exists('actionid', $params) || empty($resource) || empty($graphuri)) {\n            $this->_abort('missing parameters.', OntoWiki_Message::ERROR);\n        }\n\n        // set active tab to history\n        OntoWiki::getInstance()->getNavigation()->setActive('history');\n\n        // setting default title\n        if (!empty($resource->getTitle())) {\n            $title = $resource->getTitle();\n        } else {\n            $title = OntoWiki_Utils::contractNamespace($resource->getIri());\n        }\n        $windowTitle = sprintf($translate->_('Versions for %1$s'), $title);\n        $this->view->placeholder('main.window.title')->set($windowTitle);\n\n        // setting more view variables\n        $url = new OntoWiki_Url(array('controller' => 'view', 'action' => 'index' ), null);\n        $this->view->backUrl = (string)$url;\n\n        // set translate on view\n        $this->view->translate = $this->_owApp->translate;\n\n        // abort on insufficient rights\n        if (!$this->_erfurt->getAc()->isActionAllowed('Rollback')) {\n            $this->_abort('not allowed.', OntoWiki_Message::ERROR);\n        }\n\n        // enabling versioning\n        $versioning = $this->_erfurt->getVersioning();\n\n        if (!$versioning->isVersioningEnabled()) {\n            $this->_abort('versioning / history is currently disabled.', null, false);\n        }\n\n        $successIDs = array();\n        $errorIDs = array();\n        $actionids = array();\n\n        // starting rollback action\n        $actionSpec = array(\n            'modeluri'      => $graphuri ,\n            'type'          => Erfurt_Versioning::STATEMENTS_ROLLBACK,\n            'resourceuri'   => (string)$resource\n        );\n\n        $versioning->startAction($actionSpec);\n\n        // Trying to rollback actions from POST parameters (style: serialized in actionid)\n        foreach (unserialize($params['actionid']) as $id) {\n                if ($versioning->rollbackAction($id)) {\n                    $successIDs[] = $id;\n                } else {\n                    $errorIDs[] = $id;\n                }\n        }\n\n        // ending rollback action\n        $versioning->endAction();\n\n        // adding messages for errors and success\n        if (!empty($successIDs)) {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message(\n                    'Rolled back action(s): ' . implode(', ', $successIDs),\n                    OntoWiki_Message::SUCCESS\n                )\n            );\n        }\n\n        if (!empty($errorIDs)) {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message(\n                    'Error on rollback of action(s): ' . implode(', ', $errorIDs),\n                    OntoWiki_Message::ERROR\n                )\n            );\n        }\n    }\n\n    /**\n     * Service to generate small HTML for Action-Details-AJAX-Integration inside Ontowiki\n     */\n    public function detailsAction()\n    {\n        $params = $this->_request->getParams();\n\n        if (empty($params['id'])) {\n            $this->_abort('missing parameters.');\n        } else {\n            $actionID = (int)$params['id'];\n        }\n\n        // disabling layout as it is used as a service\n        $this->_helper->layout()->disableLayout();\n        $this->view->isEmpty = true;\n\n        $results = $this->getActionTriple($actionID);\n        if ($results != null ) {\n            $this->view->isEmpty = false;\n        }\n\n        $this->view->translate      = $this->_owApp->translate;\n        $this->view->actionID       = $actionID;\n        $this->view->stAddArray     = $results['added'];\n        $this->view->stDelArray     = $results['deleted'];\n        $this->view->stOtherArray   = $results['other'];\n    }\n\n    private function toFlatArray($serializedString)\n    {\n        $walkArray = unserialize($serializedString);\n        foreach ($walkArray as $subject => $a) {\n            foreach ($a as $predicate => $b) {\n                foreach ($b as $object) {\n                    return array($subject, $predicate, $object['value']);\n                }\n            }\n        }\n    }\n\n    private function getActionTriple($actionID)\n    {\n        // enabling versioning\n        $versioning = $this->_erfurt->getVersioning();\n\n        $detailsArray = $versioning->getDetailsForAction($actionID);\n\n        $stAddArray     = array();\n        $stDelArray     = array();\n        $stOtherArray   = array();\n\n        foreach ($detailsArray as $entry) {\n            $type = (int)$entry['action_type'];\n            if ($type === Erfurt_Versioning::STATEMENT_ADDED ) {\n                $stAddArray[]   = $this->toFlatArray($entry['statement_hash']);\n            } elseif ($type === Erfurt_Versioning::STATEMENT_REMOVED ) {\n                $stDelArray[]   = $this->toFlatArray($entry['statement_hash']);\n            } else {\n                $stOtherArray[] = $this->toFlatArray($entry['statement_hash']);\n            }\n        }\n\n        return array(\n            'id' => $actionID,\n            'added' => $stAddArray,\n            'deleted' => $stDelArray,\n            'other' => $stOtherArray\n        );\n    }\n\n    /**\n     * Shortcut for adding messages\n     */\n    private function _abort($msg, $type = null, $redirect = null)\n    {\n        if (empty($type)) {\n            $type = OntoWiki_Message::INFO;\n        }\n\n        $this->_owApp->appendMessage(\n            new OntoWiki_Message(\n                $msg,\n                $type\n            )\n        );\n\n        if (empty($redirect)) {\n            if ($redirect !== false) {\n                $this->_redirect($this->_config->urlBase);\n            }\n        } else {\n            $this->redirect((string)$redirect);\n        }\n\n        return true;\n    }\n    //TODO generate feed about resource\n}\n"
  },
  {
    "path": "extensions/history/HistoryHelper.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Helper class for the History component.\n *\n * - register the tab for all navigations except the instances list\n *   (this should be undone if the history can be created from a Query2 too)\n *\n * @category OntoWiki\n * @package Extensions_History\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass HistoryHelper extends OntoWiki_Component_Helper\n{\n    public function init()\n    {\n        OntoWiki::getInstance()->getNavigation()->register(\n            'history',\n            array(\n                'controller' => 'history',     // history controller\n                'action'     => 'list',        // list action\n                'name'       => 'History',\n                'priority'   => 30\n            )\n        );\n    }\n}\n\n"
  },
  {
    "path": "extensions/history/default.ini",
    "content": ";;\n; Basic component configuration\n;;\nenabled    = true\ntemplates  = \"templates\"\nlanguages  = \"languages/\"\n\naction     = list\nname       = \"History\"\ndescription = \"show the revision history of resources (creation, changes, etc.) and provide rollback GUI.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\n\n[private]\n"
  },
  {
    "path": "extensions/history/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/history/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :history .\n:history a doap:Project ;\n  doap:name \"history\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/history/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  owconfig:templates \"templates\" ;\n  owconfig:languages \"languages/\" ;\n  owconfig:defaultAction \"list\" ;\n  rdfs:label \"History\" ;\n  doap:description \"show the revision history of resources (creation, changes, etc.) and provide rollback GUI.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/history/languages/history-de.csv",
    "content": "HISTORY_ACTIONTYPE_10;Model importiert\nHISTORY_ACTIONTYPE_20;Statement hinzugefügt\nHISTORY_ACTIONTYPE_21;Statement geändert\nHISTORY_ACTIONTYPE_22;Statement gelöscht\nHISTORY_ACTIONTYPE_23;\"Änderungen wiederhergestellt\"\nHISTORY_ACTIONTYPE_120;Daten zur Wissensbasis hinzugefügt\nHISTORY_ACTIONTYPE_130;Ressource gelöscht\nselect;Auswahl\nuser;Benutzer\ntimestamp;Zeitstempel\naction-type;Aktionstyp\nRollback changes;\"Änderungen wiederherstellen\"\nVersions for %1$s;Versionen von %1$s\n"
  },
  {
    "path": "extensions/history/languages/history-en.csv",
    "content": "HISTORY_ACTIONTYPE_10;Model imported\nHISTORY_ACTIONTYPE_20;Statement added\nHISTORY_ACTIONTYPE_21;Statement changed\nHISTORY_ACTIONTYPE_22;Statement deleted\nHISTORY_ACTIONTYPE_23;Rollback\nHISTORY_ACTIONTYPE_120;Added data to knowledge base\nHISTORY_ACTIONTYPE_130;Resource deleted\nVersions for %1$s\naction-type;Action type\n"
  },
  {
    "path": "extensions/history/templates/history/details.phtml",
    "content": "<table class=\"separated-vertical\" \n       id=\"history-details-<?php echo $this->actionID; ?>\"\n       style=\"border: 1px dotted black; font-size:0.8em;\">\n<?php \n    if ($this->isEmpty) {\n        echo $this->translate->_('No matches.');\n    }\n?>\n<?php $odd = true; ?>\n<?php foreach ($this->stAddArray as $entry) : ?>\n    <tr class=\"<?php echo $odd ? 'odd' : 'even'; $odd = !$odd; ?> \">\n        <td>&#43;                           </td>\n        <td><?php echo current($entry); ?>  </td>\n        <td><?php echo next($entry); ?>     </td>\n        <td><?php echo next($entry); ?>     </td>\n    </tr>\n<?php endforeach; ?>\n<?php foreach ($this->stDelArray as $entry) : ?>\n    <tr class=\"<?php echo $odd ? 'odd' : 'even'; $odd = !$odd; ?> \">\n        <td>&#45;                           </td>\n        <td><?php echo current($entry); ?>  </td>\n        <td><?php echo next($entry); ?>     </td>\n        <td><?php echo next($entry); ?>     </td>\n    </tr>\n<?php endforeach; ?>\n<?php foreach ($this->stOtherArray as $entry) : ?>\n    <tr class=\"<?php echo $odd ? 'odd' : 'even'; $odd = !$odd; ?> \">\n        <td>...</td>\n        <td><?php echo current($entry); ?>  </td>\n        <td><?php echo next($entry); ?>     </td>\n        <td><?php echo next($entry); ?>     </td>\n    </tr>\n<?php endforeach; ?>\n</table>\n\n"
  },
  {
    "path": "extensions/history/templates/history/list.phtml",
    "content": "<?php $odd = false; ?>\n<?php if (!empty($this->historyArray)) { ?>\n<table class=\"separated-vertical\" id=\"history-list\">\n    <thead>\n    <!-- history table headers -->\n    <tr class=\"odd\">\n        <th><?php echo $this->_('select'); ?>          </th>\n        <th><?php echo $this->_('ID'); ?>              </th>\n        <?php if(!$this->singleResource){?><th><?php echo $this->_('resource'); ?> </th><?php } ?>\n        <th><?php echo $this->_('user'); ?>            </th>\n        <th><?php echo $this->_('timestamp'); ?>       </th>\n        <th><?php echo $this->_('action-type'); ?>     </th>\n    </tr>\n    </thead>\n    <tbody>\n    <!-- history table contents -->\n    <?php $i = 0; ?>      \n    <?php foreach ($this->historyArray as $abschnitt) :?>\n    <tr class=\"<?php echo $odd ? 'odd' : 'even'; $odd = !$odd; ?> \">\n        <td class=\"selector\">\n            <input\n                <?php if (!$this->rollbackAllowed) echo 'disabled'; ?> \n                type=\"radio\"\n                id=\"actionid-<?php echo $abschnitt['id']; ?>\"\n                name=\"actionid\"\n                <?php \n                    $chunk = array_chunk($this->idArray,$i++ + 1); \n                    $idString = htmlentities(serialize($chunk[0]));\n                ?>\n                value=\"<?php echo $idString; ?>\"/>\n        </td>\n        <td class=\"enumeration\">\n            <label for=\"actionid-<?php echo $abschnitt['id']; ?>\"><?php echo $abschnitt['id']; ?></label>\n        </td>\n        <?php if(!$this->singleResource){?><td><a href=\"<?php echo $abschnitt['url']; ?>\"><?php echo $this->titleHelper->getTitle($abschnitt['resource']); ?></a></td><?php } ?>\n        <td><?php echo $this->userArray[$abschnitt['useruri']]; ?></td>\n        <td>\n            <?php $timestamp = date('c', (int) $abschnitt['tstamp']); ?>\n            <?php echo OntoWiki_Utils::dateDifference($timestamp) . ' ('.substr($timestamp,0,strlen($timestamp) - 6).')'; ?>\n        </td>\n        <td class=\"history-detail\"><a><?php echo $this->_('HISTORY_ACTIONTYPE_' . $abschnitt['action_type']); ?></a>\n            <div style=\"display:none;\" class=\"is-processing\"><?php echo $abschnitt['id']; ?></div>\n        </td>\n    </tr>\n    <?php endforeach; ?>\n                    \n    </tbody>\n</table>\n<?php } ?>\n\n<script type=\"text/javascript\">\n\n    $(document).ready(function() {\n        $('#history-list .history-detail').livequery('click', function (event) {\n\n            var node = $(this).children('div');\n            if (node.hasClass('is-processing')) {\n                var param = node.text();\n                node.text('');\n                $.get(urlBase + \"history/details/id/\" + param, function(data){\n                        node.html(data);\n                        node.removeClass('is-processing');\n                    });\n            }\n            node.toggle();\n            event.stopPropagation();\n        });\n    });\n</script>\n"
  },
  {
    "path": "extensions/history/templates/history/rollback.phtml",
    "content": "<p style=\"text-align:center\">\n    <a href=\"<?php echo $this->backUrl; ?>\">\n        <?php echo $this->translate->_(\"Back\"); ?>\n    </a>\n</p>\n"
  },
  {
    "path": "extensions/imagelink/ImagelinkPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * @category   OntoWiki\n * @package    Extensions_Imagelink\n */\nclass ImagelinkPlugin extends OntoWiki_Plugin\n{\n    private $_properties = null;\n\n    public function init()\n    {\n        $configValues      = $this->_privateConfig->properties->toArray();\n        $this->_properties = array_combine($configValues, $configValues);\n\n        return $this->_properties;\n    }\n\n    public function onDisplayObjectPropertyValue($event)\n    {\n        if (isset($this->_properties[$event->property])) {\n            return '<img class=\"object\" src=\"' . $event->value . '\" alt=\"image of ' . $event->value . '\"/>';\n        }\n    }\n\n    public function onDisplayLiteralPropertyValue($event)\n    {\n        if (isset($this->_properties[$event->property])) {\n            return '<img class=\"object\" src=\"' . $event->value . '\" alt=\"image of ' . $event->value . '\"/>';\n        }\n    }\n}\n\n"
  },
  {
    "path": "extensions/imagelink/default.ini",
    "content": "enabled     = yes\nname        = Imagelink\ndescription = \"A plug-in that renders values of certain properties as HTML images.\"\nauthor      = \"Norman Heino\"\n; url         = \n\n[events]\n1 = onDisplayObjectPropertyValue\n2 = onDisplayLiteralPropertyValue\n\n[private]\nproperties[] = \"http://xmlns.com/foaf/0.1/depiction\"\nproperties[] = \"http://xmlns.com/foaf/0.1/logo\"\nproperties[] = \"http://xmlns.com/foaf/0.1/img\"\nproperties[] = \"http://purl.org/ontology/mo/image\"\nproperties[] = \"http://open.vocab.org/terms/screenshot\"\n"
  },
  {
    "path": "extensions/imagelink/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/imagelink/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :imagelink .\n:imagelink a doap:Project ;\n  doap:name \"imagelink\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/imagelink/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Imagelink\" ;\n  doap:description \"A plug-in that renders values of certain properties as HTML images.\" ;\n  owconfig:authorLabel \"Norman Heino\" ;\n  owconfig:pluginEvent event:onDisplayObjectPropertyValue ;\n  owconfig:pluginEvent event:onDisplayLiteralPropertyValue ;\n  :properties <http://schema.org/image> ,\n    <http://xmlns.com/foaf/0.1/depiction> ,\n    <http://xmlns.com/foaf/0.1/logo> ,\n    <http://xmlns.com/foaf/0.1/img> ,\n    <http://purl.org/ontology/mo/image> ,\n    <http://open.vocab.org/terms/screenshot> ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/imprint/ImprintModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module – Navigation\n *\n * this is the main navigation module\n *\n * @category   OntoWiki\n * @package    Extensions_Imprint\n * @author     Sebastian Dietzold <sebastian@dietzold.de>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass ImprintModule extends OntoWiki_Module\n{\n    protected $_session = null;\n\n    public function init()\n    {\n        $this->_session = $this->_owApp->session;\n    }\n\n    /**\n     * Returns the content\n     */\n    public function getContents()\n    {\n        $this->view->notice = $this->_privateConfig->notice;\n        $this->view->mail   = $this->_privateConfig->mail;\n        $this->view->name   = $this->_privateConfig->name;\n        $this->view->street = $this->_privateConfig->street;\n        $this->view->zip    = $this->_privateConfig->zip;\n        $this->view->city   = $this->_privateConfig->city;\n        $content            = $this->render('imprint'); //\n        return $content;\n    }\n\n    public function getTitle()\n    {\n        return 'Imprint';\n    }\n\n    public function shouldShow()\n    {\n        return true;\n    }\n\n}\n\n\n"
  },
  {
    "path": "extensions/imprint/default.ini",
    "content": "enabled    = false\nname       = \"Imprint\"\ncaching    = no\npriority   = 40\ncontexts[] = \"main.sidewindows\"\ndescription = \"show a little box on the left that can contain legal notices and a contact information on the legally responsible person.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\n[private]\nnotice = \"Angaben gemäß § 5 TMG:\"\nmail = \"info@domain.de\"\nname = \"Herr Max Mustermann\"\nstreet = \"Lange Str. 123\"\ncity = \"Leipzig\"\nzip = \"04123\"\n"
  },
  {
    "path": "extensions/imprint/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/imprint/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :imprint .\n:imprint a doap:Project ;\n  doap:name \"imprint\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/imprint/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  rdfs:label \"Imprint\" ;\n  doap:description \"show a little box on the left that can contain legal notices and a contact information on the legally responsible person.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:hasModule :Default .\n:Default a owconfig:Module ;\n  rdfs:label \"Default\" ;\n  owconfig:caching \"false\"^^xsd:boolean ;\n  owconfig:priority \"40\" ;\n  owconfig:context \"main.sidewindows\" .\n:imprint :notice \"Angaben gemäß § 5 TMG:\" ;\n  :mail \"info@domain.de\" ;\n  :name \"Herr Max Mustermann\" ;\n  :street \"Lange Str. 123\" ;\n  :city \"Leipzig\" ;\n  :zip \"04123\" ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/imprint/imprint.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * OntoWiki imprint template\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n?>\n<?php echo $this->notice; ?><br/><br/>\n<?php echo $this->name; ?><br/>\n<?php echo $this->street; ?><br/>\n<?php echo $this->zip; ?> <?php echo $this->city; ?><br/>\nMail: <a href=\"mailto:<?php echo $this->mail; ?>\"><?php echo $this->mail; ?></a><br/>\n\n\n"
  },
  {
    "path": "extensions/jsonrpc/EvolutionJsonrpcAdapter.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n$ep = OntoWiki::getInstance()->extensionManager->getExtensionPath();\nrequire_once $ep . 'patternmanager/classes/PatternEngine.php';\nrequire_once $ep . 'patternmanager/classes/ComplexPattern.php';\nrequire_once $ep . 'patternmanager/classes/BasicPattern.php';\nrequire_once $ep . 'patternmanager/classes/PatternFunction.php';\nunset($ep);\n\n/**\n * JSON RPC Class, this wrapper class is for all Evolution Engine RPC calls.\n *\n * @category    OntoWiki\n * @package     Extensions_Jsonrpc\n * @copyright   Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license     http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author      Marvin Frommhold\n */\nclass EvolutionJsonrpcAdapter\n{\n\n    private $_owApp = null;\n    private $_engine = null;\n\n    public function __construct()\n    {\n        $this->_owApp = OntoWiki::getInstance();\n\n        $patternManagerConfig = $this->_owApp->componentManager->getComponentPrivateConfig(\"patternmanager\");\n\n        $this->_engine = new PatternEngine();\n        $this->_engine->setConfig($patternManagerConfig);\n        $this->_engine->setBackend($this->_owApp->erfurt);\n    }\n\n    /**\n     * @desc Executes the given Evolution pattern (in JSON format).\n     *\n     * @param params the POST data parameters (structure: [{\"pattern\":\"foo\",\"graph\":\"foo\",\n     *        \"variables\":{\"var1\":\"foo\",\"var2\":\"foo\"}}], variables is not mandatory)\n     *\n     * @return string\n     * @throws Exception\n     */\n    public function execPattern($params)\n    {\n        // get pattern\n        if (!array_key_exists(\"pattern\", $params)) {\n\n            throw new Erfurt_Exception(\"No pattern given!\");\n        }\n        $pattern = urldecode($params['pattern']);\n\n        // get graph\n        if (!array_key_exists(\"graph\", $params)) {\n\n            throw new Erfurt_Exception(\"No graph given!\");\n        }\n        $graph = $params[\"graph\"];\n\n        // get variables\n        $variables = array();\n        if (array_key_exists(\"variables\", $params)) {\n\n            $variables = $params[\"variables\"];\n        }\n\n        // set graph\n        $this->_engine->setDefaultGraph($graph);\n\n        // create pattern\n        $complexPattern = new ComplexPattern();\n        // load pattern from json string\n        $complexPattern->fromArray($pattern, true);\n\n        // check for errors while decoding json pattern\n        switch (json_last_error()) {\n\n            case JSON_ERROR_DEPTH:\n                throw new Erfurt_Exception(\"JSON error - maximum stack depth exceeded.\");\n            case JSON_ERROR_CTRL_CHAR:\n                throw new Erfurt_Exception(\"JSON error - unexpected control character found.\");\n            case JSON_ERROR_SYNTAX:\n                throw new Erfurt_Exception(\"JSON error - syntax error, malformed JSON.\");\n            case JSON_ERROR_NONE:\n                break;\n        }\n\n        // bound variables\n        $unboundVariables = $complexPattern->getVariables(false);\n\n        foreach ($variables as $name => $value) {\n            unset($unboundVariables[$name]);\n            $complexPattern->bindVariable($name, $value);\n        }\n\n        // process the pattern\n        $this->_engine->processPattern($complexPattern);\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "extensions/jsonrpc/JsonrpcController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * JSON RPC Server (http://json-rpc.org/) Controller for OntoWiki\n *\n * test it e.g. with:\n * wget -q -O - --post-data='{\"method\": \"count\", \"params\": {\"uri\": \"yourmodeluri\"}, \"id\": 33}'\\\n * \"ONTOWIKI/jsonrpc/request\"\n *\n * Note:\n *   HISTORY_ACTIONTYPE_80xxx for all actions\n *   HISTORY_ACTIONTYPE_801xx for all meta actions\n *   HISTORY_ACTIONTYPE_802xx for all model actions\n *   HISTORY_ACTIONTYPE_802xx for all store actions\n *\n * @category   OntoWiki\n * @package    Extensions_Jsonrpc\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass JsonrpcController extends OntoWiki_Controller_Component\n{\n    private $_server = null;\n\n    public function init()\n    {\n        parent::init();\n        $this->_helper->viewRenderer->setNoRender();\n        $this->_helper->layout()->disableLayout();\n        $this->_server = new Zend_Json_Server();\n    }\n\n    public function __call($method, $args)\n    {\n        $classname = ucfirst(str_replace('Action', '', $method)) . 'JsonrpcAdapter';\n        @include_once $classname . '.php';\n        if (class_exists($classname)) {\n            $this->_server->setClass($classname);\n\n            // JSONRPC Autodiscovery: http://framework.zend.com/manual/en/zend.json.server.html\n            if ('GET' == $_SERVER['REQUEST_METHOD']) {\n                // Indicate the URL endpoint, and the JSON-RPC version used:\n                $this->_server->setTarget('/json-rpc.php')\n                    ->setEnvelope(Zend_Json_Server_Smd::ENV_JSONRPC_2);\n\n                // TODO: Add a description to each service method\n                // http://framework.zend.com/manual/de/zend.reflection.examples.html\n\n                // Grab the SMD\n                $smd = $this->_server->getServiceMap();\n\n                // Return the SMD to the client\n                header('Content-Type: application/json');\n                echo $smd;\n\n                return;\n            }\n\n            $this->_server->handle();\n\n            return;\n        } else {\n            $this->_response->setRawHeader('HTTP/1.0 404 Not Found');\n            echo '400 Not Found - The given JSONRPC Server has no corresponding wrapper class.';\n\n            return;\n        }\n    }\n}\n\n"
  },
  {
    "path": "extensions/jsonrpc/MetaJsonrpcAdapter.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * JSON RPC Class, this wrapper class is for all meta RPC calls\n *\n * @category   OntoWiki\n * @package    Extensions_Jsonrpc\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass MetaJsonrpcAdapter\n{\n    private $_store = null;\n    private $_erfurt = null;\n\n    private $_server = array(\n        'meta'      => 'methods to query the json service itself',\n        'store'     => 'methods to manipulate and query the store',\n        'model'     => 'methods to manipulate and query a specific model',\n        'resource'  => 'methods to manipulate and query a specific resource',\n        //'evolution' => 'methods to manage and use the evolution engine',\n    );\n\n    public function __construct()\n    {\n        $this->_store  = Erfurt_App::getInstance()->getStore();\n        $this->_erfurt = Erfurt_App::getInstance();\n    }\n\n    /**\n     * @desc lists all jsonrpc server from the wiki instance\n     * @return array\n     */\n    public function listServer()\n    {\n        $returnArray = array();\n        foreach ($this->_server as $_server => $description) {\n            $returnArray[] = array(\n                'name'        => $_server,\n                'description' => $description,\n            );\n        }\n\n        return $returnArray;\n    }\n\n    /*\n     * from: http://de3.php.net/manual/en/class.reflectionmethod.php\n     * I have written a function which returns the value of a given DocComment tag.\n     */\n    protected function getDocComment($string, $tag = '')\n    {\n        if (empty($tag)) {\n            return $string;\n        }\n\n        $matches = array();\n        preg_match(\"/\" . $tag . \"(.*)(\\\\r\\\\n|\\\\r|\\\\n)/U\", $string, $matches);\n\n        if (isset($matches[1])) {\n            return trim($matches[1]);\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @desc lists all remote procedures from a specific jsonrpc server\n     *\n     * @param string server\n     *\n     * @return array\n     */\n    public function listProcedures($_server)\n    {\n        $classname = ucfirst($_server) . 'JsonrpcAdapter';\n        @include_once $classname . '.php';\n        if (class_exists($classname)) {\n            $reflectionClass = new ReflectionClass($classname);\n            // get only public functions\n            $reflectionMethods = $reflectionClass->getMethods(ReflectionMethod::IS_PUBLIC);\n            $returnArray       = array();\n            foreach ($reflectionMethods as $method) {\n                $methodName        = $method->name;\n                $methodDescription = $this->getDocComment($method, $tag = '@desc');\n                // we return only methods with a descriptions\n                if ($methodDescription) {\n                    $returnArray[] = array(\n                        'name'        => $_server . ':' . $methodName,\n                        'description' => $methodDescription,\n                    );\n                }\n            }\n            ksort($returnArray);\n\n            return $returnArray;\n        } else {\n            throw new Erfurt_Exception('Error: Server ' . $_server . ' does not exist.');\n        }\n    }\n\n    /**\n     * @desc lists all remote procedures from ALL jsonrpc server\n     * @return array\n     */\n    public function listAllProcedures()\n    {\n        $procedures = array();\n        foreach ($this->_server as $_server => $desc) {\n            $proceduresOfServer = self::listProcedures($_server);\n            $procedures         = array_merge($procedures, $proceduresOfServer);\n        }\n\n        return $procedures;\n    }\n}\n"
  },
  {
    "path": "extensions/jsonrpc/ModelJsonrpcAdapter.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * JSON RPC Class, this wrapper class is for all model RPC calls\n *\n * @category   OntoWiki\n * @package    Extensions_Jsonrpc\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass ModelJsonrpcAdapter\n{\n    private $_store  = null;\n    private $_erfurt = null;\n    private $_config = null;\n\n    public function __construct()\n    {\n        $this->_store  = Erfurt_App::getInstance()->getStore();\n        $this->_erfurt = Erfurt_App::getInstance();\n        $this->_config = $this->_erfurt->getConfig();\n    }\n\n    /**\n     * @desc exports a model as rdf/xml\n     *\n     * @param string modelIri\n     *\n     * @return string\n     */\n    public function export($modelIri)\n    {\n        return $this->_store->exportRdf($modelIri);\n    }\n\n    /**\n     * @desc performs a sparql query on the model\n     *\n     * @param string modelIri\n     * @param string query\n     *\n     * @return string\n     */\n    public function sparql($modelIri, $query = null)\n    {\n        if (null === $query) {\n            $query = 'SELECT DISTINCT ?resource ?label WHERE {?resource rdfs:label ?label} LIMIT 5';\n        }\n\n        $model    = $this->_store->getModel($modelIri);\n        $prefixes = $model->getNamespacePrefixes();\n        foreach ($prefixes as $prefix => $namespace) {\n            $query = 'PREFIX ' . $prefix . ': <' . $namespace . '>' . PHP_EOL . $query;\n        }\n\n        $query = Erfurt_Sparql_SimpleQuery::initWithString($query);\n\n        return $model->sparqlQuery($query);\n    }\n\n    /**\n     * @desc List all prefix-namespace mappings\n     *\n     * @param string modelIri\n     *\n     * @return array\n     */\n    public function getPrefixes($modelIri)\n    {\n        $model    = $this->_store->getModel($modelIri);\n        $prefixes = $model->getNamespacePrefixes();\n        $return   = array();\n        foreach ($prefixes as $index => $key) {\n            $return[] = array('prefix' => $index, 'namespace' => $key);\n        }\n\n        return $return;\n    }\n\n    /**\n     * @desc Add a prefix to namespace mapping\n     *\n     * @param string modelIri\n     * @param string prefix\n     * @param string namespace uri\n     *\n     * @return bool\n     */\n    public function addPrefix($modelIri, $prefix, $namespace = false)\n    {\n        $model    = $this->_store->getModel($modelIri);\n        $prefixes = $model->getNamespacePrefixes();\n        if (isset($prefixes[$prefix])) {\n            return false;\n        } else {\n            // try to use a standard namespace if no parameter is given\n            if ($namespace == false) {\n                $standards = isset($this->_config->namespaces) ? $this->_config->namespaces->toArray() : array();\n                if (isset($standards[$prefix])) {\n                    $namespace = $standards[$prefix];\n                } else {\n                    return false;\n                }\n            }\n            $model->addNamespacePrefix($prefix, $namespace);\n\n            return true;\n        }\n    }\n\n    /**\n     * @desc delete a prefix to namespace mapping\n     *\n     * @param string modelIri\n     * @param string prefix\n     *\n     * @return bool\n     */\n    public function deletePrefix($modelIri, $prefix = 'rdf')\n    {\n        $model    = $this->_store->getModel($modelIri);\n        $prefixes = $model->getNamespacePrefixes();\n        if (!isset($prefixes[$prefix])) {\n            return false;\n        } else {\n            $model->deleteNamespacePrefix($prefix);\n\n            return true;\n        }\n    }\n\n    /**\n     * @desc get the titles for a given array of resources\n     *\n     * @param string modelIri\n     * @param array resources\n     *\n     * @return array An associative array of resources and their titles\n     */\n    public function getTitles($modelIri, $resources)\n    {\n        // [\"http://pfarrerbuch.comiles.eu/sachsen/\"]\n        $resources = json_decode($resources);\n\n        $model    = $this->_store->getModel($modelIri);\n        $titleHelper = new OntoWiki_Model_TitleHelper($model, $this->_store);\n        $titleHelper->addResources($resources);\n        $titles = array();\n        foreach ($resources as $resourceUri) {\n            $titles[$resourceUri] = $titleHelper->getTitle($resourceUri);\n        }\n\n        return $titles;\n    }\n\n    /**\n     * @desc counts the number of statements of a model\n     *\n     * @param string modelIri\n     * @param string whereSpec\n     * @param string countSpec\n     *\n     * @return string\n     */\n    public function count($modelIri, $whereSpec = '{?s ?p ?o}', $countSpec = '*')\n    {\n        return $this->_store->countWhereMatches($modelIri, $whereSpec, $countSpec);\n    }\n\n\n    /**\n     * @desc add all input statements to the model\n     *\n     * @param string $modelIri\n     * @param string $inputModel\n     *\n     * @return bool\n     */\n    public function add($modelIri, $inputModel)\n    {\n        $model                     = $this->_store->getModel($modelIri);\n        $versioning                = $this->_erfurt->getVersioning();\n        $actionSpec                = array();\n        $actionSpec['type']        = 80201;\n        $actionSpec['modeluri']    = (string)$model;\n        $actionSpec['resourceuri'] = (string)$model;\n\n        $versioning->startAction($actionSpec);\n        $model->addMultipleStatements($inputModel);\n        $versioning->endAction();\n\n        return true;\n    }\n\n    /**\n     * @desc create a new knowledge base\n     *\n     * @param string $modelIri\n     *\n     * @return bool\n     */\n    public function create($modelIri)\n    {\n        $this->_store->getNewModel($modelIri);\n\n        return true;\n    }\n\n    /**\n     * @desc drop an existing knowledge base\n     *\n     * @param string $modelIri\n     *\n     * @return bool\n     */\n    public function drop($modelIri)\n    {\n        $this->_store->deleteModel($modelIri);\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "extensions/jsonrpc/ResourceJsonrpcAdapter.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2014-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * JSON RPC Class, this wrapper class is for all model RPC calls\n *\n * @category   OntoWiki\n * @package    Extensions_Jsonrpc\n * @copyright  Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass ResourceJsonrpcAdapter\n{\n    private $_store  = null;\n    private $_erfurt = null;\n    private $_config = null;\n\n    public function __construct()\n    {\n        $this->_store  = Erfurt_App::getInstance()->getStore();\n        $this->_erfurt = Erfurt_App::getInstance();\n        $this->_config = $this->_erfurt->getConfig();\n    }\n\n    /**\n     * @desc get a resource as RDF/JSON\n     *\n     * @param string modelIri\n     * @param string resourceIri\n     * @param string format\n     *\n     * @return string\n     */\n    public function get($modelIri, $resourceIri, $format = 'rdfjson')\n    {\n        if (!$this->_store->isModelAvailable($modelIri)) {\n            throw new Erfurt_Exception('Error: Model \"' . $modelIri . '\" is not available.');\n        }\n        $editable = $this->_store->getModel($modelIri)->isEditable();\n        $supportedFormats = Erfurt_Syntax_RdfSerializer::getSupportedFormats();\n        if (!isset($supportedFormats[$format])) {\n            throw new Erfurt_Exception('Error: Format \"' . $format . '\" is not supported by serializer.');\n        }\n        $serializer = Erfurt_Syntax_RdfSerializer::rdfSerializerWithFormat($format);\n        // create hash for current status of resource\n        $currentDataHash = $this->_getCurrentResourceHash($modelIri, $resourceIri);\n        $return = new stdClass();\n        $return->dataHash = $currentDataHash;\n        $return->editable = $editable;\n        $return->data = $serializer->serializeResourceToString($resourceIri, $modelIri);\n        return $return;\n    }\n\n    /**\n     * @desc update a modified resource\n     *\n     * @param string modelIri\n     * @param string resourceIri\n     * @param string data\n     * @param string format\n     * @param string origDataHash\n     *\n     * @return string\n     */\n    public function update($modelIri, $resourceIri, $data, $origDataHash, $format = 'rdfjson')\n    {\n        $model = $this->_store->getModel($modelIri);\n        if (!$model->isEditable()) {\n            throw new Erfurt_Exception('Error: Model \"' . $modelIri . '\" is not available.');\n        }\n        // TODO check for formats supported by the parser (not yet implemented)\n\n        // calculate hash of current status and compare to commited hash\n        $currentDataHash = $this->_getCurrentResourceHash($modelIri, $resourceIri);\n\n        if ($currentDataHash !== $origDataHash) {\n            throw new Erfurt_Exception('Error: Resource \"' . $resourceIri . '\" was edited during your session.');\n        }\n\n        // get current statements of resource\n        $resource = $model->getResource($resourceIri);\n        $originalStatements = $resource->getDescription();\n\n        // get new statements of resource\n        $parser = Erfurt_Syntax_RdfParser::rdfParserWithFormat($format);\n        $modifiedStatements = $parser->parse($data, Erfurt_Syntax_RdfParser::LOCATOR_DATASTRING);\n\n        $model->updateWithMutualDifference($originalStatements, $modifiedStatements);\n\n        return true;\n    }\n\n    /**\n     * @desc counts the number of statements of a model\n     *\n     * @param string modelIri\n     * @param string whereSpec\n     * @param string countSpec\n     *\n     * @return string\n     */\n    public function count($modelIri, $whereSpec = '{?s ?p ?o}', $countSpec = '*')\n    {\n        return $this->_store->countWhereMatches($modelIri, $whereSpec, $countSpec);\n    }\n\n    /**\n     * @desc create a new knowledge base\n     *\n     * @param string $modelIri\n     *\n     * @return bool\n     */\n    public function create($modelIri)\n    {\n        $this->_store->getNewModel($modelIri);\n\n        return true;\n    }\n\n    /**\n     * @desc drop an existing knowledge base\n     *\n     * @param string $modelIri\n     *\n     * @return bool\n     */\n    public function drop($modelIri)\n    {\n        $this->_store->deleteModel($modelIri);\n\n        return true;\n    }\n\n    /**\n     * This methid calculates a hash value for a resource including its IRI and all its properties.\n     *\n     * @param string $modelIri the IRI of the model\n     * @param string $resourceIri the IRI of the resource\n     *\n     * @return string with the hash value\n     */\n    private function _getCurrentResourceHash($modelIri, $resourceIri)\n    {\n        $resource = $this->_store->getModel($modelIri)->getResource($resourceIri);\n        $statements = $resource->getDescription();\n        return md5(serialize($statements));\n    }\n}\n"
  },
  {
    "path": "extensions/jsonrpc/StoreJsonrpcAdapter.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * JSON RPC Class, this wrapper class is for all store RPC calls\n *\n * @category   OntoWiki\n * @package    Extensions_Jsonrpc\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass StoreJsonrpcAdapter\n{\n    private $_store = null;\n    private $_erfurt = null;\n\n    public function __construct()\n    {\n        $this->_store  = Erfurt_App::getInstance()->getStore();\n        $this->_erfurt = Erfurt_App::getInstance();\n    }\n\n    /**\n     * @desc list modelIris which are readable with the current identity\n     * @return array\n     */\n    public function listModels()\n    {\n        $models = $this->_store->getAvailableModels(true);\n        // transform result to one-dim array\n        $array = array();\n        foreach ($models as $model => $bool) {\n            $array[] = $model;\n        }\n\n        return $array;\n    }\n\n    /**\n     * @desc return the name of the backend (e.g. Zend or Virtuoso)\n     * @return string\n     */\n    public function getBackendName()\n    {\n        return $this->_store->getBackendName();\n    }\n\n    /**\n     * @desc performs a sparql query on the store\n     *\n     * @param string query\n     *\n     * @return string\n     */\n    public function sparql($query = 'SELECT ?resource ?label WHERE {?resource ?prop ?label} LIMIT 5')\n    {\n        $query = Erfurt_Sparql_SimpleQuery::initWithString($query);\n\n        return $this->_store->sparqlQuery($query);\n    }\n\n    /**\n     * @desc returns the label of the current identity\n     * @return string\n     */\n    public function getIdentity()\n    {\n        return $this->_erfurt->getAuth()->getIdentity()->getUsername();\n    }\n\n\n}\n"
  },
  {
    "path": "extensions/jsonrpc/default.ini",
    "content": ";;\r\n; Basic component configuration\r\n;;\r\nenabled    = true\r\nname       = \"JSON RPC Server\"\r\ndescription = \"provides a service for remote control (e.g. with owcli).\"\r\nauthor      = \"AKSW\"\r\nauthorUrl   = \"http://aksw.org\"\r\nhomepage    = \"http://code.google.com/p/ontowiki/wiki/CommandLineInterface\"\r\n\r\nlanguages  = \"languages/\"\r\n\r\n;;\r\n; Component's private configuration\r\n; Anything set below will be available within the component ($this->_privateConfig->key)\r\n;;\r\n[private]\r\n\r\n"
  },
  {
    "path": "extensions/jsonrpc/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/jsonrpc/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :jsonrpc .\n:jsonrpc a doap:Project ;\n  doap:name \"jsonrpc\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/jsonrpc/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"JSON RPC Server\" ;\n  doap:description \"provides a service for remote control (e.g. with owcli).\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  :homepage <http://code.google.com/p/ontowiki/wiki/CommandLineInterface> ;\n  owconfig:languages \"languages/\" ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/jsonrpc/languages/community-en.csv",
    "content": "HISTORY_ACTIONTYPE_80201;JSON/RPC model->add\n"
  },
  {
    "path": "extensions/linkeddataserver/LinkeddataPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\ndefine('DEFAULT_TYPE', '*/*');\n\n/**\n * OntoWiki linked data plug-in\n *\n * Takes a request URL as a resource URI and forwards to a appropriate\n * action if a resource exists, thus providing dereferencable resource URIs.\n *\n * @category   OntoWiki\n * @package    Extensions_Linkeddata\n * @author     Norman Heino <norman.heino@gmail.com>\n * @author     Natanael Arndt <arndtn@gmail.com>\n * @copyright  Copyright (c) 2013, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass LinkeddataPlugin extends OntoWiki_Plugin\n{\n    /**\n     * Recognized mime type requests and format (f) parameter values\n     *\n     * @var array\n     */\n    private $_typeMapping = array(\n        DEFAULT_TYPE            => 'html', // default is xhtml\n        'text/html'             => 'html', // we only deliver XML-compatible html\n        'application/xhtml+xml' => 'html',\n        'application/rdf+xml'   => 'rdf',\n        'text/n3'               => 'n3',\n        'text/turtle'           => 'ttl',\n        'application/rdf+json'  => 'json',\n        'application/json'      => 'json',\n        'application/xml'       => 'html' // TODO: should this be xhtml or rdf?\n    );\n\n    /**\n     * This method is called, when the onIsDispatchable event was triggered.\n     *\n     * The onIsDispatchable event is fired in an early stage of the OntoWiki\n     * request lifecycle. Hence it is not decided in that moment, which controller\n     * an action will be used.\n     *\n     * The given Erfurt_Event object has an uri property, which contains the\n     * requested URI. The method then checks if a resource identified by that\n     * URI exists in the local store. Iff this is the case it sends a redirect\n     * to another URL depending on the requested MIME type.\n     *\n     * $event->uri contains the request URI.\n     *\n     * @param Erfurt_Event $event The event containing the required parameters.\n     *\n     * @return boolean false if the request was not handled, i.e. no resource was found.\n     */\n    public function onIsDispatchable($event)\n    {\n        $store = null;\n        try {\n            $store = OntoWiki::getInstance()->erfurt->getStore();\n        } catch (Exception $e) {\n            // if we can't get the store, we do nothing\n            return;\n        }\n\n        $request  = Zend_Controller_Front::getInstance()->getRequest();\n        $response = Zend_Controller_Front::getInstance()->getResponse();\n\n        $aliascheck = new Erfurt_Event('onResolveDomainAliasInput');\n        $aliascheck->uri = $event->uri;\n        $aliascheck->trigger();\n        $uri = $aliascheck->uri;\n\n        try {\n            // Check for a supported type by investigating the suffix of the URI or by\n            // checking the Accept header (content negotiation). The $matchingSuffixFlag\n            // parameter contains true if the suffix was used instead of the Accept header.\n            $matchingSuffixFlag = false;\n            $type               = $this->_getTypeForRequest($request, $uri, $matchingSuffixFlag);\n\n            // We need a readable graph to query. We use the first graph that was found.\n            // If no readable graph is available for the current user, we cancel here.\n            list($graph, $matchedUri) = $this->_matchGraphAndUri($uri);\n\n            if (!$graph || !$matchedUri) {\n                // URI not found\n                return false;\n            }\n\n            if ($uri !== $matchedUri) {\n                // Re-append faux file extension\n                if ($matchingSuffixFlag) {\n                    $matchedUri .= '.' . $type;\n                }\n                // Redirect to new (correct URI)\n                $response->setRedirect((string)$matchedUri, 301);\n\n                return;\n            }\n\n            // Prepare for redirect according to the given type.\n            $url = null; // This will contain the URL to redirect to.\n            switch ($type) {\n                case 'rdf':\n                case 'n3':\n                case 'ttl':\n                case 'json':\n                    // Check the config, whether provenance information should be included.\n                    $prov = false;\n                    if (isset($this->_privateConfig->provenance)\n                        && isset($this->_privateConfig->provenance->enabled)\n                    ) {\n\n                        $prov = (boolean)$this->_privateConfig->provenance->enabled;\n                    }\n\n                    // Special case: If the graph URI is identical to the requested URI, we export\n                    // the whole graph instead of only data regarding the resource.\n                    $urlSpec = array();\n                    if ($graph === $uri) {\n                        $urlSpec = array('controller' => 'model', 'action' => 'export');\n                    } else {\n                        $urlSpec = array('route' => 'data');\n                    }\n\n                    // Create a URL with the export action on the resource or model controller.\n                    // Set the required parameters for this action.\n                    $url = new OntoWiki_Url($urlSpec, array());\n                    $url->setParam('r', $uri, true)\n                        ->setParam('f', $type)\n                        ->setParam('m', $graph)\n                        ->setParam('provenance', $prov);\n                    break;\n                case 'html':\n                default:\n                    // Defaults to the standard property view.\n                    // Set the required parameters for this action.\n                    $url = new OntoWiki_Url(\n                        array('route' => 'properties'),\n                        array()\n                    );\n                    $url->setParam('r', $uri, true)\n                        ->setParam('m', $graph);\n                    break;\n            }\n\n            // Make $graph the active graph (session required) and make the resource\n            // in $uri the active resource.\n            $activeModel                              = $store->getModel($graph);\n            OntoWiki::getInstance()->selectedModel    = $activeModel;\n            OntoWiki::getInstance()->selectedResource = new OntoWiki_Resource($uri, $activeModel);\n\n            // Mark the request as dispatched, since we have all required information now.\n            $request->setDispatched(true);\n\n            // Give plugins a chance to do something before redirecting.\n            $event           = new Erfurt_Event('onBeforeLinkedDataRedirect');\n            $event->response = $response;\n            $event->trigger();\n\n            // Give plugins a chance to handle the redirection instead of doing it here.\n            $event           = new Erfurt_Event('onShouldLinkedDataRedirect');\n            $event->request  = $request;\n            $event->response = $response;\n            $event->type     = $type;\n            $event->uri      = $uri;\n            $event->flag     = $matchingSuffixFlag;\n            $event->setDefault(true);\n\n            $shouldRedirect = $event->trigger();\n            if ($shouldRedirect) {\n                // set redirect and send immediately\n                $response->setRedirect((string)$url, 303);\n\n                return;\n            }\n\n            return !$shouldRedirect; // will default to false\n        } catch (Erfurt_Exception $e) {\n            // don't handle errors since other plug-ins\n            // could chain this event\n            return false;\n        }\n    }\n\n    public function onRouteShutdown($event)\n    {\n        $request = Zend_Controller_Front::getInstance()->getRequest();\n        $owApp   = OntoWiki::getInstance();\n\n        $store = null;\n        try {\n            $store = $owApp->erfurt->getStore();\n        } catch (Exception $e) {\n            // if we can't get the store, we do nothing\n            return;\n        }\n\n        if (null == $owApp->selectedModel) {\n            $uri = $request->getScheme() . '://' . $request->getHttpHost() . $request->getRequestUri();\n            try {\n                $activeModel          = $store->getModel($uri);\n                $owApp->selectedModel = $activeModel;\n            } catch (Exception $e) {\n                // Nothing to do here.\n            }\n        }\n    }\n\n    public function onNeedsGraphForLinkedDataUri($event)\n    {\n        $store = null;\n        try {\n            $store = OntoWiki::getInstance()->erfurt->getStore();\n        } catch (Exception $e) {\n            // if we can't get the store, we do nothing\n            return;\n        }\n\n        $graphs = $store->getReadableGraphsUsingResource($event->uri);\n\n        return $graphs[0];\n    }\n\n    public function onNeedsLinkedDataUri($event)\n    {\n        if ($this->_isLinkedDataUri($event->uri)) {\n            $store = null;\n            try {\n                $store = OntoWiki::getInstance()->erfurt->getStore();\n            } catch (Exception $e) {\n                // if we can't get the store, we do nothing\n                return;\n            }\n\n            $graphs = $store->getReadableGraphsUsingResource($event->uri);\n            if ($graphs !== null) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    protected function _getTypeForRequest($request, &$uri, &$flag)\n    {\n        // check for valid type suffix\n        $parts  = explode('.', $uri);\n        $suffix = $parts[count($parts) - 1];\n        if (in_array($suffix, array_values($this->_typeMapping))) {\n            $uri  = substr($uri, 0, strlen($uri) - strlen($suffix) - 1);\n            $flag = true; // rewritten flag\n            return $suffix;\n        }\n\n        // content negotiation\n        $possibleTypes = array_keys($this->_typeMapping);\n        if ($type = $this->_matchDocumentTypeRequest($request, $possibleTypes)) {\n            return $this->_typeMapping[$type];\n        }\n\n        return $this->_typeMapping[DEFAULT_TYPE]; // default type\n    }\n\n    /**\n     * Matches the request's accept header againest supported mime types\n     * and returns the supported type with highest priority found.\n     *\n     * @param Zend_Request_Abstract the request object\n     *\n     * @return string\n     */\n    private function _matchDocumentTypeRequest($request, array $supportedTypes = array())\n    {\n        return OntoWiki_Utils::matchMimetypeFromRequest($request, $supportedTypes);\n    }\n\n    private function _matchGraphAndUri($uri)\n    {\n        $graph     = null;\n        $actualUri = null;\n\n        $store = null;\n        try {\n            $store = OntoWiki::getInstance()->erfurt->getStore();\n        } catch (Exception $e) {\n            // if we can't get the store, we do nothing\n            return;\n        }\n\n        if ((bool)$this->_privateConfig->fuzzyMatch === true) {\n            // Remove trailing slashes\n            $uri = rtrim($uri, '/');\n            // Match case-insensitive and optionally with trailing slashes\n            $query    = sprintf(\n                'SELECT DISTINCT ?uri WHERE {?uri ?p ?o . FILTER (regex(str(?uri), \"^%s/*$\", \"i\"))}',\n                $uri\n            );\n            $queryObj = Erfurt_Sparql_SimpleQuery::initWithString($query);\n            $result   = $store->sparqlQuery($queryObj);\n            $first    = current($result);\n            if (isset($first['uri'])) {\n                $actualUri = $first['uri'];\n            }\n        } else {\n            $actualUri = $uri;\n        }\n\n        $graphs = $store->getReadableGraphsUsingResource($actualUri, true);\n\n        return array($graphs[0], $actualUri);\n    }\n\n    private function _isLinkedDataUri($uri)\n    {\n        $owApp  = OntoWiki::getInstance();\n        $owBase = $owApp->config->urlBase;\n\n        if (substr($uri, 0, strlen($owBase)) === $owBase) {\n            return true;\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "extensions/linkeddataserver/default.ini",
    "content": "enabled = true\nname        = \"Linked Data Server\"\ndescription = \"A plug-in that converts resource URIs to internal OntoWiki URLs if a resource exists.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\n[events]\n1 = onIsDispatchable\n2 = onRouteShutdown\n3 = onNeedsGraphForLinkedDataUri\n4 = onNeedsLinkedDataUri\n\n[private]\n;; whether to include provenance information\n;provenance.enabled = true\n;; Ignores trailing slashes and case in linked data URIs\n; fuzzyMatch = yes\n"
  },
  {
    "path": "extensions/linkeddataserver/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/linkeddataserver/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :linkeddataserver .\n:linkeddataserver a doap:Project ;\n  doap:name \"linkeddataserver\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/linkeddataserver/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Linked Data Server\" ;\n  doap:description \"A plug-in that converts resource URIs to internal OntoWiki URLs if a resource exists.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:pluginEvent event:onIsDispatchable ;\n  owconfig:pluginEvent event:onRouteShutdown ;\n  owconfig:pluginEvent event:onNeedsGraphForLinkedDataUri ;\n  owconfig:pluginEvent event:onNeedsLinkedDataUri ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/listmodules/ShowpropertiesModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module – showproperties\n *\n * Add instance properties to the list view\n *\n * @category   OntoWiki\n * @package    Extensions_Listmodules\n * @author     Norman Heino <norman.heino@gmail.com>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass ShowpropertiesModule extends OntoWiki_Module\n{\n    protected $_instances;\n\n    public function init()\n    {\n        $listHelper       = Zend_Controller_Action_HelperBroker::getStaticHelper('List');\n        $this->_instances = $listHelper->getLastList();\n    }\n\n    public function getTitle()\n    {\n        return 'Show Properties';\n    }\n\n    public function shouldShow()\n    {\n        return ($this->_instances instanceof OntoWiki_Model_Instances) && $this->_instances->hasData();\n    }\n\n    public function getContents()\n    {\n        $this->view->headScript()->appendFile($this->view->moduleUrl . 'showproperties.js');\n\n        $allShownProperties     = $this->_instances->getShownPropertiesPlain();\n        $shownProperties        = array();\n        $shownInverseProperties = array();\n        foreach ($allShownProperties as $prop) {\n            if ($prop['inverse']) {\n                $shownInverseProperties[] = $prop['uri'];\n            } else {\n                $shownProperties[] = $prop['uri'];\n            }\n        }\n        $this->view->headScript()->appendScript(\n            'var shownProperties = ' . json_encode($shownProperties) . ';\n            var shownInverseProperties = ' . json_encode($shownInverseProperties) . ';'\n        );\n\n        $url = new OntoWiki_Url(array('controller' => 'resource', 'action' => 'instances'));\n        $url->setParam(\n            'instancesconfig', json_encode(\n                array('filter' => array(array('id'    => 'propertyUsage', 'action' => 'add', 'mode' => 'query',\n                                              'query' => (string)$this->_instances->getAllPropertiesQuery(false))))\n            )\n        );\n        $url->setParam('init', true);\n        $this->view->propertiesListLink = (string)$url;\n        $url->setParam(\n            'instancesconfig', json_encode(\n                array('filter' => array(array('id'    => 'propertyUsage', 'action' => 'add', 'mode' => 'query',\n                                              'query' => (string)$this->_instances->getAllPropertiesQuery(true))))\n            )\n        );\n        $this->view->inversePropertiesListLink = (string)$url;\n\n        if ($this->_privateConfig->filterhidden || $this->_privateConfig->filterlist) {\n            $this->view->properties        = $this->filterProperties($this->_instances->getAllProperties(false));\n            $this->view->reverseProperties = $this->filterProperties($this->_instances->getAllProperties(true));\n        } else {\n            $this->view->properties        = $this->_instances->getAllProperties(false);\n            $this->view->reverseProperties = $this->_instances->getAllProperties(true);\n        }\n\n        return $this->render('showproperties');\n    }\n\n    public function getStateId()\n    {\n        $id = $this->_owApp->selectedModel\n            . $this->_owApp->selectedResource;\n\n        return $id;\n    }\n\n    private function filterProperties($properties)\n    {\n        $uriToFilter        = array();\n        $filteredProperties = array();\n\n        if ($this->_privateConfig->filterhidden) {\n            $store = $this->_owApp->erfurt->getStore();\n            //query for hidden properties\n            $query = new Erfurt_Sparql_SimpleQuery();\n            $query->setSelectClause(\n                'PREFIX sysont: <http://ns.ontowiki.net/SysOnt/>\n                                     SELECT ?uri'\n            )\n                ->setWherePart('WHERE {?uri sysont:hidden \\'true\\'.}');\n            $uriToFilter = $store->sparqlQuery($query);\n        }\n\n        if ($this->_privateConfig->filterlist) {\n            //get properties to hide from privateconfig\n            $toFilter = $this->_privateConfig->property->toArray();\n            foreach ($toFilter as $element) {\n                array_push($uriToFilter, array('uri' => $element));\n            }\n        }\n\n        foreach ($properties as $property) {\n            $toFilter = false;\n            foreach ($uriToFilter as $element) {\n                if ($element['uri'] == $property['uri']) {\n                    $toFilter = true;\n                    break;\n                }\n            }\n            if (!$toFilter) {\n                array_push($filteredProperties, $property);\n            }\n        }\n\n        return $filteredProperties;\n    }\n}\n"
  },
  {
    "path": "extensions/listmodules/default.ini",
    "content": "enabled    = true\ntitle     = \"List Modules\"\ncaching    = false\npriority   = 20\ncontexts[] = \"main.window.list\"\ndescription = \"Modules showed in the list view (show properties)\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\n[private]\n\n; define wheter properties annotated with sysont:hidden should be filtered out:\nfilterhidden = false;\n\n; define wheter properties from this list should be filtered out:\nfilterlist = false;\n\n;property[] = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\"\n;property[] = \"http://www.w3.org/2000/01/rdf-schema#label\"\nproperty[] = \"http://www.w3.org/2003/01/geo/wgs84_pos#lat\"\nproperty[] = \"http://www.w3.org/2003/01/geo/wgs84_pos#long\"\n"
  },
  {
    "path": "extensions/listmodules/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/listmodules/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :listmodules .\n:listmodules a doap:Project ;\n  doap:name \"listmodules\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/listmodules/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"List Modules\" ;\n  doap:description \"Modules showed in the list view (show properties)\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:hasModule :Default .\n:Default a owconfig:Module ;\n  rdfs:label \"Default\" ;\n  owconfig:caching \"false\"^^xsd:boolean ;\n  owconfig:priority \"20\" ;\n  owconfig:context \"main.window.list\" .\n:listmodules :filterhidden \"false\"^^xsd:boolean ;\n  :filterlist \"false\"^^xsd:boolean ;\n  :property <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ;\n  :property <http://www.w3.org/2003/01/geo/wgs84_pos#long> ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/listmodules/showproperties.js",
    "content": "/**\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n$(document).ready(function() {\n    //Set up drag- and drop-functionality\n    $('.show-property').draggable({\n        scope: 'Resource',\n        helper: 'clone',\n        zIndex: 10000,\n        scroll: false,\n        appendTo: 'body'\n});\n\n    // highlight previously selected properties\n    $('.show-property').each(function() {\n        var propUri = $(this).attr('about');\n        if (!$(this).hasClass('InverseProperty')) {\n            var pos = $.inArray(propUri, shownProperties);\n        } else {\n            var pos = $.inArray(propUri, shownInverseProperties);\n        }\n        if (pos > -1) {\n            $(this).addClass('selected');\n        }\n    })\n\n    function handleNewSelect() {\n        var propUri = $(this).attr('about');\n        $(this).toggleClass('selected');\n        \n        var action = $(this).hasClass('selected')? \"add\" : \"remove\";\n        var inverse = $(this).hasClass('InverseProperty');\n        var label = $(this).attr(\"title\");\n        var data = { shownProperties : [{\n            \"uri\" : propUri,\n            \"label\" : label,\n            \"action\" : action,\n            \"inverse\" : inverse\n        }]};\n\n        var serialized = $.toJSON(data);\n        //\n        //reload page\n        //$('#showproperties form input').attr(\"value\", serialized);\n        //$('#showproperties form').submit();\n        var arr = document.URL.split('?');\n        var url = arr[0]; //without parameters (a s-parameter would re-build the query)\n        // or reload list\n        var mainInnerContent = $(this).parents('.content.has-innerwindows').eq(0).find('.innercontent');\n        mainInnerContent.addClass('is-processing');\n        mainInnerContent.load(\n            reloadUrl+\"\",\n            {\"instancesconfig\": serialized, \"list\":listName},\n            function(){\n                mainInnerContent.removeClass('is-processing');\n                $('body').trigger('ontowiki.resource-list.reloaded');\n                showPropertiesAddDroppableToListTable();\n            });\n      };\n\n    function showPropertiesAddDroppableToListTable() {\n        $('.content table').droppable({\n             accept: '.show-property',\n             scope: 'Resource',\n             activeClass: 'ui-droppable-accepted-destination',\n             hoverClass: 'ui-droppable-hovered',\n             drop:\n                 function(event, ui) {$(ui.draggable).each(handleNewSelect);}\n        });\n    }\n\n    //set click handler for the properties\n    $('.show-property').click(handleNewSelect);\n    showPropertiesAddDroppableToListTable();\n})\n"
  },
  {
    "path": "extensions/listmodules/showproperties.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki showproperties module template\n */\n\n?>\n<?php if (!empty($this->properties)): ?>\n<div class=\"has-contextmenu-area\">\n    <div class=\"contextmenu\">\n        <a class=\"item\"\n           href=\"<?php echo $this->propertiesListLink ?>\">\n                <span class=\"icon icon-list\" title=\"Show as List\">\n                        <span>Show as List</span>\n                </span>\n        </a>\n    </div>\n    <ul class=\"inline separated\">\n        <?php $i = 0; \n        foreach ($this->properties as $id => $propertyInfo):\n            if (++$i == count($this->properties)): ?>\n                <li class=\"last-child\"><a class=\"show-property Property hasMenu\" about=\"<?php echo $propertyInfo['uri']; ?>\" title=\"<?php echo $propertyInfo['title'] ?>\"><?php echo $propertyInfo['title'] ?></a></li>\n            <?php else: ?>\n                <li><a class=\"show-property hasMenu\" about=\"<?php echo $propertyInfo['uri']; ?>\" title=\"<?php echo $propertyInfo['title'] ?>\"><?php echo $propertyInfo['title'] ?></a></li>\n            <?php endif; ?>\n        <?php endforeach; ?>\n    </ul>\n</div>\n<?php endif ?>\n<?php if (!empty($this->reverseProperties)): ?>\n<div class=\"has-contextmenu-area\">\n    <div class=\"contextmenu\">\n        <a class=\"item\"\n           href=\"<?php echo $this->inversePropertiesListLink ?>\">\n                <span class=\"icon icon-list\" title=\"Show as List\">\n                        <span>Show as List</span>\n                </span>\n        </a>\n    </div>\n\t<ul class=\"inline separated\">\n\t    <?php $i = 0; \n            foreach ($this->reverseProperties as $id => $propertyInfo):\n                    if (++$i == count($this->properties)): ?>\n\t\t        <li class=\"last-child\"><a class=\"show-property InverseProperty hasMenu\" about=\"<?php echo $propertyInfo['uri']; ?>\" title=\"<?php echo $propertyInfo['title'] ?>\"><?php echo $propertyInfo['title'] ?></a><sup>-1</sup></li>\n\t\t    <?php else: ?>\n\t\t        <li><a class=\"show-property InverseProperty hasMenu\" about=\"<?php echo $propertyInfo['uri']; ?>\" title=\"<?php echo $propertyInfo['title'] ?>\"><?php echo $propertyInfo['title'] ?></a><sup>-1</sup></li>\n\t\t    <?php endif; ?>\n\t\t<?php endforeach; ?>\n\t</ul>\n</div>\n<?php endif ?>\n<?php if ( ( !empty($this->Properties) ) && ( !empty($this->reverseProperties) ) ): ?>\n\t<p class=\"messagebox info\"><?php echo $this->_($this->message) ?></p>\n<?php endif; ?>\n\n"
  },
  {
    "path": "extensions/literaltypes/LiteraltypesPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * @category   OntoWiki\n * @package    Extensions_Literaltypes\n */\nclass LiteraltypesPlugin extends OntoWiki_Plugin\n{\n\n    public function init()\n    {\n    }\n\n    public function onDisplayLiteralPropertyValue($event)\n    {\n        $parameter = $event->getParams();\n\n        if (!empty($parameter['datatype'])) {\n\n            $url = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n            $url->setParam('r', $parameter['datatype'], true);\n            $datatypeLink\n                = \"<a class=\\\"hasMenu\\\" about=\\\"\" . $parameter['datatype'] . \"\\\" href=\\\"\" . ((string)$url) . \"\\\">\"\n                . (OntoWiki_Utils::getUriLocalPart($parameter['datatype'])) . \"</a>\";\n\n            $ret = \"<span>\" . $parameter['value'] . \"</span>\";\n            $ret .= \"<span style = 'float:right;margin-left:2em'>[\" . $datatypeLink . \"]</span>\";\n\n            return $ret;\n        }\n        if (!empty($parameter['language'])) {\n            $ret = \"<span>\" . $parameter['value'] . \"</span>\";\n            $ret .= \"<span style = 'float:right;margin-left:2em'>[\" . $parameter['language'] . \"]</span>\";\n\n            return $ret;\n        }\n    }\n\n}\n"
  },
  {
    "path": "extensions/literaltypes/default.ini",
    "content": "enabled     = false\nname        = LiteralTypes\ndescription = \"Visualizes the language or the datatype of a LiteralValue\"\nauthor      = \"Michael Martin\"\n\n[events]\n1 = onDisplayLiteralPropertyValue\n\n[private]\n"
  },
  {
    "path": "extensions/literaltypes/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/literaltypes/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :literaltypes .\n:literaltypes a doap:Project ;\n  doap:name \"literaltypes\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/literaltypes/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  rdfs:label \"LiteralTypes\" ;\n  doap:description \"Visualizes the language or the datatype of a LiteralValue\" ;\n  owconfig:authorLabel \"Michael Martin\" ;\n  owconfig:pluginEvent event:onDisplayLiteralPropertyValue ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/mail/MailPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * This class includes a plugin to send mails via an event from different places\n * within ontowiki.\n *\n * @category   OntoWiki\n * @package    Extensions_Mail\n */\nclass MailPlugin extends OntoWiki_Plugin\n{\n    public function onAnnounceWorker($event)\n    {\n        // key name, class file, class name, config\n        $event->registry->registerJob(\n            'testMail',\n            'extensions/mail/jobs/Mail.php',\n            'Mail_Job_Mail',\n            $this->_privateConfig->smtp->toArray()\n        );\n    }\n}\n\n"
  },
  {
    "path": "extensions/mail/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/sendmail/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :mail .\n:mail a doap:Project ;\n  doap:name \"mail\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/mail/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  rdfs:label \"Mail\" ;\n  doap:description \"A plug-in that tests mail support\" ;\n  owconfig:authorLabel \"Würker Christian\" ;\n  owconfig:pluginEvent event:onAnnounceWorker ;\n  owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"smtp\";\n      :server \"yourserver.de\";\n      :auth \"login\";\n      :username \"user@yourserver.de\";\n      :password \"<password>\";\n] ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/mail/jobs/Mail.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2013-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * This class includes a mail send job.\n *\n * @category    OntoWiki\n * @package     Extensions_Mail\n * @copyright   Copyright (c) 2013, {@link http://aksw.org AKSW}\n * @author      Christian Würker <christian.wuerker@ceusmedia.de>\n * @license     http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass Mail_Job_Mail extends Erfurt_Worker_Job_Abstract\n{\n    /**\n     *  Send mail.\n     *\n     *  @access     public\n     *  @param      object      $workload       Object with mail sender, receiver, subject and body\n     *  @return     void\n     *  @throws     InvalidArgumentException    if workload object has no sender\n     *  @throws     InvalidArgumentException    if workload object has no receiver\n     *  @throws     InvalidArgumentException    if workload object has no subject\n     *  @throws     InvalidArgumentException    if workload object has no body\n     */\n    public function run($workload)\n    {\n        $smtpServer = $this->options['server'];\n        $config     = array();\n        if ($this->options['auth']) {\n            $config['auth']      = $this->options['auth'];\n            $config['username']  = $this->options['username'];\n            $config['password']  = $this->options['password'];\n        }\n        $transport = new Zend_Mail_Transport_Smtp($smtpServer, $config);\n\n        if (is_object($workload)) {\n            if (empty($workload->sender)) {\n                throw new InvalidArgumentException('Workload is missing sender');\n            }\n            if (empty($workload->receiver)) {\n                throw new InvalidArgumentException('Workload is missing receiver');\n            }\n            if (empty($workload->subject)) {\n                throw new InvalidArgumentException('Workload is missing subject');\n            }\n            if (empty($workload->body)) {\n                throw new InvalidArgumentException('Workload is missing body');\n            }\n            $mail = new Zend_Mail();\n            $mail->setDefaultTransport($transport);\n            $mail->addTo($workload->receiver);\n            $mail->setSubject($workload->subject);\n            $mail->setBodyText($workload->body);\n            $mail->setFrom($workload->sender);\n            $mail->send($transport);\n            $this->logSuccess('Mail \"'.$workload->subject.'\" sent to '.$workload->receiver);\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/mailtolink/MailtolinkPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * @category   OntoWiki\n * @package    Extensions_Mailtolink\n */\nclass MailtolinkPlugin extends OntoWiki_Plugin\n{\n    private $_properties = null;\n\n    public function init()\n    {\n        $configValues      = $this->_privateConfig->properties->toArray();\n        $this->_properties = array_combine($configValues, $configValues);\n\n        return $this->_properties;\n    }\n\n    public function onDisplayObjectPropertyValue($event)\n    {\n        if (!substr($event->value, 0, 7) === 'mailto:') {\n            $mailUri = 'mailto:' . $event->value;\n        } else {\n            $mailUri = $event->value;\n        }\n        if (isset($this->_properties[$event->property])) {\n            return '<a href=\"' . $mailUri . '\">' . $event->value . '</a>';\n        }\n    }\n\n    public function onDisplayLiteralPropertyValue($event)\n    {\n        if (!substr($event->value, 0, 7) === 'mailto:') {\n            $mailUri = 'mailto:' . $event->value;\n        } else {\n            $mailUri = $event->value;\n        }\n        if (isset($this->_properties[$event->property])) {\n            return '<a href=\"' . $mailUri . '\">' . $event->value . '</a>';\n        }\n    }\n}\n\n"
  },
  {
    "path": "extensions/mailtolink/default.ini",
    "content": "enabled     = yes\nname        = Mailtolink\ndescription = \"A plug-in that renders values of certain properties as mailto links.\"\nauthor      = \"Norman Heino\"\n; url         = \n\n[events]\n1 = onDisplayObjectPropertyValue\n2 = onDisplayLiteralPropertyValue\n\n[private]\nproperties[] = \"http://xmlns.com/foaf/0.1/mbox\"\nproperties[] = \"http://swrc.ontoware.org/ontology#email\""
  },
  {
    "path": "extensions/mailtolink/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/mailtolink/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :mailtolink .\n:mailtolink a doap:Project ;\n  doap:name \"mailtolink\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/mailtolink/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Mailtolink\" ;\n  doap:description \"A plug-in that renders values of certain properties as mailto links.\" ;\n  owconfig:authorLabel \"Norman Heino\" ;\n  owconfig:pluginEvent event:onDisplayObjectPropertyValue ;\n  owconfig:pluginEvent event:onDisplayLiteralPropertyValue ;\n  :properties <http://xmlns.com/foaf/0.1/mbox> ;\n  :properties <http://swrc.ontoware.org/ontology#email> ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/manchester/ManchesterController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Manchester Syntax Controller\n *\n * @category   OntoWiki\n * @package    Extensions_Manchester\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass ManchesterController extends OntoWiki_Controller_Component\n{\n    /*\n     * post a manchester string to save/edit the class\n     */\n    public function postAction()\n    {\n        // service controller needs no view renderer\n        $this->_helper->viewRenderer->setNoRender();\n        // disable layout for Ajax requests\n        $this->_helper->layout()->disableLayout();\n\n        $response = $this->getResponse();\n        $request  = $this->_request;\n        $output   = false;\n\n        try {\n            $model = $this->_owApp->selectedModel;\n            $store = $this->_owApp->erfurt->getStore();\n\n            $classname = OntoWiki::getInstance()->selectedResource;\n            $manchester = $request->manchester;\n\n            $structuredOwl = $this->initParser($manchester);\n\n            $triples = $structuredOwl->toTriples();\n\n            $output = array(\n                'message' => 'class saved',\n                'class'   => 'success',\n                'out'     => $triples\n            );\n        } catch (Exception $e) {\n            // encode the exception for http response\n            $output = array(\n                'message' => $e->getMessage(),\n                'class'   => 'error'\n            );\n            $response->setRawHeader('HTTP/1.1 500 Internal Server Error');\n        }\n\n        // send the response\n        $response->setHeader('Content-Type', 'application/json');\n        $response->setBody(json_encode($output));\n    }\n\n    private function initParser($inputQuery)\n    {\n        require_once 'antlr/Php/antlr.php';\n        $input  = new ANTLRStringStream($inputQuery);\n        $lexer  = new Erfurt_Syntax_ManchesterLexer($input);\n        $tokens = new CommonTokenStream($lexer);\n        $parser = new Erfurt_Syntax_ManchesterParser($tokens);\n\n        // call the correct parser method (currently it's classFrame)\n        return $parser->classFrame();\n    }\n\n\n}\n"
  },
  {
    "path": "extensions/manchester/ManchesterModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Module.php';\n\n/**\n * OntoWiki module – Manchester Editor Module\n *\n * @category   OntoWiki\n * @package    Extensions_Manchester\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass ManchesterModule extends OntoWiki_Module\n{\n    public function getTitle()\n    {\n        return 'Manchester Syntax';\n    }\n\n    public function init()\n    {\n        if (!isset(OntoWiki::getInstance()->selectedResource)) {\n            return;\n        }\n    }\n\n    /**\n     * Returns the content\n     */\n    public function getContents()\n    {\n        $from      = $this->_owApp->selectedModel;\n        $classname = OntoWiki::getInstance()->selectedResource;\n\n        $structured = Erfurt_Owl_Structured_Util_Owl2Structured::mapOWL2Structured(\n            array((string)$from), (string)$classname\n        );\n\n        $data    = new StdClass();\n        $formUrl = new OntoWiki_Url(array('controller' => 'manchester', 'action' => 'post'), array());\n\n        $data->formUrl          = (string)$formUrl;\n        $data->manchesterString = (string)$structured;\n\n        $content = $this->render('modules/manchester', $data, 'data');\n\n        return $content;\n    }\n\n}\n"
  },
  {
    "path": "extensions/manchester/default.ini",
    "content": ";;\n; Basic component configuration\n;;\nenabled    = false\ntemplates  = \"templates\"\nlanguages  = \"languages\"\nname       = \"Manchester\"\ndescription = \"Class Editor with Manchester Syntax\"\nauthor      = \"AKSW\"\n\nmodules.manchester.title      = \"Manchester Syntax\"\nmodules.manchester.caching    = no\nmodules.manchester.priority   = 3\nmodules.manchester.contexts.0 = \"main.window.properties\"\n"
  },
  {
    "path": "extensions/manchester/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/manchester/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :manchester .\n:manchester a doap:Project ;\n  doap:name \"manchester\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/manchester/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  owconfig:templates \"templates\" ;\n  owconfig:languages \"languages\" ;\n  rdfs:label \"Manchester\" ;\n  doap:description \"Class Editor with Manchester Syntax\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  owconfig:hasModule :Manchester .\n:Manchester a owconfig:Module ;\n  rdfs:label \"Manchester Syntax\" ;\n  owconfig:caching \"false\"^^xsd:boolean ;\n  owconfig:priority \"3\" ;\n  owconfig:context \"main.window.properties\" .\n:manchester doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/manchester/templates/modules/manchester.phtml",
    "content": "<?php $data = $this->data ?>\n<form action=\"<?php echo $data->formUrl ?>\" method=\"post\" class=\"width98\">\n    <fieldset>\n        <div class=\"row-input\">\n            <label class=\"display-block onlyAural\" for=\"manchester\">Describe this resource in manchester syntax ...</label>\n            <input class=\"text width99 inner-label\" style=\"height: 5em\" type=\"text\" name=\"manchester\" id=\"manchester\" value=\"<?php echo $data->manchesterString?>\"/>\n        </div>\n        <div class=\"actionbuttons onlyAural hidden\">\n            <button type=\"submit\">Save</button>\n        </div>\n    </fieldset>\n</form>\n\n"
  },
  {
    "path": "extensions/markdown/MarkdownPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * @category   OntoWiki\n * @package    Extensions_Markdown\n */\nclass MarkdownPlugin extends OntoWiki_Plugin\n{\n\n    public function init()\n    {\n        $this->properties = array_values($this->_privateConfig->properties->toArray());\n        if (isset($this->_privateConfig->datatypes) && $this->_privateConfig->datatypes instanceof Zend_Config) {\n            $this->datatypes = array_values($this->_privateConfig->datatypes->toArray());\n        } else {\n            if (isset($this->_privateConfig->datatypes)) {\n                $this->datatypes = array($this->_privateConfig->datatypes);\n            }\n        }\n    }\n\n    public function onDisplayLiteralPropertyValue($event)\n    {\n        if (in_array($event->property, $this->properties)) {\n            require_once 'parser/markdown.php';\n\n            return Markdown($event->value);\n        }\n        if (in_array($event->datatype, $this->datatypes)) {\n            require_once 'parser/markdown.php';\n\n            return Markdown($event->value);\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/markdown/default.ini",
    "content": "enabled     = true\nname        = Markdown\ndescription = \"A plug-in that renders markdown values of certain properties as html.\"\nauthor      = \"Marvin Frommhold\"\n; url         =\n\n[events]\n1 = onDisplayLiteralPropertyValue\n\n[private]\nproperties[] = \"http://purl.org/dc/elements/1.1/description\"\nproperties[] = \"http://rdfs.org/sioc/ns#content\"\n\ndatatypes[] = \"http://ns.ontowiki.net/SysOnt/Markdown\"\n"
  },
  {
    "path": "extensions/markdown/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/markdown/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :markdown .\n:markdown a doap:Project ;\n  doap:name \"markdown\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/markdown/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Markdown\" ;\n  doap:description \"A plug-in that renders markdown values of certain properties as html.\" ;\n  owconfig:authorLabel \"Marvin Frommhold\" ;\n  owconfig:pluginEvent event:onDisplayLiteralPropertyValue ;\n  :properties <http://purl.org/dc/elements/1.1/description> ;\n  :properties <http://rdfs.org/sioc/ns#content> ;\n  :datatypes <http://ns.ontowiki.net/SysOnt/Markdown> ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/markdown/parser/License.text",
    "content": "PHP Markdown\nCopyright (c) 2004-2013 Michel Fortin \n<http://michelf.ca/>  \nAll rights reserved.\n\nBased on Markdown  \nCopyright (c) 2003-2006 John Gruber   \n<http://daringfireball.net/>   \nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n\n* Neither the name \"Markdown\" nor the names of its contributors may\n  be used to endorse or promote products derived from this software\n  without specific prior written permission.\n\nThis software is provided by the copyright holders and contributors \"as\nis\" and any express or implied warranties, including, but not limited\nto, the implied warranties of merchantability and fitness for a\nparticular purpose are disclaimed. In no event shall the copyright owner\nor contributors be liable for any direct, indirect, incidental, special,\nexemplary, or consequential damages (including, but not limited to,\nprocurement of substitute goods or services; loss of use, data, or\nprofits; or business interruption) however caused and on any theory of\nliability, whether in contract, strict liability, or tort (including\nnegligence or otherwise) arising in any way out of the use of this\nsoftware, even if advised of the possibility of such damage.\n"
  },
  {
    "path": "extensions/markdown/parser/PHP Markdown Readme.text",
    "content": "PHP Markdown\n============\n\nVersion 1.0.1p - Sun 13 Jan 2013\n\nby Michel Fortin  \n<http://michelf.ca/>\n\nbased on work by John Gruber  \n<http://daringfireball.net/>\n\n\nIntroduction\n------------\n\nMarkdown is a text-to-HTML conversion tool for web writers. Markdown\nallows you to write using an easy-to-read, easy-to-write plain text\nformat, then convert it to structurally valid XHTML (or HTML).\n\n\"Markdown\" is two things: a plain text markup syntax, and a software \ntool, written in Perl, that converts the plain text markup to HTML. \nPHP Markdown is a port to PHP of the original Markdown program by \nJohn Gruber.\n\nPHP Markdown can work as a plug-in for WordPress, as a modifier for\nthe Smarty templating engine, or as a replacement for Textile\nformatting in any software that supports Textile.\n\nFull documentation of Markdown's syntax is available on John's \nMarkdown page: <http://daringfireball.net/projects/markdown/>\n\n\nInstallation and Requirement\n----------------------------\n\nPHP Markdown requires PHP version 4.0.5 or later.\n\nBefore PHP 5.3.7, pcre.backtrack_limit defaults to 100 000, which is too small\nin many situations. You might need to set it to higher values. Later PHP \nreleases defaults to 1 000 000, which is usually fine.\n\n\n### WordPress ###\n\nPHP Markdown works with [WordPress][wp], version 1.2 or later.\n\n [wp]: http://wordpress.org/\n\n1.  To use PHP Markdown with WordPress, place the \"markdown.php\" file \n    in the \"plugins\" folder. This folder is located inside \n    \"wp-content\" at the root of your site:\n\n        (site home)/wp-content/plugins/\n\n2.  Activate the plugin with the administrative interface of \n    WordPress. In the \"Plugins\" section you will now find Markdown. \n    To activate the plugin, click on the \"Activate\" button on the \n    same line as Markdown. Your entries will now be formatted by \n    PHP Markdown.\n\n3.  To post Markdown content, you'll first have to disable the \n    \"visual\" editor in the User section of WordPress.\n\nYou can configure PHP Markdown to not apply to the comments on your \nWordPress weblog. See the \"Configuration\" section below.\n\nIt is not possible at this time to apply a different set of \nfilters to different entries. All your entries will be formatted by \nPHP Markdown. This is a limitation of WordPress. If your old entries \nare written in HTML (as opposed to another formatting syntax, like \nTextile), they'll probably stay fine after installing Markdown.\n\n\n### Replacing Textile in TextPattern ###\n\n[TextPattern][tp] use [Textile][tx] to format your text. You can \nreplace Textile by Markdown in TextPattern without having to change\nany code by using the *Textile Compatibility Mode*. This may work \nwith other software that expect Textile too.\n\n [tx]: http://www.textism.com/tools/textile/\n [tp]: http://www.textpattern.com/\n\n1.  Rename the \"markdown.php\" file to \"classTextile.php\". This will\n    make PHP Markdown behave as if it was the actual Textile parser.\n\n2.  Replace the \"classTextile.php\" file TextPattern installed in your\n    web directory. It can be found in the \"lib\" directory:\n\n        (site home)/textpattern/lib/\n\nContrary to Textile, Markdown does not convert quotes to curly ones \nand does not convert multiple hyphens (`--` and `---`) into en- and \nem-dashes. If you use PHP Markdown in Textile Compatibility Mode, you \ncan solve this problem by installing the \"smartypants.php\" file from \n[PHP SmartyPants][psp] beside the \"classTextile.php\" file. The Textile \nCompatibility Mode function will use SmartyPants automatically without \nfurther modification.\n\n [psp]: http://michelf.ca/projects/php-smartypants/\n\n\n### Updating Markdown in Other Programs ###\n\nMany web applications now ship with PHP Markdown, or have plugins to \nperform the conversion to HTML. You can update PHP Markdown in many of \nthese programs by swapping the old \"markdown.php\" file for the new one.\n\nHere is a short non-exhaustive list of some programs and where they \nhide the \"markdown.php\" file.\n\n| Program   | Path to Markdown\n| -------   | ----------------\n| [Pivot][] | `(site home)/pivot/includes/markdown/markdown.php`\n\nIf you're unsure if you can do this with your application, ask the \ndeveloper, or wait for the developer to update his application or \nplugin with the new version of PHP Markdown.\n\n [Pivot]: http://pivotlog.net/\n\n\n### In Your Own Programs ###\n\nYou can use PHP Markdown easily in your current PHP program. Simply \ninclude the file and then call the Markdown function on the text you \nwant to convert:\n\n    include_once \"markdown.php\";\n    $my_html = Markdown($my_text);\n\nIf you wish to use PHP Markdown with another text filter function \nbuilt to parse HTML, you should filter the text *after* the Markdown\nfunction call. This is an example with [PHP SmartyPants][psp]:\n\n    $my_html = SmartyPants(Markdown($my_text));\n\n\n### With Smarty ###\n\nIf your program use the [Smarty][sm] template engine, PHP Markdown \ncan now be used as a modifier for your templates. Rename \"markdown.php\" \nto \"modifier.markdown.php\" and put it in your smarty plugins folder.\n\n  [sm]: http://smarty.php.net/\n\nIf you are using MovableType 3.1 or later, the Smarty plugin folder is \nlocated at `(MT CGI root)/php/extlib/smarty/plugins`. This will allow \nMarkdown to work on dynamic pages.\n\n\nConfiguration\n-------------\n\nBy default, PHP Markdown produces XHTML output for tags with empty \nelements. E.g.:\n\n    <br />\n\nMarkdown can be configured to produce HTML-style tags; e.g.:\n\n    <br>\n\nTo do this, you  must edit the \"MARKDOWN_EMPTY_ELEMENT_SUFFIX\" \ndefinition below the \"Global default settings\" header at the start of \nthe \"markdown.php\" file.\n\n\n### WordPress-Specific Settings ###\n\nBy default, the Markdown plugin applies to both posts and comments on \nyour WordPress weblog. To deactivate one or the other, edit the \n`MARKDOWN_WP_POSTS` or `MARKDOWN_WP_COMMENTS` definitions under the \n\"WordPress settings\" header at the start of the \"markdown.php\" file.\n\n\nBugs\n----\n\nTo file bug reports please send email to:\n<michel.fortin@michelf.ca>\n\nPlease include with your report: (1) the example input; (2) the output you\nexpected; (3) the output PHP Markdown actually produced.\n\nIf you have a problem where Markdown gives you an empty result, first check \nthat the backtrack limit is not too low by running `php --info | grep pcre`.\nSee Installation and Requirement above for details.\n\n\nVersion History\n---------------\n\n1.0.1p (13 Jan 2013):\n\n*\tFixed an issue where some XML-style empty tags (such as `<br/>`) were not \n\trecognized correctly as such when inserted into Markdown-formatted text.\n\n*\tThe following HTML 5 elements are treated as block elements when at the \n\troot of an HTML block: `article`, `section`, `nav`, `aside`, `hgroup`, \n\t`header`, `footer`, and `figure`. `svg` too.\n\n\n1.0.1o (8 Jan 2012):\n\n*\tSilenced a new warning introduced around PHP 5.3 complaining about\n\tPOSIX characters classes not being implemented. PHP Markdown does not\n\tuse POSIX character classes, but it nevertheless trigged that warning.\n\n\n1.0.1n (10 Oct 2009):\n\n*\tEnabled reference-style shortcut links. Now you can write reference-style \n\tlinks with less brakets:\n\n\t\tThis is [my website].\n\n\t\t[my website]: http://example.com/\n\n\tThis was added in the 1.0.2 betas, but commented out in the 1.0.1 branch, \n\twaiting for the feature to be officialized. [But half of the other Markdown\n\timplementations are supporting this syntax][half], so it makes sense for \n\tcompatibility's sake to allow it in PHP Markdown too.\n\n [half]: http://babelmark.bobtfish.net/?markdown=This+is+%5Bmy+website%5D.%0D%0A%09%09%0D%0A%5Bmy+website%5D%3A+http%3A%2F%2Fexample.com%2F%0D%0A&src=1&dest=2\n\n*\tNow accepting many valid email addresses in autolinks that were \n\tpreviously rejected, such as:\n\n\t\t<abc+mailbox/department=shipping@example.com>\n\t\t<!#$%&'*+-/=?^_`.{|}~@example.com>\n\t\t<\"abc@def\"@example.com>\n\t\t<\"Fred Bloggs\"@example.com>\n\t\t<jsmith@[192.0.2.1]>\n\n*\tNow accepting spaces in URLs for inline and reference-style links. Such \n\tURLs need to be surrounded by angle brakets. For instance:\n\n\t\t[link text](<http://url/with space> \"optional title\")\n\n\t\t[link text][ref]\n\t\t[ref]: <http://url/with space> \"optional title\"\n\t\n\tThere is still a quirk which may prevent this from working correctly with \n\trelative URLs in inline-style links however.\n\n*\tFix for adjacent list of different kind where the second list could\n\tend as a sublist of the first when not separated by an empty line.\n\n*\tFixed a bug where inline-style links wouldn't be recognized when the link \n\tdefinition contains a line break between the url and the title.\n\n*\tFixed a bug where tags where the name contains an underscore aren't parsed \n\tcorrectly.\n\n*\tFixed some corner-cases mixing underscore-ephasis and asterisk-emphasis.\n\n\n1.0.1m (21 Jun 2008):\n\n*\tLists can now have empty items.\n\n*\tRewrote the emphasis and strong emphasis parser to fix some issues\n\twith odly placed and overlong markers.\n\n\n1.0.1l (11 May 2008):\n\n*\tNow removing the UTF-8 BOM at the start of a document, if present.\n\n*\tNow accepting capitalized URI schemes (such as HTTP:) in automatic\n\tlinks, such as `<HTTP://EXAMPLE.COM/>`.\n\n*\tFixed a problem where `<hr@example.com>` was seen as a horizontal\n\trule instead of an automatic link.\n\n*\tFixed an issue where some characters in Markdown-generated HTML\n\tattributes weren't properly escaped with entities.\n\n*\tFix for code blocks as first element of a list item. Previously,\n\tthis didn't create any code block for item 2:\n\n\t\t*   Item 1 (regular paragraph)\n\n\t\t*       Item 2 (code block)\n\n*\tA code block starting on the second line of a document wasn't seen\n\tas a code block. This has been fixed.\n\n*\tAdded programatically-settable parser properties `predef_urls` and \n\t`predef_titles` for predefined URLs and titles for reference-style \n\tlinks. To use this, your PHP code must call the parser this way:\n\n\t\t$parser = new Markdwon_Parser;\n\t\t$parser->predef_urls = array('linkref' => 'http://example.com');\n\t\t$html = $parser->transform($text);\n\n\tYou can then use the URL as a normal link reference:\n\t\n\t\t[my link][linkref]\t\n\t\t[my link][linkRef]\n\n\tReference names in the parser properties *must* be lowercase.\n\tReference names in the Markdown source may have any case.\n\n*\tAdded `setup` and `teardown` methods which can be used by subclassers\n\tas hook points to arrange the state of some parser variables before and \n\tafter parsing.\n\n\n1.0.1k (26 Sep 2007):\n\n*\tFixed a problem introduced in 1.0.1i where three or more identical\n\tuppercase letters, as well as a few other symbols, would trigger\n\ta horizontal line.\n\n\n1.0.1j (4 Sep 2007):\n\n*\tFixed a problem introduced in 1.0.1i where the closing `code` and \n\t`pre` tags at the end of a code block were appearing in the wrong \n\torder.\n\n*\tOverriding configuration settings by defining constants from an \n\texternal before markdown.php is included is now possible without \n\tproducing a PHP warning.\n\n\n1.0.1i (31 Aug 2007):\n\n*\tFixed a problem where an escaped backslash before a code span \n\twould prevent the code span from being created. This should now\n\twork as expected:\n\t\n\t\tLitteral backslash: \\\\`code span`\n\n*\tOverall speed improvements, especially with long documents.\n\n\n1.0.1h (3 Aug 2007):\n\n*\tAdded two properties (`no_markup` and `no_entities`) to the parser \n\tallowing HTML tags and entities to be disabled.\n\n*\tFix for a problem introduced in 1.0.1g where posting comments in \n\tWordPress would trigger PHP warnings and cause some markup to be \n\tincorrectly filtered by the kses filter in WordPress.\n\n\n1.0.1g (3 Jul 2007):\n\n*\tFix for PHP 5 compiled without the mbstring module. Previous fix to \n\tcalculate the length of UTF-8 strings in `detab` when `mb_strlen` is \n\tnot available was only working with PHP 4.\n\n*\tFixed a problem with WordPress 2.x where full-content posts in RSS feeds \n\twere not processed correctly by Markdown.\n\n*\tNow supports URLs containing literal parentheses for inline links \n\tand images, such as:\n\n\t\t[WIMP](http://en.wikipedia.org/wiki/WIMP_(computing))\n\n\tSuch parentheses may be arbitrarily nested, but must be\n\tbalanced. Unbalenced parentheses are allowed however when the URL \n\twhen escaped or when the URL is enclosed in angle brakets `<>`.\n\n*\tFixed a performance problem where the regular expression for strong \n\temphasis introduced in version 1.0.1d could sometime be long to process, \n\tgive slightly wrong results, and in some circumstances could remove \n\tentirely the content for a whole paragraph.\n\n*\tSome change in version 1.0.1d made possible the incorrect nesting of \n\tanchors within each other. This is now fixed.\n\n*\tFixed a rare issue where certain MD5 hashes in the content could\n\tbe changed to their corresponding text. For instance, this:\n\n\t\tThe MD5 value for \"+\" is \"26b17225b626fb9238849fd60eabdf60\".\n\t\n\twas incorrectly changed to this in previous versions of PHP Markdown:\n\n\t\t<p>The MD5 value for \"+\" is \"+\".</p>\n\n*\tNow convert escaped characters to their numeric character \n\treferences equivalent.\n\t\n\tThis fix an integration issue with SmartyPants and backslash escapes. \n\tSince Markdown and SmartyPants have some escapable characters in common, \n\tit was sometime necessary to escape them twice. Previously, two \n\tbackslashes were sometime required to prevent Markdown from \"eating\" the \n\tbackslash before SmartyPants sees it:\n\t\n\t\tHere are two hyphens: \\\\--\n\t\n\tNow, only one backslash will do:\n\t\n\t\tHere are two hyphens: \\--\n\n\n1.0.1f (7 Feb 2007):\n\n*\tFixed an issue with WordPress where manually-entered excerpts, but \n\tnot the auto-generated ones, would contain nested paragraphs.\n\n*\tFixed an issue introduced in 1.0.1d where headers and blockquotes \n\tpreceded too closely by a paragraph (not separated by a blank line) \n\twhere incorrectly put inside the paragraph.\n\n*\tFixed an issue introduced in 1.0.1d in the tokenizeHTML method where \n\ttwo consecutive code spans would be merged into one when together they \n\tform a valid tag in a multiline paragraph.\n\n*\tFixed an long-prevailing issue where blank lines in code blocks would \n\tbe doubled when the code block is in a list item.\n\t\n\tThis was due to the list processing functions relying on artificially \n\tdoubled blank lines to correctly determine when list items should \n\tcontain block-level content. The list item processing model was thus \n\tchanged to avoid the need for double blank lines.\n\n*\tFixed an issue with `<% asp-style %>` instructions used as inline \n\tcontent where the opening `<` was encoded as `&lt;`.\n\n*\tFixed a parse error occuring when PHP is configured to accept \n\tASP-style delimiters as boundaries for PHP scripts.\n\n*\tFixed a bug introduced in 1.0.1d where underscores in automatic links\n\tgot swapped with emphasis tags.\n\n\n1.0.1e (28 Dec 2006)\n\n*\tAdded support for internationalized domain names for email addresses in \n\tautomatic link. Improved the speed at which email addresses are converted \n\tto entities. Thanks to Milian Wolff for his optimisations.\n\n*\tMade deterministic the conversion to entities of email addresses in \n\tautomatic links. This means that a given email address will always be \n\tencoded the same way.\n\n*\tPHP Markdown will now use its own function to calculate the length of an \n\tUTF-8 string in `detab` when `mb_strlen` is not available instead of \n\tgiving a fatal error.\n\n\n1.0.1d (1 Dec 2006)\n\n*   Fixed a bug where inline images always had an empty title attribute. The \n\ttitle attribute is now present only when explicitly defined.\n\n*\tLink references definitions can now have an empty title, previously if the \n\ttitle was defined but left empty the link definition was ignored. This can \n\tbe useful if you want an empty title attribute in images to hide the \n\ttooltip in Internet Explorer.\n\n*\tMade `detab` aware of UTF-8 characters. UTF-8 multi-byte sequences are now \n\tcorrectly mapped to one character instead of the number of bytes.\n\n*\tFixed a small bug with WordPress where WordPress' default filter `wpautop`\n\twas not properly deactivated on comment text, resulting in hard line breaks\n\twhere Markdown do not prescribes them.\n\n*\tAdded a `TextileRestrited` method to the textile compatibility mode. There\n\tis no restriction however, as Markdown does not have a restricted mode at \n\tthis point. This should make PHP Markdown work again in the latest \n\tversions of TextPattern.\n\n*   Converted PHP Markdown to a object-oriented design.\n\n*\tChanged span and block gamut methods so that they loop over a \n\tcustomizable list of methods. This makes subclassing the parser a more \n\tinteresting option for creating syntax extensions.\n\n*\tAlso added a \"document\" gamut loop which can be used to hook document-level \n\tmethods (like for striping link definitions).\n\n*\tChanged all methods which were inserting HTML code so that they now return \n\ta hashed representation of the code. New methods `hashSpan` and `hashBlock`\n\tare used to hash respectivly span- and block-level generated content. This \n\thas a couple of significant effects:\n\t\n\t1.\tIt prevents invalid nesting of Markdown-generated elements which \n\t    could occur occuring with constructs like `*something [link*][1]`.\n\t2.\tIt prevents problems occuring with deeply nested lists on which \n\t    paragraphs were ill-formed.\n\t3.\tIt removes the need to call `hashHTMLBlocks` twice during the the \n\t\tblock gamut.\n\t\n\tHashes are turned back to HTML prior output.\n\n*\tMade the block-level HTML parser smarter using a specially-crafted regular \n\texpression capable of handling nested tags.\n\n*\tSolved backtick issues in tag attributes by rewriting the HTML tokenizer to \n\tbe aware of code spans. All these lines should work correctly now:\n\t\n\t\t<span attr='`ticks`'>bar</span>\n\t\t<span attr='``double ticks``'>bar</span>\n\t\t`<test a=\"` content of attribute `\">`\n\n*\tChanged the parsing of HTML comments to match simply from `<!--` to `-->` \n\tinstead using of the more complicated SGML-style rule with paired `--`.\n\tThis is how most browsers parse comments and how XML defines them too.\n\n*\t`<address>` has been added to the list of block-level elements and is now\n\ttreated as an HTML block instead of being wrapped within paragraph tags.\n\n*\tNow only trim trailing newlines from code blocks, instead of trimming\n\tall trailing whitespace characters.\n\n*\tFixed bug where this:\n\n\t\t[text](http://m.com \"title\" )\n\t\t\n\twasn't working as expected, because the parser wasn't allowing for spaces\n\tbefore the closing paren.\n\n*\tFilthy hack to support markdown='1' in div tags.\n\n*\t_DoAutoLinks() now supports the 'dict://' URL scheme.\n\n*\tPHP- and ASP-style processor instructions are now protected as\n\traw HTML blocks.\n\n\t\t<? ... ?>\n\t\t<% ... %>\n\n*\tFix for escaped backticks still triggering code spans:\n\n\t\tThere are two raw backticks here: \\` and here: \\`, not a code span\n\n\n1.0.1c (9 Dec 2005)\n\n*   Fixed a problem occurring with PHP 5.1.1 due to a small\n    change to strings variable replacement behaviour in\n    this version.\n\n\n1.0.1b (6 Jun 2005)\n\n*\tFixed a bug where an inline image followed by a reference link would\n\tgive a completely wrong result.\n\n*\tFix for escaped backticks still triggering code spans:\n\t\n\t\tThere are two raw backticks here: \\` and here: \\`, not a code span\n\n*\tFix for an ordered list following an unordered list, and the \n\treverse. There is now a loop in _DoList that does the two \n\tseparately.\n\n*\tFix for nested sub-lists in list-paragraph mode. Previously we got\n\ta spurious extra level of `<p>` tags for something like this:\n\n\t\t*\tthis\n\t\t\n\t\t\t*\tsub\n\t\t\n\t\t\tthat\n\n*\tFixed some incorrect behaviour with emphasis. This will now work\n\tas it should:\n\n\t\t*test **thing***  \n\t\t**test *thing***  \n\t\t***thing* test**  \n\t\t***thing** test*\n\n\t\tName: __________  \n\t\tAddress: _______\n\n*\tCorrect a small bug in `_TokenizeHTML` where a Doctype declaration\n\twas not seen as HTML.\n\n*\tMajor rewrite of the WordPress integration code that should \n\tcorrect many problems by preventing default WordPress filters from \n\ttampering with Markdown-formatted text. More details here:\n\t<http://michelf.ca/weblog/2005/wordpress-text-flow-vs-markdown/>\n\n\n1.0.1a (15 Apr 2005)\n\n*\tFixed an issue where PHP warnings were trigged when converting\n\ttext with list items running on PHP 4.0.6. This was comming from \n\tthe `rtrim` function which did not support the second argument \n\tprior version 4.1. Replaced by a regular expression.\n\n*\tMarkdown now filter correctly post excerpts and comment\n\texcerpts in WordPress.\n\n*\tAutomatic links and some code sample were \"corrected\" by \n\tthe balenceTag filter in WordPress meant to ensure HTML\n\tis well formed. This new version of PHP Markdown postpone this\n\tfilter so that it runs after Markdown.\n\n*\tBlockquote syntax and some code sample were stripped by \n\ta new WordPress 1.5 filter meant to remove unwanted HTML \n\tin comments. This new version of PHP Markdown postpone this\n\tfilter so that it runs after Markdown.\n\n\n1.0.1 (16 Dec 2004):\n\n*\tChanged the syntax rules for code blocks and spans. Previously,\n\tbackslash escapes for special Markdown characters were processed\n\teverywhere other than within inline HTML tags. Now, the contents of\n\tcode blocks and spans are no longer processed for backslash escapes.\n\tThis means that code blocks and spans are now treated literally,\n\twith no special rules to worry about regarding backslashes.\n\n\t**IMPORTANT**: This breaks the syntax from all previous versions of\n\tMarkdown. Code blocks and spans involving backslash characters will\n\tnow generate different output than before.\n\n\tImplementation-wise, this change was made by moving the call to\n\t`_EscapeSpecialChars()` from the top-level `Markdown()` function to\n\twithin `_RunSpanGamut()`.\n\n*\tSignificants performance improvement in `_DoHeader`, `_Detab`\n\tand `_TokenizeHTML`.\n\n*\tAdded `>`, `+`, and `-` to the list of backslash-escapable\n\tcharacters. These should have been done when these characters\n\twere added as unordered list item markers.\n\n*\tInline links using `<` and `>` URL delimiters weren't working:\n\n\t\tlike [this](<http://example.com/>)\n\n\tFixed by moving `_DoAutoLinks()` after `_DoAnchors()` in\n\t`_RunSpanGamut()`.\n\n*\tFixed bug where auto-links were being processed within code spans:\n\n\t\tlike this: `<http://example.com/>`\n\n\tFixed by moving `_DoAutoLinks()` from `_RunBlockGamut()` to\n\t`_RunSpanGamut()`.\n\n*\tSort-of fixed a bug where lines in the middle of hard-wrapped\n\tparagraphs, which lines look like the start of a list item,\n\twould accidentally trigger the creation of a list. E.g. a\n\tparagraph that looked like this:\n\n\t\tI recommend upgrading to version\n\t\t8. Oops, now this line is treated\n\t\tas a sub-list.\n\n\tThis is fixed for top-level lists, but it can still happen for\n\tsub-lists. E.g., the following list item will not be parsed\n\tproperly:\n\n\t\t*\tI recommend upgrading to version\n\t\t\t8. Oops, now this line is treated\n\t\t\tas a sub-list.\n\n\tGiven Markdown's list-creation rules, I'm not sure this can\n\tbe fixed.\n\n*\tFix for horizontal rules preceded by 2 or 3 spaces or followed by\n\ttrailing spaces and tabs.\n\n*\tStandalone HTML comments are now handled; previously, they'd get\n\twrapped in a spurious `<p>` tag.\n\n*\t`_HashHTMLBlocks()` now tolerates trailing spaces and tabs following\n\tHTML comments and `<hr/>` tags.\n\n*\tChanged special case pattern for hashing `<hr>` tags in\n\t`_HashHTMLBlocks()` so that they must occur within three spaces\n\tof left margin. (With 4 spaces or a tab, they should be\n\tcode blocks, but weren't before this fix.)\n\n*\tAuto-linked email address can now optionally contain\n\ta 'mailto:' protocol. I.e. these are equivalent:\n\n\t\t<mailto:user@example.com>\n\t\t<user@example.com>\n\n*\tFixed annoying bug where nested lists would wind up with\n\tspurious (and invalid) `<p>` tags.\n\n*\tChanged `_StripLinkDefinitions()` so that link definitions must\n\toccur within three spaces of the left margin. Thus if you indent\n\ta link definition by four spaces or a tab, it will now be a code\n\tblock.\n\n*\tYou can now write empty links:\n\n\t\t[like this]()\n\n\tand they'll be turned into anchor tags with empty href attributes.\n\tThis should have worked before, but didn't.\n\n*\t`***this***` and `___this___` are now turned into\n\n\t\t<strong><em>this</em></strong>\n\n\tInstead of\n\n\t\t<strong><em>this</strong></em>\n\n\twhich isn't valid.\n\n*\tFixed problem for links defined with urls that include parens, e.g.:\n\n\t\t[1]: http://sources.wikipedia.org/wiki/Middle_East_Policy_(Chomsky)\n\n\t\"Chomsky\" was being erroneously treated as the URL's title.\n\n*\tDouble quotes in the title of an inline link used to give strange \n\tresults (incorrectly made entities). Fixed.\n\n*\tTabs are now correctly changed into spaces. Previously, only \n\tthe first tab was converted. In code blocks, the second one was too,\n\tbut was not always correctly aligned.\n\n*\tFixed a bug where a tab character inserted after a quote on the same\n\tline could add a slash before the quotes.\n\n\t\tThis is \"before\"\t[tab] and \"after\" a tab.\n\n\tPreviously gave this result:\n\n\t\t<p>This is \\\"before\\\"  [tab] and \"after\" a tab.</p>\n\n*\tRemoved a call to `htmlentities`. This fixes a bug where multibyte\n\tcharacters present in the title of a link reference could lead to\n\tinvalid utf-8 characters. \n\n*\tChanged a regular expression in `_TokenizeHTML` that could lead to\n\ta segmentation fault with PHP 4.3.8 on Linux.\n\n*\tFixed some notices that could show up if PHP error reporting \n\tE_NOTICE flag was set.\n\n\nCopyright and License\n---------------------\n\nPHP Markdown\nCopyright (c) 2004-2013 Michel Fortin  \n<http://michelf.ca/>  \nAll rights reserved.\n\nBased on Markdown  \nCopyright (c) 2003-2006 John Gruber   \n<http://daringfireball.net/>   \nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n*   Redistributions of source code must retain the above copyright notice,\n    this list of conditions and the following disclaimer.\n\n*   Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in the\n    documentation and/or other materials provided with the distribution.\n\n*   Neither the name \"Markdown\" nor the names of its contributors may\n    be used to endorse or promote products derived from this software\n    without specific prior written permission.\n\nThis software is provided by the copyright holders and contributors \"as\nis\" and any express or implied warranties, including, but not limited\nto, the implied warranties of merchantability and fitness for a\nparticular purpose are disclaimed. In no event shall the copyright owner\nor contributors be liable for any direct, indirect, incidental, special,\nexemplary, or consequential damages (including, but not limited to,\nprocurement of substitute goods or services; loss of use, data, or\nprofits; or business interruption) however caused and on any theory of\nliability, whether in contract, strict liability, or tort (including\nnegligence or otherwise) arising in any way out of the use of this\nsoftware, even if advised of the possibility of such damage.\n"
  },
  {
    "path": "extensions/markdown/parser/markdown.php",
    "content": "<?php\n#\n# Markdown  -  A text-to-HTML conversion tool for web writers\n#\n# PHP Markdown  \n# Copyright (c) 2004-2013 Michel Fortin  \n# <http://michelf.ca/projects/php-markdown/>\n#\n# Original Markdown  \n# Copyright (c) 2004-2006 John Gruber  \n# <http://daringfireball.net/projects/markdown/>\n#\n\n\ndefine( 'MARKDOWN_VERSION',  \"1.0.1p\" ); # Sun 13 Jan 2013\n\n\n#\n# Global default settings:\n#\n\n# Change to \">\" for HTML output\n@define( 'MARKDOWN_EMPTY_ELEMENT_SUFFIX',  \" />\");\n\n# Define the width of a tab for code blocks.\n@define( 'MARKDOWN_TAB_WIDTH',     4 );\n\n\n#\n# WordPress settings:\n#\n\n# Change to false to remove Markdown from posts and/or comments.\n@define( 'MARKDOWN_WP_POSTS',      true );\n@define( 'MARKDOWN_WP_COMMENTS',   true );\n\n\n\n### Standard Function Interface ###\n\n@define( 'MARKDOWN_PARSER_CLASS',  'Markdown_Parser' );\n\nfunction Markdown($text) {\n#\n# Initialize the parser and return the result of its transform method.\n#\n\t# Setup static parser variable.\n\tstatic $parser;\n\tif (!isset($parser)) {\n\t\t$parser_class = MARKDOWN_PARSER_CLASS;\n\t\t$parser = new $parser_class;\n\t}\n\n\t# Transform text using parser.\n\treturn $parser->transform($text);\n}\n\n\n### WordPress Plugin Interface ###\n\n/*\nPlugin Name: Markdown\nPlugin URI: http://michelf.ca/projects/php-markdown/\nDescription: <a href=\"http://daringfireball.net/projects/markdown/syntax\">Markdown syntax</a> allows you to write using an easy-to-read, easy-to-write plain text format. Based on the original Perl version by <a href=\"http://daringfireball.net/\">John Gruber</a>. <a href=\"http://michelf.ca/projects/php-markdown/\">More...</a>\nVersion: 1.0.1p\nAuthor: Michel Fortin\nAuthor URI: http://michelf.ca/\n*/\n\nif (isset($wp_version)) {\n\t# More details about how it works here:\n\t# <http://michelf.ca/weblog/2005/wordpress-text-flow-vs-markdown/>\n\t\n\t# Post content and excerpts\n\t# - Remove WordPress paragraph generator.\n\t# - Run Markdown on excerpt, then remove all tags.\n\t# - Add paragraph tag around the excerpt, but remove it for the excerpt rss.\n\tif (MARKDOWN_WP_POSTS) {\n\t\tremove_filter('the_content',     'wpautop');\n        remove_filter('the_content_rss', 'wpautop');\n\t\tremove_filter('the_excerpt',     'wpautop');\n\t\tadd_filter('the_content',     'Markdown', 6);\n        add_filter('the_content_rss', 'Markdown', 6);\n\t\tadd_filter('get_the_excerpt', 'Markdown', 6);\n\t\tadd_filter('get_the_excerpt', 'trim', 7);\n\t\tadd_filter('the_excerpt',     'mdwp_add_p');\n\t\tadd_filter('the_excerpt_rss', 'mdwp_strip_p');\n\t\t\n\t\tremove_filter('content_save_pre',  'balanceTags', 50);\n\t\tremove_filter('excerpt_save_pre',  'balanceTags', 50);\n\t\tadd_filter('the_content',  \t  'balanceTags', 50);\n\t\tadd_filter('get_the_excerpt', 'balanceTags', 9);\n\t}\n\t\n\t# Comments\n\t# - Remove WordPress paragraph generator.\n\t# - Remove WordPress auto-link generator.\n\t# - Scramble important tags before passing them to the kses filter.\n\t# - Run Markdown on excerpt then remove paragraph tags.\n\tif (MARKDOWN_WP_COMMENTS) {\n\t\tremove_filter('comment_text', 'wpautop', 30);\n\t\tremove_filter('comment_text', 'make_clickable');\n\t\tadd_filter('pre_comment_content', 'Markdown', 6);\n\t\tadd_filter('pre_comment_content', 'mdwp_hide_tags', 8);\n\t\tadd_filter('pre_comment_content', 'mdwp_show_tags', 12);\n\t\tadd_filter('get_comment_text',    'Markdown', 6);\n\t\tadd_filter('get_comment_excerpt', 'Markdown', 6);\n\t\tadd_filter('get_comment_excerpt', 'mdwp_strip_p', 7);\n\t\n\t\tglobal $mdwp_hidden_tags, $mdwp_placeholders;\n\t\t$mdwp_hidden_tags = explode(' ',\n\t\t\t'<p> </p> <pre> </pre> <ol> </ol> <ul> </ul> <li> </li>');\n\t\t$mdwp_placeholders = explode(' ', str_rot13(\n\t\t\t'pEj07ZbbBZ U1kqgh4w4p pre2zmeN6K QTi31t9pre ol0MP1jzJR '.\n\t\t\t'ML5IjmbRol ulANi1NsGY J7zRLJqPul liA8ctl16T K9nhooUHli'));\n\t}\n\t\n\tfunction mdwp_add_p($text) {\n\t\tif (!preg_match('{^$|^<(p|ul|ol|dl|pre|blockquote)>}i', $text)) {\n\t\t\t$text = '<p>'.$text.'</p>';\n\t\t\t$text = preg_replace('{\\n{2,}}', \"</p>\\n\\n<p>\", $text);\n\t\t}\n\t\treturn $text;\n\t}\n\t\n\tfunction mdwp_strip_p($t) { return preg_replace('{</?p>}i', '', $t); }\n\n\tfunction mdwp_hide_tags($text) {\n\t\tglobal $mdwp_hidden_tags, $mdwp_placeholders;\n\t\treturn str_replace($mdwp_hidden_tags, $mdwp_placeholders, $text);\n\t}\n\tfunction mdwp_show_tags($text) {\n\t\tglobal $mdwp_hidden_tags, $mdwp_placeholders;\n\t\treturn str_replace($mdwp_placeholders, $mdwp_hidden_tags, $text);\n\t}\n}\n\n\n### bBlog Plugin Info ###\n\nfunction identify_modifier_markdown() {\n\treturn array(\n\t\t'name'\t\t\t=> 'markdown',\n\t\t'type'\t\t\t=> 'modifier',\n\t\t'nicename'\t\t=> 'Markdown',\n\t\t'description'\t=> 'A text-to-HTML conversion tool for web writers',\n\t\t'authors'\t\t=> 'Michel Fortin and John Gruber',\n\t\t'licence'\t\t=> 'BSD-like',\n\t\t'version'\t\t=> MARKDOWN_VERSION,\n\t\t'help'\t\t\t=> '<a href=\"http://daringfireball.net/projects/markdown/syntax\">Markdown syntax</a> allows you to write using an easy-to-read, easy-to-write plain text format. Based on the original Perl version by <a href=\"http://daringfireball.net/\">John Gruber</a>. <a href=\"http://michelf.ca/projects/php-markdown/\">More...</a>'\n\t);\n}\n\n\n### Smarty Modifier Interface ###\n\nfunction smarty_modifier_markdown($text) {\n\treturn Markdown($text);\n}\n\n\n### Textile Compatibility Mode ###\n\n# Rename this file to \"classTextile.php\" and it can replace Textile everywhere.\n\nif (strcasecmp(substr(__FILE__, -16), \"classTextile.php\") == 0) {\n\t# Try to include PHP SmartyPants. Should be in the same directory.\n\t@include_once 'smartypants.php';\n\t# Fake Textile class. It calls Markdown instead.\n\tclass Textile {\n\t\tfunction TextileThis($text, $lite='', $encode='') {\n\t\t\tif ($lite == '' && $encode == '')    $text = Markdown($text);\n\t\t\tif (function_exists('SmartyPants'))  $text = SmartyPants($text);\n\t\t\treturn $text;\n\t\t}\n\t\t# Fake restricted version: restrictions are not supported for now.\n\t\tfunction TextileRestricted($text, $lite='', $noimage='') {\n\t\t\treturn $this->TextileThis($text, $lite);\n\t\t}\n\t\t# Workaround to ensure compatibility with TextPattern 4.0.3.\n\t\tfunction blockLite($text) { return $text; }\n\t}\n}\n\n\n\n#\n# Markdown Parser Class\n#\n\nclass Markdown_Parser {\n\n\t### Configuration Variables ###\n\n\t# Change to \">\" for HTML output.\n\tvar $empty_element_suffix = MARKDOWN_EMPTY_ELEMENT_SUFFIX;\n\tvar $tab_width = MARKDOWN_TAB_WIDTH;\n\t\n\t# Change to `true` to disallow markup or entities.\n\tvar $no_markup = false;\n\tvar $no_entities = false;\n\t\n\t# Predefined urls and titles for reference links and images.\n\tvar $predef_urls = array();\n\tvar $predef_titles = array();\n\n\n\t### Parser Implementation ###\n\n\t# Regex to match balanced [brackets].\n\t# Needed to insert a maximum bracked depth while converting to PHP.\n\tvar $nested_brackets_depth = 6;\n\tvar $nested_brackets_re;\n\t\n\tvar $nested_url_parenthesis_depth = 4;\n\tvar $nested_url_parenthesis_re;\n\n\t# Table of hash values for escaped characters:\n\tvar $escape_chars = '\\`*_{}[]()>#+-.!';\n\tvar $escape_chars_re;\n\n\n\tfunction Markdown_Parser() {\n\t#\n\t# Constructor function. Initialize appropriate member variables.\n\t#\n\t\t$this->_initDetab();\n\t\t$this->prepareItalicsAndBold();\n\t\n\t\t$this->nested_brackets_re = \n\t\t\tstr_repeat('(?>[^\\[\\]]+|\\[', $this->nested_brackets_depth).\n\t\t\tstr_repeat('\\])*', $this->nested_brackets_depth);\n\t\n\t\t$this->nested_url_parenthesis_re = \n\t\t\tstr_repeat('(?>[^()\\s]+|\\(', $this->nested_url_parenthesis_depth).\n\t\t\tstr_repeat('(?>\\)))*', $this->nested_url_parenthesis_depth);\n\t\t\n\t\t$this->escape_chars_re = '['.preg_quote($this->escape_chars).']';\n\t\t\n\t\t# Sort document, block, and span gamut in ascendent priority order.\n\t\tasort($this->document_gamut);\n\t\tasort($this->block_gamut);\n\t\tasort($this->span_gamut);\n\t}\n\n\n\t# Internal hashes used during transformation.\n\tvar $urls = array();\n\tvar $titles = array();\n\tvar $html_hashes = array();\n\t\n\t# Status flag to avoid invalid nesting.\n\tvar $in_anchor = false;\n\t\n\t\n\tfunction setup() {\n\t#\n\t# Called before the transformation process starts to setup parser \n\t# states.\n\t#\n\t\t# Clear global hashes.\n\t\t$this->urls = $this->predef_urls;\n\t\t$this->titles = $this->predef_titles;\n\t\t$this->html_hashes = array();\n\t\t\n\t\t$in_anchor = false;\n\t}\n\t\n\tfunction teardown() {\n\t#\n\t# Called after the transformation process to clear any variable \n\t# which may be taking up memory unnecessarly.\n\t#\n\t\t$this->urls = array();\n\t\t$this->titles = array();\n\t\t$this->html_hashes = array();\n\t}\n\n\n\tfunction transform($text) {\n\t#\n\t# Main function. Performs some preprocessing on the input text\n\t# and pass it through the document gamut.\n\t#\n\t\t$this->setup();\n\t\n\t\t# Remove UTF-8 BOM and marker character in input, if present.\n\t\t$text = preg_replace('{^\\xEF\\xBB\\xBF|\\x1A}', '', $text);\n\n\t\t# Standardize line endings:\n\t\t#   DOS to Unix and Mac to Unix\n\t\t$text = preg_replace('{\\r\\n?}', \"\\n\", $text);\n\n\t\t# Make sure $text ends with a couple of newlines:\n\t\t$text .= \"\\n\\n\";\n\n\t\t# Convert all tabs to spaces.\n\t\t$text = $this->detab($text);\n\n\t\t# Turn block-level HTML blocks into hash entries\n\t\t$text = $this->hashHTMLBlocks($text);\n\n\t\t# Strip any lines consisting only of spaces and tabs.\n\t\t# This makes subsequent regexen easier to write, because we can\n\t\t# match consecutive blank lines with /\\n+/ instead of something\n\t\t# contorted like /[ ]*\\n+/ .\n\t\t$text = preg_replace('/^[ ]+$/m', '', $text);\n\n\t\t# Run document gamut methods.\n\t\tforeach ($this->document_gamut as $method => $priority) {\n\t\t\t$text = $this->$method($text);\n\t\t}\n\t\t\n\t\t$this->teardown();\n\n\t\treturn $text . \"\\n\";\n\t}\n\t\n\tvar $document_gamut = array(\n\t\t# Strip link definitions, store in hashes.\n\t\t\"stripLinkDefinitions\" => 20,\n\t\t\n\t\t\"runBasicBlockGamut\"   => 30,\n\t\t);\n\n\n\tfunction stripLinkDefinitions($text) {\n\t#\n\t# Strips link definitions from text, stores the URLs and titles in\n\t# hash references.\n\t#\n\t\t$less_than_tab = $this->tab_width - 1;\n\n\t\t# Link defs are in the form: ^[id]: url \"optional title\"\n\t\t$text = preg_replace_callback('{\n\t\t\t\t\t\t\t^[ ]{0,'.$less_than_tab.'}\\[(.+)\\][ ]?:\t# id = $1\n\t\t\t\t\t\t\t  [ ]*\n\t\t\t\t\t\t\t  \\n?\t\t\t\t# maybe *one* newline\n\t\t\t\t\t\t\t  [ ]*\n\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t  <(.+?)>\t\t\t# url = $2\n\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t  (\\S+?)\t\t\t# url = $3\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t  [ ]*\n\t\t\t\t\t\t\t  \\n?\t\t\t\t# maybe one newline\n\t\t\t\t\t\t\t  [ ]*\n\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t(?<=\\s)\t\t\t# lookbehind for whitespace\n\t\t\t\t\t\t\t\t[\"(]\n\t\t\t\t\t\t\t\t(.*?)\t\t\t# title = $4\n\t\t\t\t\t\t\t\t[\")]\n\t\t\t\t\t\t\t\t[ ]*\n\t\t\t\t\t\t\t)?\t# title is optional\n\t\t\t\t\t\t\t(?:\\n+|\\Z)\n\t\t\t}xm',\n\t\t\tarray(&$this, '_stripLinkDefinitions_callback'),\n\t\t\t$text);\n\t\treturn $text;\n\t}\n\tfunction _stripLinkDefinitions_callback($matches) {\n\t\t$link_id = strtolower($matches[1]);\n\t\t$url = $matches[2] == '' ? $matches[3] : $matches[2];\n\t\t$this->urls[$link_id] = $url;\n\t\t$this->titles[$link_id] =& $matches[4];\n\t\treturn ''; # String that will replace the block\n\t}\n\n\n\tfunction hashHTMLBlocks($text) {\n\t\tif ($this->no_markup)  return $text;\n\n\t\t$less_than_tab = $this->tab_width - 1;\n\n\t\t# Hashify HTML blocks:\n\t\t# We only want to do this for block-level HTML tags, such as headers,\n\t\t# lists, and tables. That's because we still want to wrap <p>s around\n\t\t# \"paragraphs\" that are wrapped in non-block-level tags, such as anchors,\n\t\t# phrase emphasis, and spans. The list of tags we're looking for is\n\t\t# hard-coded:\n\t\t#\n\t\t# *  List \"a\" is made of tags which can be both inline or block-level.\n\t\t#    These will be treated block-level when the start tag is alone on \n\t\t#    its line, otherwise they're not matched here and will be taken as \n\t\t#    inline later.\n\t\t# *  List \"b\" is made of tags which are always block-level;\n\t\t#\n\t\t$block_tags_a_re = 'ins|del';\n\t\t$block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'.\n\t\t\t\t\t\t   'script|noscript|form|fieldset|iframe|math|svg|'.\n\t\t\t\t\t\t   'article|section|nav|aside|hgroup|header|footer|'.\n\t\t\t\t\t\t   'figure';\n\n\t\t# Regular expression for the content of a block tag.\n\t\t$nested_tags_level = 4;\n\t\t$attr = '\n\t\t\t(?>\t\t\t\t# optional tag attributes\n\t\t\t  \\s\t\t\t# starts with whitespace\n\t\t\t  (?>\n\t\t\t\t[^>\"/]+\t\t# text outside quotes\n\t\t\t  |\n\t\t\t\t/+(?!>)\t\t# slash not followed by \">\"\n\t\t\t  |\n\t\t\t\t\"[^\"]*\"\t\t# text inside double quotes (tolerate \">\")\n\t\t\t  |\n\t\t\t\t\\'[^\\']*\\'\t# text inside single quotes (tolerate \">\")\n\t\t\t  )*\n\t\t\t)?\t\n\t\t\t';\n\t\t$content =\n\t\t\tstr_repeat('\n\t\t\t\t(?>\n\t\t\t\t  [^<]+\t\t\t# content without tag\n\t\t\t\t|\n\t\t\t\t  <\\2\t\t\t# nested opening tag\n\t\t\t\t\t'.$attr.'\t# attributes\n\t\t\t\t\t(?>\n\t\t\t\t\t  />\n\t\t\t\t\t|\n\t\t\t\t\t  >', $nested_tags_level).\t# end of opening tag\n\t\t\t\t\t  '.*?'.\t\t\t\t\t# last level nested tag content\n\t\t\tstr_repeat('\n\t\t\t\t\t  </\\2\\s*>\t# closing nested tag\n\t\t\t\t\t)\n\t\t\t\t  |\t\t\t\t\n\t\t\t\t\t<(?!/\\2\\s*>\t# other tags with a different name\n\t\t\t\t  )\n\t\t\t\t)*',\n\t\t\t\t$nested_tags_level);\n\t\t$content2 = str_replace('\\2', '\\3', $content);\n\n\t\t# First, look for nested blocks, e.g.:\n\t\t# \t<div>\n\t\t# \t\t<div>\n\t\t# \t\ttags for inner block must be indented.\n\t\t# \t\t</div>\n\t\t# \t</div>\n\t\t#\n\t\t# The outermost tags must start at the left margin for this to match, and\n\t\t# the inner nested divs must be indented.\n\t\t# We need to do this before the next, more liberal match, because the next\n\t\t# match will start at the first `<div>` and stop at the first `</div>`.\n\t\t$text = preg_replace_callback('{(?>\n\t\t\t(?>\n\t\t\t\t(?<=\\n\\n)\t\t# Starting after a blank line\n\t\t\t\t|\t\t\t\t# or\n\t\t\t\t\\A\\n?\t\t\t# the beginning of the doc\n\t\t\t)\n\t\t\t(\t\t\t\t\t\t# save in $1\n\n\t\t\t  # Match from `\\n<tag>` to `</tag>\\n`, handling nested tags \n\t\t\t  # in between.\n\t\t\t\t\t\n\t\t\t\t\t\t[ ]{0,'.$less_than_tab.'}\n\t\t\t\t\t\t<('.$block_tags_b_re.')# start tag = $2\n\t\t\t\t\t\t'.$attr.'>\t\t\t# attributes followed by > and \\n\n\t\t\t\t\t\t'.$content.'\t\t# content, support nesting\n\t\t\t\t\t\t</\\2>\t\t\t\t# the matching end tag\n\t\t\t\t\t\t[ ]*\t\t\t\t# trailing spaces/tabs\n\t\t\t\t\t\t(?=\\n+|\\Z)\t# followed by a newline or end of document\n\n\t\t\t| # Special version for tags of group a.\n\n\t\t\t\t\t\t[ ]{0,'.$less_than_tab.'}\n\t\t\t\t\t\t<('.$block_tags_a_re.')# start tag = $3\n\t\t\t\t\t\t'.$attr.'>[ ]*\\n\t# attributes followed by >\n\t\t\t\t\t\t'.$content2.'\t\t# content, support nesting\n\t\t\t\t\t\t</\\3>\t\t\t\t# the matching end tag\n\t\t\t\t\t\t[ ]*\t\t\t\t# trailing spaces/tabs\n\t\t\t\t\t\t(?=\\n+|\\Z)\t# followed by a newline or end of document\n\t\t\t\t\t\n\t\t\t| # Special case just for <hr />. It was easier to make a special \n\t\t\t  # case than to make the other regex more complicated.\n\t\t\t\n\t\t\t\t\t\t[ ]{0,'.$less_than_tab.'}\n\t\t\t\t\t\t<(hr)\t\t\t\t# start tag = $2\n\t\t\t\t\t\t'.$attr.'\t\t\t# attributes\n\t\t\t\t\t\t/?>\t\t\t\t\t# the matching end tag\n\t\t\t\t\t\t[ ]*\n\t\t\t\t\t\t(?=\\n{2,}|\\Z)\t\t# followed by a blank line or end of document\n\t\t\t\n\t\t\t| # Special case for standalone HTML comments:\n\t\t\t\n\t\t\t\t\t[ ]{0,'.$less_than_tab.'}\n\t\t\t\t\t(?s:\n\t\t\t\t\t\t<!-- .*? -->\n\t\t\t\t\t)\n\t\t\t\t\t[ ]*\n\t\t\t\t\t(?=\\n{2,}|\\Z)\t\t# followed by a blank line or end of document\n\t\t\t\n\t\t\t| # PHP and ASP-style processor instructions (<? and <%)\n\t\t\t\n\t\t\t\t\t[ ]{0,'.$less_than_tab.'}\n\t\t\t\t\t(?s:\n\t\t\t\t\t\t<([?%])\t\t\t# $2\n\t\t\t\t\t\t.*?\n\t\t\t\t\t\t\\2>\n\t\t\t\t\t)\n\t\t\t\t\t[ ]*\n\t\t\t\t\t(?=\\n{2,}|\\Z)\t\t# followed by a blank line or end of document\n\t\t\t\t\t\n\t\t\t)\n\t\t\t)}Sxmi',\n\t\t\tarray(&$this, '_hashHTMLBlocks_callback'),\n\t\t\t$text);\n\n\t\treturn $text;\n\t}\n\tfunction _hashHTMLBlocks_callback($matches) {\n\t\t$text = $matches[1];\n\t\t$key  = $this->hashBlock($text);\n\t\treturn \"\\n\\n$key\\n\\n\";\n\t}\n\t\n\t\n\tfunction hashPart($text, $boundary = 'X') {\n\t#\n\t# Called whenever a tag must be hashed when a function insert an atomic \n\t# element in the text stream. Passing $text to through this function gives\n\t# a unique text-token which will be reverted back when calling unhash.\n\t#\n\t# The $boundary argument specify what character should be used to surround\n\t# the token. By convension, \"B\" is used for block elements that needs not\n\t# to be wrapped into paragraph tags at the end, \":\" is used for elements\n\t# that are word separators and \"X\" is used in the general case.\n\t#\n\t\t# Swap back any tag hash found in $text so we do not have to `unhash`\n\t\t# multiple times at the end.\n\t\t$text = $this->unhash($text);\n\t\t\n\t\t# Then hash the block.\n\t\tstatic $i = 0;\n\t\t$key = \"$boundary\\x1A\" . ++$i . $boundary;\n\t\t$this->html_hashes[$key] = $text;\n\t\treturn $key; # String that will replace the tag.\n\t}\n\n\n\tfunction hashBlock($text) {\n\t#\n\t# Shortcut function for hashPart with block-level boundaries.\n\t#\n\t\treturn $this->hashPart($text, 'B');\n\t}\n\n\n\tvar $block_gamut = array(\n\t#\n\t# These are all the transformations that form block-level\n\t# tags like paragraphs, headers, and list items.\n\t#\n\t\t\"doHeaders\"         => 10,\n\t\t\"doHorizontalRules\" => 20,\n\t\t\n\t\t\"doLists\"           => 40,\n\t\t\"doCodeBlocks\"      => 50,\n\t\t\"doBlockQuotes\"     => 60,\n\t\t);\n\n\tfunction runBlockGamut($text) {\n\t#\n\t# Run block gamut tranformations.\n\t#\n\t\t# We need to escape raw HTML in Markdown source before doing anything \n\t\t# else. This need to be done for each block, and not only at the \n\t\t# begining in the Markdown function since hashed blocks can be part of\n\t\t# list items and could have been indented. Indented blocks would have \n\t\t# been seen as a code block in a previous pass of hashHTMLBlocks.\n\t\t$text = $this->hashHTMLBlocks($text);\n\t\t\n\t\treturn $this->runBasicBlockGamut($text);\n\t}\n\t\n\tfunction runBasicBlockGamut($text) {\n\t#\n\t# Run block gamut tranformations, without hashing HTML blocks. This is \n\t# useful when HTML blocks are known to be already hashed, like in the first\n\t# whole-document pass.\n\t#\n\t\tforeach ($this->block_gamut as $method => $priority) {\n\t\t\t$text = $this->$method($text);\n\t\t}\n\t\t\n\t\t# Finally form paragraph and restore hashed blocks.\n\t\t$text = $this->formParagraphs($text);\n\n\t\treturn $text;\n\t}\n\t\n\t\n\tfunction doHorizontalRules($text) {\n\t\t# Do Horizontal Rules:\n\t\treturn preg_replace(\n\t\t\t'{\n\t\t\t\t^[ ]{0,3}\t# Leading space\n\t\t\t\t([-*_])\t\t# $1: First marker\n\t\t\t\t(?>\t\t\t# Repeated marker group\n\t\t\t\t\t[ ]{0,2}\t# Zero, one, or two spaces.\n\t\t\t\t\t\\1\t\t\t# Marker character\n\t\t\t\t){2,}\t\t# Group repeated at least twice\n\t\t\t\t[ ]*\t\t# Tailing spaces\n\t\t\t\t$\t\t\t# End of line.\n\t\t\t}mx',\n\t\t\t\"\\n\".$this->hashBlock(\"<hr$this->empty_element_suffix\").\"\\n\", \n\t\t\t$text);\n\t}\n\n\n\tvar $span_gamut = array(\n\t#\n\t# These are all the transformations that occur *within* block-level\n\t# tags like paragraphs, headers, and list items.\n\t#\n\t\t# Process character escapes, code spans, and inline HTML\n\t\t# in one shot.\n\t\t\"parseSpan\"           => -30,\n\n\t\t# Process anchor and image tags. Images must come first,\n\t\t# because ![foo][f] looks like an anchor.\n\t\t\"doImages\"            =>  10,\n\t\t\"doAnchors\"           =>  20,\n\t\t\n\t\t# Make links out of things like `<http://example.com/>`\n\t\t# Must come after doAnchors, because you can use < and >\n\t\t# delimiters in inline links like [this](<url>).\n\t\t\"doAutoLinks\"         =>  30,\n\t\t\"encodeAmpsAndAngles\" =>  40,\n\n\t\t\"doItalicsAndBold\"    =>  50,\n\t\t\"doHardBreaks\"        =>  60,\n\t\t);\n\n\tfunction runSpanGamut($text) {\n\t#\n\t# Run span gamut tranformations.\n\t#\n\t\tforeach ($this->span_gamut as $method => $priority) {\n\t\t\t$text = $this->$method($text);\n\t\t}\n\n\t\treturn $text;\n\t}\n\t\n\t\n\tfunction doHardBreaks($text) {\n\t\t# Do hard breaks:\n\t\treturn preg_replace_callback('/ {2,}\\n/', \n\t\t\tarray(&$this, '_doHardBreaks_callback'), $text);\n\t}\n\tfunction _doHardBreaks_callback($matches) {\n\t\treturn $this->hashPart(\"<br$this->empty_element_suffix\\n\");\n\t}\n\n\n\tfunction doAnchors($text) {\n\t#\n\t# Turn Markdown link shortcuts into XHTML <a> tags.\n\t#\n\t\tif ($this->in_anchor) return $text;\n\t\t$this->in_anchor = true;\n\t\t\n\t\t#\n\t\t# First, handle reference-style links: [link text] [id]\n\t\t#\n\t\t$text = preg_replace_callback('{\n\t\t\t(\t\t\t\t\t# wrap whole match in $1\n\t\t\t  \\[\n\t\t\t\t('.$this->nested_brackets_re.')\t# link text = $2\n\t\t\t  \\]\n\n\t\t\t  [ ]?\t\t\t\t# one optional space\n\t\t\t  (?:\\n[ ]*)?\t\t# one optional newline followed by spaces\n\n\t\t\t  \\[\n\t\t\t\t(.*?)\t\t# id = $3\n\t\t\t  \\]\n\t\t\t)\n\t\t\t}xs',\n\t\t\tarray(&$this, '_doAnchors_reference_callback'), $text);\n\n\t\t#\n\t\t# Next, inline-style links: [link text](url \"optional title\")\n\t\t#\n\t\t$text = preg_replace_callback('{\n\t\t\t(\t\t\t\t# wrap whole match in $1\n\t\t\t  \\[\n\t\t\t\t('.$this->nested_brackets_re.')\t# link text = $2\n\t\t\t  \\]\n\t\t\t  \\(\t\t\t# literal paren\n\t\t\t\t[ \\n]*\n\t\t\t\t(?:\n\t\t\t\t\t<(.+?)>\t# href = $3\n\t\t\t\t|\n\t\t\t\t\t('.$this->nested_url_parenthesis_re.')\t# href = $4\n\t\t\t\t)\n\t\t\t\t[ \\n]*\n\t\t\t\t(\t\t\t# $5\n\t\t\t\t  ([\\'\"])\t# quote char = $6\n\t\t\t\t  (.*?)\t\t# Title = $7\n\t\t\t\t  \\6\t\t# matching quote\n\t\t\t\t  [ \\n]*\t# ignore any spaces/tabs between closing quote and )\n\t\t\t\t)?\t\t\t# title is optional\n\t\t\t  \\)\n\t\t\t)\n\t\t\t}xs',\n\t\t\tarray(&$this, '_doAnchors_inline_callback'), $text);\n\n\t\t#\n\t\t# Last, handle reference-style shortcuts: [link text]\n\t\t# These must come last in case you've also got [link text][1]\n\t\t# or [link text](/foo)\n\t\t#\n\t\t$text = preg_replace_callback('{\n\t\t\t(\t\t\t\t\t# wrap whole match in $1\n\t\t\t  \\[\n\t\t\t\t([^\\[\\]]+)\t\t# link text = $2; can\\'t contain [ or ]\n\t\t\t  \\]\n\t\t\t)\n\t\t\t}xs',\n\t\t\tarray(&$this, '_doAnchors_reference_callback'), $text);\n\n\t\t$this->in_anchor = false;\n\t\treturn $text;\n\t}\n\tfunction _doAnchors_reference_callback($matches) {\n\t\t$whole_match =  $matches[1];\n\t\t$link_text   =  $matches[2];\n\t\t$link_id     =& $matches[3];\n\n\t\tif ($link_id == \"\") {\n\t\t\t# for shortcut links like [this][] or [this].\n\t\t\t$link_id = $link_text;\n\t\t}\n\t\t\n\t\t# lower-case and turn embedded newlines into spaces\n\t\t$link_id = strtolower($link_id);\n\t\t$link_id = preg_replace('{[ ]?\\n}', ' ', $link_id);\n\n\t\tif (isset($this->urls[$link_id])) {\n\t\t\t$url = $this->urls[$link_id];\n\t\t\t$url = $this->encodeAttribute($url);\n\t\t\t\n\t\t\t$result = \"<a href=\\\"$url\\\"\";\n\t\t\tif ( isset( $this->titles[$link_id] ) ) {\n\t\t\t\t$title = $this->titles[$link_id];\n\t\t\t\t$title = $this->encodeAttribute($title);\n\t\t\t\t$result .=  \" title=\\\"$title\\\"\";\n\t\t\t}\n\t\t\n\t\t\t$link_text = $this->runSpanGamut($link_text);\n\t\t\t$result .= \">$link_text</a>\";\n\t\t\t$result = $this->hashPart($result);\n\t\t}\n\t\telse {\n\t\t\t$result = $whole_match;\n\t\t}\n\t\treturn $result;\n\t}\n\tfunction _doAnchors_inline_callback($matches) {\n\t\t$whole_match\t=  $matches[1];\n\t\t$link_text\t\t=  $this->runSpanGamut($matches[2]);\n\t\t$url\t\t\t=  $matches[3] == '' ? $matches[4] : $matches[3];\n\t\t$title\t\t\t=& $matches[7];\n\n\t\t$url = $this->encodeAttribute($url);\n\n\t\t$result = \"<a href=\\\"$url\\\"\";\n\t\tif (isset($title)) {\n\t\t\t$title = $this->encodeAttribute($title);\n\t\t\t$result .=  \" title=\\\"$title\\\"\";\n\t\t}\n\t\t\n\t\t$link_text = $this->runSpanGamut($link_text);\n\t\t$result .= \">$link_text</a>\";\n\n\t\treturn $this->hashPart($result);\n\t}\n\n\n\tfunction doImages($text) {\n\t#\n\t# Turn Markdown image shortcuts into <img> tags.\n\t#\n\t\t#\n\t\t# First, handle reference-style labeled images: ![alt text][id]\n\t\t#\n\t\t$text = preg_replace_callback('{\n\t\t\t(\t\t\t\t# wrap whole match in $1\n\t\t\t  !\\[\n\t\t\t\t('.$this->nested_brackets_re.')\t\t# alt text = $2\n\t\t\t  \\]\n\n\t\t\t  [ ]?\t\t\t\t# one optional space\n\t\t\t  (?:\\n[ ]*)?\t\t# one optional newline followed by spaces\n\n\t\t\t  \\[\n\t\t\t\t(.*?)\t\t# id = $3\n\t\t\t  \\]\n\n\t\t\t)\n\t\t\t}xs', \n\t\t\tarray(&$this, '_doImages_reference_callback'), $text);\n\n\t\t#\n\t\t# Next, handle inline images:  ![alt text](url \"optional title\")\n\t\t# Don't forget: encode * and _\n\t\t#\n\t\t$text = preg_replace_callback('{\n\t\t\t(\t\t\t\t# wrap whole match in $1\n\t\t\t  !\\[\n\t\t\t\t('.$this->nested_brackets_re.')\t\t# alt text = $2\n\t\t\t  \\]\n\t\t\t  \\s?\t\t\t# One optional whitespace character\n\t\t\t  \\(\t\t\t# literal paren\n\t\t\t\t[ \\n]*\n\t\t\t\t(?:\n\t\t\t\t\t<(\\S*)>\t# src url = $3\n\t\t\t\t|\n\t\t\t\t\t('.$this->nested_url_parenthesis_re.')\t# src url = $4\n\t\t\t\t)\n\t\t\t\t[ \\n]*\n\t\t\t\t(\t\t\t# $5\n\t\t\t\t  ([\\'\"])\t# quote char = $6\n\t\t\t\t  (.*?)\t\t# title = $7\n\t\t\t\t  \\6\t\t# matching quote\n\t\t\t\t  [ \\n]*\n\t\t\t\t)?\t\t\t# title is optional\n\t\t\t  \\)\n\t\t\t)\n\t\t\t}xs',\n\t\t\tarray(&$this, '_doImages_inline_callback'), $text);\n\n\t\treturn $text;\n\t}\n\tfunction _doImages_reference_callback($matches) {\n\t\t$whole_match = $matches[1];\n\t\t$alt_text    = $matches[2];\n\t\t$link_id     = strtolower($matches[3]);\n\n\t\tif ($link_id == \"\") {\n\t\t\t$link_id = strtolower($alt_text); # for shortcut links like ![this][].\n\t\t}\n\n\t\t$alt_text = $this->encodeAttribute($alt_text);\n\t\tif (isset($this->urls[$link_id])) {\n\t\t\t$url = $this->encodeAttribute($this->urls[$link_id]);\n\t\t\t$result = \"<img src=\\\"$url\\\" alt=\\\"$alt_text\\\"\";\n\t\t\tif (isset($this->titles[$link_id])) {\n\t\t\t\t$title = $this->titles[$link_id];\n\t\t\t\t$title = $this->encodeAttribute($title);\n\t\t\t\t$result .=  \" title=\\\"$title\\\"\";\n\t\t\t}\n\t\t\t$result .= $this->empty_element_suffix;\n\t\t\t$result = $this->hashPart($result);\n\t\t}\n\t\telse {\n\t\t\t# If there's no such link ID, leave intact:\n\t\t\t$result = $whole_match;\n\t\t}\n\n\t\treturn $result;\n\t}\n\tfunction _doImages_inline_callback($matches) {\n\t\t$whole_match\t= $matches[1];\n\t\t$alt_text\t\t= $matches[2];\n\t\t$url\t\t\t= $matches[3] == '' ? $matches[4] : $matches[3];\n\t\t$title\t\t\t=& $matches[7];\n\n\t\t$alt_text = $this->encodeAttribute($alt_text);\n\t\t$url = $this->encodeAttribute($url);\n\t\t$result = \"<img src=\\\"$url\\\" alt=\\\"$alt_text\\\"\";\n\t\tif (isset($title)) {\n\t\t\t$title = $this->encodeAttribute($title);\n\t\t\t$result .=  \" title=\\\"$title\\\"\"; # $title already quoted\n\t\t}\n\t\t$result .= $this->empty_element_suffix;\n\n\t\treturn $this->hashPart($result);\n\t}\n\n\n\tfunction doHeaders($text) {\n\t\t# Setext-style headers:\n\t\t#\t  Header 1\n\t\t#\t  ========\n\t\t#  \n\t\t#\t  Header 2\n\t\t#\t  --------\n\t\t#\n\t\t$text = preg_replace_callback('{ ^(.+?)[ ]*\\n(=+|-+)[ ]*\\n+ }mx',\n\t\t\tarray(&$this, '_doHeaders_callback_setext'), $text);\n\n\t\t# atx-style headers:\n\t\t#\t# Header 1\n\t\t#\t## Header 2\n\t\t#\t## Header 2 with closing hashes ##\n\t\t#\t...\n\t\t#\t###### Header 6\n\t\t#\n\t\t$text = preg_replace_callback('{\n\t\t\t\t^(\\#{1,6})\t# $1 = string of #\\'s\n\t\t\t\t[ ]*\n\t\t\t\t(.+?)\t\t# $2 = Header text\n\t\t\t\t[ ]*\n\t\t\t\t\\#*\t\t\t# optional closing #\\'s (not counted)\n\t\t\t\t\\n+\n\t\t\t}xm',\n\t\t\tarray(&$this, '_doHeaders_callback_atx'), $text);\n\n\t\treturn $text;\n\t}\n\tfunction _doHeaders_callback_setext($matches) {\n\t\t# Terrible hack to check we haven't found an empty list item.\n\t\tif ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1]))\n\t\t\treturn $matches[0];\n\t\t\n\t\t$level = $matches[2]{0} == '=' ? 1 : 2;\n\t\t$block = \"<h$level>\".$this->runSpanGamut($matches[1]).\"</h$level>\";\n\t\treturn \"\\n\" . $this->hashBlock($block) . \"\\n\\n\";\n\t}\n\tfunction _doHeaders_callback_atx($matches) {\n\t\t$level = strlen($matches[1]);\n\t\t$block = \"<h$level>\".$this->runSpanGamut($matches[2]).\"</h$level>\";\n\t\treturn \"\\n\" . $this->hashBlock($block) . \"\\n\\n\";\n\t}\n\n\n\tfunction doLists($text) {\n\t#\n\t# Form HTML ordered (numbered) and unordered (bulleted) lists.\n\t#\n\t\t$less_than_tab = $this->tab_width - 1;\n\n\t\t# Re-usable patterns to match list item bullets and number markers:\n\t\t$marker_ul_re  = '[*+-]';\n\t\t$marker_ol_re  = '\\d+[\\.]';\n\t\t$marker_any_re = \"(?:$marker_ul_re|$marker_ol_re)\";\n\n\t\t$markers_relist = array(\n\t\t\t$marker_ul_re => $marker_ol_re,\n\t\t\t$marker_ol_re => $marker_ul_re,\n\t\t\t);\n\n\t\tforeach ($markers_relist as $marker_re => $other_marker_re) {\n\t\t\t# Re-usable pattern to match any entirel ul or ol list:\n\t\t\t$whole_list_re = '\n\t\t\t\t(\t\t\t\t\t\t\t\t# $1 = whole list\n\t\t\t\t  (\t\t\t\t\t\t\t\t# $2\n\t\t\t\t\t([ ]{0,'.$less_than_tab.'})\t# $3 = number of spaces\n\t\t\t\t\t('.$marker_re.')\t\t\t# $4 = first list item marker\n\t\t\t\t\t[ ]+\n\t\t\t\t  )\n\t\t\t\t  (?s:.+?)\n\t\t\t\t  (\t\t\t\t\t\t\t\t# $5\n\t\t\t\t\t  \\z\n\t\t\t\t\t|\n\t\t\t\t\t  \\n{2,}\n\t\t\t\t\t  (?=\\S)\n\t\t\t\t\t  (?!\t\t\t\t\t\t# Negative lookahead for another list item marker\n\t\t\t\t\t\t[ ]*\n\t\t\t\t\t\t'.$marker_re.'[ ]+\n\t\t\t\t\t  )\n\t\t\t\t\t|\n\t\t\t\t\t  (?=\t\t\t\t\t\t# Lookahead for another kind of list\n\t\t\t\t\t    \\n\n\t\t\t\t\t\t\\3\t\t\t\t\t\t# Must have the same indentation\n\t\t\t\t\t\t'.$other_marker_re.'[ ]+\n\t\t\t\t\t  )\n\t\t\t\t  )\n\t\t\t\t)\n\t\t\t'; // mx\n\t\t\t\n\t\t\t# We use a different prefix before nested lists than top-level lists.\n\t\t\t# See extended comment in _ProcessListItems().\n\t\t\n\t\t\tif ($this->list_level) {\n\t\t\t\t$text = preg_replace_callback('{\n\t\t\t\t\t\t^\n\t\t\t\t\t\t'.$whole_list_re.'\n\t\t\t\t\t}mx',\n\t\t\t\t\tarray(&$this, '_doLists_callback'), $text);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$text = preg_replace_callback('{\n\t\t\t\t\t\t(?:(?<=\\n)\\n|\\A\\n?) # Must eat the newline\n\t\t\t\t\t\t'.$whole_list_re.'\n\t\t\t\t\t}mx',\n\t\t\t\t\tarray(&$this, '_doLists_callback'), $text);\n\t\t\t}\n\t\t}\n\n\t\treturn $text;\n\t}\n\tfunction _doLists_callback($matches) {\n\t\t# Re-usable patterns to match list item bullets and number markers:\n\t\t$marker_ul_re  = '[*+-]';\n\t\t$marker_ol_re  = '\\d+[\\.]';\n\t\t$marker_any_re = \"(?:$marker_ul_re|$marker_ol_re)\";\n\t\t\n\t\t$list = $matches[1];\n\t\t$list_type = preg_match(\"/$marker_ul_re/\", $matches[4]) ? \"ul\" : \"ol\";\n\t\t\n\t\t$marker_any_re = ( $list_type == \"ul\" ? $marker_ul_re : $marker_ol_re );\n\t\t\n\t\t$list .= \"\\n\";\n\t\t$result = $this->processListItems($list, $marker_any_re);\n\t\t\n\t\t$result = $this->hashBlock(\"<$list_type>\\n\" . $result . \"</$list_type>\");\n\t\treturn \"\\n\". $result .\"\\n\\n\";\n\t}\n\n\tvar $list_level = 0;\n\n\tfunction processListItems($list_str, $marker_any_re) {\n\t#\n\t#\tProcess the contents of a single ordered or unordered list, splitting it\n\t#\tinto individual list items.\n\t#\n\t\t# The $this->list_level global keeps track of when we're inside a list.\n\t\t# Each time we enter a list, we increment it; when we leave a list,\n\t\t# we decrement. If it's zero, we're not in a list anymore.\n\t\t#\n\t\t# We do this because when we're not inside a list, we want to treat\n\t\t# something like this:\n\t\t#\n\t\t#\t\tI recommend upgrading to version\n\t\t#\t\t8. Oops, now this line is treated\n\t\t#\t\tas a sub-list.\n\t\t#\n\t\t# As a single paragraph, despite the fact that the second line starts\n\t\t# with a digit-period-space sequence.\n\t\t#\n\t\t# Whereas when we're inside a list (or sub-list), that line will be\n\t\t# treated as the start of a sub-list. What a kludge, huh? This is\n\t\t# an aspect of Markdown's syntax that's hard to parse perfectly\n\t\t# without resorting to mind-reading. Perhaps the solution is to\n\t\t# change the syntax rules such that sub-lists must start with a\n\t\t# starting cardinal number; e.g. \"1.\" or \"a.\".\n\t\t\n\t\t$this->list_level++;\n\n\t\t# trim trailing blank lines:\n\t\t$list_str = preg_replace(\"/\\n{2,}\\\\z/\", \"\\n\", $list_str);\n\n\t\t$list_str = preg_replace_callback('{\n\t\t\t(\\n)?\t\t\t\t\t\t\t# leading line = $1\n\t\t\t(^[ ]*)\t\t\t\t\t\t\t# leading whitespace = $2\n\t\t\t('.$marker_any_re.'\t\t\t\t# list marker and space = $3\n\t\t\t\t(?:[ ]+|(?=\\n))\t# space only required if item is not empty\n\t\t\t)\n\t\t\t((?s:.*?))\t\t\t\t\t\t# list item text   = $4\n\t\t\t(?:(\\n+(?=\\n))|\\n)\t\t\t\t# tailing blank line = $5\n\t\t\t(?= \\n* (\\z | \\2 ('.$marker_any_re.') (?:[ ]+|(?=\\n))))\n\t\t\t}xm',\n\t\t\tarray(&$this, '_processListItems_callback'), $list_str);\n\n\t\t$this->list_level--;\n\t\treturn $list_str;\n\t}\n\tfunction _processListItems_callback($matches) {\n\t\t$item = $matches[4];\n\t\t$leading_line =& $matches[1];\n\t\t$leading_space =& $matches[2];\n\t\t$marker_space = $matches[3];\n\t\t$tailing_blank_line =& $matches[5];\n\n\t\tif ($leading_line || $tailing_blank_line || \n\t\t\tpreg_match('/\\n{2,}/', $item))\n\t\t{\n\t\t\t# Replace marker with the appropriate whitespace indentation\n\t\t\t$item = $leading_space . str_repeat(' ', strlen($marker_space)) . $item;\n\t\t\t$item = $this->runBlockGamut($this->outdent($item).\"\\n\");\n\t\t}\n\t\telse {\n\t\t\t# Recursion for sub-lists:\n\t\t\t$item = $this->doLists($this->outdent($item));\n\t\t\t$item = preg_replace('/\\n+$/', '', $item);\n\t\t\t$item = $this->runSpanGamut($item);\n\t\t}\n\n\t\treturn \"<li>\" . $item . \"</li>\\n\";\n\t}\n\n\n\tfunction doCodeBlocks($text) {\n\t#\n\t#\tProcess Markdown `<pre><code>` blocks.\n\t#\n\t\t$text = preg_replace_callback('{\n\t\t\t\t(?:\\n\\n|\\A\\n?)\n\t\t\t\t(\t            # $1 = the code block -- one or more lines, starting with a space/tab\n\t\t\t\t  (?>\n\t\t\t\t\t[ ]{'.$this->tab_width.'}  # Lines must start with a tab or a tab-width of spaces\n\t\t\t\t\t.*\\n+\n\t\t\t\t  )+\n\t\t\t\t)\n\t\t\t\t((?=^[ ]{0,'.$this->tab_width.'}\\S)|\\Z)\t# Lookahead for non-space at line-start, or end of doc\n\t\t\t}xm',\n\t\t\tarray(&$this, '_doCodeBlocks_callback'), $text);\n\n\t\treturn $text;\n\t}\n\tfunction _doCodeBlocks_callback($matches) {\n\t\t$codeblock = $matches[1];\n\n\t\t$codeblock = $this->outdent($codeblock);\n\t\t$codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);\n\n\t\t# trim leading newlines and trailing newlines\n\t\t$codeblock = preg_replace('/\\A\\n+|\\n+\\z/', '', $codeblock);\n\n\t\t$codeblock = \"<pre><code>$codeblock\\n</code></pre>\";\n\t\treturn \"\\n\\n\".$this->hashBlock($codeblock).\"\\n\\n\";\n\t}\n\n\n\tfunction makeCodeSpan($code) {\n\t#\n\t# Create a code span markup for $code. Called from handleSpanToken.\n\t#\n\t\t$code = htmlspecialchars(trim($code), ENT_NOQUOTES);\n\t\treturn $this->hashPart(\"<code>$code</code>\");\n\t}\n\n\n\tvar $em_relist = array(\n\t\t''  => '(?:(?<!\\*)\\*(?!\\*)|(?<!_)_(?!_))(?=\\S|$)(?![\\.,:;]\\s)',\n\t\t'*' => '(?<=\\S|^)(?<!\\*)\\*(?!\\*)',\n\t\t'_' => '(?<=\\S|^)(?<!_)_(?!_)',\n\t\t);\n\tvar $strong_relist = array(\n\t\t''   => '(?:(?<!\\*)\\*\\*(?!\\*)|(?<!_)__(?!_))(?=\\S|$)(?![\\.,:;]\\s)',\n\t\t'**' => '(?<=\\S|^)(?<!\\*)\\*\\*(?!\\*)',\n\t\t'__' => '(?<=\\S|^)(?<!_)__(?!_)',\n\t\t);\n\tvar $em_strong_relist = array(\n\t\t''    => '(?:(?<!\\*)\\*\\*\\*(?!\\*)|(?<!_)___(?!_))(?=\\S|$)(?![\\.,:;]\\s)',\n\t\t'***' => '(?<=\\S|^)(?<!\\*)\\*\\*\\*(?!\\*)',\n\t\t'___' => '(?<=\\S|^)(?<!_)___(?!_)',\n\t\t);\n\tvar $em_strong_prepared_relist;\n\t\n\tfunction prepareItalicsAndBold() {\n\t#\n\t# Prepare regular expressions for searching emphasis tokens in any\n\t# context.\n\t#\n\t\tforeach ($this->em_relist as $em => $em_re) {\n\t\t\tforeach ($this->strong_relist as $strong => $strong_re) {\n\t\t\t\t# Construct list of allowed token expressions.\n\t\t\t\t$token_relist = array();\n\t\t\t\tif (isset($this->em_strong_relist[\"$em$strong\"])) {\n\t\t\t\t\t$token_relist[] = $this->em_strong_relist[\"$em$strong\"];\n\t\t\t\t}\n\t\t\t\t$token_relist[] = $em_re;\n\t\t\t\t$token_relist[] = $strong_re;\n\t\t\t\t\n\t\t\t\t# Construct master expression from list.\n\t\t\t\t$token_re = '{('. implode('|', $token_relist) .')}';\n\t\t\t\t$this->em_strong_prepared_relist[\"$em$strong\"] = $token_re;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfunction doItalicsAndBold($text) {\n\t\t$token_stack = array('');\n\t\t$text_stack = array('');\n\t\t$em = '';\n\t\t$strong = '';\n\t\t$tree_char_em = false;\n\t\t\n\t\twhile (1) {\n\t\t\t#\n\t\t\t# Get prepared regular expression for seraching emphasis tokens\n\t\t\t# in current context.\n\t\t\t#\n\t\t\t$token_re = $this->em_strong_prepared_relist[\"$em$strong\"];\n\t\t\t\n\t\t\t#\n\t\t\t# Each loop iteration search for the next emphasis token. \n\t\t\t# Each token is then passed to handleSpanToken.\n\t\t\t#\n\t\t\t$parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t$text_stack[0] .= $parts[0];\n\t\t\t$token =& $parts[1];\n\t\t\t$text =& $parts[2];\n\t\t\t\n\t\t\tif (empty($token)) {\n\t\t\t\t# Reached end of text span: empty stack without emitting.\n\t\t\t\t# any more emphasis.\n\t\t\t\twhile ($token_stack[0]) {\n\t\t\t\t\t$text_stack[1] .= array_shift($token_stack);\n\t\t\t\t\t$text_stack[0] .= array_shift($text_stack);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$token_len = strlen($token);\n\t\t\tif ($tree_char_em) {\n\t\t\t\t# Reached closing marker while inside a three-char emphasis.\n\t\t\t\tif ($token_len == 3) {\n\t\t\t\t\t# Three-char closing marker, close em and strong.\n\t\t\t\t\tarray_shift($token_stack);\n\t\t\t\t\t$span = array_shift($text_stack);\n\t\t\t\t\t$span = $this->runSpanGamut($span);\n\t\t\t\t\t$span = \"<strong><em>$span</em></strong>\";\n\t\t\t\t\t$text_stack[0] .= $this->hashPart($span);\n\t\t\t\t\t$em = '';\n\t\t\t\t\t$strong = '';\n\t\t\t\t} else {\n\t\t\t\t\t# Other closing marker: close one em or strong and\n\t\t\t\t\t# change current token state to match the other\n\t\t\t\t\t$token_stack[0] = str_repeat($token{0}, 3-$token_len);\n\t\t\t\t\t$tag = $token_len == 2 ? \"strong\" : \"em\";\n\t\t\t\t\t$span = $text_stack[0];\n\t\t\t\t\t$span = $this->runSpanGamut($span);\n\t\t\t\t\t$span = \"<$tag>$span</$tag>\";\n\t\t\t\t\t$text_stack[0] = $this->hashPart($span);\n\t\t\t\t\t$$tag = ''; # $$tag stands for $em or $strong\n\t\t\t\t}\n\t\t\t\t$tree_char_em = false;\n\t\t\t} else if ($token_len == 3) {\n\t\t\t\tif ($em) {\n\t\t\t\t\t# Reached closing marker for both em and strong.\n\t\t\t\t\t# Closing strong marker:\n\t\t\t\t\tfor ($i = 0; $i < 2; ++$i) {\n\t\t\t\t\t\t$shifted_token = array_shift($token_stack);\n\t\t\t\t\t\t$tag = strlen($shifted_token) == 2 ? \"strong\" : \"em\";\n\t\t\t\t\t\t$span = array_shift($text_stack);\n\t\t\t\t\t\t$span = $this->runSpanGamut($span);\n\t\t\t\t\t\t$span = \"<$tag>$span</$tag>\";\n\t\t\t\t\t\t$text_stack[0] .= $this->hashPart($span);\n\t\t\t\t\t\t$$tag = ''; # $$tag stands for $em or $strong\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t# Reached opening three-char emphasis marker. Push on token \n\t\t\t\t\t# stack; will be handled by the special condition above.\n\t\t\t\t\t$em = $token{0};\n\t\t\t\t\t$strong = \"$em$em\";\n\t\t\t\t\tarray_unshift($token_stack, $token);\n\t\t\t\t\tarray_unshift($text_stack, '');\n\t\t\t\t\t$tree_char_em = true;\n\t\t\t\t}\n\t\t\t} else if ($token_len == 2) {\n\t\t\t\tif ($strong) {\n\t\t\t\t\t# Unwind any dangling emphasis marker:\n\t\t\t\t\tif (strlen($token_stack[0]) == 1) {\n\t\t\t\t\t\t$text_stack[1] .= array_shift($token_stack);\n\t\t\t\t\t\t$text_stack[0] .= array_shift($text_stack);\n\t\t\t\t\t}\n\t\t\t\t\t# Closing strong marker:\n\t\t\t\t\tarray_shift($token_stack);\n\t\t\t\t\t$span = array_shift($text_stack);\n\t\t\t\t\t$span = $this->runSpanGamut($span);\n\t\t\t\t\t$span = \"<strong>$span</strong>\";\n\t\t\t\t\t$text_stack[0] .= $this->hashPart($span);\n\t\t\t\t\t$strong = '';\n\t\t\t\t} else {\n\t\t\t\t\tarray_unshift($token_stack, $token);\n\t\t\t\t\tarray_unshift($text_stack, '');\n\t\t\t\t\t$strong = $token;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t# Here $token_len == 1\n\t\t\t\tif ($em) {\n\t\t\t\t\tif (strlen($token_stack[0]) == 1) {\n\t\t\t\t\t\t# Closing emphasis marker:\n\t\t\t\t\t\tarray_shift($token_stack);\n\t\t\t\t\t\t$span = array_shift($text_stack);\n\t\t\t\t\t\t$span = $this->runSpanGamut($span);\n\t\t\t\t\t\t$span = \"<em>$span</em>\";\n\t\t\t\t\t\t$text_stack[0] .= $this->hashPart($span);\n\t\t\t\t\t\t$em = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$text_stack[0] .= $token;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tarray_unshift($token_stack, $token);\n\t\t\t\t\tarray_unshift($text_stack, '');\n\t\t\t\t\t$em = $token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $text_stack[0];\n\t}\n\n\n\tfunction doBlockQuotes($text) {\n\t\t$text = preg_replace_callback('/\n\t\t\t  (\t\t\t\t\t\t\t\t# Wrap whole match in $1\n\t\t\t\t(?>\n\t\t\t\t  ^[ ]*>[ ]?\t\t\t# \">\" at the start of a line\n\t\t\t\t\t.+\\n\t\t\t\t\t# rest of the first line\n\t\t\t\t  (.+\\n)*\t\t\t\t\t# subsequent consecutive lines\n\t\t\t\t  \\n*\t\t\t\t\t\t# blanks\n\t\t\t\t)+\n\t\t\t  )\n\t\t\t/xm',\n\t\t\tarray(&$this, '_doBlockQuotes_callback'), $text);\n\n\t\treturn $text;\n\t}\n\tfunction _doBlockQuotes_callback($matches) {\n\t\t$bq = $matches[1];\n\t\t# trim one level of quoting - trim whitespace-only lines\n\t\t$bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq);\n\t\t$bq = $this->runBlockGamut($bq);\t\t# recurse\n\n\t\t$bq = preg_replace('/^/m', \"  \", $bq);\n\t\t# These leading spaces cause problem with <pre> content, \n\t\t# so we need to fix that:\n\t\t$bq = preg_replace_callback('{(\\s*<pre>.+?</pre>)}sx', \n\t\t\tarray(&$this, '_doBlockQuotes_callback2'), $bq);\n\n\t\treturn \"\\n\". $this->hashBlock(\"<blockquote>\\n$bq\\n</blockquote>\").\"\\n\\n\";\n\t}\n\tfunction _doBlockQuotes_callback2($matches) {\n\t\t$pre = $matches[1];\n\t\t$pre = preg_replace('/^  /m', '', $pre);\n\t\treturn $pre;\n\t}\n\n\n\tfunction formParagraphs($text) {\n\t#\n\t#\tParams:\n\t#\t\t$text - string to process with html <p> tags\n\t#\n\t\t# Strip leading and trailing lines:\n\t\t$text = preg_replace('/\\A\\n+|\\n+\\z/', '', $text);\n\n\t\t$grafs = preg_split('/\\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY);\n\n\t\t#\n\t\t# Wrap <p> tags and unhashify HTML blocks\n\t\t#\n\t\tforeach ($grafs as $key => $value) {\n\t\t\tif (!preg_match('/^B\\x1A[0-9]+B$/', $value)) {\n\t\t\t\t# Is a paragraph.\n\t\t\t\t$value = $this->runSpanGamut($value);\n\t\t\t\t$value = preg_replace('/^([ ]*)/', \"<p>\", $value);\n\t\t\t\t$value .= \"</p>\";\n\t\t\t\t$grafs[$key] = $this->unhash($value);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t# Is a block.\n\t\t\t\t# Modify elements of @grafs in-place...\n\t\t\t\t$graf = $value;\n\t\t\t\t$block = $this->html_hashes[$graf];\n\t\t\t\t$graf = $block;\n//\t\t\t\tif (preg_match('{\n//\t\t\t\t\t\\A\n//\t\t\t\t\t(\t\t\t\t\t\t\t# $1 = <div> tag\n//\t\t\t\t\t  <div  \\s+\n//\t\t\t\t\t  [^>]*\n//\t\t\t\t\t  \\b\n//\t\t\t\t\t  markdown\\s*=\\s*  ([\\'\"])\t#\t$2 = attr quote char\n//\t\t\t\t\t  1\n//\t\t\t\t\t  \\2\n//\t\t\t\t\t  [^>]*\n//\t\t\t\t\t  >\n//\t\t\t\t\t)\n//\t\t\t\t\t(\t\t\t\t\t\t\t# $3 = contents\n//\t\t\t\t\t.*\n//\t\t\t\t\t)\n//\t\t\t\t\t(</div>)\t\t\t\t\t# $4 = closing tag\n//\t\t\t\t\t\\z\n//\t\t\t\t\t}xs', $block, $matches))\n//\t\t\t\t{\n//\t\t\t\t\tlist(, $div_open, , $div_content, $div_close) = $matches;\n//\n//\t\t\t\t\t# We can't call Markdown(), because that resets the hash;\n//\t\t\t\t\t# that initialization code should be pulled into its own sub, though.\n//\t\t\t\t\t$div_content = $this->hashHTMLBlocks($div_content);\n//\t\t\t\t\t\n//\t\t\t\t\t# Run document gamut methods on the content.\n//\t\t\t\t\tforeach ($this->document_gamut as $method => $priority) {\n//\t\t\t\t\t\t$div_content = $this->$method($div_content);\n//\t\t\t\t\t}\n//\n//\t\t\t\t\t$div_open = preg_replace(\n//\t\t\t\t\t\t'{\\smarkdown\\s*=\\s*([\\'\"]).+?\\1}', '', $div_open);\n//\n//\t\t\t\t\t$graf = $div_open . \"\\n\" . $div_content . \"\\n\" . $div_close;\n//\t\t\t\t}\n\t\t\t\t$grafs[$key] = $graf;\n\t\t\t}\n\t\t}\n\n\t\treturn implode(\"\\n\\n\", $grafs);\n\t}\n\n\n\tfunction encodeAttribute($text) {\n\t#\n\t# Encode text for a double-quoted HTML attribute. This function\n\t# is *not* suitable for attributes enclosed in single quotes.\n\t#\n\t\t$text = $this->encodeAmpsAndAngles($text);\n\t\t$text = str_replace('\"', '&quot;', $text);\n\t\treturn $text;\n\t}\n\t\n\t\n\tfunction encodeAmpsAndAngles($text) {\n\t#\n\t# Smart processing for ampersands and angle brackets that need to \n\t# be encoded. Valid character entities are left alone unless the\n\t# no-entities mode is set.\n\t#\n\t\tif ($this->no_entities) {\n\t\t\t$text = str_replace('&', '&amp;', $text);\n\t\t} else {\n\t\t\t# Ampersand-encoding based entirely on Nat Irons's Amputator\n\t\t\t# MT plugin: <http://bumppo.net/projects/amputator/>\n\t\t\t$text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\\w+);)/', \n\t\t\t\t\t\t\t\t'&amp;', $text);;\n\t\t}\n\t\t# Encode remaining <'s\n\t\t$text = str_replace('<', '&lt;', $text);\n\n\t\treturn $text;\n\t}\n\n\n\tfunction doAutoLinks($text) {\n\t\t$text = preg_replace_callback('{<((https?|ftp|dict):[^\\'\">\\s]+)>}i', \n\t\t\tarray(&$this, '_doAutoLinks_url_callback'), $text);\n\n\t\t# Email addresses: <address@domain.foo>\n\t\t$text = preg_replace_callback('{\n\t\t\t<\n\t\t\t(?:mailto:)?\n\t\t\t(\n\t\t\t\t(?:\n\t\t\t\t\t[-!#$%&\\'*+/=?^_`.{|}~\\w\\x80-\\xFF]+\n\t\t\t\t|\n\t\t\t\t\t\".*?\"\n\t\t\t\t)\n\t\t\t\t\\@\n\t\t\t\t(?:\n\t\t\t\t\t[-a-z0-9\\x80-\\xFF]+(\\.[-a-z0-9\\x80-\\xFF]+)*\\.[a-z]+\n\t\t\t\t|\n\t\t\t\t\t\\[[\\d.a-fA-F:]+\\]\t# IPv4 & IPv6\n\t\t\t\t)\n\t\t\t)\n\t\t\t>\n\t\t\t}xi',\n\t\t\tarray(&$this, '_doAutoLinks_email_callback'), $text);\n\n\t\treturn $text;\n\t}\n\tfunction _doAutoLinks_url_callback($matches) {\n\t\t$url = $this->encodeAttribute($matches[1]);\n\t\t$link = \"<a href=\\\"$url\\\">$url</a>\";\n\t\treturn $this->hashPart($link);\n\t}\n\tfunction _doAutoLinks_email_callback($matches) {\n\t\t$address = $matches[1];\n\t\t$link = $this->encodeEmailAddress($address);\n\t\treturn $this->hashPart($link);\n\t}\n\n\n\tfunction encodeEmailAddress($addr) {\n\t#\n\t#\tInput: an email address, e.g. \"foo@example.com\"\n\t#\n\t#\tOutput: the email address as a mailto link, with each character\n\t#\t\tof the address encoded as either a decimal or hex entity, in\n\t#\t\tthe hopes of foiling most address harvesting spam bots. E.g.:\n\t#\n\t#\t  <p><a href=\"&#109;&#x61;&#105;&#x6c;&#116;&#x6f;&#58;&#x66;o&#111;\n\t#        &#x40;&#101;&#x78;&#97;&#x6d;&#112;&#x6c;&#101;&#46;&#x63;&#111;\n\t#        &#x6d;\">&#x66;o&#111;&#x40;&#101;&#x78;&#97;&#x6d;&#112;&#x6c;\n\t#        &#101;&#46;&#x63;&#111;&#x6d;</a></p>\n\t#\n\t#\tBased by a filter by Matthew Wickline, posted to BBEdit-Talk.\n\t#   With some optimizations by Milian Wolff.\n\t#\n\t\t$addr = \"mailto:\" . $addr;\n\t\t$chars = preg_split('/(?<!^)(?!$)/', $addr);\n\t\t$seed = (int)abs(crc32($addr) / strlen($addr)); # Deterministic seed.\n\t\t\n\t\tforeach ($chars as $key => $char) {\n\t\t\t$ord = ord($char);\n\t\t\t# Ignore non-ascii chars.\n\t\t\tif ($ord < 128) {\n\t\t\t\t$r = ($seed * (1 + $key)) % 100; # Pseudo-random function.\n\t\t\t\t# roughly 10% raw, 45% hex, 45% dec\n\t\t\t\t# '@' *must* be encoded. I insist.\n\t\t\t\tif ($r > 90 && $char != '@') /* do nothing */;\n\t\t\t\telse if ($r < 45) $chars[$key] = '&#x'.dechex($ord).';';\n\t\t\t\telse              $chars[$key] = '&#'.$ord.';';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$addr = implode('', $chars);\n\t\t$text = implode('', array_slice($chars, 7)); # text without `mailto:`\n\t\t$addr = \"<a href=\\\"$addr\\\">$text</a>\";\n\n\t\treturn $addr;\n\t}\n\n\n\tfunction parseSpan($str) {\n\t#\n\t# Take the string $str and parse it into tokens, hashing embeded HTML,\n\t# escaped characters and handling code spans.\n\t#\n\t\t$output = '';\n\t\t\n\t\t$span_re = '{\n\t\t\t\t(\n\t\t\t\t\t\\\\\\\\'.$this->escape_chars_re.'\n\t\t\t\t|\n\t\t\t\t\t(?<![`\\\\\\\\])\n\t\t\t\t\t`+\t\t\t\t\t\t# code span marker\n\t\t\t'.( $this->no_markup ? '' : '\n\t\t\t\t|\n\t\t\t\t\t<!--    .*?     -->\t\t# comment\n\t\t\t\t|\n\t\t\t\t\t<\\?.*?\\?> | <%.*?%>\t\t# processing instruction\n\t\t\t\t|\n\t\t\t\t\t<[!$]?[-a-zA-Z0-9:_]+\t# regular tags\n\t\t\t\t\t(?>\n\t\t\t\t\t\t\\s\n\t\t\t\t\t\t(?>[^\"\\'>]+|\"[^\"]*\"|\\'[^\\']*\\')*\n\t\t\t\t\t)?\n\t\t\t\t\t>\n\t\t\t\t|\n\t\t\t\t\t<[-a-zA-Z0-9:_]+\\s*/> # xml-style empty tag\n\t\t\t\t|\n\t\t\t\t\t</[-a-zA-Z0-9:_]+\\s*> # closing tag\n\t\t\t').'\n\t\t\t\t)\n\t\t\t\t}xs';\n\n\t\twhile (1) {\n\t\t\t#\n\t\t\t# Each loop iteration seach for either the next tag, the next \n\t\t\t# openning code span marker, or the next escaped character. \n\t\t\t# Each token is then passed to handleSpanToken.\n\t\t\t#\n\t\t\t$parts = preg_split($span_re, $str, 2, PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t\n\t\t\t# Create token from text preceding tag.\n\t\t\tif ($parts[0] != \"\") {\n\t\t\t\t$output .= $parts[0];\n\t\t\t}\n\t\t\t\n\t\t\t# Check if we reach the end.\n\t\t\tif (isset($parts[1])) {\n\t\t\t\t$output .= $this->handleSpanToken($parts[1], $parts[2]);\n\t\t\t\t$str = $parts[2];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $output;\n\t}\n\t\n\t\n\tfunction handleSpanToken($token, &$str) {\n\t#\n\t# Handle $token provided by parseSpan by determining its nature and \n\t# returning the corresponding value that should replace it.\n\t#\n\t\tswitch ($token{0}) {\n\t\t\tcase \"\\\\\":\n\t\t\t\treturn $this->hashPart(\"&#\". ord($token{1}). \";\");\n\t\t\tcase \"`\":\n\t\t\t\t# Search for end marker in remaining text.\n\t\t\t\tif (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm', \n\t\t\t\t\t$str, $matches))\n\t\t\t\t{\n\t\t\t\t\t$str = $matches[2];\n\t\t\t\t\t$codespan = $this->makeCodeSpan($matches[1]);\n\t\t\t\t\treturn $this->hashPart($codespan);\n\t\t\t\t}\n\t\t\t\treturn $token; // return as text since no ending marker found.\n\t\t\tdefault:\n\t\t\t\treturn $this->hashPart($token);\n\t\t}\n\t}\n\n\n\tfunction outdent($text) {\n\t#\n\t# Remove one level of line-leading tabs or spaces\n\t#\n\t\treturn preg_replace('/^(\\t|[ ]{1,'.$this->tab_width.'})/m', '', $text);\n\t}\n\n\n\t# String length function for detab. `_initDetab` will create a function to \n\t# hanlde UTF-8 if the default function does not exist.\n\tvar $utf8_strlen = 'mb_strlen';\n\t\n\tfunction detab($text) {\n\t#\n\t# Replace tabs with the appropriate amount of space.\n\t#\n\t\t# For each line we separate the line in blocks delemited by\n\t\t# tab characters. Then we reconstruct every line by adding the \n\t\t# appropriate number of space between each blocks.\n\t\t\n\t\t$text = preg_replace_callback('/^.*\\t.*$/m',\n\t\t\tarray(&$this, '_detab_callback'), $text);\n\n\t\treturn $text;\n\t}\n\tfunction _detab_callback($matches) {\n\t\t$line = $matches[0];\n\t\t$strlen = $this->utf8_strlen; # strlen function for UTF-8.\n\t\t\n\t\t# Split in blocks.\n\t\t$blocks = explode(\"\\t\", $line);\n\t\t# Add each blocks to the line.\n\t\t$line = $blocks[0];\n\t\tunset($blocks[0]); # Do not add first block twice.\n\t\tforeach ($blocks as $block) {\n\t\t\t# Calculate amount of space, insert spaces, insert block.\n\t\t\t$amount = $this->tab_width - \n\t\t\t\t$strlen($line, 'UTF-8') % $this->tab_width;\n\t\t\t$line .= str_repeat(\" \", $amount) . $block;\n\t\t}\n\t\treturn $line;\n\t}\n\tfunction _initDetab() {\n\t#\n\t# Check for the availability of the function in the `utf8_strlen` property\n\t# (initially `mb_strlen`). If the function is not available, create a \n\t# function that will loosely count the number of UTF-8 characters with a\n\t# regular expression.\n\t#\n\t\tif (function_exists($this->utf8_strlen)) return;\n\t\t$this->utf8_strlen = create_function('$text', 'return preg_match_all(\n\t\t\t\"/[\\\\\\\\x00-\\\\\\\\xBF]|[\\\\\\\\xC0-\\\\\\\\xFF][\\\\\\\\x80-\\\\\\\\xBF]*/\", \n\t\t\t$text, $m);');\n\t}\n\n\n\tfunction unhash($text) {\n\t#\n\t# Swap back in all the tags hashed by _HashHTMLBlocks.\n\t#\n\t\treturn preg_replace_callback('/(.)\\x1A[0-9]+\\1/', \n\t\t\tarray(&$this, '_unhash_callback'), $text);\n\t}\n\tfunction _unhash_callback($matches) {\n\t\treturn $this->html_hashes[$matches[0]];\n\t}\n\n}\n\n/*\n\nPHP Markdown\n============\n\nDescription\n-----------\n\nThis is a PHP translation of the original Markdown formatter written in\nPerl by John Gruber.\n\nMarkdown is a text-to-HTML filter; it translates an easy-to-read /\neasy-to-write structured text format into HTML. Markdown's text format\nis mostly similar to that of plain text email, and supports features such\nas headers, *emphasis*, code blocks, blockquotes, and links.\n\nMarkdown's syntax is designed not as a generic markup language, but\nspecifically to serve as a front-end to (X)HTML. You can use span-level\nHTML tags anywhere in a Markdown document, and you can use block level\nHTML tags (like <div> and <table> as well).\n\nFor more information about Markdown's syntax, see:\n\n<http://daringfireball.net/projects/markdown/>\n\n\nBugs\n----\n\nTo file bug reports please send email to:\n\n<michel.fortin@michelf.ca>\n\nPlease include with your report: (1) the example input; (2) the output you\nexpected; (3) the output Markdown actually produced.\n\n\nVersion History\n--------------- \n\nSee the readme file for detailed release notes for this version.\n\n\nCopyright and License\n---------------------\n\nPHP Markdown  \nCopyright (c) 2004-2013 Michel Fortin  \n<http://michelf.ca/>  \nAll rights reserved.\n\nBased on Markdown  \nCopyright (c) 2003-2006 John Gruber   \n<http://daringfireball.net/>   \nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n*\tRedistributions of source code must retain the above copyright notice,\n\tthis list of conditions and the following disclaimer.\n\n*\tRedistributions in binary form must reproduce the above copyright\n\tnotice, this list of conditions and the following disclaimer in the\n\tdocumentation and/or other materials provided with the distribution.\n\n*\tNeither the name \"Markdown\" nor the names of its contributors may\n\tbe used to endorse or promote products derived from this software\n\twithout specific prior written permission.\n\nThis software is provided by the copyright holders and contributors \"as\nis\" and any express or implied warranties, including, but not limited\nto, the implied warranties of merchantability and fitness for a\nparticular purpose are disclaimed. In no event shall the copyright owner\nor contributors be liable for any direct, indirect, incidental, special,\nexemplary, or consequential damages (including, but not limited to,\nprocurement of substitute goods or services; loss of use, data, or\nprofits; or business interruption) however caused and on any theory of\nliability, whether in contract, strict liability, or tort (including\nnegligence or otherwise) arising in any way out of the use of this\nsoftware, even if advised of the possibility of such damage.\n\n*/\n?>"
  },
  {
    "path": "extensions/modellist/ModellistModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module – modellist\n *\n * Shows a list of all models in a store\n *\n * @category   OntoWiki\n * @package    Extensions_Modellist\n * @author     Norman Heino <norman.heino@gmail.com>\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass ModellistModule extends OntoWiki_Module\n{\n    public function init()\n    {\n        $this->view->headScript()->appendFile($this->view->moduleUrl . 'modellist.js');\n\n        $menuRegistry = OntoWiki_Menu_Registry::getInstance();\n        $menuRegistry->getMenu('application')->getSubMenu('View')->setEntry('Hide Knowledge Bases Box', '#');\n\n        $this->session          = new Zend_Session_Namespace(_OWSESSION);\n        $this->allGraphUris     = $this->_store->getAvailableModels(true);\n        $this->visibleGraphUris = $this->_store->getAvailableModels(false);\n\n        if (isset($this->session->showHiddenGraphs) && $this->session->showHiddenGraphs == true) {\n            $this->graphUris = $this->allGraphUris;\n        } else {\n            $this->graphUris = $this->visibleGraphUris;\n        }\n    }\n\n\n    public function shouldShow()\n    {\n        // show only if there are models (visible or hidden)\n        if (($this->allGraphUris) || ($this->_erfurt->getAc()->isActionAllowed('ModelManagement'))) {\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Returns the menu of the module\n     *\n     * @return string\n     */\n    public function getMenu()\n    {\n        if ($this->_erfurt->getAc()->isActionAllowed('ModelManagement')) {\n            $editMenu = new OntoWiki_Menu();\n            $editMenu->setEntry('Create Knowledge Base', $this->_config->urlBase . 'model/create');\n        }\n\n        $viewMenu = new OntoWiki_Menu();\n        $session  = new Zend_Session_Namespace(_OWSESSION);\n        if (!isset($session->showHiddenGraphs) || $session->showHiddenGraphs == false) {\n            $viewMenu->setEntry('Show Hidden Knowledge Bases', array('class' => 'modellist_hidden_button show'));\n        } else {\n            $viewMenu->setEntry('Hide Hidden Knowledge Bases', array('class' => 'modellist_hidden_button'));\n        }\n\n        // build menu out of sub menus\n        $mainMenu = new OntoWiki_Menu();\n\n        if (isset($editMenu)) {\n            $mainMenu->setEntry('Edit', $editMenu);\n        }\n        $mainMenu->setEntry('View', $viewMenu);\n\n        return $mainMenu;\n    }\n\n    /**\n     * Returns the content for the model list.\n     */\n    public function getContents()\n    {\n        $models        = array();\n        $selectedModel = $this->_owApp->selectedModel ? $this->_owApp->selectedModel->getModelIri() : null;\n\n        $lang = $this->_config->languages->locale;\n\n        $titleHelper = new OntoWiki_Model_TitleHelper();\n        $titleHelper->addResources(array_keys($this->graphUris));\n\n        $useGraphUriAsLink = false;\n        if (isset($this->_privateConfig->useGraphUriAsLink) && (bool)$this->_privateConfig->useGraphUriAsLink) {\n            $useGraphUriAsLink = true;\n        }\n\n        foreach ($this->graphUris as $graphUri => $true) {\n            $linkUrl = $this->_config->urlBase . 'model/select/?m=' . urlencode($graphUri);\n            if ($useGraphUriAsLink) {\n                if (isset($this->_config->vhosts)) {\n                    $vHostsArray = $this->_config->vhosts->toArray();\n                    foreach ($vHostsArray as $vHostUri) {\n                        if (strpos($graphUri, $vHostUri) !== false) {\n                            // match\n                            $linkUrl = $graphUri;\n                            break;\n                        }\n                    }\n                }\n            }\n\n            $temp             = array();\n            $temp['url']      = $linkUrl;\n            $temp['graphUri'] = $graphUri;\n            $temp['selected'] = ($selectedModel == $graphUri ? 'selected' : '');\n\n            // use URI if no title exists\n            $label         = $titleHelper->getTitle($graphUri, $lang);\n            $temp['label'] = !empty($label) ? $label : $graphUri;\n\n            $temp['backendName'] = $true;\n\n            $models[] = $temp;\n        }\n\n        $content = $this->render('modellist', $models, 'models');\n\n        return $content;\n    }\n\n    public function getStateId()\n    {\n        $session = new Zend_Session_Namespace(_OWSESSION);\n        if (isset($session->showHiddenGraphs) && $session->showHiddenGraphs == true) {\n            $showHidden = 'true';\n        } else {\n            $showHidden = 'false';\n        }\n\n        $id = (string)$this->_owApp->getUser()->getUri()\n            . $this->_owApp->selectedModel\n            . $showHidden;\n\n        return $id;\n    }\n\n    public function getTitle()\n    {\n        return \"Knowledge Bases\";\n    }\n\n}\n"
  },
  {
    "path": "extensions/modellist/default.ini",
    "content": ";;\n; Static module configuration\n;;\nenabled     = true\nname        = \"Knowledge Bases Module\"\ndescription = \"provides a model list with create and view menu.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\ncaching    = yes\npriority   = 20\ncontexts[] = \"main.sidewindows\"\nclasses    = \"has-contextmenus-block\"\n\n[private]\n\n; use graph URI iff vhost matches\n;useGraphUriAsLink = true\n"
  },
  {
    "path": "extensions/modellist/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/modellist/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :modellist .\n:modellist a doap:Project ;\n  doap:name \"modellist\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/modellist/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Knowledge Bases Module\" ;\n  doap:description \"provides a model list with create and view menu.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:class \"has-contextmenus-block\" ;\n  owconfig:hasModule :Default .\n:Default a owconfig:Module ;\n  rdfs:label \"Default\" ;\n  owconfig:caching \"true\"^^xsd:boolean ;\n  owconfig:priority \"20\" ;\n  owconfig:context \"main.sidewindows\" .\n:modellist doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/modellist/modellist.js",
    "content": "/**\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n$(document).ready(function() {\n    $('.modellist_hidden_button').livequery('click', function() {\n        if ($(this).hasClass('show')) {\n            sessionStore('showHiddenGraphs', true, {\n                method: 'set', \n                callback: function() { \n                    updateModellistModule(); \n                }\n            });\n    } else {\n        sessionStore('showHiddenGraphs', false, {\n            method: 'unset', \n            callback: function() { \n                updateModellistModule(); \n            }\n        });\n    }\n});\n});\n\nfunction updateModellistModule()\n{\n    // Remove the context menu.\n    $('.contextmenu-enhanced .contextmenu').fadeOut(effectTime, function(){\n        $(this).remove();\n    })\n\n    var options = {\n        url: urlBase + 'module/get/name/modellist/id/modellist'\n    };\n\n    $.get(options.url, function(data) {\n        $('#modellist').replaceWith(data);\n        $('#modellist').addClass('has-contextmenus-block')\n        .addClass('windowbuttonscount-right-1')\n        .addClass('windowbuttonscount-left-1');\n\n        $('#modellist').enhanceWindow();\n    });\n}\n"
  },
  {
    "path": "extensions/modellist/modellist.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki model list template\n */\n\n?>\n<?php if (!empty($this->models)): ?>\n    <ol class=\"bullets-none separated has-contextmenus-block\">\n    \t<?php foreach ($this->models as $modelDetails): ?>\n    \t\t<li>\n    \t\t\t<a class=\"Model <?php echo $modelDetails['selected'] ?>\" href=\"<?php echo $modelDetails['url'] ?>\" about=\"<?php echo $modelDetails['graphUri'] ?>\">\n    \t\t\t\t<?php echo $modelDetails['label'] ?>\n    \t\t\t</a>\n    \t\t</li>\n    \t<?php endforeach; ?>\n    </ol>\n<?php else: ?>\n    <p class=\"messagebox info\"><?php echo $this->_('No knowledge bases found.') ?></p>\n<?php endif; ?>\n"
  },
  {
    "path": "extensions/navigation/NavigationController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Controller for OntoWiki Navigation Module\n *\n * @category OntoWiki\n * @package  Extensions_Navigation\n * @author   {@link http://sebastian.tramp.name Sebastian Tramp}\n */\nclass NavigationController extends OntoWiki_Controller_Component\n{\n    private $_store;\n    private $_translate;\n    private $_ac;\n    private $_model;\n    /* an array of arrays, each has type and text */\n    private $_messages = array();\n    /* the setup consists of state and config */\n    private $_setup = null;\n    private $_limit = 50;\n\n    /*\n     * Initializes Naviagation Controller,\n     * creates class vars for current store, session and model\n     */\n    public function init()\n    {\n        parent::init();\n        $this->_store     = $this->_owApp->erfurt->getStore();\n        $this->_translate = $this->_owApp->translate;\n        $this->_ac        = $this->_erfurt->getAc();\n\n        $sessionKey         = 'Navigation' . (isset($config->session->identifier) ? $config->session->identifier : '');\n        $this->stateSession = new Zend_Session_Namespace($sessionKey);\n\n        $this->_model = $this->_owApp->selectedModel;\n        if (isset($this->_request->m)) {\n            $this->_model = $_store->getModel($this->_request->m);\n        }\n        if (empty($this->_model)) {\n            throw new OntoWiki_Exception(\n                'Missing parameter m (model) and no selected model in session!'\n            );\n        }\n        // create title helper\n        $this->titleHelper = new OntoWiki_Model_TitleHelper($this->_model);\n\n        // Model Based Access Control\n        if (!$this->_ac->isModelAllowed('view', $this->_model->getModelIri())) {\n            throw new Erfurt_Ac_Exception('You are not allowed to read this model.');\n        }\n    }\n\n    /*\n     * The main action which is retrieved via ajax\n     */\n    public function exploreAction()\n    {\n        // disable standart navigation\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        // translate navigation title to selected language\n        $this->view->placeholder('main.window.title')->set($this->_translate->_('Navigation'));\n\n        // check if setup is present\n        if (empty($this->_request->setup)) {\n            throw new OntoWiki_Exception('Missing parameter setup !');\n        }\n        // decode setup from JSON into array\n        $this->_setup = json_decode($this->_request->getParam('setup'));\n\n        // check if setup was not converted\n        if ($this->_setup == false) {\n            throw new OntoWiki_Exception(\n                'Invalid parameter setup (json_decode failed): ' . $this->_request->setup\n            );\n        }\n\n        // overwrite the hard limit with the given one\n        if (isset($this->_setup->state->limit)) {\n            $this->_limit = $this->_setup->state->limit;\n        }\n\n        // build initial view\n        $this->view->entries = $this->_queryNavigationEntries($this->_setup);\n\n        // trigger before output event\n        $this->startOutput($this->_setup);\n\n        // set view variable for the show more button\n        if ((count($this->view->entries) > $this->_limit) && $this->_setup->state->lastEvent != \"search\") {\n            // return only $_limit entries\n            $this->view->entries    = array_slice($this->view->entries, 0, $this->_limit);\n            $this->view->showMeMore = true;\n        } else {\n            $this->view->showMeMore = false;\n        }\n\n        // if there's no entries, show text\n        if (empty($this->view->entries)) {\n            if (isset($this->_setup->state->searchString)) {\n                $this->_messages[] = array('type' => 'info', 'text' => 'No result for this search.');\n            } else {\n                $this->_messages[] = array('type' => 'info', 'text' => 'Nothing to navigate here.');\n            }\n        }\n\n        // the root entry (parent of the shown elements)\n        if (isset($this->_setup->state->parent)) {\n            $this->view->rootEntry          = array();\n            $this->view->rootEntry['uri']   = $this->_setup->state->parent;\n            $this->view->rootEntry['url']   = $this->_getListLink($this->_setup->state->parent, $this->_setup);\n            $this->view->rootEntry['title'] = $this->_getTitle(\n                $this->_setup->state->parent,\n                isset($this->_setup->config->titleMode) ? $this->_setup->config->titleMode : null,\n                null\n            );\n        }\n\n        // if search string is set, show it in view\n        if (isset($this->_setup->state->searchString)) {\n            $this->view->searchString = $this->_setup->state->searchString;\n        }\n\n        // if rootName is set, show it in view\n        if (isset($this->_setup->config->rootName)) {\n            $this->view->rootName = $this->_setup->config->rootName;\n        }\n\n        // if rootURI is set, apply it to rootName in view\n        if (isset($this->_setup->config->rootURI)) {\n            $this->view->rootLink = $this->_getListLink(\n                $this->_setup->config->rootURI,\n                $this->_setup\n            );\n        }\n\n        // set view messages and setup\n        $this->view->messages = $this->_messages;\n        $this->view->setup    = $this->_setup;\n\n        // trigger after end output\n        $this->endOutput($this->_setup);\n\n        // save state to session\n        $this->savestateServer($this->view, $this->_setup);\n    }\n\n    private function startOutput($config)\n    {\n        $event         = new Erfurt_Event('onNavigationStartOutput');\n        $event->config = $config;\n        $event->trigger();\n    }\n\n    private function endOutput($config)\n    {\n        $event         = new Erfurt_Event('onNavigationEndOutput');\n        $event->config = $config;\n        $event->trigger();\n    }\n\n    /*\n     * Saves current view, setup and model to state to use it on refresh\n     */\n    protected function savestateServer($view, $setup)\n    {\n        // encode setup to json\n        $setup = json_encode($setup);\n        // replace \\' and \\\" to ' and \"\n        $replaceFrom = array(\"\\\\'\", '\\\\\"');\n        $replaceTo   = array(\"'\", '\"');\n        $setup       = str_replace($replaceFrom, $replaceTo, $setup);\n\n        // save view, setup and current model to state\n        $this->stateSession->view  = $view->render(\"navigation/explore.phtml\");\n        $this->stateSession->setup = $setup;\n        $this->stateSession->model = (string)$this->_model;\n    }\n\n    /*\n     * Queries all navigation entries according to a given setup\n     */\n    protected function _queryNavigationEntries($setup)\n    {\n        if (isset($setup->config->cache)\n            && $setup->config->cache == true\n        ) {\n            $cache      = $this->_owApp->erfurt->getCache(); // Object cache\n            $queryCache = $this->_owApp->erfurt->getQueryCache(); // query cache\n        }\n\n        // set cache id\n        $cid = 'nav_' . md5(serialize($setup) . $this->_model);\n\n        $this->_owApp->logger->info(\n            'NavigationController _queryNavigationEntries Input: ' . PHP_EOL . print_r($setup, true)\n        );\n        //*/\n\n        // try to load results from cache\n        if (isset($setup->config->cache)\n            && $setup->config->cache == true\n        ) {\n            if ($entriesCached = $cache->load($cid)) {\n                return $entriesCached;\n            }\n\n            // start transaction\n            $queryCache->startTransaction($cid);\n        }\n\n        // if user searched for something\n        if ($setup->state->lastEvent == \"search\") {\n            // search request\n            // @todo: also search request should not show ignored entities\n            $resVar  = new Erfurt_Sparql_Query2_Var('resourceUri');\n            $typeVar = new Erfurt_Sparql_Query2_IriRef(EF_RDF_TYPE);\n            $query   = new Erfurt_Sparql_Query2();\n            $query->addProjectionVar($resVar)->setDistinct(true);\n\n            $pattern = $this->_store->getSearchPattern(\n                $setup->state->searchString,\n                (string)$this->_model\n            );\n            $query->addElements($pattern);\n\n            $union = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n\n            foreach ($setup->config->hierarchyTypes as $type) {\n                $groupPattern = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                $groupPattern->addTriple(\n                    $resVar,\n                    $typeVar,\n                    new Erfurt_Sparql_Query2_IriRef($type)\n                );\n                $union->addElement($groupPattern);\n            }\n            $query->addElement($union);\n\n            // set to _limit+1, so we can see if there are more than $_limit entries\n            $query->setLimit($this->_limit + 1);\n\n        } else {\n            // if there's no top query assigned and hideDefaultHierarchy is false\n            // generate query based on setup\n            if ((!isset($setup->config->hideDefaultHierarchy)\n                || ($setup->config->hideDefaultHierarchy == false))\n                && !isset($setup->config->query->top)\n            ) {\n                $query = $this->_buildQuery($setup, false);\n            } elseif (isset($setup->config->query->top)) {\n                // if top query is assigned - use it\n                $query = Erfurt_Sparql_SimpleQuery::initWithString($setup->config->query->top);\n            } else {\n                $query = null;\n            }\n        }\n\n        // if there's something wrong with query generation - exit\n        if ($query == null) {\n            return;\n        }\n\n        // error logging\n        $this->_owApp->logger->info(\n            'NavigationController _queryNavigationEntries Query: ' . $query->__toString()\n        );\n        //*/\n        //\n\n        // get extended results\n        $allResults = $this->_model->sparqlQuery(\n            $query,\n            array('result_format' => 'extended')\n        );\n\n        // create res array\n        $results = array();\n\n        // parse to needed format\n        foreach ($allResults['results']['bindings'] as $res) {\n            if ($res['resourceUri']['type'] != 'bnode') {\n                $results[]['resourceUri'] = $res['resourceUri']['value'];\n            } else {\n                $results[]['resourceUri'] = $this->_getSubclass(\n                    str_replace(\"_:\", \"\", $res['resourceUri']['value']),\n                    $setup\n                );\n            }\n        }\n\n        // if we need to show implicit elements\n        $showImplicit = false;\n        if (!isset($setup->config->rootElement)) {\n            if (!isset($setup->state->showImplicit)) {\n                if (isset($setup->config->showImplicitElements)\n                    && $setup->config->showImplicitElements == true\n                ) {\n                    $showImplicit = true;\n                }\n            } else {\n                if ($setup->state->showImplicit == true) {\n                    $showImplicit = true;\n                }\n            }\n        }\n\n        // if we need to show implicit elements\n        // generate additional query for them\n        if ($showImplicit) {\n            // new query for regular event\n            if ($setup->state->lastEvent != \"search\") {\n                $query           = $this->_buildQuery($setup, true);\n                $resultsImplicit = $this->_model->sparqlQuery(\n                    $query,\n                    array('result_format' => 'extended')\n                );\n            } else {\n                // new query for search\n                $query           = $this->_buildStringSearchQuery($setup);\n                $resultsImplicit = $this->_model->sparqlQuery(\n                    $query,\n                    array('result_format' => 'extended')\n                );\n            }\n\n            // append implicit classes to results\n            foreach ($resultsImplicit['results']['bindings'] as $res) {\n                if (!in_array($res['resourceUri']['value'], $results)) {\n                    if ($res['resourceUri']['type'] != 'bnode') {\n                        $results[]['resourceUri'] = $res['resourceUri']['value'];\n                    } else {\n                        $results[]['resourceUri'] = $this->_getSubclass(\n                            str_replace(\n                                \"_:\",\n                                \"\",\n                                $res['resourceUri']['value']\n                            ),\n                            $setup\n                        );\n                    }\n                }\n            }\n        }\n\n        // log results\n        $this->_owApp->logger->info(\n            'NavigationController _queryNavigationEntries Result: ' . PHP_EOL . print_r($allResults, true)\n        );\n        //*/\n\n        // set titleMode from config or set it to null if config is not assigned\n        if (isset($setup->config->titleMode)) {\n            $mode = $setup->config->titleMode;\n        } else {\n            $mode = null;\n        }\n\n        // if title mode set to titlehelper\n        // get titles of all resources\n        if ($mode == \"titleHelper\") {\n            if (isset($results)) {\n                foreach ($results as $result) {\n                    $this->titleHelper->addResource($result['resourceUri']);\n                }\n            }\n            // add parent to titleHelper to get title\n            if (isset($setup->state->parent)) {\n                $this->titleHelper->addResource($setup->state->parent);\n            }\n        }\n\n        // create new array for navigation entries\n        $entries = array();\n\n        // if there's no query results - exit\n        if ($results == null) {\n            return;\n        }\n\n        // parse all results to entries\n        foreach ($results as $result) {\n            $entry = array();\n\n            // assing resource URI\n            $uri            = $result['resourceUri'];\n            $entry          = array();\n            $entry['title'] = $this->_getTitle($uri, $mode, $setup);\n            // get resource ling\n            $entry['link'] = $this->_getListLink($uri, $setup);\n\n            // chech if there's need to look for subresources\n            $checkSubs = false;\n            if (isset($setup->config->checkSub)\n                && $setup->config->checkSub == true\n            ) {\n                $checkSubs = true;\n            }\n\n            // if needed look for subresources\n            if ($checkSubs) {\n                // build sub query\n                $query = $this->_buildSubCheckQuery($uri, $setup);\n                // get results\n                $results = $this->_model->sparqlQuery($query);\n                // assigh count of results\n                $entry['sub'] = count($results);\n            } else {\n                // if there's no need to look for subres\n                // just set var to 1, so that \"go deeper\" arrow\n                // will be allways visible\n                $entry['sub'] = 1;\n            }\n\n            // check if filtering empty is enabled\n            $filterEmpty = false;\n            if (!isset($setup->state->showEmpty)) {\n                if (isset($setup->config->showEmptyElements)\n                    && $setup->config->showEmptyElements == false\n                ) {\n                    $filterEmpty = true;\n                }\n            } else {\n                if ($setup->state->showEmpty == false) {\n                    $filterEmpty = true;\n                }\n            }\n\n            // do filter empty if needed\n            $show = true;\n            if ($filterEmpty) {\n                // generate query\n                $query = $this->_buildCountQuery($uri, $setup);\n                // get results\n                $results = $this->_model->sparqlQuery($query);\n                // depending on result format set count\n                if (isset($results[0]['callret-0'])) {\n                    $count = $results[0]['callret-0'];\n                } else {\n                    $count = count($results);\n                }\n                // if count is 0 do not show entry\n                if ($count == 0) {\n                    $show = false;\n                }\n            }\n\n            if (isset($setup->config->checkUsage)\n                && $setup->config->checkUsage == true\n            ) {\n                // gen query\n                $query = $this->_buildUsageQuery($uri, $setup);\n                // get results\n                $results = $this->_model->sparqlQuery($query);\n                // depending on result format set count\n                if (isset($results[0]['callret-0'])) {\n                    $count = $results[0]['callret-0'];\n                } else {\n                    $count = count($results);\n                }\n                // if count is 0 do not show entry\n                if ($count == 0) {\n                    $show = false;\n                }\n            }\n            // apply $show flag\n            if ($show) {\n                $entries[$uri] = $entry;\n            }\n        }\n\n        $this->_owApp->logger->info('ENTRIES: ' . print_r($entries, true));\n\n        if (isset($setup->config->cache) && $setup->config->cache == true) {\n            // save results to cache\n            $cache->save($entries, $cid);\n            // end cache transaction\n            $queryCache->endTransaction($cid);\n        }\n\n        return $entries;\n    }\n\n    protected function _getSubclass($node, $setup)\n    {\n        $subVar    = new Erfurt_Sparql_Query2_Var('subResourceUri');\n        $searchVar = new Erfurt_Sparql_Query2_BlankNode($node);\n        $query     = new Erfurt_Sparql_Query2();\n        $query->addProjectionVar($subVar);\n        $query->setDistinct();\n\n        $elements = array();\n\n        if (isset($setup->config->hierarchyRelations->in)) {\n            if (count($setup->config->hierarchyRelations->in) > 1) {\n                // init union var\n                $unionSub = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n                // parse config gile\n                foreach ($setup->config->hierarchyRelations->in as $rel) {\n                    // sub stuff\n                    $groupPattern = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                    // add triplen\n                    $groupPattern->addTriple(\n                        $subVar,\n                        new Erfurt_Sparql_Query2_IriRef($rel),\n                        $searchVar\n                    );\n                    // add triplet to union var\n                    $unionSub->addElement($groupPattern);\n                }\n                $elements[] = $unionSub;\n            } else {\n                $rel = $setup->config->hierarchyRelations->in;\n                // add optional sub relation\n                $elements[] = new Erfurt_Sparql_Query2_Triple(\n                    $subVar,\n                    new Erfurt_Sparql_Query2_IriRef($rel[0]),\n                    $searchVar\n                );\n            }\n        }\n\n        if (isset($setup->config->hierarchyRelations->out)) {\n            if (count($setup->config->hierarchyRelations->out) > 1) {\n                // init union var\n                $unionSub = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                // parse config gile\n                foreach ($setup->config->hierarchyRelations->out as $rel) {\n                    // sub stuff\n                    $optionalPattern = new Erfurt_Sparql_Query2_OptionalGraphPattern();\n                    // add triplen\n                    $optionalPattern->addTriple(\n                        $searchVar,\n                        new Erfurt_Sparql_Query2_IriRef($rel),\n                        $subVar\n                    );\n                    // add triplet to union var\n                    $unionSub->addElement($optionalPattern);\n                }\n                $elements[] = $unionSub;\n            } else {\n                $rel = $setup->config->hierarchyRelations->out;\n                // add optional sub relation\n                $elements[] = new Erfurt_Sparql_Query2_Triple(\n                    $searchVar,\n                    new Erfurt_Sparql_Query2_IriRef($rel[0]),\n                    $subVar\n                );\n            }\n        }\n        $query->addElements($elements);\n\n        $result = $this->_model->sparqlQuery($query);\n\n        return $result[0]['subResourceUri'];\n    }\n\n    protected function _getTitle($uri, $mode, $setup)\n    {\n        $name = '';\n        // set default mode if none is set\n        if (!isset($mode) || $mode == null) {\n            $mode = \"baseName\";\n        }\n\n        // get title\n        if ($mode == \"titleHelper\") {\n            $name = $this->titleHelper->getTitle($uri, OntoWiki::getInstance()->language);\n        } elseif ($mode == \"baseName\") {\n            if (strrpos($uri, '#') > 0) {\n                $name = substr($uri, strrpos($uri, '#') + 1);\n            } elseif (strrpos($uri, '/') > 0) {\n                $name = substr($uri, strrpos($uri, '/') + 1);\n            } else {\n                $name = $uri;\n            }\n        } else {\n            $name = 'error';\n        }\n\n        // count entries\n        if (isset($setup->config->showCounts)\n            && $setup->config->showCounts == true\n        ) {\n            $query   = $this->_buildCountQuery($uri, $setup);\n            $results = $this->_model->sparqlQuery($query);\n            if (isset($results[0]['callret-0'])) {\n                $count = $results[0]['callret-0'];\n            } else {\n                $count = count($results);\n            }\n\n            if ($count > 0) {\n                $name .= ' (' . $count . ')';\n            }\n        }\n\n        return $name;\n    }\n\n    /*\n     * Builds query for main actions (root, nav. deeper)\n     */\n    protected function _buildQuery($setup, $forImplicit = false)\n    {\n        if (isset($setup->config->query->deeper)\n            && isset($setup->state->parent)\n        ) {\n            //$replace = ;\n            $queryString = str_replace(\n                \"%resource%\",\n                $setup->state->parent,\n                $setup->config->query->deeper\n            );\n            $query       = Erfurt_Sparql_SimpleQuery::initWithString($queryString);\n        } else {\n            $query = new Erfurt_Sparql_Query2();\n            $query->addElements(\n                NavigationHelper::getSearchTriples(\n                    $setup,\n                    $forImplicit,\n                    $this->_config->store->backend\n                )\n            );\n            $query->setDistinct(true);\n            $query->addProjectionVar(new Erfurt_Sparql_Query2_Var('resourceUri'));\n        }\n        // sorting\n        if (isset($setup->state->sorting)) {\n            $query->getOrder()->add(new Erfurt_Sparql_Query2_Var('sortRes'), \"ASC\");\n        } elseif (isset($setup->config->ordering->relation)) { // set ordering\n            $orderVar = new Erfurt_Sparql_Query2_Var('order');\n            $query->getWhere()->addElement(\n                new Erfurt_Sparql_Query2_OptionalGraphPattern(\n                    array(\n                         new Erfurt_Sparql_Query2_Triple(\n                             new Erfurt_Sparql_Query2_Var('resourceUri'),\n                             new Erfurt_Sparql_Query2_IriRef($setup->config->ordering->relation),\n                             $orderVar\n                         )\n                    )\n                )\n            );\n            $query->getOrder()->add(\n                $orderVar,\n                $setup->config->ordering->modifier\n            );\n        }\n\n        // set offset\n        if (isset($setup->state->offset) && $setup->state->lastEvent == 'more') {\n            $query->setOffset($setup->state->offset);\n            $query->setLimit($this->_limit + 1);\n        } else {\n            $query->setLimit($this->_limit + 1);\n        }\n\n        return $query;\n    }\n\n    /*\n     * Builds search query string\n     */\n    protected function _buildStringSearchQuery($setup)\n    {\n        // define vars\n        $searchVar = new Erfurt_Sparql_Query2_Var('resourceUri');\n        $subVar    = new Erfurt_Sparql_Query2_Var('sub');\n\n        // define query\n        $query = new Erfurt_Sparql_Query2();\n        $query->addProjectionVar($searchVar);\n        $query->setDistinct();\n\n        // init union var\n        $union = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n        // parse config\n        if (isset($setup->config->hierarchyRelations->out)) {\n            foreach ($setup->config->hierarchyRelations->out as $rel) {\n                // create new graph pattern\n                $groupPattern = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                // add triplen\n                $groupPattern->addTriple(\n                    $searchVar,\n                    new Erfurt_Sparql_Query2_IriRef($rel),\n                    $subVar\n                );\n                // add triplet to union var\n                $union->addElement($groupPattern);\n            }\n        }\n        // parse config\n        if (isset($setup->config->hierarchyRelations->in)) {\n            foreach ($setup->config->hierarchyRelations->in as $rel) {\n                // create new graph pattern\n                $groupPattern = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                // add triplen\n                $groupPattern->addTriple(\n                    $subVar,\n                    new Erfurt_Sparql_Query2_IriRef($rel),\n                    $searchVar\n                );\n                // add triplet to union var\n                $union->addElement($groupPattern);\n            }\n        }\n        // parse config\n        if (isset($setup->config->instanceRelation->out)) {\n            foreach ($setup->config->instanceRelation->out as $rel) {\n                // create new graph pattern\n                $groupPattern = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                // add triplen\n                $groupPattern->addTriple(\n                    $subVar,\n                    new Erfurt_Sparql_Query2_IriRef($rel),\n                    $searchVar\n                );\n                // add triplet to union var\n                $union->addElement($groupPattern);\n            }\n        }\n\n        // parse config\n        if (isset($setup->config->instanceRelation->in)) {\n            foreach ($setup->config->instanceRelation->in as $rel) {\n                // create new graph pattern\n                $groupPattern = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                // add triplen\n                $groupPattern->addTriple(\n                    $searchVar,\n                    new Erfurt_Sparql_Query2_IriRef($rel),\n                    $subVar\n                );\n                // add triplet to union var\n                $union->addElement($groupPattern);\n            }\n        }\n\n        $query->addElement($union);\n        // add regex filter for search string\n        $query->addFilter(\n            new Erfurt_Sparql_Query2_Regex(\n                new Erfurt_Sparql_Query2_Str($searchVar),\n                new Erfurt_Sparql_Query2_RDFLiteral($setup->state->searchString)\n            )\n        );\n\n        return $query;\n    }\n\n    /*\n     * Builds counting query for given $uri\n     */\n    protected function _buildCountQuery($uri, $setup)\n    {\n        $query = new Erfurt_Sparql_Query2();\n        $query->addProjectionVar(new Erfurt_Sparql_Query2_Var('resourceUri'));\n        $query->setCountStar(true);\n        $query->setDistinct();\n        $query->addElements(NavigationHelper::getInstancesTriples($uri, $setup));\n\n        // error logging\n        $this->_owApp->logger->info(\n            'NavigationController: COUNTQUERY: ' . $query->__toString()\n        );\n\n        //*/\n\n        return $query;\n    }\n\n    /*\n     * Builds usage query for given $uri\n     */\n    protected function _buildUsageQuery($uri, $setup)\n    {\n        $query = new Erfurt_Sparql_Query2();\n        $query->addProjectionVar(new Erfurt_Sparql_Query2_Var('resourceUri'));\n        $query->setCountStar(true);\n        $query->setDistinct();\n\n        return $query;\n    }\n\n    /*\n     * Builds query to check for subresources for $uri based on $setup\n     */\n    protected function _buildSubCheckQuery($uri, $setup)\n    {\n        $subVar    = new Erfurt_Sparql_Query2_Var('subResourceUri');\n        $searchVar = new Erfurt_Sparql_Query2_Var('resourceUri');\n        $query = new Erfurt_Sparql_Query2();\n        $query->addProjectionVar($subVar);\n        $query->setDistinct();\n\n        $this->_owApp->logger->info(\"data: \" . print_r($query, true));\n        $elements = array();\n        $in       = array();\n        $out      = array();\n\n        if (isset($setup->config->hierarchyRelations->in)) {\n            if (count($setup->config->hierarchyRelations->in) > 1) {\n                // init union var\n                $unionSub = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n                // parse config gile\n                foreach ($setup->config->hierarchyRelations->in as $rel) {\n                    // sub stuff\n                    $groupPattern = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                    // add triplen\n                    $groupPattern->addTriple(\n                        $subVar,\n                        new Erfurt_Sparql_Query2_IriRef($rel),\n                        $searchVar\n                    );\n                    // add triplet to union var\n                    $unionSub->addElement($groupPattern);\n                }\n                $in[] = $unionSub;\n            } else {\n                $rel = $setup->config->hierarchyRelations->in;\n                // add optional sub relation\n                // create optional graph to load sublacsses of selected class\n                $queryOptional = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                $queryOptional->addTriple(\n                    $subVar,\n                    new Erfurt_Sparql_Query2_IriRef($rel[0]),\n                    $searchVar\n                );\n                $in[] = $queryOptional;\n            }\n        }\n        if (isset($setup->config->hierarchyRelations->out)) {\n            if (count($setup->config->hierarchyRelations->out) > 1) {\n                // init union var\n                $unionSub = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                // parse config gile\n                foreach ($setup->config->hierarchyRelations->out as $rel) {\n                    // sub stuff\n                    $optPattern = new Erfurt_Sparql_Query2_OptionalGraphPattern();\n                    // add triple\n                    $optPattern->addTriple(\n                        $searchVar,\n                        new Erfurt_Sparql_Query2_IriRef($rel),\n                        $subVar\n                    );\n                    // add triplet to union var\n                    $unionSub->addElement($optPattern);\n                }\n                $out[] = $unionSub;\n            } else {\n                $rel = $setup->config->hierarchyRelations->out;\n                // add optional sub relation\n                // create optional graph to load sublacsses of selected class\n                $queryOptional = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                $queryOptional->addTriple(\n                    $searchVar,\n                    new Erfurt_Sparql_Query2_IriRef($rel[0]),\n                    $subVar\n                );\n                $out[] = $queryOptional;\n            }\n        }\n        $inout = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n        $inout->addElements($in);\n        $inout->addElements($out);\n        $elements[] = $inout;\n        // add filter\n        if ($this->_store->isInSyntaxSupported()) { // e.g. Virtuoso\n            $elements[] = new Erfurt_Sparql_Query2_Filter(\n                new Erfurt_Sparql_Query2_InExpression($searchVar, array(new Erfurt_Sparql_Query2_IriRef($uri)))\n            );\n        } else { // sameTerm || sameTerm ... as supported by EfZendDb adapter\n            // add filter\n            $elements[] = new Erfurt_Sparql_Query2_Filter(\n                new Erfurt_Sparql_Query2_Equals($searchVar, new Erfurt_Sparql_Query2_IriRef($uri))\n            );\n        }\n        // build\n        $query->addElements($elements);\n        $query->setLimit(1);\n\n        // log results\n        $this->_owApp->logger->info(\n            'NavigationController CHECK SUB: ' . PHP_EOL . $query->__toString()\n        );\n\n        return $query;\n    }\n\n    /*\n     * This method returns the link to the resource list action\n     * according to a given URI in the navigation module and a\n     * given navigation setup\n     */\n    protected function _getListLink($uri, $setup)\n    {\n        if (isset($setup->config->directLink) && $setup->config->directLink) {\n            $return = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n            // set URL\n            $return->setParam('r', $uri, true);\n            return $return;\n        }\n\n        $owUrl  = new OntoWiki_Url(\n            array('route' => 'instances'),\n            array()\n        );\n        $return = (string)$owUrl;\n\n        // at the moment, we use r= here, not class=\n        $return .= \"?init\";\n        $conf = array();\n        // there is a shortcut for rdfs classes\n        if (isset($setup->config->list->config)) {\n            $configString = str_replace(\"|\", '\"', $setup->config->list->config);\n            $configString = str_replace(\"%resource%\", $uri, $configString);\n            $conf         = json_decode($configString);\n        } else {\n            if (isset($setup->config->list->query)) {\n                // show properties\n                if (isset($setup->config->list->shownProperties)) {\n                    $configString              = str_replace(\"|\", '\"', $setup->config->list->shownProperties);\n                    $configString              = str_replace(\"%resource%\", $uri, $configString);\n                    $conf['shownProperties'][] = json_decode($configString);\n                }\n\n                // query\n                $configQuery = str_replace(\"%resource%\", $uri, $setup->config->list->query);\n                $configQuery = str_replace(\"\\n\", \" \", $configQuery);\n\n                $conf['filter'][] = array(\n                    'mode'  => 'query',\n                    'query' => $configQuery\n                );\n            } else {\n                if (isset($setup->config->instanceRelation->out)\n                    && isset($setup->config->instanceRelation->in)\n                    && ($setup->config->instanceRelation->out[0] == EF_RDF_TYPE)\n                    && ($setup->config->hierarchyRelations->in[0] == EF_RDFS_SUBCLASSOF)\n                ) {\n                    $conf['filter'][] = array(\n                        'mode'      => 'rdfsclass',\n                        'rdfsclass' => $uri,\n                        'action'    => 'add'\n                    );\n                } else {\n                    $conf['filter'][] = array(\n                        'mode'   => 'cnav',\n                        'cnav'   => $setup,\n                        'uri'    => $uri,\n                        'action' => 'add'\n                    );\n                }\n            }\n        }\n\n        return $return . \"&instancesconfig=\" . urlencode(json_encode($conf));\n    }\n}\n"
  },
  {
    "path": "extensions/navigation/NavigationHelper.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Nav helper. builds a query for the nav controller and for the resource controller\n *\n * @category   OntoWiki\n * @package    Extensions_Navigation\n */\nclass NavigationHelper extends OntoWiki_Component_Helper\n{\n    /*\n     * Returns Triples for list generation query\n     */\n    public static function getInstancesTriples($uri, $setup)\n    {\n        $searchVar = new Erfurt_Sparql_Query2_Var('resourceUri');\n        $classVar  = new Erfurt_Sparql_Query2_Var('classUri');\n        $elements  = array();\n\n        // init union var\n        $union = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n\n        // parse config\n        if (isset($setup->config->hierarchyRelations->out)) {\n            foreach ($setup->config->hierarchyRelations->out as $rel) {\n                // create new graph pattern\n                $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                // add triplen\n                $ggp->addTriple(\n                    $classVar,\n                    new Erfurt_Sparql_Query2_IriRef($rel),\n                    $searchVar\n                );\n                // add triplet to union var\n                $union->addElement($ggp);\n            }\n        }\n\n        // parse config\n        if (isset($setup->config->hierarchyRelations->in)) {\n            foreach ($setup->config->hierarchyRelations->in as $rel) {\n                // create new graph pattern\n                $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                // add triplen\n                $ggp->addTriple(\n                    $searchVar,\n                    new Erfurt_Sparql_Query2_IriRef($rel),\n                    $classVar\n                );\n                // add triplet to union var\n                $union->addElement($ggp);\n            }\n        }\n\n        // parse config\n        if (isset($setup->config->instanceRelation->in)) {\n            foreach ($setup->config->instanceRelation->in as $rel) {\n                // create new graph pattern\n                $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                // add triplen\n                $ggp->addTriple(\n                    $classVar,\n                    new Erfurt_Sparql_Query2_IriRef($rel),\n                    $searchVar\n                );\n                // add triplet to union var\n                $union->addElement($ggp);\n            }\n        }\n\n        // parse config\n        if (isset($setup->config->instanceRelation->out)) {\n            foreach ($setup->config->instanceRelation->out as $rel) {\n                // create new graph pattern\n                $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                // add triplen\n                $ggp->addTriple(\n                    $searchVar,\n                    new Erfurt_Sparql_Query2_IriRef($rel),\n                    $classVar\n                );\n                // add triplet to union var\n                $union->addElement($ggp);\n            }\n        }\n        $elements[] = $union;\n\n        $owApp    = OntoWiki::getInstance();\n        $modelIRI = (string)$owApp->selectedModel;\n        $store    = $owApp->erfurt->getStore();\n\n        // get all subclass of the super class\n        $classes = array();\n        if (isset($setup->config->hierarchyRelations->out)) {\n            foreach ($setup->config->hierarchyRelations->out as $rel) {\n                $classes += $store->getTransitiveClosure($modelIRI, $rel, $uri, false);\n            }\n        }\n        if (isset($setup->config->hierarchyRelations->in)) {\n            foreach ($setup->config->hierarchyRelations->in as $rel) {\n                $classes += $store->getTransitiveClosure($modelIRI, $rel, $uri, true);\n            }\n        }\n\n        // create filter for types\n        $filterType = array();\n        $filterUris = array();\n        $counted    = array();\n        foreach ($classes as $class) {\n            // get uri\n            $uri = ($class['parent'] != '') ? $class['parent'] : $class['node'];\n\n            // if this class is already counted - continue\n            if (in_array($uri, $counted)) {\n                if ($class['node'] != '') {\n                    $uri = $class['node'];\n                    if (in_array($uri, $counted)) {\n                        continue;\n                    }\n                } else {\n                    continue;\n                }\n            }\n\n            $uriElem      = new Erfurt_Sparql_Query2_IriRef($uri);\n            $filterUris[] = $uriElem;\n            $filterType[] = new Erfurt_Sparql_Query2_Equals($classVar, $uriElem);\n\n            // add uri to counted\n            $counted[] = $uri;\n        }\n\n        if ($store->isInSyntaxSupported()) { // e.g. Virtuoso\n            $elements[] = new Erfurt_Sparql_Query2_Filter(\n                new Erfurt_Sparql_Query2_InExpression($classVar, $filterUris)\n            );\n        } else { // sameTerm || sameTerm ... as supported by EfZendDb adapter\n            // add filter\n            $elements[] = new Erfurt_Sparql_Query2_Filter(\n                new Erfurt_Sparql_Query2_ConditionalOrExpression($filterType)\n            );\n        }\n\n        return $elements;\n    }\n\n    public static function getSearchTriples($setup, $forImplicit = false, $backend = 'zenddb')\n    {\n        $searchVar = new Erfurt_Sparql_Query2_Var('resourceUri');\n        $classVar  = new Erfurt_Sparql_Query2_Var('classUri');\n        $subVar    = new Erfurt_Sparql_Query2_Var('subResourceUri');\n        $elements  = array();\n\n        // if deeper query\n        if (isset($setup->state->parent)) {\n            $mainUnion = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n\n            // in relations\n            if (isset($setup->config->hierarchyRelations->in)) {\n                // default stuff\n                if (count($setup->config->hierarchyRelations->in) > 1) {\n                    // parse config gile\n                    foreach ($setup->config->hierarchyRelations->in as $rel) {\n                        // set type\n                        $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                        // add triplen\n                        $ggp->addTriple(\n                            $searchVar,\n                            new Erfurt_Sparql_Query2_IriRef($rel),\n                            new Erfurt_Sparql_Query2_IriRef($setup->state->parent)\n                        );\n                        // add triplet to union var\n                        $mainUnion->addElement($ggp);\n                    }\n                } else {\n                    $rel           = $setup->config->hierarchyRelations->in;\n                    $queryOptional = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                    $queryOptional->addTriple(\n                        $searchVar,\n                        new Erfurt_Sparql_Query2_IriRef($rel[0]),\n                        new Erfurt_Sparql_Query2_IriRef($setup->state->parent)\n                    );\n                    $mainUnion->addElement($queryOptional);\n                }\n            }\n\n            // out relations\n            if (isset($setup->config->hierarchyRelations->out)) {\n                // if there's out relations\n                if (count($setup->config->hierarchyRelations->out) > 1) {\n                    // parse config gile\n                    foreach ($setup->config->hierarchyRelations->out as $rel) {\n                        // set type\n                        $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                        // add triplen\n                        $ggp->addTriple(\n                            new Erfurt_Sparql_Query2_IriRef($setup->state->parent),\n                            new Erfurt_Sparql_Query2_IriRef($rel),\n                            $searchVar\n                        );\n                        // add triplet to union var\n                        $mainUnion->addElement($ggp);\n                    }\n                } else {\n                    // get one relation\n                    $rel           = $setup->config->hierarchyRelations->out;\n                    $queryOptional = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                    $queryOptional->addTriple(\n                        new Erfurt_Sparql_Query2_IriRef($setup->state->parent),\n                        new Erfurt_Sparql_Query2_IriRef($rel[0]),\n                        $searchVar\n                    );\n                    $mainUnion->addElement($queryOptional);\n                }\n            }\n\n            $elements[] = $mainUnion;\n\n        } else { // if default request\n            if (!$forImplicit) {\n\n                $elements[] = new Erfurt_Sparql_Query2_Triple(\n                    $searchVar,\n                    new Erfurt_Sparql_Query2_IriRef(EF_RDF_TYPE),\n                    $classVar\n                );\n\n                // request sub elements\n                // in relations\n                $optional = new Erfurt_Sparql_Query2_OptionalGraphPattern();\n                $unionSub = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n                if (isset($setup->config->hierarchyRelations->in)) {\n                    if (count($setup->config->hierarchyRelations->in) > 1) {\n                        // parse config gile\n                        foreach ($setup->config->hierarchyRelations->in as $rel) {\n                            // sub stuff\n                            $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                            // add triplen\n                            $ggp->addTriple(\n                                $subVar,\n                                new Erfurt_Sparql_Query2_IriRef($rel),\n                                $searchVar\n                            );\n                            // add triplet to union var\n                            $unionSub->addElement($ggp);\n                        }\n                    } else {\n                        $rel = $setup->config->hierarchyRelations->in;\n                        // add optional sub relation\n                        // create optional graph to load sublacsses of selected class\n                        $optional->addTriple(\n                            $subVar,\n                            new Erfurt_Sparql_Query2_IriRef($rel[0]),\n                            $searchVar\n                        );\n                    }\n                }\n                if (isset($setup->config->hierarchyRelations->out)) {\n                    // init union var\n                    if (count($setup->config->hierarchyRelations->out) > 1) {\n                        // parse config gile\n                        foreach ($setup->config->hierarchyRelations->out as $rel) {\n                            // sub stuff\n                            $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                            // add triplen\n                            $ggp->addTriple(\n                                $searchVar,\n                                new Erfurt_Sparql_Query2_IriRef($rel),\n                                $subVar\n                            );\n                            // add triplet to union var\n                            $unionSub->addElement($ggp);\n                        }\n                    } else {\n                        $rel = $setup->config->hierarchyRelations->out;\n                        // add optional sub relation\n                        // create optional graph to load sublacsses of selected class\n                        $optional->addTriple(\n                            $searchVar,\n                            new Erfurt_Sparql_Query2_IriRef($rel[0]),\n                            $subVar\n                        );\n                    }\n                }\n                if ($unionSub->size() > 0) {\n                    $optional->addElement($unionSub);\n                }\n                $elements[] = $optional;\n\n                // create filter for types\n                $filterType = array();\n                $filterUris = array();\n                foreach ($setup->config->hierarchyTypes as $type) {\n                    $uriElem      = new Erfurt_Sparql_Query2_IriRef($type);\n                    $filterUris[] = $uriElem;\n                    $filterType[] = new Erfurt_Sparql_Query2_Equals($classVar, $uriElem);\n                }\n\n                $owApp = OntoWiki::getInstance();\n                $store = $owApp->erfurt->getStore();\n                if ($store->isInSyntaxSupported()) { // e.g. Virtuoso\n                    $elements[] = new Erfurt_Sparql_Query2_Filter(\n                        new Erfurt_Sparql_Query2_InExpression($classVar, $filterUris)\n                    );\n                } else { // sameTerm || sameTerm ... as supported by EfZendDb adapter\n                    // add filter\n                    $elements[] = new Erfurt_Sparql_Query2_Filter(\n                        new Erfurt_Sparql_Query2_ConditionalOrExpression($filterType)\n                    );\n                }\n            } else {\n                // define subvar\n                $subVar = new Erfurt_Sparql_Query2_Var('sub');\n                // init union var\n                $union = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n                // parse config\n                if (isset($setup->config->hierarchyRelations->out)) {\n                    if (is_string($setup->config->hierarchyRelations->out)) {\n                        $setup->config->hierarchyRelations->out = array($setup->config->hierarchyRelations->out);\n                    }\n                    foreach ($setup->config->hierarchyRelations->out as $rel) {\n                        // create new graph pattern\n                        $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                        // add triplen\n                        $ggp->addTriple(\n                            $searchVar,\n                            new Erfurt_Sparql_Query2_IriRef($rel),\n                            $subVar\n                        );\n                        // add triplet to union var\n                        $union->addElement($ggp);\n                    }\n                }\n                // parse config\n                if (isset($setup->config->hierarchyRelations->in)) {\n                    if (is_string($setup->config->hierarchyRelations->in)) {\n                        $setup->config->hierarchyRelations->in = array($setup->config->hierarchyRelations->in);\n                    }\n                    foreach ($setup->config->hierarchyRelations->in as $rel) {\n                        // create new graph pattern\n                        $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                        // add triplen\n                        $ggp->addTriple(\n                            $subVar,\n                            new Erfurt_Sparql_Query2_IriRef($rel),\n                            $searchVar\n                        );\n                        // add triplet to union var\n                        $union->addElement($ggp);\n                    }\n                }\n                // parse config\n                if (isset($setup->config->instanceRelation->out)) {\n                    if (is_string($setup->config->instanceRelation->out)) {\n                        $setup->config->instanceRelation->out = array($setup->config->instanceRelation->out);\n                    }\n                    foreach ($setup->config->instanceRelation->out as $rel) {\n                        // create new graph pattern\n                        $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                        // add triplen\n                        $ggp->addTriple(\n                            $subVar,\n                            new Erfurt_Sparql_Query2_IriRef($rel),\n                            $searchVar\n                        );\n                        // add triplet to union var\n                        $union->addElement($ggp);\n                    }\n                }\n                // parse config\n                if (isset($setup->config->instanceRelation->in)) {\n                    if (is_string($setup->config->instanceRelation->in)) {\n                        $setup->config->instanceRelation->in = array($setup->config->instanceRelation->in);\n                    }\n                    foreach ($setup->config->instanceRelation->in as $rel) {\n                        // create new graph pattern\n                        $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                        // add triplen\n                        $ggp->addTriple(\n                            $searchVar,\n                            new Erfurt_Sparql_Query2_IriRef($rel),\n                            $subVar\n                        );\n                        // add triplet to union var\n                        $union->addElement($ggp);\n                    }\n                }\n                $elements[] = $union;\n            }\n\n        }\n\n        if (isset($setup->config->rootElement)) {\n            $union = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n            if (isset($setup->config->hierarchyRelations->in)) {\n                foreach ($setup->config->hierarchyRelations->in as $rel) {\n                    // create new graph pattern\n                    $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                    // add triplen\n                    $ggp->addTriple(\n                        $searchVar,\n                        new Erfurt_Sparql_Query2_IriRef($rel),\n                        new Erfurt_Sparql_Query2_IriRef($setup->config->rootElement)\n                    );\n                    // add triplet to union var\n                    $union->addElement($ggp);\n                }\n                $superUsed = true;\n            }\n            if (isset($setup->config->hierarchyRelations->out)) {\n                foreach ($setup->config->hierarchyRelations->out as $rel) {\n                    // create new graph pattern\n                    $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                    // add triplen\n                    $ggp->addTriple(\n                        new Erfurt_Sparql_Query2_IriRef($setup->config->rootElement),\n                        new Erfurt_Sparql_Query2_IriRef($rel),\n                        $searchVar\n                    );\n                    // add triplet to union var\n                    $union->addElement($ggp);\n                }\n                $superUsed = true;\n            }\n            if ($superUsed) {\n                $elements[] = $union;\n            }\n        }\n\n        $elements[] = new Erfurt_Sparql_Query2_Filter(\n            new Erfurt_Sparql_Query2_UnaryExpressionNot(\n                new Erfurt_Sparql_Query2_isBlank(\n                    new Erfurt_Sparql_Query2_Var('resourceUri')\n                )\n            )\n        );\n\n        // namespaces to be ignored, rdfs/owl-defined objects\n        if (!isset($setup->state->showHidden)) {\n            if (isset($setup->config->hiddenRelation)) {\n                // optional var\n                $queryOptional = new Erfurt_Sparql_Query2_OptionalGraphPattern();\n                // parse config\n                if (is_string($setup->config->hiddenRelation)) {\n                    $setup->config->hiddenRelation = array($setup->config->hiddenRelation);\n                }\n                foreach ($setup->config->hiddenRelation as $ignore) {\n                    $queryOptional->addTriple(\n                        new Erfurt_Sparql_Query2_Var('resourceUri'),\n                        new Erfurt_Sparql_Query2_IriRef($ignore),\n                        new Erfurt_Sparql_Query2_Var('reg')\n                    );\n                    $regUsed = true;\n                }\n                if ($regUsed) {\n                    $elements[] = $queryOptional;\n                    $elements[] = new Erfurt_Sparql_Query2_Filter(\n                        new Erfurt_Sparql_Query2_UnaryExpressionNot(\n                            new Erfurt_Sparql_Query2_bound(\n                                new Erfurt_Sparql_Query2_Var('reg')\n                            )\n                        )\n                    );\n                }\n            }\n\n            if (isset($setup->config->hiddenNS)) {\n                // parse config\n                foreach ($setup->config->hiddenNS as $ignore) {\n                    $elements[] = new Erfurt_Sparql_Query2_Filter(\n                        new Erfurt_Sparql_Query2_UnaryExpressionNot(\n                            new Erfurt_Sparql_Query2_Regex(\n                                new Erfurt_Sparql_Query2_Str(new Erfurt_Sparql_Query2_Var('resourceUri')),\n                                new Erfurt_Sparql_Query2_RDFLiteral('^' . $ignore)\n                            )\n                        )\n                    );\n                }\n            }\n        }\n\n        // dont't show rdfs/owl entities and subtypes in the first level\n        if (!isset($setup->state->parent) && !isset($setup->config->rootElement)) {\n\n            OntoWiki::getInstance()->logger->info(\"BACKEND: \" . $backend);\n\n            // optional var\n            if ($backend == \"zenddb\") {\n                $queryUnion = new Erfurt_Sparql_Query2_OptionalGraphPattern();\n            } else {\n                $queryUnion = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n            }\n            if (isset($setup->config->hierarchyRelations->in)) {\n                if (count($setup->config->hierarchyRelations->in) > 1) {\n                    foreach ($setup->config->hierarchyRelations->in as $rel) {\n                        $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                        $ggp->addTriple(\n                            $searchVar,\n                            new Erfurt_Sparql_Query2_IriRef($rel),\n                            new Erfurt_Sparql_Query2_Var('super')\n                        );\n                        $queryUnion->addElement($ggp);\n                    }\n                } else {\n                    $rel = $setup->config->hierarchyRelations->in;\n                    // add optional sub relation\n                    if ($backend == \"zenddb\") {\n                        $queryUnion->addTriple(\n                            $searchVar,\n                            new Erfurt_Sparql_Query2_IriRef($rel[0]),\n                            new Erfurt_Sparql_Query2_Var('super')\n                        );\n                    } else {\n                        $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                        $ggp->addTriple(\n                            $searchVar,\n                            new Erfurt_Sparql_Query2_IriRef($rel[0]),\n                            new Erfurt_Sparql_Query2_Var('super')\n                        );\n                        $queryUnion->addElement($ggp);\n                    }\n                }\n                $superUsed = true;\n            }\n            if (isset($setup->config->hierarchyRelations->out)) {\n                if (count($setup->config->hierarchyRelations->out) > 1) {\n                    foreach ($setup->config->hierarchyRelations->out as $rel) {\n                        $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                        $ggp->addTriple(\n                            new Erfurt_Sparql_Query2_Var('super'),\n                            new Erfurt_Sparql_Query2_IriRef($rel),\n                            $searchVar\n                        );\n                        $queryUnion->addElement($ggp);\n                    }\n                } else {\n                    $rel = $setup->config->hierarchyRelations->out;\n                    // add optional sub relation\n                    if ($backend == \"zenddb\") {\n                        $queryUnion->addTriple(\n                            new Erfurt_Sparql_Query2_Var('super'),\n                            new Erfurt_Sparql_Query2_IriRef($rel[0]),\n                            $searchVar\n                        );\n                    } else {\n                        $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n                        $ggp->addTriple(\n                            new Erfurt_Sparql_Query2_Var('super'),\n                            new Erfurt_Sparql_Query2_IriRef($rel[0]),\n                            $searchVar\n                        );\n                        $queryUnion->addElement($ggp);\n                    }\n                }\n                $superUsed = true;\n            }\n            if ($superUsed) {\n                if ($backend == \"zenddb\") {\n                    $elements[] = $queryUnion;\n                } else {\n                    $queryOptional = new Erfurt_Sparql_Query2_OptionalGraphPattern();\n                    $queryOptional->addElement($queryUnion);\n                    $elements[] = $queryOptional;\n                }\n\n                $filter[] = new Erfurt_Sparql_Query2_Regex(\n                    new Erfurt_Sparql_Query2_Str(new Erfurt_Sparql_Query2_Var('super')),\n                    new Erfurt_Sparql_Query2_RDFLiteral('^' . EF_OWL_NS)\n                );\n                $filter[] = new Erfurt_Sparql_Query2_UnaryExpressionNot(\n                    new Erfurt_Sparql_Query2_bound(\n                        new Erfurt_Sparql_Query2_Var('super')\n                    )\n                );\n\n                $elements[] = new Erfurt_Sparql_Query2_Filter(\n                    new Erfurt_Sparql_Query2_ConditionalOrExpression($filter)\n                );\n            }\n        }\n        if (isset($setup->state->sorting)) {\n            $sortRel = new Erfurt_Sparql_Query2_IriRef($setup->state->sorting);\n            $sortVar = new Erfurt_Sparql_Query2_Var('sortRes');\n\n            $queryOptional = new Erfurt_Sparql_Query2_OptionalGraphPattern();\n            $queryOptional->addTriple(new Erfurt_Sparql_Query2_Var('resourceUri'), $sortRel, $sortVar);\n            $elements[] = $queryOptional;\n        }\n\n        return $elements;\n    }\n}\n"
  },
  {
    "path": "extensions/navigation/NavigationModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module – Navigation\n *\n * this is the main navigation module\n *\n * @category OntoWiki\n * @package  Extensions_Navigation\n * @author   {@link http://sebastian.tramp.name Sebastian Tramp}\n */\nclass NavigationModule extends OntoWiki_Module\n{\n    protected $_session = null;\n\n    public function init()\n    {\n        $this->_session = $this->_owApp->session;\n    }\n\n    public function getTitle()\n    {\n        return \"Navigation\";\n    }\n\n    /**\n     * Returns the menu of the module\n     *\n     * @return string\n     */\n    public function getMenu()\n    {\n        // check if menu must be shown\n        if (!$this->_privateConfig->defaults->showMenu) {\n            return new OntoWiki_Menu();\n        }\n\n        // build main menu (out of sub menus below)\n        $mainMenu = new OntoWiki_Menu();\n\n        // edit sub menu\n        if ($this->_owApp->erfurt->getAc()->isModelAllowed('edit', $this->_owApp->selectedModel)) {\n            $editMenu = new OntoWiki_Menu();\n            $editMenu->setEntry('Add Resource here', \"javascript:navigationAddElement()\");\n            $mainMenu->setEntry('Edit', $editMenu);\n        }\n\n        // count sub menu\n        $countMenu = new OntoWiki_Menu();\n        $countMenu->setEntry('10', \"javascript:navigationEvent('setLimit', 10)\")\n            ->setEntry('20', \"javascript:navigationEvent('setLimit', 20)\")\n            ->setEntry('30', \"javascript:navigationEvent('setLimit', 30)\");\n\n        // toggle sub menu\n        $toggleMenu = new OntoWiki_Menu();\n        // hidden elements\n        $toggleMenu->setEntry('Hidden Elements', \"javascript:navigationEvent('toggleHidden')\");\n        // empty elements\n        $toggleMenu->setEntry('Empty Elements', \"javascript:navigationEvent('toggleEmpty')\");\n        // implicit\n        $toggleMenu->setEntry('Implicit Elements', \"javascript:navigationEvent('toggleImplicit')\");\n\n        // view sub menu\n        $viewMenu = new OntoWiki_Menu();\n        $viewMenu->setEntry('Number of Elements', $countMenu);\n        $viewMenu->setEntry('Toggle Elements', $toggleMenu);\n        $viewMenu->setEntry('Reset Navigation', \"javascript:navigationEvent('reset')\");\n        $mainMenu->setEntry('View', $viewMenu);\n\n        // navigation type submenu\n        $sortMenu = new OntoWiki_Menu();\n        foreach ($this->_privateConfig->sorting->toArray() as $sortKey => $sortItem) {\n            $sortMenu->setEntry(\n                $sortItem['title'], \"javascript:navigationEvent('setSort', '\" . $sortItem['type'] . \"')\"\n            );\n        }\n        $mainMenu->setEntry('Sort', $sortMenu);\n\n        // navigation type submenu\n        $typeMenu = new OntoWiki_Menu();\n        foreach ($this->_privateConfig->config as $key => $config) {\n            if ($this->_privateConfig->defaults->checkTypes) {\n                if (isset($config->checkVisibility) && $config->checkVisibility == false) {\n                    $typeMenu->setEntry($config->title, \"javascript:navigationEvent('setType', '$key')\");\n                } else {\n                    if ($this->checkConfig($config) > 0) {\n                        $typeMenu->setEntry($config->title, \"javascript:navigationEvent('setType', '$key')\");\n                    }\n                }\n            } else {\n                $typeMenu->setEntry($config->title, \"javascript:navigationEvent('setType', '$key')\");\n            }\n        }\n        $mainMenu->setEntry('Type', $typeMenu);\n\n        return $mainMenu;\n    }\n\n    /**\n     * Returns the content\n     */\n    public function getContents()\n    {\n        // scripts and css only if module is visible\n        $this->view->headScript()->appendFile($this->view->moduleUrl . 'navigation.js');\n        $this->view->headLink()->appendStylesheet($this->view->moduleUrl . 'navigation.css');\n\n        // this gives the complete config array as json to the javascript parts\n        $this->view->inlineScript()->prependScript(\n            '/* from modules/navigation/ */' . PHP_EOL .\n            'var navigationConfig = ' . json_encode($this->_privateConfig->toArray()) . ';' . PHP_EOL\n        );\n        // this gives the navigation session config to the javascript parts\n        if ($this->_session->navigation) {\n            $this->view->inlineScript()->prependScript(\n                '/* from modules/navigation/ */' . PHP_EOL .\n                'var navigationConfig = ' . json_encode($this->_privateConfig->toArray()) . ';' . PHP_EOL\n            );\n        }\n\n        $sessionKey   = 'Navigation' . (isset($config->_session->identifier) ? $config->_session->identifier : '');\n        $stateSession = new Zend_Session_Namespace($sessionKey);\n        if (isset($stateSession) && ($stateSession->model == (string)$this->_owApp->selectedModel)) {\n            // load setup\n            $this->view->inlineScript()->prependScript(\n                '/* from modules/navigation/ */' . PHP_EOL .\n                'var navigationStateSetup = ' . $stateSession->setup . ';' . PHP_EOL\n            );\n            // load view\n            $this->view->stateView = $stateSession->view;\n            // set js actions\n            $this->view->inlineScript()->prependScript(\n                '$(document).ready(function() { navigationPrepareList(); } );' . PHP_EOL\n            );\n        }\n\n        // init view from scratch\n        $this->view->inlineScript()->prependScript(\n            '$(document).ready(function() { navigationEvent(\\'init\\'); } );' . PHP_EOL\n        );\n\n        $data['session'] = $this->_session->navigation;\n\n        // draw\n        $content = $this->render('navigation', $data, 'data'); //\n        // return content\n        return $content;\n    }\n\n    public function shouldShow()\n    {\n        return isset($this->_owApp->selectedModel);\n    }\n\n    private function checkConfig($config)\n    {\n        $resVar  = new Erfurt_Sparql_Query2_Var('resourceUri');\n        $typeVar = new Erfurt_Sparql_Query2_IriRef(EF_RDF_TYPE);\n        $query   = new Erfurt_Sparql_Query2();\n        $query->addProjectionVar($resVar)->setDistinct(true);\n\n        $union = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n        if (is_string($config->hierarchyTypes)) {\n            $config->hierarchyTypes = array($config->hierarchyTypes);\n        }\n        foreach ($config->hierarchyTypes->toArray() as $type) {\n            $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();\n            $ggp->addTriple(\n                $resVar,\n                $typeVar,\n                new Erfurt_Sparql_Query2_IriRef($type)\n            );\n            $union->addElement($ggp);\n        }\n        $query->addElement($union);\n        $query->setLimit(1);\n\n        $allResults = $this->_owApp->selectedModel->sparqlQuery($query);\n\n        return count($allResults);\n    }\n}\n"
  },
  {
    "path": "extensions/navigation/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix : <https://github.com/AKSW/navigation/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :navigation .\n:navigation a doap:Project ;\n  doap:name \"navigation\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/navigation/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Navigation Module\" ;\n  doap:description \"an extensible and highly customizable module to navigate in knowledge bases via tree-based information (e.g. classes)\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:templates \"templates\" ;\n  owconfig:languages \"languages\" ;\n  owconfig:hasModule :Default .\n\n:Default a owconfig:Module ;\n  rdfs:label \"Default\" ;\n  owconfig:context \"main.sidewindows\" ;\n  owconfig:priority \"30\" .\n\n:navigation owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"defaults\";\n      :config \"classes\" ;\n      :limit \"10\" ;\n      :checkTypes \"true\"^^xsd:boolean ;\n      :showMenu \"true\"^^xsd:boolean\n];\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"sorting\";\n      owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"label\";\n          rdfs:label \"By Label\" ;\n          :type <http://www.w3.org/2000/01/rdf-schema#label>\n    ]\n];\n\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"config\";\n\n      owconfig:config [\n            a owconfig:Config;\n            owconfig:id \"sitenav\";\n            rdfs:label \"Site Navigation\" ;\n            :titleMode \"titleHelper\" ;\n            :cache \"false\"^^xsd:boolean ;\n            :hierarchyTypes (<http://ns.ontowiki.net/SysOnt/Site/Navigation>) ;\n            :checkVisibility \"true\"^^xsd:boolean ;\n            :showCounts \"false\"^^xsd:boolean ;\n            :checkSub \"false\"^^xsd:boolean ;\n            :hideDefaultHierarchy \"false\"^^xsd:boolean ;\n            :directLink \"true\"^^xsd:boolean ;\n            owconfig:config [\n              a owconfig:Config ;\n              owconfig:id \"list\" ;\n              :query \"SELECT DISTINCT ?resourceUri WHERE { <%resource%> ?property ?resourceUri . ?property a <http://www.w3.org/2000/01/rdf-schema#ContainerMembershipProperty> . }\" ;\n            ];\n            owconfig:config [\n              a owconfig:Config ;\n              owconfig:id \"query\" ;\n              :top \"SELECT DISTINCT ?resourceUri WHERE { ?resourceUri a <http://ns.ontowiki.net/SysOnt/Site/Navigation> . }\" ;\n              :deeper \"SELECT DISTINCT ?resourceUri WHERE { <%resource%> ?property ?resourceUri. ?resourceUri a <http://ns.ontowiki.net/SysOnt/Site/Navigation>}\" ;\n            ];\n        ] ;\n\n\n      owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"classes\";\n          rdfs:label \"Classes\" ;\n          :cache \"false\"^^xsd:boolean ;\n          :titleMode \"titleHelper\" ;\n          :checkVisibility \"false\"^^xsd:boolean ;\n          :hierarchyTypes (\n                <http://www.w3.org/2002/07/owl#Class> \n                <http://www.w3.org/2000/01/rdf-schema#Class>\n          ) ;\n          owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"hierarchyRelations\";\n              :in (<http://www.w3.org/2000/01/rdf-schema#subClassOf>) ;\n        ];\n\n owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"instanceRelation\";\n              :out (<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>)\n        ];\n          :hiddenNS (\n                <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n                <http://www.w3.org/2000/01/rdf-schema#>\n                <http://www.w3.org/2002/07/owl#>\n          ) ;\n          :hiddenRelation (<http://ns.ontowiki.net/SysOnt/hidden>) ;\n          :showImplicitElements \"true\"^^xsd:boolean ;\n          :showEmptyElements \"true\"^^xsd:boolean ;\n          :showHiddenElements \"false\"^^xsd:boolean ;\n          :showCounts \"false\"^^xsd:boolean ;\n          :checkSub \"true\"^^xsd:boolean ;\n          :hideDefaultHierarchy \"false\"^^xsd:boolean ;\n owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"list\";\n              :config \"{|filter|:[{|rdfsclass|:|%resource%|,|mode|:|rdfsclass|}]}\"\n        ]\n    ];\n owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"properties\";\n          rdfs:label \"Properties\" ;\n          :titleMode \"titleHelper\" ;\n          :hierarchyTypes (\n                <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property>\n                <http://www.w3.org/2002/07/owl#DatatypeProperty>\n                <http://www.w3.org/2002/07/owl#ObjectProperty>\n                <http://www.w3.org/2002/07/owl#AnnotationProperty>\n          ) ;\n          owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"hierarchyRelations\";\n              :in (<http://www.w3.org/2000/01/rdf-schema#subPropertyOf>)\n        ];\n owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"instanceRelation\";\n              :out (<http://www.w3.org/2000/01/rdf-schema#subPropertyOf>)\n        ];\n          :showImplicitElements \"false\"^^xsd:boolean ;\n          :showEmptyElements \"true\"^^xsd:boolean ;\n          :showCounts \"false\"^^xsd:boolean ;\n          :hideDefaultHierarchy \"false\"^^xsd:boolean ;\n          :checkSub \"true\"^^xsd:boolean ;\n owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"list\";\n              :config \"{|shownProperties|:[{|uri|:|%resource%|,|label|:|Label 1|,|action|:|add|,|inverse|:false}],|filter|:[{|property|:|%resource%|,|filter|:|bound|}]}\"\n        ]\n    ];\n owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"spatial\";\n          rdfs:label \"Spatial\" ;\n          :hierarchyTypes (\n                <http://ns.aksw.org/spatialHierarchy/SpatialArea>\n                <http://ns.aksw.org/spatialHierarchy/Planet> \n                <http://ns.aksw.org/spatialHierarchy/Continent> \n                <http://ns.aksw.org/spatialHierarchy/Country> \n                <http://ns.aksw.org/spatialHierarchy/Province> \n                <http://ns.aksw.org/spatialHierarchy/District> \n                <http://ns.aksw.org/spatialHierarchy/City>\n          ) ;\n          owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"hierarchyRelations\";\n              :in (<http://ns.aksw.org/spatialHierarchy/isLocatedIn>)\n        ];\n owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"instanceRelation\";\n              :out (\n                    <http://ns.aksw.org/addressFeatures/physical/country>\n                    <http://ns.aksw.org/addressFeatures/physical/city>\n              )\n        ];\n :titleMode \"titleHelper\"\n    ];\n owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"faun\";\n          rdfs:label \"Faunistics\" ;\n          :hierarchyTypes (\n                <http://purl.org/net/faunistics#Family> \n                <http://purl.org/net/faunistics#Genus> \n                <http://purl.org/net/faunistics#Species> \n                <http://purl.org/net/faunistics#Order> \n                <http://purl.org/net/faunistics#SubOrder> \n          ) ;\n          owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"hierarchyRelations\";\n              :in (<http://purl.org/net/faunistics#subTaxonOf>)\n        ];\n owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"instanceRelation\";\n              :out (<http://purl.org/net/faunistics#identifiesAs>)\n        ];\n :titleMode \"titleHelper\" ;\n          :checkSub \"true\"^^xsd:boolean\n    ];\n owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"skos\";\n          rdfs:label \"SKOS\" ;\n          :hierarchyTypes (\n            <http://www.w3.org/2004/02/skos/core#Concept>\n            <http://www.w3.org/2004/02/skos/core#ConceptScheme>\n          ) ;\n          owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"hierarchyRelations\";\n              :in (\n                <http://www.w3.org/2004/02/skos/core#broader>\n                <http://www.w3.org/2004/02/skos/core#inScheme>\n              ) ;\n              :out (<http://www.w3.org/2004/02/skos/core#narrower>)\n        ];\n        :checkSub \"true\"^^xsd:boolean ;\n        :titleMode \"titleHelper\" ;\n        :showCounts \"false\"^^xsd:boolean\n    ];\n owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"org\";\n          rdfs:label \"Groups\" ;\n          :hierarchyTypes (\n                <http://xmlns.com/foaf/0.1/Group>\n                <http://xmlns.com/foaf/0.1/Organization>\n          ) ;\n          owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"hierarchyRelations\";\n              :out (<http://ns.ontowiki.net/SysOnt/subGroup>)\n        ];\n owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"instanceRelation\";\n              :in (<http://xmlns.com/foaf/0.1/member>) ;\n              :out (<http://xmlns.com/foaf/0.1/member_of>)\n        ];\n :titleMode \"titleHelper\" ;\n          :showCounts \"true\"^^xsd:boolean\n    ];\n owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"go\";\n          rdfs:label \"Gene Ontology\" ;\n          :hierarchyTypes (<http://www.geneontology.org/dtds/go.dtd#term>) ;\n          owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"hierarchyRelations\";\n              :in (<http://www.geneontology.org/dtds/go.dtd#is_a>)\n        ] ;\n          :titleMode \"titleHelper\" ;\n          :showCounts \"false\"^^xsd:boolean ;\n          :checkSub \"true\"^^xsd:boolean ;\n          :hideDefaultHierarchy \"false\"^^xsd:boolean ;\n owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"list\";\n              :query \"SELECT DISTINCT ?resourceUri WHERE { ?resourceUri <http://www.geneontology.org/GO.format.gaf-2_0.shtml#go_id> <%resource%> }\"\n        ]\n    ];\n owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"checklist\";\n          rdfs:label \"Checklist\" ;\n          :titleMode \"titleHelper\" ;\n          :hierarchyTypes (<http://www.mindswap.org/2003/owl/geo/geoFeatures.owl#Country>) ;\n          owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"hierarchyRelations\";\n              :in (<http://www.mindswap.org/2003/owl/geo/geoFeatures.owl#within>)\n        ] ;\n          :checkSub \"true\"^^xsd:boolean ;\n owconfig:config [\n              a owconfig:Config;\n              owconfig:id \"list\";\n              :shownProperties \"{|uri|:|http://purl.org/net/faunistics#citationSuffix|,|label|:|citation suffix|,|action|:|add|,|inverse|:false}\" ;\n              :query \"SELECT DISTINCT ?resourceUri ?famUri WHERE {     ?recUri <http://purl.org/net/faunistics#recordedAtLocation> ?resourceLocation     OPTIONAL{         ?resourceLocation <http://www.mindswap.org/2003/owl/geo/geoFeatures.owl#within> ?l1.         OPTIONAL{             ?l1 <http://www.mindswap.org/2003/owl/geo/geoFeatures.owl#within> ?l2.             OPTIONAL{                 ?l2 <http://www.mindswap.org/2003/owl/geo/geoFeatures.owl#within> ?l3.             }         }     }     ?recUri <http://purl.org/net/faunistics#identifiesAs> ?resourceUri .     ?resourceUri <http://purl.org/net/faunistics#subTaxonOf> ?genUri .     ?genUri <http://purl.org/net/faunistics#subTaxonOf> ?famUri .     FILTER ( sameTerm(?resourceLocation, <%resource%>) ||     sameTerm(?l1, <%resource%>) ||     sameTerm(?l2, <%resource%>) ||     sameTerm(?l3, <%resource%>)) }\"\n        ];\n :rootName \"Caucasus Spiders\" ;\n          :rootURI <http://db.caucasus-spiders.info/Area/152> ;\n    ] ;\n\n\n] .\n\n:navigation doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/navigation/languages/navigation-de.csv",
    "content": ""
  },
  {
    "path": "extensions/navigation/languages/navigation-en.csv",
    "content": ""
  },
  {
    "path": "extensions/navigation/navigation.css",
    "content": "/*\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n.content h2.navRoot\n{\n    font-size:1em;\n    font-weight:bold;\n}\n\n#navigation .icon { width:0.7em; }\n\n#navigation .icon.icon-arrow-next\n{\n    display:block;\n    font-size:1.5em !important;\n    width:1em; height:1em;\n    position:absolute;\n    right:0;\n    top:50%; margin-top:-0.5em;\n    /*top:0; height:100%;*/\n    background-color:#999;\n    background-image:url(icon-next.png);\n    -moz-border-radius:0.5em; border-radius:0.5em;\n}\n\n#navigation .icon.icon-arrow-previous { background-image:url(icon-previous.png); width:12px; }\n\n#navigation .icon.icon-arrow-first { background-image:url(icon-first.png); width:8px; }\n\n#navigation .navRoot.fancybuttons .icon.icon-arrow-previous\n{\n    background-color:#999;\n    width:1.2em;\n    height:1.2em;\n    -moz-border-radius:0.6em;\n    border-radius:0.6em;\n    position:relative;\n    left:-0.25em;\n}\n\n#navigation .navRoot.fancybuttons .icon.icon-arrow-first\n{\n    background-color:#bbb;\n    width:0.9em;\n    height:0.9em;\n    -moz-border-radius:0.45em;\n    border-radius:0.45em;\n}\n\n/* set contextmenu more left */\n#navigation .has-contextmenus-block li a:hover span.button\n{\n    right:1.75em;\n}\n\n\n#navigation a .icon, #navigation a.icon { opacity:0.4; }\n#navigation a:hover .icon, #navigation a.icon:hover { opacity:0.6; text-decoration:none !important;}\n#navigation a:hover .icon:hover { opacity:1; }\n\n#navigation a span.navDeeperIcon { opacity:0.5; }\n#navigation a span.navDeeperIcon:hover { opacity:1; }\n\n#navigation .has-contextmenus-block li a\n{\n    padding-right:1.75em;\n}\n"
  },
  {
    "path": "extensions/navigation/navigation.js",
    "content": "/**\n * This file is part of the navigation extension for OntoWiki\n *\n * @author     Sebastian Tramp <tramp@informatik.uni-leipzig.de>\n * @copyright  Copyright (c) 2009-2010, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n *\n */\n(function(){\n    /**\n     * The main document.ready assignments and code\n     */\n    $(document).ready(function() {\n        /* some used variables */\n        navigationContainer = $('#navigation-content');\n        navigationInput = $('#navigation-input');\n        navigationWindow = $('#navigation');\n        navigationExploreUrl = urlBase + 'navigation/explore';\n        navigationMoreUrl = urlBase + 'navigation/more';\n        navigationSaveUrl = urlBase + 'navigation/savestate';\n        navigationLoadUrl = urlBase + 'navigation/loadstate';\n        navigationListUrl = urlBase + 'list';\n        navSetup = '';\n\n        navigationInput.livequery('keypress', function(event) {\n            // do not create until user pressed enter\n            if ((event.which === 13) && (event.currentTarget.value !== '') ) {\n                navigationEvent('search', event.currentTarget.value);\n                $(event.currentTarget).val('');\n                return false;\n            } else if ( event.which === 13 ) {\n                return false;\n            }\n            return true;\n        });\n\n        if( typeof navigationStateSetup !== 'undefined'){\n            navigationSetup = navigationStateSetup;\n        }\n    });\n\n    /**\n     * Setups the Navgiation Parameters and start the request\n     */\n    var navigationEvent = function (navEvent, eventParameter) {\n        var setup, navType;\n\n        /* init config when not existing or resetted by user */\n        if ((typeof navigationSetup === 'undefined') || (navEvent === 'reset') || (navEvent === 'setType')) {\n            // set the default or setType config\n            if (navEvent === 'setType') {\n                navType = eventParameter;\n            } else {\n                navType = navigationConfig.defaults.config;\n            }\n            var config = navigationConfig.config[navType];\n\n            // the limit\n            var limit = navigationConfig.defaults.limit;\n\n            // set the state\n            var state = {};\n            state.limit = limit;\n            state.path = [];\n            // pack state and config into setup value for post\n            setup = {'state': state, 'config': config};\n        } else {\n            setup = navigationSetup;\n        }\n\n        // delete old search string\n        delete(setup.state.searchString);\n\n        // nav event\n        switch (navEvent) {\n        case 'init':\n            // save hidden, implicit and empty to state\n            if(typeof navigationStateSetup !== 'undefined'){\n                if(typeof navigationStateSetup.state.showEmpty !== 'undefined'){\n                    setup.state.showEmpty = navigationStateSetup.state.showEmpty;\n                }\n                if(typeof navigationStateSetup.state.showImplicit !== 'undefined'){\n                    setup.state.showImplicit = navigationStateSetup.state.showImplicit;\n                }\n                if(typeof navigationStateSetup.state.showHidden !== 'undefined'){\n                    setup.state.showHidden = navigationStateSetup.state.showHidden;\n                }\n            }else{\n                if(setup.config.showEmptyElements === '1'){\n                    setup.state.showEmpty = true;\n                }\n                if(setup.config.showImplicitElements === '1'){\n                    setup.state.showImplicit = true;\n                }\n                if(setup.config.showHiddenElements === '1'){\n                    setup.state.showHidden = true;\n                }\n            }\n            // remove init sign and setup module title\n            navigationContainer.removeClass('init-me-please');\n            $('#navigation h1.title').text('Navigation: '+setup.config.title);\n            break;\n        case 'reset':\n            if(setup.config.showEmptyElements === '1'){\n                setup.state.showEmpty = true;\n            }\n            if(setup.config.showImplicitElements === '1'){\n                setup.state.showImplicit = true;\n            }\n            if(setup.config.showHiddenElements === '1'){\n                setup.state.showHidden = true;\n            }\n        case 'setType':\n            // remove init sign and setup module title\n            navigationContainer.removeClass('init-me-please');\n            $('#navigation h1.title').text('Navigation: '+setup.config.title);\n            break;\n\n        case 'refresh':\n            break;\n\n        case 'showResourceList':\n            setup.state.parent = eventParameter;\n            break;\n\n        case 'navigateDeeper':\n            // save path element\n            if ( typeof setup.state.parent !== 'undefined' ) {\n                setup.state.path.push(setup.state.parent);\n            }\n            // set new parent\n            setup.state.parent = eventParameter;\n            break;\n\n        case 'navigateHigher':\n            // count path elements\n            var pathlength = setup.state.path.length;\n            if ( typeof setup.state.parent === 'undefined' ) {\n                // we are at root level, so nothing higher than here\n                return;\n            }\n            if (pathlength === 0) {\n                // we are at the first sublevel (so we go to root)\n                delete(setup.state.parent);\n            } else {\n                // we are somewhere deeper ...\n                // set parent to the last path element\n                setup.state.parent = setup.state.path[pathlength-1];\n                // and delete the last path element\n                setup.state.path.pop();\n            }\n            break;\n\n        case 'navigateRoot':\n            // we are at root level, so nothing higher than here\n            // exception: after a search, it should be also rootable\n            if (typeof setup.state.parent === 'undefined' && setup.state.lastEvent !== 'search'){\n                return;\n            }\n            delete(setup.state.parent);\n            setup.state.path = [];\n            break;\n\n        case 'search':\n            setup.state.searchString = eventParameter;\n            break;\n\n        case 'setLimit':\n            setup.state.limit = eventParameter;\n            delete(setup.state.offset);\n            break;\n\n        case 'toggleHidden':\n            if (typeof setup.state.showHidden !== 'undefined') {\n                delete(setup.state.showHidden);\n                $('a[href=\\'javascript:navigationEvent(\\'toggleHidden\\')\\']').text('Show Hidden Elements');\n            } else {\n                setup.state.showHidden = true;\n                $('a[href=\\'javascript:navigationEvent(\\'toggleHidden\\')\\']').text('Hide Hidden Elements');\n            }\n            break;\n\n        case 'toggleEmpty':\n            // if no state is set, use default value from config\n            if ( typeof setup.state.showEmpty === 'undefined' ) {\n                if ( typeof setup.config.showEmptyElements !== 'undefined' ) {\n                    setup.state.showEmpty = setup.config.showEmptyElements;\n                    if(setup.state.showEmpty === true){\n                        $('a[href=\\'javascript:navigationEvent(\\'toggleEmpty\\')\\']').text('Hide Empty Elements');\n                    }\n                } else {\n                    setup.state.showEmpty = true;\n                    $('a[href=\\'javascript:navigationEvent(\\'toggleEmpty\\')\\']').text('Hide Empty Elements');\n                }\n            } else if (setup.state.showEmpty === false) {\n                setup.state.showEmpty = true;\n                $('a[href=\\'javascript:navigationEvent(\\'toggleEmpty\\')\\']').text('Hide Empty Elements');\n            } else {\n                setup.state.showEmpty = false;\n                $('a[href=\\'javascript:navigationEvent(\\'toggleEmpty\\')\\']').text('Show Empty Elements');\n            }\n            break;\n\n        case 'toggleImplicit':\n            // if no state is set, use default value from config\n            if (typeof setup.state.showImplicit === 'undefined') {\n                if (typeof setup.config.showImplicitElements !== 'undefined') {\n                    setup.state.showImplicit = setup.config.showImplicitElements;\n                    if (setup.state.showImplicit === true) {\n                        $('a[href=\\'javascript:navigationEvent(\\'toggleImplicit\\')\\']').text('Hide Implicit Elements');\n                    } else {\n                        $('a[href=\\'javascript:navigationEvent(\\'toggleImplicit\\')\\']').text('Show Implicit Elements');\n                    }\n                } else {\n                    setup.state.showImplicit = true;\n                    $('a[href=\\'javascript:navigationEvent(\\'toggleImplicit\\')\\']').text('Hide Implicit Elements');\n                }\n            } else if (setup.state.showImplicit === false) {\n                setup.state.showImplicit = true;\n                $('a[href=\\'javascript:navigationEvent(\\'toggleImplicit\\')\\']').text('Hide Implicit Elements');\n            } else {\n                setup.state.showImplicit = false;\n                $('a[href=\\'javascript:navigationEvent(\\'toggleImplicit\\')\\']').text('Show Implicit Elements');\n            }\n            break;\n        case 'more':\n            if( setup.state.offset !== undefined  ){\n                setup.state.offset += 10;\n            }else{\n                setup.state.offset = parseInt(setup.state.limit, 10);\n            }\n            setup.state.limit = setup.state.offset;\n            break;\n        case 'setSort':\n            setup.state.sorting = eventParameter;\n            break;\n        default:\n            alert('error: unknown navigation event: '+navEvent);\n            return;\n        }\n\n        setup.state.lastEvent = navEvent;\n        navigationSetup = setup;\n        navSetup = setup;\n        navigationLoad (navEvent, setup);\n        return;\n    };\n    // expose\n    window.navigationEvent = navigationEvent;\n\n    /**\n     * request the navigation\n     */\n    var navigationLoad = function (navEvent, setup) {\n        if (typeof setup === 'undefined') {\n            alert('error: No navigation setup given, but navigationLoad requested');\n            return;\n        }\n\n        // preparation of a callback function\n        var cbAfterLoad = function(){\n            $.post(navigationExploreUrl, {setup: $.toJSON(setup)},\n                function (data) {\n                    //alert(data);\n                    // only clear when there's no offset\n                    if(typeof setup.state.offset === 'undefined' || setup.state.offset === 0) {\n                        navigationContainer.empty();\n                    } else if (setup.state.lastEvent === 'init') { // remove \"show more\" button on init event if we have offset\n                        $('a.minibutton', navigationContainer).remove();\n                    }\n                    navigationContainer.append(data);\n                    // remove the processing status\n                    navigationInput.removeClass('is-processing');\n\n                    switch (navEvent) {\n                    case 'more':\n                        navigationMore.remove();\n                        // remove the processing status\n                        navigationMore.removeClass('is-processing');\n                    case 'refresh':\n                        // no animation in refresh event (just the is processing)\n                        break;\n                    case 'navigateHigher':\n                        navigationContainer.css('marginLeft', '-100%');\n                        navigationContainer.animate({marginLeft:'0px'},'slow');\n                        break;\n                    case 'navigateDeeper':\n                        navigationContainer.css('marginLeft', '100%');\n                        navigationContainer.animate({marginLeft:'0px'},'slow');\n                        break;\n                    }\n\n                    navigationPrepareList();\n                }\n            );\n        };\n\n        // first we set the processing status\n        navigationInput.addClass('is-processing');\n        navigationContainer.css('overflow', 'hidden');\n\n        switch (navEvent) {\n        case 'more':\n            navigationMore = $('#naviganion-more');\n            navigationMore.html('&nbsp;&nbsp;&nbsp;&nbsp;');\n            navigationMore.addClass('is-processing');\n        case 'refresh':\n            // no animation in refresh event (just the is processing)\n            cbAfterLoad();\n            break;\n        case 'navigateHigher':\n            navigationContainer.animate({marginLeft:'100%'},'slow', '', cbAfterLoad);\n            break;\n        case 'navigateDeeper':\n            navigationContainer.animate({marginLeft:'-100%'},'slow', '', cbAfterLoad);\n            break;\n        default:\n            //navigationContainer.slideUp('fast', cbAfterLoad);\n            cbAfterLoad();\n        }\n\n        return ;\n    };\n\n    var navigationPrepareToggles = function(){\n        if (navigationSetup.state.showHidden === true ) {\n            $('a[href=\\'javascript:navigationEvent(\\'toggleHidden\\')\\']').text('Hide Hidden Elements');\n        } else {\n            $('a[href=\\'javascript:navigationEvent(\\'toggleHidden\\')\\']').text('Show Hidden Elements');\n        }\n\n        // if no state is set, use default value from config\n        if (navigationSetup.state.showEmpty === true) {\n            $('a[href=\\'javascript:navigationEvent(\\'toggleEmpty\\')\\']').text('Hide Empty Elements');\n        } else {\n            $('a[href=\\'javascript:navigationEvent(\\'toggleEmpty\\')\\']').text('Show Empty Elements');\n        }\n\n        // if no state is set, use default value from config\n        if (navigationSetup.state.showImplicit === true) {\n            $('a[href=\\'javascript:navigationEvent(\\'toggleImplicit\\')\\']').text('Hide Implicit Elements');\n        } else {\n            $('a[href=\\'javascript:navigationEvent(\\'toggleImplicit\\')\\']').text('Show Implicit Elements');\n        }\n    };\n\n    /*\n     * This function creates navigation events\n     */\n    var navigationPrepareList = function() {\n        //saveState();\n        // the links to deeper navigation entries\n        $('.navDeeper').click(function(event) {\n            navigationEvent('navigateDeeper', $(this).parent().attr('about'));\n            return false;\n        });\n\n        // the link to the root\n        $('.navFirst').click(function(event){\n            navigationEvent('navigateRoot');\n            return false;\n        });\n\n        // the link to higher level\n        $('.navBack').click(function(event){\n            navigationEvent('navigateHigher');\n            return false;\n        });\n\n        // the link to the instance list\n        $('.navList').click(function(event){\n            window.location.href = $(this).attr('href');\n            return false;\n        });\n\n        navigationPrepareToggles();\n    };\n    // expose\n    window.navigationPrepareList = navigationPrepareList;\n\n    /*\n     * Starts RDFauthor with a specific class init depending on position and config\n     */\n    var navigationAddElement = function(){\n        // we use the first configured navigationType to create\n        var classResource = navigationSetup.config.hierarchyTypes[0];\n\n        // callback which manipulates the data given from the init json service\n        dataCallback = function(data) {\n            var config = navigationSetup.config; // configured navigation setup\n            var state = navigationSetup.state; // current navigation state\n\n            // subjectUri is the main resource\n            for (var newElementUri in data) {\n                break;\n            }\n\n            // check for parent element\n            if (typeof state.parent !== 'undefined') {\n                var parentUri = state.parent;\n                var relations = config.hierarchyRelations; // configured hierarchy relations\n\n                if (typeof relations.in !== 'undefined') {\n                    // check for hierarchy relations (incoming eg. subClassOf)\n                    var propertyUri = relations.in[0];\n\n                    // TODO: this should be done by a future RDF/JSON API\n                    data[newElementUri][propertyUri] = [ {'type' : 'uri' , 'value' : parentUri} ];\n                } else if (typeof relations.out !== 'undefined') {\n                    // check for hierarchy relations (outgoing eg. skos:narrower)\n                    var propertyUri = relations.out[0];\n\n                    // TODO: this should be done by a future RDF/JSON API\n                    var newStatement = {};\n                    newStatement[propertyUri] = [{\n                            'hidden': true ,\n                            'type' : 'uri' ,\n                            'value' : newElementUri\n                        }];\n                    data[parentUri] = newStatement;\n                }\n            }\n\n            // dont forget to return the manipulated data\n            return data;\n        };\n\n        // start RDFauthor\n        createInstanceFromClassURI(classResource, dataCallback);\n    }\n    // expose\n    window.navigationAddElement = navigationAddElement;\n})();\n"
  },
  {
    "path": "extensions/navigation/navigation.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki navigation template\n */\n\n?>\n<form class=\"width98\">\n    <label\n        class=\"display-block onlyAural\"\n        for=\"navigation-input\">Search in Navigation</label>\n    <input\n        id=\"navigation-input\"\n        class=\"text width99 inner-label\"\n        type=\"text\"\n        value=\"\"\n        name=\"navigation-input\"/>\n</form>\n<div id=\"navigation-content\" class=\"width99 init-me-please\">\n<?php\nif( isset($this->stateView) ){\n    echo $this->stateView;\n}\n?>\n</div>\n"
  },
  {
    "path": "extensions/navigation/templates/navigation/explore.phtml",
    "content": "<?php\n\n/**\n * OntoWiki navigation entry list template\n */\n$odd = true;\n?>\n    <?php if (! (isset($this->showRoot) && $this->showRoot == false) ):?>\n        <h2 class=\"navRoot fancybuttons\">\n        <?php if (isset($this->rootEntry)):?>\n            <a class=\"navFirst icon icon-arrow-first\" title=\"Go to root level\">\n                <span>[Go to root level]</span>\n            </a><a class=\"navBack icon icon-arrow-previous\" title=\"Go to previous level\">\n                <span>[Go to previous level]</span>\n            </a><br/>\n            <a class=\"hasMenu\" href=\"<?php echo $this->rootEntry['url'] ?>\" about=\"<?php echo $this->rootEntry['uri'] ?>\">\n                <?php echo $this->rootEntry['title'] ?>\n            </a>\n        <?php else: ?>\n            <?php if ( isset($this->rootName) ){\n                if( isset($this->rootLink) ){\n                   echo '<a class=\"navigation\" href=\"'.$this->rootLink.'\" >';\n                   echo $this->rootName;\n                   echo '</a>';\n                }else{\n                    echo $this->rootName;\n                }\n            }else{ ?>\n            <?php } ?>\n        <?php endif ?>\n        </h2>\n    <?php endif ?>\n\n    <?php if (!empty($this->messages)): ?>\n        <?php foreach ($this->messages as $message): ?>\n        <p class=\"messagebox <?php echo $message['type'] ?>\">\n            <?php echo $message['text'] ?>\n        </p>\n        <?php endforeach; ?>\n    <?php endif ?>\n\n\n    <?php if ($this->entries) :?>\n        <ol class=\"bullets-none separated has-contextmenus-block\">\n        <?php foreach ($this->entries as $uri => $entry): ?>\n            <li class=\"<?php echo $odd ? 'odd' : 'even'; $odd = !$odd; ?>\">\n                <a class=\"navigation navList\"\n                   href=\"<?php echo $entry['link'] ?>\"\n                   about=\"<?php echo $uri ?>\" title=\"show list of instances\">\n                   <?php echo $entry['title'] ?>\n\n                   <?php if( $entry['sub'] > 0 ): ?>\n                   <span class=\"navDeeper navDeeperIcon icon icon-arrow-next\" title=\"show deeper level\"><span>[show deeper level]</span></span>\n                   <?php endif ?>\n                </a>\n            </li>\n        <?php endforeach; ?>\n        </ol>\n    <?php endif; ?>\n\n<?php if ($this->showMeMore) :?>\n<a class=\"minibutton\" href=\"javascript:navigationEvent ('more', '')\" id=\"naviganion-more\"><span class=\"icon icon-arrow-down\"></span> Show Me More</a>\n<?php endif; ?>\n"
  },
  {
    "path": "extensions/navigation/templates/navigation/loadstate.phtml",
    "content": "<?php\nif( isset($this->data) ){\n    echo $this->data;\n}\n?>"
  },
  {
    "path": "extensions/pingback/PingbackController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * semantic pingback controller\n *\n * @category   OntoWiki\n * @package    Extensions_Pingback\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n * @author     Sebastian Tramp <mail@sebastian.tramp.name>\n * @author     Jonas Brekle <jonas.brekle@gmail.com>\n * @author     Natanael Arndt <arndtn@gmail.com>\n */\nclass PingbackController extends OntoWiki_Controller_Component\n{\n\n    protected $_targetGraph = null;\n    protected $_sourceRdf = null;\n    private $_dbChecked = false;\n\n    /**\n     * receive a ping\n     */\n    public function pingAction()\n    {\n        $owApp  = OntoWiki::getInstance();\n        $logger = $owApp->logger;\n        $logger->debug('Pingback Server Init.');\n\n        $this->_helper->viewRenderer->setNoRender();\n        $this->_helper->layout->disableLayout();\n\n        $this->_owApp->appendMessage(\n            new OntoWiki_Message('Ping received.', OntoWiki_Message::INFO)\n        );\n\n        $post = $this->_request->getPost();\n        if (isset($post['source']) && isset($post['target'])) {\n            // Simplified Semantic Pingback\n\n            // read config and put it into options\n            $options = array();\n            $config  = $this->_privateConfig;\n            if (isset($config->rdfa->enabled)) {\n                $options['rdfa'] = $config->rdfa->enabled;\n            }\n            if (isset($config->titleProperties)) {\n                $options['title_properties'] = $config->titleProperties->toArray();\n            }\n            if (isset($config->genericRelation)) {\n                $options['generic_relation'] = $config->genericRelation;\n            }\n\n            $ping = new Erfurt_Ping($options);\n            echo $ping->receive($post['source'], $post['target']);\n\n            return;\n        } else {\n            // Create XML RPC Server\n            $server = new Zend_XmlRpc_Server();\n            $server->setClass($this, 'pingback');\n\n            // Let the server handle the RPC calls.\n            $response = $this->getResponse();\n            $response->setBody($server->handle());\n\n            return;\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/pingback/PingbackPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * The pingback plugin is used on different events\n *\n * @category   OntoWiki\n * @package    Extensions_Pingback\n * @author     Philipp Frischmuth\n * @author     Sebastian Tramp <mail@sebastian.tramp.name>\n */\n\nclass PingbackPlugin extends OntoWiki_Plugin\n{\n\n    public function onBeforeLinkedDataRedirect($event)\n    {\n        if ($event->response === null) {\n            return;\n        }\n        $response = $event->response;\n\n        $serverUrl = null;\n        if (isset($this->_privateConfig->external_pingback_server)) {\n            $serverUrl = $this->_privateConfig->external_pingback_server;\n        } else {\n            $owApp     = OntoWiki::getInstance();\n            $serverUrl = $owApp->config->urlBase . 'pingback/ping/';\n        }\n\n        $url = $serverUrl;\n        $response->setHeader('X-Pingback', $url, true);\n    }\n\n    public function onAfterInitController($event)\n    {\n        if ($event->response === null) {\n            return;\n        }\n        $response = $event->response;\n\n        $serverUrl = null;\n        if (isset($this->_privateConfig->external_pingback_server)) {\n            $serverUrl = $this->_privateConfig->external_pingback_server;\n        } else {\n            $owApp     = OntoWiki::getInstance();\n            $serverUrl = $owApp->config->urlBase . 'pingback/ping/';\n        }\n\n        $url = $serverUrl;\n        $response->setHeader('X-Pingback', $url, true);\n    }\n\n    public function onAddStatement($event)\n    {\n        // Check the environement... e.g. Linked Data plugin needs to be enabled.\n        if (!$this->_check()) {\n            return;\n        }\n\n        $s = $event->statement['subject'];\n        $p = $event->statement['predicate'];\n        $o = $event->statement['object'];\n        $this->_checkAndPingback($s, $p, $o);\n    }\n\n    public function onAddMultipleStatements($event)\n    {\n        // Check the environement... e.g. Linked Data plugin needs to be enabled.\n        if (!$this->_check()) {\n            return;\n        }\n        // Parse SPO array.\n        $statements = $event->statements;\n        foreach ($statements as $subject => $predicatesArray) {\n            foreach ($predicatesArray as $predicate => $objectsArray) {\n                foreach ($objectsArray as $object) {\n                    $this->_checkAndPingback($subject, $predicate, $object);\n                }\n            }\n        }\n    }\n\n    public function onDeleteMultipleStatements($event)\n    {\n        // If pingOnDelete is configured, we also ping on statement delete, otherwise we skip.\n        if (!isset($this->_privateConfig->pingOnDelete)\n            || ((boolean)$this->_privateConfig->pingOnDelete === false)\n        ) {\n\n            return;\n        }\n\n        // Check the environement... e.g. Linked Data plugin needs to be enabled.\n        if (!$this->_check()) {\n            return;\n        }\n\n        // Parse SPO array.\n        foreach ($event->statements as $subject => $predicatesArray) {\n            foreach ($predicatesArray as $predicate => $objectsArray) {\n                foreach ($objectsArray as $object) {\n                    $this->_checkAndPingback($subject, $predicate, $object);\n                }\n            }\n        }\n    }\n\n    /*\n     * used on export event to add a statement to the export\n     */\n    public function beforeExportResource($event)\n    {\n        $owApp = OntoWiki::getInstance();\n\n        // this is the event value if there are other plugins before\n        $prevModel = $event->getValue();\n        // throw away non memory model values OR use the given one if valid\n        if (is_object($prevModel) && get_class($prevModel) == 'Erfurt_Rdf_MemoryModel') {\n            $newModel = $prevModel;\n        } else {\n            $newModel = new Erfurt_Rdf_MemoryModel();\n        }\n\n        // prepare the statement URIs\n        $subjectUri  = (string)$event->resource;\n        $propertyUri = 'http://purl.org/net/pingback/to';\n        $objectUri   = $owApp->config->urlBase . 'pingback/ping/';\n\n        $newModel->addRelation(\n            $subjectUri, $propertyUri, $objectUri\n        );\n\n        return $newModel;\n    }\n\n    protected function _check()\n    {\n        // Check, whether linked data plugin is enabled.\n        $owApp         = OntoWiki::getInstance();\n        $pluginManager = $owApp->erfurt->getPluginManager(false);\n        if (!$pluginManager->isPluginEnabled('linkeddata')) {\n            $this->_logInfo('Linked Data plugin disabled, Pingbacks are not allowed.');\n\n            return false;\n        }\n\n        return true;\n    }\n\n    protected function _checkAndPingback($subject, $predicate, $object)\n    {\n        // If at least one ping_properties value is set in config, we only ping for matching predicates.\n        if (isset($this->_privateConfig->ping_properties)) {\n            $props = (array)$this->_privateConfig->ping_properties;\n            if (!in_array($predicate, $props)) {\n                return;\n            }\n        }\n\n        $owApp   = OntoWiki::getInstance();\n        $base    = $owApp->config->urlBase;\n        $baseLen = strlen($base);\n\n        // Object (target) needs to be an external URI\n        if ($object['type'] !== 'uri') {\n            return;\n        } else {\n            $targetUri = $object['value'];\n            $owApp     = OntoWiki::getInstance();\n            $owBase    = $owApp->config->urlBase;\n\n            // Check, whether URI is external.\n            if (substr($targetUri, 0, strlen($owBase)) === $owBase) {\n                return;\n            }\n\n            // Check, whether URI is derefderencable via HTTP.\n            if ((substr($object['value'], 0, 7) !== 'http://') && (substr($object['value'], 0, 8) !== 'https://')) {\n                return;\n            }\n        }\n\n        // Source URI (subject) needs to be a (internal) Linked Data resource\n        if (!$this->_isLinkedDataUri($subject)) {\n            return;\n        }\n\n        // All tests passed... send the pingback.\n        $this->_sendPingback($subject, $object['value']);\n    }\n\n    protected function _discoverPingbackServer($targetUri)\n    {\n        // 1. Retrieve HTTP-Header and check for X-Pingback\n        $headers = self::_get_headers($targetUri);\n        if (!is_array($headers)) {\n            return null;\n        }\n        if (isset($headers['X-Pingback'])) {\n            if (is_array($headers['X-Pingback'])) {\n                $this->_logInfo($headers['X-Pingback'][0]);\n\n                return $headers['X-Pingback'][0];\n            }\n\n            $this->_logInfo($headers['X-Pingback']);\n\n            return $headers['X-Pingback'];\n        }\n\n        // 2. Check for (X)HTML Link element, if target has content type text/html\n        // TODO Fetch only the first X bytes...???\n        $client = Erfurt_App::getInstance()->getHttpClient(\n            $targetUri, array(\n                             'maxredirects' => 0,\n                             'timeout'      => 3\n                        )\n        );\n\n        $response = $client->request();\n        if ($response->getStatus() === 200) {\n            $htmlDoc     = new DOMDocument();\n            $result      = @$htmlDoc->loadHtml($response->getBody());\n            $relElements = $htmlDoc->getElementsByTagName('link');\n\n            foreach ($relElements as $relElem) {\n                $rel = $relElem->getAttribute('rel');\n                if (strtolower($rel) === 'pingback') {\n                    return $relElem->getAttribute('href');\n                }\n            }\n        }\n\n        // 3. Check RDF/XML\n        require_once 'Zend/Http/Client.php';\n        $client = Erfurt_App::getInstance()->getHttpClient(\n            $targetUri, array(\n                             'maxredirects' => 10,\n                             'timeout'      => 3\n                        )\n        );\n        $client->setHeaders('Accept', 'application/rdf+xml');\n\n        $response = $client->request();\n        if ($response->getStatus() === 200) {\n            $rdfString = $response->getBody();\n\n            $parser = Erfurt_Syntax_RdfParser::rdfParserWithFormat('rdfxml');\n            try {\n                $result = $parser->parse($rdfString, Erfurt_Syntax_RdfParser::LOCATOR_DATASTRING);\n            } catch (Exception $e) {\n                $this->_logError($e->getMessage());\n\n                return null;\n            }\n\n            if (isset($result[$targetUri])) {\n                $pArray = $result[$targetUri];\n\n                foreach ($pArray as $p => $oArray) {\n                    if ($p === 'http://purl.org/net/pingback/service') {\n                        return $oArray[0]['value'];\n                    }\n                }\n            }\n        }\n\n        return null;\n    }\n\n    protected function _logError($msg)\n    {\n        if (is_array($msg)) {\n            $this->_log('Pingback Plugin Error - ' . var_export($msg, true));\n        } else {\n            $this->_log('Pingback Plugin Error - ' . $msg);\n        }\n    }\n\n    protected function _logInfo($msg)\n    {\n        if (is_array($msg)) {\n            $this->_log('Pingback Plugin Info - ' . var_export($msg, true));\n        } else {\n            $this->_log('Pingback Plugin Info - ' . $msg);\n        }\n    }\n\n    protected function _sendPingback($sourceUri, $targetUri)\n    {\n        $pingbackServiceUrl = $this->_discoverPingbackServer($targetUri);\n        if ($pingbackServiceUrl === null) {\n            $this->_logInfo('No Pingback server discovered');\n\n            return;\n        }\n\n        $xml = '<?xml version=\"1.0\"?><methodCall><methodName>pingback.ping</methodName><params>' .\n            '<param><value><string>' . $sourceUri . '</string></value></param>' .\n            '<param><value><string>' . $targetUri . '</string></value></param>' .\n            '</params></methodCall>';\n\n        // TODO without curl? with zend?\n        $rq = curl_init();\n        curl_setopt($rq, CURLOPT_URL, $pingbackServiceUrl);\n        curl_setopt($rq, CURLOPT_POST, 1);\n        curl_setopt($rq, CURLOPT_POSTFIELDS, $xml);\n        curl_setopt($rq, CURLOPT_FOLLOWLOCATION, false);\n        curl_setopt($rq, CURLOPT_RETURNTRANSFER, true);\n        $synchronous = false;\n        if (!$synchronous) { //a timeout of one ms is like ignoring the http response -> asynchonous\n            curl_setopt($rq, CURLOPT_TIMEOUT, 1);\n            $this->_logInfo(\n                'Now sending Pingback (not waiting for response) - ' . $sourceUri . ', ' . $targetUri\n            );\n        }\n        $res = curl_exec($rq);\n        if ($synchronous) {\n            $this->_logInfo('Pingback Result for (' . $pingbackServiceUrl . ', ' . $xml . ') - ' . $res);\n        }\n        curl_close($rq);\n\n        return true;\n    }\n\n    private function _isLinkedDataUri($uri)\n    {\n        $event      = new Erfurt_Event('onNeedsLinkedDataUri');\n        $event->uri = $uri;\n\n        $result = (bool)$event->trigger();\n\n        return $result;\n    }\n\n    private function _log($msg)\n    {\n        $logger = OntoWiki::getInstance()->getCustomLogger('pingback_plugin');\n        $logger->debug($msg);\n    }\n\n    /**\n     * This method provides and alternative to PHP's get_headers method, which has no timeout.\n     * It is inspired by: http://snipplr.com/view/61985/\n     */\n    private static function _get_headers($url)\n    {\n        $connection = curl_init();\n\n        $options = array(\n            CURLOPT_URL             => $url,\n            CURLOPT_NOBODY          => true,\n            CURLOPT_HEADER          => true,\n            CURLOPT_TIMEOUT         => 10,\n            CURLOPT_RETURNTRANSFER  => true\n        );\n\n        curl_setopt_array($connection, $options);\n        $result = curl_exec($connection);\n        curl_close($connection);\n\n        if ($result !== false) {\n            $resultArray = explode(\"\\n\", $result);\n\n            $header = array();\n            foreach ($resultArray as $headerLine) {\n                $match = preg_match('#(.*?)\\:\\s(.*)#', $headerLine, $part);\n                if ($match) {\n                    $header[$part[1]] = trim($part[2]);\n                }\n            }\n\n            return $header;\n        } else {\n            return false;\n        }\n    }\n\n}\n"
  },
  {
    "path": "extensions/pingback/default.ini",
    "content": ";;\n; Basic component configuration\n;;\ntemplates  = \"templates\"\n;languages  = \"languages\"\nenabled    = false\nname       = \"Pingback Server\"\ndescription = \"provides a Semantic Pingback Server and pingback enables all linked data resources\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\n[events]\n1 = onBeforeLinkedDataRedirect\n2 = onAfterInitController\n3 = onAddStatement\n4 = onAddMultipleStatements\n5 = onDeleteMultipleStatements\n6 = beforeExportResource\n\n[private]\n; model to write pingbacks\n;pingback_model = \"http://example.org/GR/\"\n;external_pingback_server = \"http://pingback.aksw.org/\"\ngenericRelation = \"http://rdfs.org/sioc/ns#links_to\"\n\nrdfa.enabled = yes\nrdfa.service = \"http://www.w3.org/2007/08/pyRdfa/extract?format=pretty-xml&warnings=false&parser=lax&space-preserve=true&uri=\"\n\ntitleProperties[] = \"http://purl.org/dc/elements/1.1/title\"\ntitleProperties[] = \"http://purl.org/dc/terms/title\"\ntitleProperties[] = \"http://xmlns.com/foaf/0.1/name\"\ntitleProperties[] = \"http://usefulinc.com/ns/doap#name\"\ntitleProperties[] = \"http://rdfs.org/sioc/ns#name\"\ntitleProperties[] = \"http://www.w3.org/2000/01/rdf-schema#label\"\ntitleProperties[] = \"http://xmlns.com/foaf/0.1/nick\"\ntitleProperties[] = \"http://xmlns.com/foaf/0.1/surname\"\n\n; If at least one pingProperties value is set not all new statements are pinged, but only those\n; with a property that fits the value here. If none those is set, all new statements are pinged.\npingProperties[] = \"http://xmlns.com/foaf/0.1/knows\"\n\n; Also ping, when a statement was removed? If not set, this will default to false\npingOnDelete = false\n"
  },
  {
    "path": "extensions/pingback/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/pingback/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :pingback .\n:pingback a doap:Project ;\n  doap:name \"pingback\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/pingback/raw/master/doap.n3#> ;\n  owconfig:templates \"templates\" ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  rdfs:label \"Pingback Server\" ;\n  doap:description \"provides a Semantic Pingback Server and pingback enables all linked data resources\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:pluginEvent event:onBeforeLinkedDataRedirect ;\n  owconfig:pluginEvent event:onAfterInitController ;\n  owconfig:pluginEvent event:onAddStatement ;\n  owconfig:pluginEvent event:onAddMultipleStatements ;\n  owconfig:pluginEvent event:onDeleteMultipleStatements ;\n  owconfig:pluginEvent event:beforeExportResource ;\n  :genericRelation <http://rdfs.org/sioc/ns#links_to> ;\n  owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"rdfa\";\n      owconfig:enabled \"true\"^^xsd:boolean ;\n      :service <http://www.w3.org/2007/08/pyRdfa/extract?format=pretty-xml&warnings=false&parser=lax&space-preserve=true&uri=>\n];\n :titleroperties <http://purl.org/dc/elements/1.1/title> ;\n  :titleProperties <http://purl.org/dc/terms/title> ;\n  :titleProperties <http://xmlns.com/foaf/0.1/name> ;\n  :titleProperties <http://usefulinc.com/ns/doap#name> ;\n  :titleProperties <http://rdfs.org/sioc/ns#name> ;\n  :titleProperties <http://www.w3.org/2000/01/rdf-schema#label> ;\n  :titleProperties <http://xmlns.com/foaf/0.1/nick> ;\n  :titleProperties <http://xmlns.com/foaf/0.1/surname> ;\n  :pingProperties <http://xmlns.com/foaf/0.1/knows> ;\n  :pingOnDelete \"false\"^^xsd:boolean .\n:pingback doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/pingback/templates/pingback/ping.phtml",
    "content": ""
  },
  {
    "path": "extensions/queries/QueriesController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Controller for OntoWiki Filter Module\n *\n * @category   OntoWiki\n * @package    Extensions_Queries\n * @copyright  Copyright (c) 2013, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass QueriesController extends OntoWiki_Controller_Component\n{\n    protected $_userUri;\n    protected $_userName;\n    protected $_userDbUri;\n\n    public $prefixHandler;\n\n    /**\n     * init() Method to init() normal and add tabbed Navigation\n     */\n    public function init()\n    {\n        parent::init();\n\n        // setup the navigation\n        OntoWiki::getInstance()->getNavigation()->reset();\n        $tabExist = false;\n        $ow = OntoWiki::getInstance();\n\n        if ($this->_privateConfig->general->enabled->saving) {\n            OntoWiki::getInstance()->getNavigation()->register(\n                'listquery',\n                array(\n                    'controller' => 'queries',\n                    'action' => 'listquery',\n                    'name' => 'Saved Queries',\n                    'position' => 0,\n                    'active' => true\n                )\n            );\n            $this->view->headScript()->appendFile(\n                $ow->extensionManager->getComponentUrl('queries').'resources/savepartial.js'\n            );\n            $tabExist = true;\n        }\n        if ($this->_privateConfig->general->enabled->editor) {\n            OntoWiki::getInstance()->getNavigation()->register(\n                'queryeditor',\n                array(\n                    'controller' => 'queries',\n                    'action' => 'editor',\n                    'name' => 'Query Editor',\n                    'position' => 1,\n                    'active' => false\n                )\n            );\n            $tabExist = true;\n        }\n\n        if ($this->_privateConfig->general->enabled->builder) {\n            OntoWiki::getInstance()->getNavigation()->register(\n                'savedqueries',\n                array(\n                    'controller' => 'queries',\n                    'action' => 'manage',\n                    'name' => 'Query Builder ',\n                    'position' => 2,\n                    'active' => false\n                )\n            );\n            $tabExist = true;\n        }\n\n        if (!$tabExist) {\n            OntoWiki::getInstance()->getNavigation()->disableNavigation();\n        }\n\n        $user = $this->_erfurt->getAuth()->getIdentity();\n        $this->_userUri = $user->getUri();\n        $this->_userName = $user->getUsername();\n        $this->_userDbUri = $this->_privateConfig->saving->baseQueryDbUri . 'user-' . $this->_userName . '/';\n    }\n\n    public function editorAction()\n    {\n        if ($this->_owApp->selectedModel === null) {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message($this->view->_('No model selected.'), OntoWiki_Message::ERROR)\n            );\n            $this->view->errorFlag = true;\n            return;\n        }\n\n        $this->view->headLink()->appendStylesheet(\n            $this->_owApp->extensionManager->getComponentUrl('queries').'resources/querieseditor.css'\n        );\n        $this->view->placeholder('main.window.title')->set('SPARQL Query Editor');\n        $this->view->formActionUrl = $this->_config->urlBase . 'queries/editor';\n        $this->view->formMethod = 'post';\n        $this->view->formName = 'sparqlquery';\n        $this->view->query = $this->_request->getParam('query', '');\n\n        $this->view->urlBase = $this->_config->urlBase;\n        $this->view->writeable = $this->_owApp->selectedModel->isEditable();\n\n        // set URIs\n        if ($this->_owApp->selectedModel) {\n            $this->view->modelUri = $this->_owApp->selectedModel->getModelIri();\n        }\n        if ($this->_owApp->selectedResource) {\n            $this->view->resourceUri = $this->_owApp->selectedResource;\n        }\n\n        // build toolbar\n        $toolbar = $this->_owApp->toolbar;\n        $toolbar->appendButton(\n            OntoWiki_Toolbar::SUBMIT,\n            array(\n                'name' => 'Submit Query'\n            )\n        )->appendButton(\n            OntoWiki_Toolbar::RESET,\n            array(\n                'name' => 'Reset Form'\n            )\n        );\n        $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n        // build menu\n        if ($this->_owApp->selectedModel) {\n            $insertMenu = new OntoWiki_Menu();\n            $insertMenu->setEntry('Current Model URI', 'javascript:insertModelUri()');\n\n            if ($this->_owApp->selectedResource) {\n                $insertMenu->setEntry('Current Resource URI', 'javascript:insertResourceUri()');\n            }\n        }\n\n        $helpMenu = new OntoWiki_Menu();\n        $helpMenu\n            ->setEntry(\n                'Specification',\n                'http://www.w3.org/TR/rdf-sparql-query/'\n            )\n            ->setEntry(\n                'Reference Card',\n                'http://www.dajobe.org/2005/04-sparql/'\n            )\n            ->setEntry(\n                'Tutorial',\n                'http://platon.escet.urjc.es/%7Eaxel/sparqltutorial/'\n            );\n\n        $menu = new OntoWiki_Menu();\n        if (isset($insertMenu)) {\n            $menu->setEntry('Insert', $insertMenu);\n        }\n        $menu->setEntry('Help', $helpMenu);\n        $this->view->placeholder('main.window.menu')->set($menu->toArray());\n\n        $prefixes = $this->_owApp->selectedModel->getNamespacePrefixes();\n\n        if (isset($this->_request->queryUri)) {\n            $query = $this->getQuery($this->_request->queryUri);\n        }\n        if (empty($query)) {\n            $query = $this->getParam('query');\n        }\n\n        $format = $this->_request->getParam('result_format', 'plain');\n\n        if (!empty($query)) {\n            //handle a posted query\n            $store = $this->_erfurt->getStore();\n\n            foreach ($prefixes as $prefix => $namespace) {\n                $prefixString = 'PREFIX ' . $prefix . ': <' . $namespace . '>';\n                // only add prefix if it's not there yet\n                if (strpos($query, $prefixString) === false) {\n                    $query = $prefixString . PHP_EOL . $query;\n                }\n            }\n\n            if ($format == 'list') {\n                $url = new OntoWiki_Url(array('controller' => 'list'), array());\n                $query = str_replace(\"\\r\\n\", ' ', $query);\n                $url .= '?init=1&instancesconfig=' .\n                    urlencode(\n                        json_encode(\n                            array(\n                                'filter' => array(\n                                    array(\n                                        'mode' => 'query',\n                                        'action' => 'add',\n                                        'query' => $query\n                                    )\n                                )\n                            )\n                        )\n                    );\n\n                //redirect\n                $this->_redirect($url);\n                return;\n            }\n\n            if (stristr($query, 'select') && !stristr($query, 'limit')) {\n                $query .= PHP_EOL . 'LIMIT 20';\n            }\n\n            $this->view->query = $query;\n\n            $result = null;\n            try {\n                $start = microtime(true);\n\n                //this switch is for the target selection module\n                if ($this->_request->getParam('target') == 'all') {\n                    //query all models\n                    $result = $store->sparqlQuery(\n                        $query,\n                        array(\n                            'result_format' => $format\n                        )\n                    );\n                } else {\n                    //query selected model\n                    $result = $this->_owApp->selectedModel->sparqlQuery(\n                        $query,\n                        array(\n                            'result_format' => $format\n                        )\n                    );\n                }\n\n                //this is for the \"output to file option\n                if (($format == 'json' || $format == 'xml' || $format == 'csv')\n                    && ($this->_request->getParam('result_outputfile') == 'true')\n                ) {\n                    $this->_helper->viewRenderer->setNoRender();\n                    $this->_helper->layout()->disableLayout();\n                    $response = $this->getResponse();\n\n                    switch ($format) {\n                        case 'xml':\n                            $contentType = 'application/rdf+xml';\n                            $filename = 'query-result.xml';\n                            break;\n                        case 'json':\n                            $contentType = 'application/json';\n                            $filename = 'query-result.json';\n                            break;\n                        case 'csv':\n                            $contentType = 'text/csv';\n                            $filename = 'query-result.csv';\n                            break;\n                    }\n\n                    $response->setHeader('Content-Type', $contentType, true);\n                    $response->setHeader('Content-Disposition', ('filename=\"' . $filename . '\"'));\n\n                    $response->setBody($result);\n                    return;\n                }\n\n                $this->view->time = ((microtime(true) - $start) * 1000);\n\n                $header = array();\n                if (is_array($result) && isset($result[0]) && is_array($result[0])) {\n                    $header = array_keys($result[0]);\n                } else if (is_bool($result)) {\n                    $result = $result ? 'yes' : 'no';\n                } else if (is_int($result)) {\n                    $result = (string)$result;\n                } else if (is_string($result)) {\n                    // json\n                    $result = $result;\n                } else {\n                    $result = 'no result';\n                }\n            } catch (Exception $e) {\n                $this->view->error = $e->getMessage();\n                $header = '';\n                $result = '';\n                $this->view->time = 0;\n            }\n\n            $this->view->data = $result;\n            $this->view->header = $header;\n        }\n\n        //load js for sparql syntax highlighting\n        $this->view->headLink()->appendStylesheet(\n            $this->_componentUrlBase . 'resources/codemirror/lib/codemirror.css'\n        );\n        $this->view->headScript()->appendFile(\n            $this->_componentUrlBase . 'resources/codemirror/lib/codemirror.js'\n        );\n        $this->view->headScript()->appendFile(\n            $this->_componentUrlBase . 'resources/codemirror/addon/edit/matchbrackets.js'\n        );\n        $this->view->headScript()->appendFile(\n            $this->_componentUrlBase . 'resources/codemirror/mode/sparql/sparql.js'\n        );\n\n        $this->view->headStyle()->appendStyle(\n            '.CodeMirror { border: 1px solid black; }'\n        );\n\n        $this->view->headScript()->appendScript(\n            'var editor;\n            $(document).ready(\n                function(){\n                    editor = CodeMirror.fromTextArea(\n                        document.getElementById(\"inputfield\"),\n                        {\n                            mode: \"application/x-sparql-query\",\n                            tabMode: \"indent\",\n                            matchBrackets: true,\n                        }\n                    );\n                    $(\".CodeMirror\").resizable({\n                        resize: function() {\n                            editor.setSize($(this).width(), $(this).height());\n                        }\n                    });\n                }\n            );'\n        );\n\n        //fill in some placeholders\n        $this->view->prefixes = $prefixes;\n        $this->view->placeholder('sparql.result.format')->set($format);\n        $this->view->placeholder('sparql.query.target')->set($this->_request->getParam('target', 'this'));\n\n        //load modules\n        $this->addModuleContext('main.window.queryeditor');\n        if ($this->_privateConfig->general->enabled->saving) {\n            $this->addModuleContext('main.window.savequery');\n        }\n    }\n\n    /**\n     * Action that will show existing saved Queries\n     */\n    public function listqueryAction()\n    {\n        if ($this->_owApp->selectedModel === null) {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message($this->view->_('No model selected.'), OntoWiki_Message::ERROR)\n            );\n            $this->view->errorFlag = true;\n            return;\n        }\n\n        // set the active tab navigation\n        OntoWiki::getInstance()->getNavigation()->setActive('listquery');\n\n        $store = $this->_owApp->erfurt->getStore();\n        $graph = $this->_owApp->selectedModel;\n\n        //Loading data for list of saved queries\n        $listHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('List');\n        $listName = 'queries';\n        if ($listHelper->listExists($listName)) {\n            $list = $listHelper->getList($listName);\n            $list->setStore($store);\n            $listHelper->addList($listName, $list, $this->view, 'list_queries_main');\n        } else {\n            $list = new OntoWiki_Model_Instances($store, $graph, array());\n\n            $list->addTypeFilter($this->_privateConfig->saving->ClassUri, 'searchqueries');\n\n            $list->addShownProperty($this->_privateConfig->saving->ModelUri, 'modelUri', false, null, true);\n            $list->addShownProperty($this->_privateConfig->saving->JsonUri, 'json', false, null, true);\n            $list->addShownProperty($this->_privateConfig->saving->NameUri, 'name', false, null, false);\n            $list->addShownProperty($this->_privateConfig->saving->QueryUri, 'query', false, null, true);\n            $list->addShownProperty($this->_privateConfig->saving->GeneratorUri, 'generator', false, null, true);\n            $list->addShownProperty($this->_privateConfig->saving->NumViewsUri, 'numViews', false, null, false);\n            $list->addShownProperty($this->_privateConfig->saving->CreatorUri, 'creator', false, null, false);\n\n            $listHelper->addListPermanently($listName, $list, $this->view, 'list_queries_main');\n        }\n        $this->view->placeholder('main.window.title')->set($this->_owApp->translate->_('Saved Queries'));\n    }\n\n    /**\n     * webservice to save a query\n     */\n    public function savequeryAction()\n    {\n        $this->_helper->layout()->disableLayout();\n\n        $response = $this->getResponse();\n        $response->setHeader('Content-Type', 'text/plain');\n\n        $store = $this->_erfurt->getStore();\n        $storeGraph = $this->_owApp->selectedModel;\n        $graphUri = (string)$this->_owApp->selectedModel;\n\n        $res = \"json or desc missing\";\n        // checking for post data to save queries\n        $params = $this->_request->getParams();\n        if (isset($params['json']) && isset($params['json'])) {\n            if ($this->_request->getParam('share') == \"true\") {\n                // store in the model itself - everybody can see it\n                $storeGraph = $this->_owApp->selectedModel;\n            } else {\n                //private db - should be configured so only the user can see it\n                $storeGraph = $this->getUserQueryDB();\n            }\n\n            // checking whether any queries exist yet in this store\n            $existingQueriesQuery = Erfurt_Sparql_SimpleQuery::initWithString(\n                'SELECT *\n                 WHERE {\n                    ?query <'.EF_RDF_TYPE.'> <'.\n                OntoWiki_Utils::expandNamespace(\n                    $this->_privateConfig->saving->ClassUri\n                ).\n                '> .\n                 }'\n            );\n            $existingQueries = $storeGraph->sparqlQuery($existingQueriesQuery);\n            if (empty($existingQueries)) {\n                //this is the first query\n                $this->insertInitials($storeGraph);\n            }\n            $hash = md5($this->_request->getParam('json') . $this->_request->getParam('query'));\n            $name = (string)$storeGraph . '#Query-' . $hash;\n\n            // checking whether a query with same content (Where-Part) already exists (check by md5 sum)\n            $existingDataQuery = Erfurt_Sparql_SimpleQuery::initWithString(\n                'SELECT *\n                 WHERE {\n                     <'.$name.'> a <'.OntoWiki_Utils::expandNamespace($this->_privateConfig->saving->ClassUri) . '>\n                 }'\n            );\n\n            $existingData = $storeGraph->sparqlQuery($existingDataQuery);\n\n            if (empty($existingData)) {\n                //such a query is not saved yet - lets save it\n\n                $storeGraph->addStatement(\n                    $name,\n                    EF_RDF_TYPE,\n                    array(\n                        'value' => $this->_privateConfig->saving->ClassUri,\n                        'type' => 'uri'\n                    ),\n                    false\n                );\n                $storeGraph->addStatement(\n                    $name,\n                    $this->_privateConfig->saving->ModelUri,\n                    array(\n                        'value' => (string)$this->_owApp->selectedModel,\n                        'type' => 'uri'\n                    ),\n                    false\n                );\n                $storeGraph->addStatement(\n                    $name,\n                    $this->_privateConfig->saving->NameUri,\n                    array(\n                        'value' => $this->_request->getParam('name'),\n                        'type' => 'literal'\n                    ),\n                    false\n                );\n                $storeGraph->addStatement(\n                    $name,\n                    $this->_privateConfig->saving->DateUri,\n                    array(\n                        'value' => (string)date('c'),\n                        'type' => 'literal',\n                        'datatype' => OntoWiki_Utils::expandNamespace('xsd:dateTime')\n                    ),\n                    false\n                );\n                $storeGraph->addStatement(\n                    $name,\n                    OntoWiki_Utils::expandNamespace($this->_privateConfig->saving->NumViewsUri),\n                    array(\n                        'value' => '1',\n                        'type' => 'literal',\n                        'datatype' => OntoWiki_Utils::expandNamespace('xsd:integer')\n                    ),\n                    false\n                );\n                if ($this->_request->getParam('generator') == \"gqb\" || $this->_request->getParam('generator') == \"qb\") {\n                    $storeGraph->addStatement(\n                        $name,\n                        $this->_privateConfig->saving->JsonUri,\n                        array(\n                            'value' => $this->_request->getParam('json'),\n                            'type' => 'literal'\n                        ),\n                        false\n                    );\n                }\n                $storeGraph->addStatement(\n                    $name, $this->_privateConfig->saving->QueryUri,\n                    array(\n                        'value' => $this->_request->getParam('query'),\n                        'type' => 'literal'\n                    ),\n                    false\n                );\n                $storeGraph->addStatement(\n                    $name,\n                    $this->_privateConfig->saving->GeneratorUri,\n                    array(\n                        'value' => $this->_request->getParam('generator'),\n                        'type' => 'literal'\n                    ),\n                    false\n                );\n                if ($this->_request->getParam('generator') == \"gqb\") {\n                    $storeGraph->addStatement(\n                        $name,\n                        $this->_privateConfig->saving->IdUri,\n                        array(\n                            'value' => $this->_request->getParam('id'),\n                            'type' => 'literal'\n                        ),\n                        false\n                    );\n                    $storeGraph->addStatement(\n                        $name,\n                        $this->_privateConfig->saving->SelClassUri,\n                        array(\n                            'value' => $this->_request->getParam('type'),\n                            'type' => 'uri'\n                        ),\n                        false\n                    );\n                    $storeGraph->addStatement(\n                        $name,\n                        $this->_privateConfig->saving->SelClassLabelUri,\n                        array(\n                            'value' => $this->_request->getParam('typelabel'),\n                            'type' => 'literal'\n                        ),\n                        false\n                    );\n                } else {\n                    //TODO gqb uses id - qb not... needed?\n                    $storeGraph->addStatement(\n                        $name,\n                        $this->_privateConfig->saving->IdUri,\n                        array(\n                            'value' => $hash,\n                            'type' => 'literal'\n                        ),\n                        false\n                    );\n                }\n                $user = $this->_erfurt->getAuth()->getIdentity();\n                $userUri = $user->getUri();\n\n                $storeGraph->addStatement(\n                    $name,\n                    $this->_privateConfig->saving->CreatorUri,\n                    array(\n                        'value' => $userUri,\n                        'type' => 'uri'\n                    ),\n                    false\n                );\n\n                $res = 'All OK';\n            } else {\n                $res = 'Save failed. (Query with same pattern exists)';\n            }\n        }\n        $response->setBody($res);\n    }\n\n    /**\n     * delete a saved query by uri\n     */\n    public function deleteAction()\n    {\n        $store = OntoWiki::getInstance()->erfurt->getStore();\n\n        $response = $this->getResponse();\n        $response->setHeader('Content-Type', 'text/plain');\n\n        // fetch param\n        $uriString = $this->_request->getParam('uri', '');\n\n        if (get_magic_quotes_gpc()) {\n            $uriString = stripslashes($uriString);\n        }\n\n        $res = 'All OK';\n        if (!empty($uriString)) {\n            try {\n                //find the db\n                $userdb = $this->getUserQueryDB(false);\n\n                //TODO pass the \"where it is\" as param\n                //delete from private\n                if ($userdb != null) {\n                    $userdb->deleteMatchingStatements($uriString, null, null);\n                }\n                //delete from shared\n                $this->_owApp->selectedModel->deleteMatchingStatements($uriString, null, null);\n            } catch (Exception $e) {\n                $res = $e;\n            }\n        } else {\n            $res = 'need to pass uri';\n        }\n\n        $response->setBody($res);\n    }\n\n    private function getUserQueryDB($create = true)\n    {\n        $userdb = $this->findDB($this->_userDbUri);\n        if ($userdb != null || !$create) {\n            return $userdb;\n        } else {\n            return $this->createUserQueryDB();\n        }\n    }\n\n    /**\n     * find db by name\n     *\n     * @param string name of searched db\n     * @return Model-Object\n     */\n    private function findDB($name)\n    {\n        $_store = $this->_erfurt->getStore();\n\n        //get all Models (including hidden Models)\n        $allModels = $_store->getAvailableModels(true);\n\n        foreach ($allModels as $graphUri => $true) {\n            if ($graphUri === $name) {\n                //get the model (without authentification)\n                return $_store->getModel($graphUri, false);\n            }\n        }\n\n        return null;\n    }\n\n    /**\n     * set up db for query saving\n     * @param <type> $db\n     */\n    private function insertInitials($db)\n    {\n        //add the \"Pattern\" Class\n        $object['value'] = EF_RDFS_CLASS;\n        $object['type'] = 'uri';\n        $db->addStatement($this->_privateConfig->saving->ClassUri, EF_RDF_TYPE, $object);\n\n        //domain for the class\n        $object['value'] = $db->getModelIri();\n        $object['type'] = 'uri';\n        $db->addStatement(\n            $this->_privateConfig->saving->ClassUri,\n            'http://www.w3.org/2000/01/rdf-schema#domain',\n            $object\n        );\n\n        //label for the class\n        $object['value'] = 'Query';\n        $object['type'] = 'literal';\n        $db->addStatement(\n            $this->_privateConfig->saving->ClassUri,\n            'http://www.w3.org/2000/01/rdf-schema#label',\n            $object\n        );\n    }\n\n    private function createUserQueryDB()\n    {\n        $proposedDBname = $this->_userDbUri;\n\n        $store = $this->_erfurt->getStore();\n        $newModel = $store->getNewModel($proposedDBname);\n\n        $object = array();\n\n        // add english label for this db\n        $object['object_type'] = Erfurt_Store::TYPE_LITERAL;\n        $object['value'] = 'GQB Query DB of ' . $this->_userName;\n        $newModel->addStatement($proposedDBname, EF_RDFS_LABEL, $object);\n\n        // german label\n        $object['literal_language'] = 'de';\n        $object['value'] = 'GQB Anfrage-DB von ' . $this->_userName;\n        $newModel->addStatement($proposedDBname, EF_RDFS_LABEL, $object);\n\n        // add description of this db\n        $object['value'] = 'Hier werden Sparql-Queries gespeichert, die User ' .\n                $this->_userName . ' erstellt und gespeichert hat.';\n        $newModel->addStatement($proposedDBname, EF_RDFS_COMMENT, $object);\n\n        //domain of this db (needed?)\n        $object['value'] = $this->_privateConfig->saving->baseQueryDbUri;\n        $object['object_type'] = Erfurt_Store::TYPE_IRI;\n        $newModel->addStatement($proposedDBname, EF_RDFS_DOMAIN, $object);\n\n        //add owner/maker of this db\n        $object['value'] = $this->_userUri;\n        $newModel->addStatement(\n            $proposedDBname,\n            $this->_privateConfig->saving->CreatorUri,\n            $object\n        );\n\n        $this->insertInitials($newModel);\n\n        return $newModel;\n    }\n\n    protected function getQuery($uri)\n    {\n        $queryString = 'SELECT *\n             WHERE {\n               <'.$uri.'> <'.$this->_privateConfig->saving->QueryUri.'> ?query\n             }';\n        $queryData = $this->_erfurt->getStore()->sparqlQuery($queryString);\n        if (isset($queryData[0])) {\n            //increment view counter\n            $countQuery = 'SELECT *\n             WHERE {\n              <'.$uri.'> <'.$this->_privateConfig->saving->NumViewsUri.'> ?count\n             }';\n            $countRes = $this->_erfurt->getStore()->sparqlQuery($countQuery);\n            if (isset($countRes[0])) {\n                $i = $countRes[0]['count'];\n                $graphUri = (string)$this->_owApp->selectedModel;\n                $this->_erfurt->getStore()->deleteMatchingStatements(\n                    $graphUri,\n                    $uri,\n                    $this->_privateConfig->saving->NumViewsUri,\n                    null\n                );\n                $this->_erfurt->getStore()->addStatement(\n                    $graphUri,\n                    $uri,\n                    $this->_privateConfig->saving->NumViewsUri,\n                    array(\n                         'value' => $i + 1,\n                         'type' => 'literal'\n                    )\n                );\n            }\n            return $queryData[0]['query'];\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/queries/QueriesHelper.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * @category   OntoWiki\n * @package    Extensions_Queries\n */\nclass QueriesHelper extends OntoWiki_Component_Helper\n{\n    public function __construct()\n    {\n        $owApp = OntoWiki::getInstance();\n\n        // if a model has been selected\n        if ($owApp->selectedModel) {\n            // register with extras menu\n            $translate  = $owApp->translate;\n            $url        = new OntoWiki_Url(array('controller' => 'queries', 'action' => 'editor'));\n            $extrasMenu = OntoWiki_Menu_Registry::getInstance()->getMenu('application')->getSubMenu('Extras');\n            $extrasMenu->setEntry($translate->_('Queries'), (string)$url);\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/queries/SavequeryModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Module.php';\n\n/**\n * OntoWiki module – save query button\n *\n * @category   OntoWiki\n * @package    Extensions_Queries\n * @author     Jonas Brekle <jonas.brekle@gmail.com>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass SavequeryModule extends OntoWiki_Module\n{\n    public function getContents()\n    {\n        return $this->render('savequery');\n    }\n\n    public function getTitle()\n    {\n        return \"Save Query\";\n    }\n}\n\n\n"
  },
  {
    "path": "extensions/queries/default.ini",
    "content": "enabled     = true\nname        = \"SPARQL Query\"\ndescription = \"allows to execute and manage SPARQL queries.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\ntemplates  = \"templates\"\nlanguages  = \"languages/\"\naction     = \"display\"\ncaching    = no\n\nmodules.sparqloptions.contexts.0 = \"main.window.queryeditor\"\nmodules.sparqloptions.priority = 5\nmodules.queryeditorfromsetter.contexts.0 = \"main.window.queryeditor\"\nmodules.queryeditorfromsetter.priority = 6\nmodules.savequery.contexts.0 = \"main.window.savequery\"\nmodules.savequery.priority = 7\n\n\n[private]\ngeneral.enabled.saving = true\ngeneral.enabled.editor = true\ngeneral.enabled.gqb = false\ngeneral.enabled.builder = false\n\nsaving.baseQueryDbUri = \"http://ns.ontowiki.net/SysOnt/UserQueries/\";\nsaving.ClassUri = \"http://ns.ontowiki.net/SysOnt/SparqlQuery\";\nsaving.NameUri = \"http://purl.org/dc/elements/1.1/title\";\nsaving.DateUri = \"http://purl.org/dc/elements/1.1/created\";\nsaving.DescriptionUri = \"http://purl.org/dc/elements/1.1/description\";\nsaving.ModelUri = \"http://ns.ontowiki.net/SysOnt/Model\";\nsaving.IdUri = \"http://rdfs.org/sioc/ns#id\";\nsaving.NumViewsUri = \"http://rdfs.org/sioc/ns#num_views\";\nsaving.CreatorUri = \"http://rdfs.org/sioc/ns#has_creator\";\nsaving.GeneratorUri = \"http://ns.ontowiki.net/SysOnt/generator\"; // which query builder created this query. is there a better namespace?\nsaving.QueryUri = \"http://ns.ontowiki.net/SysOnt/sparql_code\"; // the actual content. is there a better namespace?\nsaving.JsonUri = \"http://ns.ontowiki.net/SysOnt/json_code\"; // the actual content for gqb. is there a better namespace?\n\ngqb.SelClassUri = \"http://ns.ontowiki.net/GQB/UserQueries/Pattern/Type\";\ngqb.SelClassLabelUri = \"http://ns.ontowiki.net/GQB/UserQueries/Pattern/TypeLabel\";\n"
  },
  {
    "path": "extensions/queries/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/queries/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :queries .\n:queries a doap:Project ;\n  doap:name \"queries\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/queries/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"SPARQL Query\" ;\n  doap:description \"allows to execute and manage SPARQL queries.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:templates \"templates\" ;\n  owconfig:languages \"languages/\" ;\n  owconfig:defaultAction \"display\" ;\n  owconfig:hasModule :Default .\n:Default a owconfig:Module ;\n  rdfs:label \"Default\" ;\n  owconfig:caching \"false\"^^xsd:boolean .\n:queries owconfig:hasModule :Savequery .\n:Savequery a owconfig:Module ;\n  rdfs:label \"Savequery\" ;\n  owconfig:context \"main.window.savequery\" ;\n  owconfig:priority \"7\" .\n:queries owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"general\";\n      owconfig:config [\n          a owconfig:Config;\n          owconfig:id \"enabled\";\n          :saving \"true\"^^xsd:boolean ;\n          :editor \"true\"^^xsd:boolean ;\n          :gqb \"false\"^^xsd:boolean ;\n          :builder \"false\"^^xsd:boolean\n    ]\n];\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"saving\";\n      :baseQueryDbUri <http://ns.ontowiki.net/SysOnt/UserQueries/> ;\n      :ClassUri <http://ns.ontowiki.net/SysOnt/SparqlQuery> ;\n      :NameUri <http://purl.org/dc/elements/1.1/title> ;\n      :DateUri <http://purl.org/dc/elements/1.1/created> ;\n      :DescriptionUri <http://purl.org/dc/elements/1.1/description> ;\n      :ModelUri <http://ns.ontowiki.net/SysOnt/Model> ;\n      :IdUri <http://rdfs.org/sioc/ns#id> ;\n      :NumViewsUri <http://rdfs.org/sioc/ns#num_views> ;\n      :CreatorUri <http://rdfs.org/sioc/ns#has_creator> ;\n      :GeneratorUri <http://ns.ontowiki.net/SysOnt/generator> ;\n      :QueryUri <http://ns.ontowiki.net/SysOnt/sparql_code> ;\n      :JsonUri <http://ns.ontowiki.net/SysOnt/json_code>\n];\n owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"gqb\";\n      :SelClassUri <http://ns.ontowiki.net/GQB/UserQueries/Pattern/Type> ;\n      :SelClassLabelUri <http://ns.ontowiki.net/GQB/UserQueries/Pattern/TypeLabel>\n] .\n:queries doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/queries/log/getAutocompletionQuery.log",
    "content": "SELECT ?suggest  count(?suggest) as ?count WHERE {\n\t?what ?pred ?suggest . \n \tFILTER \n((((?suggest LIKE 'http://dbpedia.org/resource/[T|t]e%' ) || \n(?suggest LIKE '[T|t]e%' )\n))\n) .\n} LIMIT 10\n\n"
  },
  {
    "path": "extensions/queries/log/getSPARQLQuery.log",
    "content": "SELECT ?what ?pred WHERE { \n\t?what ?pred ?tmpobjvar0 . \n\tFILTER \n((((str(?tmpobjvar0) =  \"te\") || \n(str(?tmpobjvar0) =  \"http://dbpedia.org/resource/te\")\n))\n) .\n } LIMIT 10\n\n"
  },
  {
    "path": "extensions/queries/log/updateTable.log",
    "content": "{\\\"0\\\":{\\\"s\\\":\\\"?what\\\",\\\"p\\\":\\\"?pred\\\",\\\"o\\\":\\\"\\\",\\\"lang\\\":\\\"\\\"},\\\"1\\\":{\\\"s\\\":\\\"?what\\\",\\\"p\\\":\\\"?pred\\\",\\\"o\\\":\\\"?newObject\\\",\\\"otype\\\":\\\"\\\",\\\"lang\\\":\\\"\\\",\\\"datatype\\\":\\\"\\\"}}\n\nSELECT ?what ?pred ?newObject WHERE { \n\t?what ?pred ?tmpobjvar0 . \n\t?what ?pred ?newObject . \n\tFILTER \n((((str(?tmpobjvar0) =  \"\") || \n(str(?tmpobjvar0) =  \"http://dbpedia.org/resource/\")\n))\n) .\n } LIMIT 10\n\nArray\n(\n    [head] => Array\n        (\n            [link] => Array\n                (\n                )\n\n            [vars] => Array\n                (\n                    [0] => what\n                    [1] => pred\n                    [2] => newObject\n                )\n\n        )\n\n    [results] => Array\n        (\n            [distinct] => \n            [ordered] => 1\n            [bindings] => Array\n                (\n                )\n\n        )\n\n)\n\n\n<thead> <tr> <th>Empty result set</th> </tr> </thead> <tbody> <tr> <td><xmp>Array\n(\n    [head] => Array\n        (\n            [link] => Array\n                (\n                )\n\n            [vars] => Array\n                (\n                    [0] => what\n                    [1] => pred\n                    [2] => newObject\n                )\n\n        )\n\n    [results] => Array\n        (\n            [distinct] => \n            [ordered] => 1\n            [bindings] => Array\n                (\n                )\n\n        )\n\n)\n</xmp></td> </tr> </tbody> \n\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/CONTRIBUTING.md",
    "content": "# How to contribute\n\n- [Getting help](#getting-help-)\n- [Submitting bug reports](#submitting-bug-reports-)\n- [Contributing code](#contributing-code-)\n\n## Getting help [^](#how-to-contribute)\n\nCommunity discussion, questions, and informal bug reporting is done on the\n[CodeMirror Google group](http://groups.google.com/group/codemirror).\n\n## Submitting bug reports [^](#how-to-contribute)\n\nThe preferred way to report bugs is to use the\n[GitHub issue tracker](http://github.com/marijnh/CodeMirror/issues). Before\nreporting a bug, read these pointers.\n\n**Note:** The issue tracker is for *bugs*, not requests for help. Questions\nshould be asked on the\n[CodeMirror Google group](http://groups.google.com/group/codemirror) instead.\n\n### Reporting bugs effectively\n\n- CodeMirror is maintained by volunteers. They don't owe you anything, so be\n  polite. Reports with an indignant or belligerent tone tend to be moved to the\n  bottom of the pile.\n\n- Include information about **the browser in which the problem occurred**. Even\n  if you tested several browsers, and the problem occurred in all of them,\n  mention this fact in the bug report. Also include browser version numbers and\n  the operating system that you're on.\n\n- Mention which release of CodeMirror you're using. Preferably, try also with\n  the current development snapshot, to ensure the problem has not already been\n  fixed.\n\n- Mention very precisely what went wrong. \"X is broken\" is not a good bug\n  report. What did you expect to happen? What happened instead? Describe the\n  exact steps a maintainer has to take to make the problem occur. We can not\n  fix something that we can not observe.\n\n- If the problem can not be reproduced in any of the demos included in the\n  CodeMirror distribution, please provide an HTML document that demonstrates\n  the problem. The best way to do this is to go to\n  [jsbin.com](http://jsbin.com/ihunin/edit), enter it there, press save, and\n  include the resulting link in your bug report.\n\n## Contributing code [^](#how-to-contribute)\n\n- Make sure you have a [GitHub Account](https://github.com/signup/free)\n- Fork [CodeMirror](https://github.com/marijnh/CodeMirror/)\n  ([how to fork a repo](https://help.github.com/articles/fork-a-repo))\n- Make your changes\n- If your changes are easy to test or likely to regress, add tests.\n  Tests for the core go into `test/test.js`, some modes have their own\n  test suite under `mode/XXX/test.js`. Feel free to add new test\n  suites to modes that don't have one yet (be sure to link the new\n  tests into `test/index.html`).\n- Make sure all tests pass. Visit `test/index.html` in your browser to\n  run them.\n- Submit a pull request\n([how to create a pull request](https://help.github.com/articles/fork-a-repo))\n\n### Coding standards\n\n- 2 spaces per indentation level, no tabs.\n- Include semicolons after statements.\n- Note that the linter (`test/lint/lint.js`) which is run after each\n  commit complains about unused variables and functions. Prefix their\n  names with an underscore to muffle it.\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/LICENSE",
    "content": "Copyright (C) 2013 by Marijn Haverbeke <marijnh@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\nPlease note that some subdirectories of the CodeMirror distribution\ninclude their own LICENSE files, and are released under different\nlicences.\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/README.md",
    "content": "# CodeMirror [![Build Status](https://secure.travis-ci.org/marijnh/CodeMirror.png?branch=master)](http://travis-ci.org/marijnh/CodeMirror)\n\nCodeMirror is a JavaScript component that provides a code editor in\nthe browser. When a mode is available for the language you are coding\nin, it will color your code, and optionally help with indentation.\n\nThe project page is http://codemirror.net  \nThe manual is at http://codemirror.net/doc/manual.html  \nThe contributing guidelines are in [CONTRIBUTING.md](https://github.com/marijnh/CodeMirror/blob/master/CONTRIBUTING.md)\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/dialog/dialog.css",
    "content": ".CodeMirror-dialog {\n  position: absolute;\n  left: 0; right: 0;\n  background: white;\n  z-index: 15;\n  padding: .1em .8em;\n  overflow: hidden;\n  color: #333;\n}\n\n.CodeMirror-dialog-top {\n  border-bottom: 1px solid #eee;\n  top: 0;\n}\n\n.CodeMirror-dialog-bottom {\n  border-top: 1px solid #eee;\n  bottom: 0;\n}\n\n.CodeMirror-dialog input {\n  border: none;\n  outline: none;\n  background: transparent;\n  width: 20em;\n  color: inherit;\n  font-family: monospace;\n}\n\n.CodeMirror-dialog button {\n  font-size: 70%;\n}\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/dialog/dialog.js",
    "content": "// Open simple dialogs on top of an editor. Relies on dialog.css.\n\n(function() {\n  function dialogDiv(cm, template, bottom) {\n    var wrap = cm.getWrapperElement();\n    var dialog;\n    dialog = wrap.appendChild(document.createElement(\"div\"));\n    if (bottom) {\n      dialog.className = \"CodeMirror-dialog CodeMirror-dialog-bottom\";\n    } else {\n      dialog.className = \"CodeMirror-dialog CodeMirror-dialog-top\";\n    }\n    dialog.innerHTML = template;\n    return dialog;\n  }\n\n  CodeMirror.defineExtension(\"openDialog\", function(template, callback, options) {\n    var dialog = dialogDiv(this, template, options && options.bottom);\n    var closed = false, me = this;\n    function close() {\n      if (closed) return;\n      closed = true;\n      dialog.parentNode.removeChild(dialog);\n    }\n    var inp = dialog.getElementsByTagName(\"input\")[0], button;\n    if (inp) {\n      CodeMirror.on(inp, \"keydown\", function(e) {\n        if (e.keyCode == 13 || e.keyCode == 27) {\n          CodeMirror.e_stop(e);\n          close();\n          me.focus();\n          if (e.keyCode == 13) callback(inp.value);\n        }\n      });\n      if (options && options.value) inp.value = options.value;\n      inp.focus();\n      CodeMirror.on(inp, \"blur\", close);\n    } else if (button = dialog.getElementsByTagName(\"button\")[0]) {\n      CodeMirror.on(button, \"click\", function() {\n        close();\n        me.focus();\n      });\n      button.focus();\n      CodeMirror.on(button, \"blur\", close);\n    }\n    return close;\n  });\n\n  CodeMirror.defineExtension(\"openConfirm\", function(template, callbacks, options) {\n    var dialog = dialogDiv(this, template, options && options.bottom);\n    var buttons = dialog.getElementsByTagName(\"button\");\n    var closed = false, me = this, blurring = 1;\n    function close() {\n      if (closed) return;\n      closed = true;\n      dialog.parentNode.removeChild(dialog);\n      me.focus();\n    }\n    buttons[0].focus();\n    for (var i = 0; i < buttons.length; ++i) {\n      var b = buttons[i];\n      (function(callback) {\n        CodeMirror.on(b, \"click\", function(e) {\n          CodeMirror.e_preventDefault(e);\n          close();\n          if (callback) callback(me);\n        });\n      })(callbacks[i]);\n      CodeMirror.on(b, \"blur\", function() {\n        --blurring;\n        setTimeout(function() { if (blurring <= 0) close(); }, 200);\n      });\n      CodeMirror.on(b, \"focus\", function() { ++blurring; });\n    }\n  });\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/edit/closetag.js",
    "content": "/**\n * Tag-closer extension for CodeMirror.\n *\n * This extension adds an \"autoCloseTags\" option that can be set to\n * either true to get the default behavior, or an object to further\n * configure its behavior.\n *\n * These are supported options:\n *\n * `whenClosing` (default true)\n *   Whether to autoclose when the '/' of a closing tag is typed.\n * `whenOpening` (default true)\n *   Whether to autoclose the tag when the final '>' of an opening\n *   tag is typed.\n * `dontCloseTags` (default is empty tags for HTML, none for XML)\n *   An array of tag names that should not be autoclosed.\n * `indentTags` (default is block tags for HTML, none for XML)\n *   An array of tag names that should, when opened, cause a\n *   blank line to be added inside the tag, and the blank line and\n *   closing line to be indented.\n *\n * See demos/closetag.html for a usage example.\n */\n\n(function() {\n  CodeMirror.defineOption(\"autoCloseTags\", false, function(cm, val, old) {\n    if (val && (old == CodeMirror.Init || !old)) {\n      var map = {name: \"autoCloseTags\"};\n      if (typeof val != \"object\" || val.whenClosing)\n        map[\"'/'\"] = function(cm) { autoCloseTag(cm, '/'); };\n      if (typeof val != \"object\" || val.whenOpening)\n        map[\"'>'\"] = function(cm) { autoCloseTag(cm, '>'); };\n      cm.addKeyMap(map);\n    } else if (!val && (old != CodeMirror.Init && old)) {\n      cm.removeKeyMap(\"autoCloseTags\");\n    }\n  });\n\n  var htmlDontClose = [\"area\", \"base\", \"br\", \"col\", \"command\", \"embed\", \"hr\", \"img\", \"input\", \"keygen\", \"link\", \"meta\", \"param\",\n                       \"source\", \"track\", \"wbr\"];\n  var htmlIndent = [\"applet\", \"blockquote\", \"body\", \"button\", \"div\", \"dl\", \"fieldset\", \"form\", \"frameset\", \"h1\", \"h2\", \"h3\", \"h4\",\n                    \"h5\", \"h6\", \"head\", \"html\", \"iframe\", \"layer\", \"legend\", \"object\", \"ol\", \"p\", \"select\", \"table\", \"ul\"];\n\n  function autoCloseTag(cm, ch) {\n    var pos = cm.getCursor(), tok = cm.getTokenAt(pos);\n    var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;\n    if (inner.mode.name != \"xml\") throw CodeMirror.Pass;\n\n    var opt = cm.getOption(\"autoCloseTags\"), html = inner.mode.configuration == \"html\";\n    var dontCloseTags = (typeof opt == \"object\" && opt.dontCloseTags) || (html && htmlDontClose);\n    var indentTags = (typeof opt == \"object\" && opt.indentTags) || (html && htmlIndent);\n\n    if (ch == \">\" && state.tagName) {\n      var tagName = state.tagName;\n      if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);\n      var lowerTagName = tagName.toLowerCase();\n      // Don't process the '>' at the end of an end-tag or self-closing tag\n      if (tok.type == \"tag\" && state.type == \"closeTag\" ||\n          /\\/\\s*$/.test(tok.string) ||\n          dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1)\n        throw CodeMirror.Pass;\n\n      var doIndent = indentTags && indexOf(indentTags, lowerTagName) > -1;\n      cm.replaceSelection(\">\" + (doIndent ? \"\\n\\n\" : \"\") + \"</\" + tagName + \">\",\n                          doIndent ? {line: pos.line + 1, ch: 0} : {line: pos.line, ch: pos.ch + 1});\n      if (doIndent) {\n        cm.indentLine(pos.line + 1);\n        cm.indentLine(pos.line + 2);\n      }\n      return;\n    } else if (ch == \"/\" && tok.type == \"tag\" && tok.string == \"<\") {\n      var tagName = state.context && state.context.tagName;\n      if (tagName) cm.replaceSelection(\"/\" + tagName + \">\", \"end\");\n      return;\n    }\n    throw CodeMirror.Pass;\n  }\n\n  function indexOf(collection, elt) {\n    if (collection.indexOf) return collection.indexOf(elt);\n    for (var i = 0, e = collection.length; i < e; ++i)\n      if (collection[i] == elt) return i;\n    return -1;\n  }\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/edit/continuecomment.js",
    "content": "(function() {\n  var modes = [\"clike\", \"css\", \"javascript\"];\n  for (var i = 0; i < modes.length; ++i)\n    CodeMirror.extendMode(modes[i], {blockCommentStart: \"/*\",\n                                     blockCommentEnd: \"*/\",\n                                     blockCommentContinue: \" * \"});\n\n  CodeMirror.commands.newlineAndIndentContinueComment = function(cm) {\n    var pos = cm.getCursor(), token = cm.getTokenAt(pos);\n    var mode = CodeMirror.innerMode(cm.getMode(), token.state).mode;\n    var space;\n\n    if (token.type == \"comment\" && mode.blockCommentStart) {\n      var end = token.string.indexOf(mode.blockCommentEnd);\n      var full = cm.getRange({line: pos.line, ch: 0}, {line: pos.line, ch: token.end}), found;\n      if (end != -1 && end == token.string.length - mode.blockCommentEnd.length) {\n        // Comment ended, don't continue it\n      } else if (token.string.indexOf(mode.blockCommentStart) == 0) {\n        space = full.slice(0, token.start);\n        if (!/^\\s*$/.test(space)) {\n          space = \"\";\n          for (var i = 0; i < token.start; ++i) space += \" \";\n        }\n      } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 &&\n                 found + mode.blockCommentContinue.length > token.start &&\n                 /^\\s*$/.test(full.slice(0, found))) {\n        space = full.slice(0, found);\n      }\n    }\n\n    if (space != null)\n      cm.replaceSelection(\"\\n\" + space + mode.blockCommentContinue, \"end\");\n    else\n      cm.execCommand(\"newlineAndIndent\");\n  };\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/edit/continuelist.js",
    "content": "(function() {\n  CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {\n    var pos = cm.getCursor(), token = cm.getTokenAt(pos);\n    var space;\n    if (token.className == \"string\") {\n      var full = cm.getRange({line: pos.line, ch: 0}, {line: pos.line, ch: token.end});\n      var listStart = /\\*|\\d+\\./, listContinue;\n      if (token.string.search(listStart) == 0) {\n        var reg = /^[\\W]*(\\d+)\\./g;\n        var matches = reg.exec(full);\n        if(matches)\n          listContinue = (parseInt(matches[1]) + 1) + \".  \";\n        else\n          listContinue = \"*   \";\n        space = full.slice(0, token.start);\n        if (!/^\\s*$/.test(space)) {\n          space = \"\";\n          for (var i = 0; i < token.start; ++i) space += \" \";\n        }\n      }\n    }\n\n    if (space != null)\n      cm.replaceSelection(\"\\n\" + space + listContinue, \"end\");\n    else\n      cm.execCommand(\"newlineAndIndent\");\n  };\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/edit/matchbrackets.js",
    "content": "(function() {\n  var matching = {\"(\": \")>\", \")\": \"(<\", \"[\": \"]>\", \"]\": \"[<\", \"{\": \"}>\", \"}\": \"{<\"};\n  function findMatchingBracket(cm) {\n    var cur = cm.getCursor(), line = cm.getLineHandle(cur.line), pos = cur.ch - 1;\n    var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];\n    if (!match) return null;\n    var forward = match.charAt(1) == \">\", d = forward ? 1 : -1;\n    var style = cm.getTokenAt({line: cur.line, ch: pos + 1}).type;\n\n    var stack = [line.text.charAt(pos)], re = /[(){}[\\]]/;\n    function scan(line, lineNo, start) {\n      if (!line.text) return;\n      var pos = forward ? 0 : line.text.length - 1, end = forward ? line.text.length : -1;\n      if (start != null) pos = start + d;\n      for (; pos != end; pos += d) {\n        var ch = line.text.charAt(pos);\n        if (re.test(ch) && cm.getTokenAt({line: lineNo, ch: pos + 1}).type == style) {\n          var match = matching[ch];\n          if (match.charAt(1) == \">\" == forward) stack.push(ch);\n          else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false};\n          else if (!stack.length) return {pos: pos, match: true};\n        }\n      }\n    }\n    for (var i = cur.line, found, e = forward ? Math.min(i + 100, cm.lineCount()) : Math.max(-1, i - 100); i != e; i+=d) {\n      if (i == cur.line) found = scan(line, i, pos);\n      else found = scan(cm.getLineHandle(i), i);\n      if (found) break;\n    }\n    return {from: {line: cur.line, ch: pos}, to: found && {line: i, ch: found.pos}, match: found && found.match};\n  }\n\n  function matchBrackets(cm, autoclear) {\n    var found = findMatchingBracket(cm);\n    if (!found) return;\n    var style = found.match ? \"CodeMirror-matchingbracket\" : \"CodeMirror-nonmatchingbracket\";\n    var one = cm.markText(found.from, {line: found.from.line, ch: found.from.ch + 1},\n                          {className: style});\n    var two = found.to && cm.markText(found.to, {line: found.to.line, ch: found.to.ch + 1},\n                                      {className: style});\n    var clear = function() {\n      cm.operation(function() { one.clear(); two && two.clear(); });\n    };\n    if (autoclear) setTimeout(clear, 800);\n    else return clear;\n  }\n\n  var currentlyHighlighted = null;\n  function doMatchBrackets(cm) {\n    cm.operation(function() {\n      if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}\n      if (!cm.somethingSelected()) currentlyHighlighted = matchBrackets(cm, false);\n    });\n  }\n\n  CodeMirror.defineOption(\"matchBrackets\", false, function(cm, val) {\n    if (val) cm.on(\"cursorActivity\", doMatchBrackets);\n    else cm.off(\"cursorActivity\", doMatchBrackets);\n  });\n\n  CodeMirror.defineExtension(\"matchBrackets\", function() {matchBrackets(this, true);});\n  CodeMirror.defineExtension(\"findMatchingBracket\", function(){return findMatchingBracket(this);});\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/fold/collapserange.js",
    "content": "(function() {\n  CodeMirror.defineOption(\"collapseRange\", false, function(cm, val, old) {\n    var wasOn = old && old != CodeMirror.Init;\n    if (val && !wasOn)\n      enableRangeCollapsing(cm);\n    else if (!val && wasOn)\n      disableRangeCollapsing(cm);\n  });\n\n  var gutterClass = \"CodeMirror-collapserange\";\n\n  function enableRangeCollapsing(cm) {\n    cm.on(\"gutterClick\", gutterClick);\n    cm.setOption(\"gutters\", (cm.getOption(\"gutters\") || []).concat([gutterClass]));\n  }\n\n  function disableRangeCollapsing(cm) {\n    cm.rangeCollapseStart = null;\n    cm.off(\"gutterClick\", gutterClick);\n    var gutters = cm.getOption(\"gutters\");\n    for (var i = 0; i < gutters.length && gutters[i] != gutterClass; ++i) {}\n    cm.setOption(\"gutters\", gutters.slice(0, i).concat(gutters.slice(i + 1)));\n  }\n\n  function gutterClick(cm, line, gutter) {\n    if (gutter != gutterClass) return;\n\n    var start = cm.rangeCollapseStart;\n    if (start) {\n      var old = cm.getLineNumber(start);\n      cm.setGutterMarker(start, gutterClass, null);\n      cm.rangeCollapseStart = null;\n      var from = Math.min(old, line), to = Math.max(old, line);\n      if (from != to) {\n        // Finish this fold\n        var fold = cm.markText({line: from + 1, ch: 0}, {line: to - 1}, {\n          collapsed: true,\n          inclusiveLeft: true,\n          inclusiveRight: true,\n          clearOnEnter: true\n        });\n        var clear = function() {\n          cm.setGutterMarker(topLine, gutterClass, null);\n          cm.setGutterMarker(botLine, gutterClass, null);\n          fold.clear();\n        };\n        var topLine = cm.setGutterMarker(from, gutterClass, makeMarker(true, true, clear));\n        var botLine = cm.setGutterMarker(to, gutterClass, makeMarker(false, true, clear));\n        CodeMirror.on(fold, \"clear\", clear);\n\n        return;\n      }\n    }\n\n    // Start a new fold\n    cm.rangeCollapseStart = cm.setGutterMarker(line, gutterClass, makeMarker(true, false));\n  }\n\n  function makeMarker(isTop, isFinished, handler) {\n    var node = document.createElement(\"div\");\n    node.innerHTML = isTop ? \"\\u25bc\" : \"\\u25b2\";\n    if (!isFinished) node.style.color = \"red\";\n    node.style.fontSize = \"85%\";\n    node.style.cursor = \"pointer\";\n    if (handler) CodeMirror.on(node, \"mousedown\", handler);\n    return node;\n  }\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/fold/foldcode.js",
    "content": "// the tagRangeFinder function is\n//   Copyright (C) 2011 by Daniel Glazman <daniel@glazman.org>\n// released under the MIT license (../../LICENSE) like the rest of CodeMirror\nCodeMirror.tagRangeFinder = function(cm, start) {\n  var nameStartChar = \"A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\";\n  var nameChar = nameStartChar + \"\\-\\:\\.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\n  var xmlNAMERegExp = new RegExp(\"^[\" + nameStartChar + \"][\" + nameChar + \"]*\");\n\n  var lineText = cm.getLine(start.line);\n  var found = false;\n  var tag = null;\n  var pos = start.ch;\n  while (!found) {\n    pos = lineText.indexOf(\"<\", pos);\n    if (-1 == pos) // no tag on line\n      return;\n    if (pos + 1 < lineText.length && lineText[pos + 1] == \"/\") { // closing tag\n      pos++;\n      continue;\n    }\n    // ok we seem to have a start tag\n    if (!lineText.substr(pos + 1).match(xmlNAMERegExp)) { // not a tag name...\n      pos++;\n      continue;\n    }\n    var gtPos = lineText.indexOf(\">\", pos + 1);\n    if (-1 == gtPos) { // end of start tag not in line\n      var l = start.line + 1;\n      var foundGt = false;\n      var lastLine = cm.lineCount();\n      while (l < lastLine && !foundGt) {\n        var lt = cm.getLine(l);\n        gtPos = lt.indexOf(\">\");\n        if (-1 != gtPos) { // found a >\n          foundGt = true;\n          var slash = lt.lastIndexOf(\"/\", gtPos);\n          if (-1 != slash && slash < gtPos) {\n            var str = lineText.substr(slash, gtPos - slash + 1);\n            if (!str.match( /\\/\\s*\\>/ )) // yep, that's the end of empty tag\n              return;\n          }\n        }\n        l++;\n      }\n      found = true;\n    }\n    else {\n      var slashPos = lineText.lastIndexOf(\"/\", gtPos);\n      if (-1 == slashPos) { // cannot be empty tag\n        found = true;\n        // don't continue\n      }\n      else { // empty tag?\n        // check if really empty tag\n        var str = lineText.substr(slashPos, gtPos - slashPos + 1);\n        if (!str.match( /\\/\\s*\\>/ )) { // finally not empty\n          found = true;\n          // don't continue\n        }\n      }\n    }\n    if (found) {\n      var subLine = lineText.substr(pos + 1);\n      tag = subLine.match(xmlNAMERegExp);\n      if (tag) {\n        // we have an element name, wooohooo !\n        tag = tag[0];\n        // do we have the close tag on same line ???\n        if (-1 != lineText.indexOf(\"</\" + tag + \">\", pos)) // yep\n        {\n          found = false;\n        }\n        // we don't, so we have a candidate...\n      }\n      else\n        found = false;\n    }\n    if (!found)\n      pos++;\n  }\n\n  if (found) {\n    var startTag = \"(\\\\<\\\\/\" + tag + \"\\\\>)|(\\\\<\" + tag + \"\\\\>)|(\\\\<\" + tag + \"\\\\s)|(\\\\<\" + tag + \"$)\";\n    var startTagRegExp = new RegExp(startTag);\n    var endTag = \"</\" + tag + \">\";\n    var depth = 1;\n    var l = start.line + 1;\n    var lastLine = cm.lineCount();\n    while (l < lastLine) {\n      lineText = cm.getLine(l);\n      var match = lineText.match(startTagRegExp);\n      if (match) {\n        for (var i = 0; i < match.length; i++) {\n          if (match[i] == endTag)\n            depth--;\n          else\n            depth++;\n          if (!depth) return {from: {line: start.line, ch: gtPos + 1},\n                              to: {line: l, ch: match.index}};\n        }\n      }\n      l++;\n    }\n    return;\n  }\n};\n\nCodeMirror.braceRangeFinder = function(cm, start) {\n  var line = start.line, lineText = cm.getLine(line);\n  var at = lineText.length, startChar, tokenType;\n  for (;;) {\n    var found = lineText.lastIndexOf(\"{\", at);\n    if (found < start.ch) break;\n    tokenType = cm.getTokenAt({line: line, ch: found}).type;\n    if (!/^(comment|string)/.test(tokenType)) { startChar = found; break; }\n    at = found - 1;\n  }\n  if (startChar == null || lineText.lastIndexOf(\"}\") > startChar) return;\n  var count = 1, lastLine = cm.lineCount(), end, endCh;\n  outer: for (var i = line + 1; i < lastLine; ++i) {\n    var text = cm.getLine(i), pos = 0;\n    for (;;) {\n      var nextOpen = text.indexOf(\"{\", pos), nextClose = text.indexOf(\"}\", pos);\n      if (nextOpen < 0) nextOpen = text.length;\n      if (nextClose < 0) nextClose = text.length;\n      pos = Math.min(nextOpen, nextClose);\n      if (pos == text.length) break;\n      if (cm.getTokenAt({line: i, ch: pos + 1}).type == tokenType) {\n        if (pos == nextOpen) ++count;\n        else if (!--count) { end = i; endCh = pos; break outer; }\n      }\n      ++pos;\n    }\n  }\n  if (end == null || end == line + 1) return;\n  return {from: {line: line, ch: startChar + 1},\n          to: {line: end, ch: endCh}};\n};\n\nCodeMirror.indentRangeFinder = function(cm, start) {\n  var tabSize = cm.getOption(\"tabSize\"), firstLine = cm.getLine(start.line);\n  var myIndent = CodeMirror.countColumn(firstLine, null, tabSize);\n  for (var i = start.line + 1, end = cm.lineCount(); i < end; ++i) {\n    var curLine = cm.getLine(i);\n    if (CodeMirror.countColumn(curLine, null, tabSize) < myIndent &&\n        CodeMirror.countColumn(cm.getLine(i-1), null, tabSize) > myIndent)\n      return {from: {line: start.line, ch: firstLine.length},\n              to: {line: i, ch: curLine.length}};\n  }\n};\n\nCodeMirror.newFoldFunction = function(rangeFinder, widget) {\n  if (widget == null) widget = \"\\u2194\";\n  if (typeof widget == \"string\") {\n    var text = document.createTextNode(widget);\n    widget = document.createElement(\"span\");\n    widget.appendChild(text);\n    widget.className = \"CodeMirror-foldmarker\";\n  }\n\n  return function(cm, pos) {\n    if (typeof pos == \"number\") pos = {line: pos, ch: 0};\n    var range = rangeFinder(cm, pos);\n    if (!range) return;\n\n    var present = cm.findMarksAt(range.from), cleared = 0;\n    for (var i = 0; i < present.length; ++i) {\n      if (present[i].__isFold) {\n        ++cleared;\n        present[i].clear();\n      }\n    }\n    if (cleared) return;\n\n    var myWidget = widget.cloneNode(true);\n    CodeMirror.on(myWidget, \"mousedown\", function() {myRange.clear();});\n    var myRange = cm.markText(range.from, range.to, {\n      replacedWith: myWidget,\n      clearOnEnter: true,\n      __isFold: true\n    });\n  };\n};\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/format/formatting.js",
    "content": "(function() {\n\n  CodeMirror.extendMode(\"css\", {\n    commentStart: \"/*\",\n    commentEnd: \"*/\",\n    newlineAfterToken: function(_type, content) {\n      return /^[;{}]$/.test(content);\n    }\n  });\n\n  CodeMirror.extendMode(\"javascript\", {\n    commentStart: \"/*\",\n    commentEnd: \"*/\",\n    // FIXME semicolons inside of for\n    newlineAfterToken: function(_type, content, textAfter, state) {\n      if (this.jsonMode) {\n        return /^[\\[,{]$/.test(content) || /^}/.test(textAfter);\n      } else {\n        if (content == \";\" && state.lexical && state.lexical.type == \")\") return false;\n        return /^[;{}]$/.test(content) && !/^;/.test(textAfter);\n      }\n    }\n  });\n\n  var inlineElements = /^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;\n\n  CodeMirror.extendMode(\"xml\", {\n    commentStart: \"<!--\",\n    commentEnd: \"-->\",\n    newlineAfterToken: function(type, content, textAfter, state) {\n      var inline = false;\n      if (this.configuration == \"html\")\n        inline = state.context ? inlineElements.test(state.context.tagName) : false;\n      return !inline && ((type == \"tag\" && />$/.test(content) && state.context) ||\n                         /^</.test(textAfter));\n    }\n  });\n\n  // Comment/uncomment the specified range\n  CodeMirror.defineExtension(\"commentRange\", function (isComment, from, to) {\n    var cm = this, curMode = CodeMirror.innerMode(cm.getMode(), cm.getTokenAt(from).state).mode;\n    cm.operation(function() {\n      if (isComment) { // Comment range\n        cm.replaceRange(curMode.commentEnd, to);\n        cm.replaceRange(curMode.commentStart, from);\n        if (from.line == to.line && from.ch == to.ch) // An empty comment inserted - put cursor inside\n          cm.setCursor(from.line, from.ch + curMode.commentStart.length);\n      } else { // Uncomment range\n        var selText = cm.getRange(from, to);\n        var startIndex = selText.indexOf(curMode.commentStart);\n        var endIndex = selText.lastIndexOf(curMode.commentEnd);\n        if (startIndex > -1 && endIndex > -1 && endIndex > startIndex) {\n          // Take string till comment start\n          selText = selText.substr(0, startIndex)\n          // From comment start till comment end\n            + selText.substring(startIndex + curMode.commentStart.length, endIndex)\n          // From comment end till string end\n            + selText.substr(endIndex + curMode.commentEnd.length);\n        }\n        cm.replaceRange(selText, from, to);\n      }\n    });\n  });\n\n  // Applies automatic mode-aware indentation to the specified range\n  CodeMirror.defineExtension(\"autoIndentRange\", function (from, to) {\n    var cmInstance = this;\n    this.operation(function () {\n      for (var i = from.line; i <= to.line; i++) {\n        cmInstance.indentLine(i, \"smart\");\n      }\n    });\n  });\n\n  // Applies automatic formatting to the specified range\n  CodeMirror.defineExtension(\"autoFormatRange\", function (from, to) {\n    var cm = this;\n    var outer = cm.getMode(), text = cm.getRange(from, to).split(\"\\n\");\n    var state = CodeMirror.copyState(outer, cm.getTokenAt(from).state);\n    var tabSize = cm.getOption(\"tabSize\");\n\n    var out = \"\", lines = 0, atSol = from.ch == 0;\n    function newline() {\n      out += \"\\n\";\n      atSol = true;\n      ++lines;\n    }\n\n    for (var i = 0; i < text.length; ++i) {\n      var stream = new CodeMirror.StringStream(text[i], tabSize);\n      while (!stream.eol()) {\n        var inner = CodeMirror.innerMode(outer, state);\n        var style = outer.token(stream, state), cur = stream.current();\n        stream.start = stream.pos;\n        if (!atSol || /\\S/.test(cur)) {\n          out += cur;\n          atSol = false;\n        }\n        if (!atSol && inner.mode.newlineAfterToken &&\n            inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos) || text[i+1] || \"\", inner.state))\n          newline();\n      }\n      if (!stream.pos && outer.blankLine) outer.blankLine(state);\n      if (!atSol && i < text.length - 1) newline();\n    }\n\n    cm.operation(function () {\n      cm.replaceRange(out, from, to);\n      for (var cur = from.line + 1, end = from.line + lines; cur <= end; ++cur)\n        cm.indentLine(cur, \"smart\");\n      cm.setSelection(from, cm.getCursor(false));\n    });\n  });\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/hint/javascript-hint.js",
    "content": "(function () {\n  function forEach(arr, f) {\n    for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);\n  }\n  \n  function arrayContains(arr, item) {\n    if (!Array.prototype.indexOf) {\n      var i = arr.length;\n      while (i--) {\n        if (arr[i] === item) {\n          return true;\n        }\n      }\n      return false;\n    }\n    return arr.indexOf(item) != -1;\n  }\n\n  function scriptHint(editor, keywords, getToken, options) {\n    // Find the token at the cursor\n    var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;\n    // If it's not a 'word-style' token, ignore the token.\n\t\tif (!/^[\\w$_]*$/.test(token.string)) {\n      token = tprop = {start: cur.ch, end: cur.ch, string: \"\", state: token.state,\n                       type: token.string == \".\" ? \"property\" : null};\n    }\n    // If it is a property, find out what it is a property of.\n    while (tprop.type == \"property\") {\n      tprop = getToken(editor, {line: cur.line, ch: tprop.start});\n      if (tprop.string != \".\") return;\n      tprop = getToken(editor, {line: cur.line, ch: tprop.start});\n      if (tprop.string == ')') {\n        var level = 1;\n        do {\n          tprop = getToken(editor, {line: cur.line, ch: tprop.start});\n          switch (tprop.string) {\n          case ')': level++; break;\n          case '(': level--; break;\n          default: break;\n          }\n        } while (level > 0);\n        tprop = getToken(editor, {line: cur.line, ch: tprop.start});\n\tif (tprop.type.indexOf(\"variable\") === 0)\n\t  tprop.type = \"function\";\n\telse return; // no clue\n      }\n      if (!context) var context = [];\n      context.push(tprop);\n    }\n    return {list: getCompletions(token, context, keywords, options),\n            from: {line: cur.line, ch: token.start},\n            to: {line: cur.line, ch: token.end}};\n  }\n\n  CodeMirror.javascriptHint = function(editor, options) {\n    return scriptHint(editor, javascriptKeywords,\n                      function (e, cur) {return e.getTokenAt(cur);},\n                      options);\n  };\n\n  function getCoffeeScriptToken(editor, cur) {\n  // This getToken, it is for coffeescript, imitates the behavior of\n  // getTokenAt method in javascript.js, that is, returning \"property\"\n  // type and treat \".\" as indepenent token.\n    var token = editor.getTokenAt(cur);\n    if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') {\n      token.end = token.start;\n      token.string = '.';\n      token.type = \"property\";\n    }\n    else if (/^\\.[\\w$_]*$/.test(token.string)) {\n      token.type = \"property\";\n      token.start++;\n      token.string = token.string.replace(/\\./, '');\n    }\n    return token;\n  }\n\n  CodeMirror.coffeescriptHint = function(editor, options) {\n    return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken, options);\n  };\n\n  var stringProps = (\"charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight \" +\n                     \"toUpperCase toLowerCase split concat match replace search\").split(\" \");\n  var arrayProps = (\"length concat join splice push pop shift unshift slice reverse sort indexOf \" +\n                    \"lastIndexOf every some filter forEach map reduce reduceRight \").split(\" \");\n  var funcProps = \"prototype apply call bind\".split(\" \");\n  var javascriptKeywords = (\"break case catch continue debugger default delete do else false finally for function \" +\n                  \"if in instanceof new null return switch throw true try typeof var void while with\").split(\" \");\n  var coffeescriptKeywords = (\"and break catch class continue delete do else extends false finally for \" +\n                  \"if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes\").split(\" \");\n\n  function getCompletions(token, context, keywords, options) {\n    var found = [], start = token.string;\n    function maybeAdd(str) {\n      if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);\n    }\n    function gatherCompletions(obj) {\n      if (typeof obj == \"string\") forEach(stringProps, maybeAdd);\n      else if (obj instanceof Array) forEach(arrayProps, maybeAdd);\n      else if (obj instanceof Function) forEach(funcProps, maybeAdd);\n      for (var name in obj) maybeAdd(name);\n    }\n\n    if (context) {\n      // If this is a property, see if it belongs to some object we can\n      // find in the current environment.\n      var obj = context.pop(), base;\n      if (obj.type.indexOf(\"variable\") === 0) {\n        if (options && options.additionalContext)\n          base = options.additionalContext[obj.string];\n        base = base || window[obj.string];\n      } else if (obj.type == \"string\") {\n        base = \"\";\n      } else if (obj.type == \"atom\") {\n        base = 1;\n      } else if (obj.type == \"function\") {\n        if (window.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') &&\n            (typeof window.jQuery == 'function'))\n          base = window.jQuery();\n        else if (window._ != null && (obj.string == '_') && (typeof window._ == 'function'))\n          base = window._();\n      }\n      while (base != null && context.length)\n        base = base[context.pop().string];\n      if (base != null) gatherCompletions(base);\n    }\n    else {\n      // If not, just look in the window object and any local scope\n      // (reading into JS mode internals to get at the local and global variables)\n      for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);\n      for (var v = token.state.globalVars; v; v = v.next) maybeAdd(v.name);\n      gatherCompletions(window);\n      forEach(keywords, maybeAdd);\n    }\n    return found;\n  }\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/hint/pig-hint.js",
    "content": "(function () {\n  function forEach(arr, f) {\n    for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);\n  }\n  \n  function arrayContains(arr, item) {\n    if (!Array.prototype.indexOf) {\n      var i = arr.length;\n      while (i--) {\n        if (arr[i] === item) {\n          return true;\n        }\n      }\n      return false;\n    }\n    return arr.indexOf(item) != -1;\n  }\n\n  function scriptHint(editor, _keywords, getToken) {\n    // Find the token at the cursor\n    var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;\n    // If it's not a 'word-style' token, ignore the token.\n\n    if (!/^[\\w$_]*$/.test(token.string)) {\n        token = tprop = {start: cur.ch, end: cur.ch, string: \"\", state: token.state,\n                         className: token.string == \":\" ? \"pig-type\" : null};\n    }\n      \n    if (!context) var context = [];\n    context.push(tprop);\n    \n    var completionList = getCompletions(token, context); \n    completionList = completionList.sort();\n    //prevent autocomplete for last word, instead show dropdown with one word\n    if(completionList.length == 1) {\n      completionList.push(\" \");\n    }\n\n    return {list: completionList,\n              from: {line: cur.line, ch: token.start},\n              to: {line: cur.line, ch: token.end}};\n  }\n  \n  CodeMirror.pigHint = function(editor) {\n    return scriptHint(editor, pigKeywordsU, function (e, cur) {return e.getTokenAt(cur);});\n  };\n \n  var pigKeywords = \"VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP \"\n  + \"JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL \"\n  + \"PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE \"\n  + \"SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE \" \n  + \"NEQ MATCHES TRUE FALSE\";\n  var pigKeywordsU = pigKeywords.split(\" \");\n  var pigKeywordsL = pigKeywords.toLowerCase().split(\" \");\n  \n  var pigTypes = \"BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP\";\n  var pigTypesU = pigTypes.split(\" \");\n  var pigTypesL = pigTypes.toLowerCase().split(\" \");\n  \n  var pigBuiltins = \"ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL \" \n  + \"CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS \"\n  + \"DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG \"\n  + \"FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN \"\n  + \"INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER \"\n  + \"ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS \"\n  + \"LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA  \"\n  + \"PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE \"\n  + \"SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG \"\n  + \"TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER\";  \n  var pigBuiltinsU = pigBuiltins.split(\" \").join(\"() \").split(\" \");  \n  var pigBuiltinsL = pigBuiltins.toLowerCase().split(\" \").join(\"() \").split(\" \");   \n  var pigBuiltinsC = (\"BagSize BinStorage Bloom BuildBloom ConstantSize CubeDimensions DoubleAbs \"\n  + \"DoubleAvg DoubleBase DoubleMax DoubleMin DoubleRound DoubleSum FloatAbs FloatAvg FloatMax \"\n  + \"FloatMin FloatRound FloatSum GenericInvoker IntAbs IntAvg IntMax IntMin IntSum \"\n  + \"InvokeForDouble InvokeForFloat InvokeForInt InvokeForLong InvokeForString Invoker \"\n  + \"IsEmpty JsonLoader JsonMetadata JsonStorage LongAbs LongAvg LongMax LongMin LongSum MapSize \"\n  + \"MonitoredUDF Nondeterministic OutputSchema PigStorage PigStreaming StringConcat StringMax \"\n  + \"StringMin StringSize TextLoader TupleSize Utf8StorageConverter\").split(\" \").join(\"() \").split(\" \");\n                    \n  function getCompletions(token, context) {\n    var found = [], start = token.string;\n    function maybeAdd(str) {\n      if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);\n    }\n    \n    function gatherCompletions(obj) {\n      if(obj == \":\") {\n        forEach(pigTypesL, maybeAdd);\n      }\n      else {\n        forEach(pigBuiltinsU, maybeAdd);\n        forEach(pigBuiltinsL, maybeAdd);\n        forEach(pigBuiltinsC, maybeAdd);\n        forEach(pigTypesU, maybeAdd);\n        forEach(pigTypesL, maybeAdd);\n        forEach(pigKeywordsU, maybeAdd);\n        forEach(pigKeywordsL, maybeAdd);\n      }\n    }\n\n    if (context) {\n      // If this is a property, see if it belongs to some object we can\n      // find in the current environment.\n      var obj = context.pop(), base;\n\n      if (obj.type == \"variable\") \n          base = obj.string;\n      else if(obj.type == \"variable-3\")\n          base = \":\" + obj.string;\n        \n      while (base != null && context.length)\n        base = base[context.pop().string];\n      if (base != null) gatherCompletions(base);\n    }\n    return found;\n  }\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/hint/python-hint.js",
    "content": "(function () {\n  function forEach(arr, f) {\n    for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);\n  }\n\n  function arrayContains(arr, item) {\n    if (!Array.prototype.indexOf) {\n      var i = arr.length;\n      while (i--) {\n        if (arr[i] === item) {\n          return true;\n        }\n      }\n      return false;\n    }\n    return arr.indexOf(item) != -1;\n  }\n\n  function scriptHint(editor, _keywords, getToken) {\n    // Find the token at the cursor\n    var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;\n    // If it's not a 'word-style' token, ignore the token.\n\n    if (!/^[\\w$_]*$/.test(token.string)) {\n        token = tprop = {start: cur.ch, end: cur.ch, string: \"\", state: token.state,\n                         className: token.string == \":\" ? \"python-type\" : null};\n    }\n\n    if (!context) var context = [];\n    context.push(tprop);\n\n    var completionList = getCompletions(token, context);\n    completionList = completionList.sort();\n    //prevent autocomplete for last word, instead show dropdown with one word\n    if(completionList.length == 1) {\n      completionList.push(\" \");\n    }\n\n    return {list: completionList,\n              from: {line: cur.line, ch: token.start},\n              to: {line: cur.line, ch: token.end}};\n  }\n\n  CodeMirror.pythonHint = function(editor) {\n    return scriptHint(editor, pythonKeywordsU, function (e, cur) {return e.getTokenAt(cur);});\n  };\n\n  var pythonKeywords = \"and del from not while as elif global or with assert else if pass yield\"\n+ \"break except import print class exec in raise continue finally is return def for lambda try\";\n  var pythonKeywordsL = pythonKeywords.split(\" \");\n  var pythonKeywordsU = pythonKeywords.toUpperCase().split(\" \");\n\n  var pythonBuiltins = \"abs divmod input open staticmethod all enumerate int ord str \"\n+ \"any eval isinstance pow sum basestring execfile issubclass print super\"\n+ \"bin file iter property tuple bool filter len range type\"\n+ \"bytearray float list raw_input unichr callable format locals reduce unicode\"\n+ \"chr frozenset long reload vars classmethod getattr map repr xrange\"\n+ \"cmp globals max reversed zip compile hasattr memoryview round __import__\"\n+ \"complex hash min set apply delattr help next setattr buffer\"\n+ \"dict hex object slice coerce dir id oct sorted intern \";\n  var pythonBuiltinsL = pythonBuiltins.split(\" \").join(\"() \").split(\" \");\n  var pythonBuiltinsU = pythonBuiltins.toUpperCase().split(\" \").join(\"() \").split(\" \");\n\n  function getCompletions(token, context) {\n    var found = [], start = token.string;\n    function maybeAdd(str) {\n      if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);\n    }\n\n    function gatherCompletions(_obj) {\n        forEach(pythonBuiltinsL, maybeAdd);\n        forEach(pythonBuiltinsU, maybeAdd);\n        forEach(pythonKeywordsL, maybeAdd);\n        forEach(pythonKeywordsU, maybeAdd);\n    }\n\n    if (context) {\n      // If this is a property, see if it belongs to some object we can\n      // find in the current environment.\n      var obj = context.pop(), base;\n\n      if (obj.type == \"variable\")\n          base = obj.string;\n      else if(obj.type == \"variable-3\")\n          base = \":\" + obj.string;\n\n      while (base != null && context.length)\n        base = base[context.pop().string];\n      if (base != null) gatherCompletions(base);\n    }\n    return found;\n  }\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/hint/simple-hint.css",
    "content": ".CodeMirror-completions {\n  position: absolute;\n  z-index: 10;\n  overflow: hidden;\n  -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n  -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n  box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n}\n.CodeMirror-completions select {\n  background: #fafafa;\n  outline: none;\n  border: none;\n  padding: 0;\n  margin: 0;\n  font-family: monospace;\n}\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/hint/simple-hint.js",
    "content": "(function() {\n  CodeMirror.simpleHint = function(editor, getHints, givenOptions) {\n    // Determine effective options based on given values and defaults.\n    var options = {}, defaults = CodeMirror.simpleHint.defaults;\n    for (var opt in defaults)\n      if (defaults.hasOwnProperty(opt))\n        options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt];\n    \n    function collectHints(previousToken) {\n      // We want a single cursor position.\n      if (editor.somethingSelected()) return;\n\n      var tempToken = editor.getTokenAt(editor.getCursor());\n\n      // Don't show completions if token has changed and the option is set.\n      if (options.closeOnTokenChange && previousToken != null &&\n          (tempToken.start != previousToken.start || tempToken.type != previousToken.type)) {\n        return;\n      }\n\n      var result = getHints(editor, givenOptions);\n      if (!result || !result.list.length) return;\n      var completions = result.list;\n      function insert(str) {\n        editor.replaceRange(str, result.from, result.to);\n      }\n      // When there is only one completion, use it directly.\n      if (options.completeSingle && completions.length == 1) {\n        insert(completions[0]);\n        return true;\n      }\n\n      // Build the select widget\n      var complete = document.createElement(\"div\");\n      complete.className = \"CodeMirror-completions\";\n      var sel = complete.appendChild(document.createElement(\"select\"));\n      // Opera doesn't move the selection when pressing up/down in a\n      // multi-select, but it does properly support the size property on\n      // single-selects, so no multi-select is necessary.\n      if (!window.opera) sel.multiple = true;\n      for (var i = 0; i < completions.length; ++i) {\n        var opt = sel.appendChild(document.createElement(\"option\"));\n        opt.appendChild(document.createTextNode(completions[i]));\n      }\n      sel.firstChild.selected = true;\n      sel.size = Math.min(10, completions.length);\n      var pos = editor.cursorCoords(options.alignWithWord ? result.from : null);\n      complete.style.left = pos.left + \"px\";\n      complete.style.top = pos.bottom + \"px\";\n      document.body.appendChild(complete);\n      // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n      var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);\n      if(winW - pos.left < sel.clientWidth)\n        complete.style.left = (pos.left - sel.clientWidth) + \"px\";\n      // Hack to hide the scrollbar.\n      if (completions.length <= 10)\n        complete.style.width = (sel.clientWidth - 1) + \"px\";\n\n      var done = false;\n      function close() {\n        if (done) return;\n        done = true;\n        complete.parentNode.removeChild(complete);\n      }\n      function pick() {\n        insert(completions[sel.selectedIndex]);\n        close();\n        setTimeout(function(){editor.focus();}, 50);\n      }\n      CodeMirror.on(sel, \"blur\", close);\n      CodeMirror.on(sel, \"keydown\", function(event) {\n        var code = event.keyCode;\n        // Enter\n        if (code == 13) {CodeMirror.e_stop(event); pick();}\n        // Escape\n        else if (code == 27) {CodeMirror.e_stop(event); close(); editor.focus();}\n        else if (code != 38 && code != 40 && code != 33 && code != 34 && !CodeMirror.isModifierKey(event)) {\n          close(); editor.focus();\n          // Pass the event to the CodeMirror instance so that it can handle things like backspace properly.\n          editor.triggerOnKeyDown(event);\n          // Don't show completions if the code is backspace and the option is set.\n          if (!options.closeOnBackspace || code != 8) {\n            setTimeout(function(){collectHints(tempToken);}, 50);\n          }\n        }\n      });\n      CodeMirror.on(sel, \"dblclick\", pick);\n\n      sel.focus();\n      // Opera sometimes ignores focusing a freshly created node\n      if (window.opera) setTimeout(function(){if (!done) sel.focus();}, 100);\n      return true;\n    }\n    return collectHints();\n  };\n  CodeMirror.simpleHint.defaults = {\n    closeOnBackspace: true,\n    closeOnTokenChange: false,\n    completeSingle: true,\n    alignWithWord: true\n  };\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/hint/xml-hint.js",
    "content": "\n(function() {\n\n    CodeMirror.xmlHints = [];\n\n    CodeMirror.xmlHint = function(cm, simbol) {\n\n        if(simbol.length > 0) {\n            var cursor = cm.getCursor();\n            cm.replaceSelection(simbol);\n            cursor = {line: cursor.line, ch: cursor.ch + 1};\n            cm.setCursor(cursor);\n        }\n\n        CodeMirror.simpleHint(cm, getHint);\n    };\n\n    var getHint = function(cm) {\n\n        var cursor = cm.getCursor();\n\n        if (cursor.ch > 0) {\n\n            var text = cm.getRange({line: 0, ch: 0}, cursor);\n            var typed = '';\n            var simbol = '';\n            for(var i = text.length - 1; i >= 0; i--) {\n                if(text[i] == ' ' || text[i] == '<') {\n                    simbol = text[i];\n                    break;\n                }\n                else {\n                    typed = text[i] + typed;\n                }\n            }\n\n            text = text.slice(0, text.length - typed.length);\n\n            var path = getActiveElement(text) + simbol;\n            var hints = CodeMirror.xmlHints[path];\n\n            if(typeof hints === 'undefined')\n                hints = [''];\n            else {\n                hints = hints.slice(0);\n                for (var i = hints.length - 1; i >= 0; i--) {\n                    if(hints[i].indexOf(typed) != 0)\n                        hints.splice(i, 1);\n                }\n            }\n\n            return {\n                list: hints,\n                from: { line: cursor.line, ch: cursor.ch - typed.length },\n                to: cursor\n            };\n        };\n    };\n\n    var getActiveElement = function(text) {\n\n        var element = '';\n\n        if(text.length >= 0) {\n\n            var regex = new RegExp('<([^!?][^\\\\s/>]*).*?>', 'g');\n\n            var matches = [];\n            var match;\n            while ((match = regex.exec(text)) != null) {\n                matches.push({\n                    tag: match[1],\n                    selfclose: (match[0].slice(match[0].length - 2) === '/>')\n                });\n            }\n\n            for (var i = matches.length - 1, skip = 0; i >= 0; i--) {\n\n                var item = matches[i];\n\n                if (item.tag[0] == '/')\n                {\n                    skip++;\n                }\n                else if (item.selfclose == false)\n                {\n                    if (skip > 0)\n                    {\n                        skip--;\n                    }\n                    else\n                    {\n                        element = '<' + item.tag + '>' + element;\n                    }\n                }\n            }\n\n            element += getOpenTag(text);\n        }\n\n        return element;\n    };\n\n    var getOpenTag = function(text) {\n\n        var open = text.lastIndexOf('<');\n        var close = text.lastIndexOf('>');\n\n        if (close < open)\n        {\n            text = text.slice(open);\n\n            if(text != '<') {\n\n                var space = text.indexOf(' ');\n                if(space < 0)\n                    space = text.indexOf('\\t');\n                if(space < 0)\n                    space = text.indexOf('\\n');\n\n                if (space < 0)\n                    space = text.length;\n\n                return text.slice(0, space);\n            }\n        }\n\n        return '';\n    };\n\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/mode/loadmode.js",
    "content": "(function() {\n  if (!CodeMirror.modeURL) CodeMirror.modeURL = \"../mode/%N/%N.js\";\n\n  var loading = {};\n  function splitCallback(cont, n) {\n    var countDown = n;\n    return function() { if (--countDown == 0) cont(); };\n  }\n  function ensureDeps(mode, cont) {\n    var deps = CodeMirror.modes[mode].dependencies;\n    if (!deps) return cont();\n    var missing = [];\n    for (var i = 0; i < deps.length; ++i) {\n      if (!CodeMirror.modes.hasOwnProperty(deps[i]))\n        missing.push(deps[i]);\n    }\n    if (!missing.length) return cont();\n    var split = splitCallback(cont, missing.length);\n    for (var i = 0; i < missing.length; ++i)\n      CodeMirror.requireMode(missing[i], split);\n  }\n\n  CodeMirror.requireMode = function(mode, cont) {\n    if (typeof mode != \"string\") mode = mode.name;\n    if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont);\n    if (loading.hasOwnProperty(mode)) return loading[mode].push(cont);\n\n    var script = document.createElement(\"script\");\n    script.src = CodeMirror.modeURL.replace(/%N/g, mode);\n    var others = document.getElementsByTagName(\"script\")[0];\n    others.parentNode.insertBefore(script, others);\n    var list = loading[mode] = [cont];\n    var count = 0, poll = setInterval(function() {\n      if (++count > 100) return clearInterval(poll);\n      if (CodeMirror.modes.hasOwnProperty(mode)) {\n        clearInterval(poll);\n        loading[mode] = null;\n        ensureDeps(mode, function() {\n          for (var i = 0; i < list.length; ++i) list[i]();\n        });\n      }\n    }, 200);\n  };\n\n  CodeMirror.autoLoadMode = function(instance, mode) {\n    if (!CodeMirror.modes.hasOwnProperty(mode))\n      CodeMirror.requireMode(mode, function() {\n        instance.setOption(\"mode\", instance.getOption(\"mode\"));\n      });\n  };\n}());\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/mode/multiplex.js",
    "content": "CodeMirror.multiplexingMode = function(outer /*, others */) {\n  // Others should be {open, close, mode [, delimStyle]} objects\n  var others = Array.prototype.slice.call(arguments, 1);\n  var n_others = others.length;\n\n  function indexOf(string, pattern, from) {\n    if (typeof pattern == \"string\") return string.indexOf(pattern, from);\n    var m = pattern.exec(from ? string.slice(from) : string);\n    return m ? m.index + from : -1;\n  }\n\n  return {\n    startState: function() {\n      return {\n        outer: CodeMirror.startState(outer),\n        innerActive: null,\n        inner: null\n      };\n    },\n\n    copyState: function(state) {\n      return {\n        outer: CodeMirror.copyState(outer, state.outer),\n        innerActive: state.innerActive,\n        inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner)\n      };\n    },\n\n    token: function(stream, state) {\n      if (!state.innerActive) {\n        var cutOff = Infinity, oldContent = stream.string;\n        for (var i = 0; i < n_others; ++i) {\n          var other = others[i];\n          var found = indexOf(oldContent, other.open, stream.pos);\n          if (found == stream.pos) {\n            stream.match(other.open);\n            state.innerActive = other;\n            state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, \"\") : 0);\n            return other.delimStyle;\n          } else if (found != -1 && found < cutOff) {\n            cutOff = found;\n          }\n        }\n        if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff);\n        var outerToken = outer.token(stream, state.outer);\n        if (cutOff != Infinity) stream.string = oldContent;\n        return outerToken;\n      } else {\n        var curInner = state.innerActive, oldContent = stream.string;\n        var found = indexOf(oldContent, curInner.close, stream.pos);\n        if (found == stream.pos) {\n          stream.match(curInner.close);\n          state.innerActive = state.inner = null;\n          return curInner.delimStyle;\n        }\n        if (found > -1) stream.string = oldContent.slice(0, found);\n        var innerToken = curInner.mode.token(stream, state.inner);\n        if (found > -1) stream.string = oldContent;\n        var cur = stream.current(), found = cur.indexOf(curInner.close);\n        if (found > -1) stream.backUp(cur.length - found);\n        return innerToken;\n      }\n    },\n    \n    indent: function(state, textAfter) {\n      var mode = state.innerActive ? state.innerActive.mode : outer;\n      if (!mode.indent) return CodeMirror.Pass;\n      return mode.indent(state.innerActive ? state.inner : state.outer, textAfter);\n    },\n\n    blankLine: function(state) {\n      var mode = state.innerActive ? state.innerActive.mode : outer;\n      if (mode.blankLine) {\n        mode.blankLine(state.innerActive ? state.inner : state.outer);\n      }\n      if (!state.innerActive) {\n        for (var i = 0; i < n_others; ++i) {\n          var other = others[i];\n          if (other.open === \"\\n\") {\n            state.innerActive = other;\n            state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, \"\") : 0);\n          }\n        }\n      } else if (mode.close === \"\\n\") {\n        state.innerActive = state.inner = null;\n      }\n    },\n\n    electricChars: outer.electricChars,\n\n    innerMode: function(state) {\n      return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {state: state.outer, mode: outer};\n    }\n  };\n};\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/mode/overlay.js",
    "content": "// Utility function that allows modes to be combined. The mode given\n// as the base argument takes care of most of the normal mode\n// functionality, but a second (typically simple) mode is used, which\n// can override the style of text. Both modes get to parse all of the\n// text, but when both assign a non-null style to a piece of code, the\n// overlay wins, unless the combine argument was true, in which case\n// the styles are combined.\n\n// overlayParser is the old, deprecated name\nCodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, combine) {\n  return {\n    startState: function() {\n      return {\n        base: CodeMirror.startState(base),\n        overlay: CodeMirror.startState(overlay),\n        basePos: 0, baseCur: null,\n        overlayPos: 0, overlayCur: null\n      };\n    },\n    copyState: function(state) {\n      return {\n        base: CodeMirror.copyState(base, state.base),\n        overlay: CodeMirror.copyState(overlay, state.overlay),\n        basePos: state.basePos, baseCur: null,\n        overlayPos: state.overlayPos, overlayCur: null\n      };\n    },\n\n    token: function(stream, state) {\n      if (stream.start == state.basePos) {\n        state.baseCur = base.token(stream, state.base);\n        state.basePos = stream.pos;\n      }\n      if (stream.start == state.overlayPos) {\n        stream.pos = stream.start;\n        state.overlayCur = overlay.token(stream, state.overlay);\n        state.overlayPos = stream.pos;\n      }\n      stream.pos = Math.min(state.basePos, state.overlayPos);\n      if (stream.eol()) state.basePos = state.overlayPos = 0;\n\n      if (state.overlayCur == null) return state.baseCur;\n      if (state.baseCur != null && combine) return state.baseCur + \" \" + state.overlayCur;\n      else return state.overlayCur;\n    },\n    \n    indent: base.indent && function(state, textAfter) {\n      return base.indent(state.base, textAfter);\n    },\n    electricChars: base.electricChars,\n\n    innerMode: function(state) { return {state: state.base, mode: base}; },\n    \n    blankLine: function(state) {\n      if (base.blankLine) base.blankLine(state.base);\n      if (overlay.blankLine) overlay.blankLine(state.overlay);\n    }\n  };\n};\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/runmode/colorize.js",
    "content": "CodeMirror.colorize = (function() {\n\n  var isBlock = /^(p|li|div|h\\\\d|pre|blockquote|td)$/;\n\n  function textContent(node, out) {\n    if (node.nodeType == 3) return out.push(node.nodeValue);\n    for (var ch = node.firstChild; ch; ch = ch.nextSibling) {\n      textContent(ch, out);\n      if (isBlock.test(node.nodeType)) out.push(\"\\n\");\n    }\n  }\n\n  return function(collection, defaultMode) {\n    if (!collection) collection = document.body.getElementsByTagName(\"pre\");\n\n    for (var i = 0; i < collection.length; ++i) {\n      var node = collection[i];\n      var mode = node.getAttribute(\"data-lang\") || defaultMode;\n      if (!mode) continue;\n\n      var text = [];\n      textContent(node, text);\n      node.innerHTML = \"\";\n      CodeMirror.runMode(text.join(\"\"), mode, node);\n\n      node.className += \" cm-s-default\";\n    }\n  };\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/runmode/runmode-standalone.js",
    "content": "/* Just enough of CodeMirror to run runMode under node.js */\n\nwindow.CodeMirror = {};\n\nfunction splitLines(string){ return string.split(/\\r?\\n|\\r/); };\n\nfunction StringStream(string) {\n  this.pos = this.start = 0;\n  this.string = string;\n}\nStringStream.prototype = {\n  eol: function() {return this.pos >= this.string.length;},\n  sol: function() {return this.pos == 0;},\n  peek: function() {return this.string.charAt(this.pos) || null;},\n  next: function() {\n    if (this.pos < this.string.length)\n      return this.string.charAt(this.pos++);\n  },\n  eat: function(match) {\n    var ch = this.string.charAt(this.pos);\n    if (typeof match == \"string\") var ok = ch == match;\n    else var ok = ch && (match.test ? match.test(ch) : match(ch));\n    if (ok) {++this.pos; return ch;}\n  },\n  eatWhile: function(match) {\n    var start = this.pos;\n    while (this.eat(match)){}\n    return this.pos > start;\n  },\n  eatSpace: function() {\n    var start = this.pos;\n    while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;\n    return this.pos > start;\n  },\n  skipToEnd: function() {this.pos = this.string.length;},\n  skipTo: function(ch) {\n    var found = this.string.indexOf(ch, this.pos);\n    if (found > -1) {this.pos = found; return true;}\n  },\n  backUp: function(n) {this.pos -= n;},\n  column: function() {return this.start;},\n  indentation: function() {return 0;},\n  match: function(pattern, consume, caseInsensitive) {\n    if (typeof pattern == \"string\") {\n      function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}\n      if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {\n        if (consume !== false) this.pos += pattern.length;\n        return true;\n      }\n    }\n    else {\n      var match = this.string.slice(this.pos).match(pattern);\n      if (match && consume !== false) this.pos += match[0].length;\n      return match;\n    }\n  },\n  current: function(){return this.string.slice(this.start, this.pos);}\n};\nCodeMirror.StringStream = StringStream;\n\nCodeMirror.startState = function (mode, a1, a2) {\n  return mode.startState ? mode.startState(a1, a2) : true;\n};\n\nvar modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {};\nCodeMirror.defineMode = function (name, mode) { modes[name] = mode; };\nCodeMirror.defineMIME = function (mime, spec) { mimeModes[mime] = spec; };\nCodeMirror.getMode = function (options, spec) {\n  if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec))\n    spec = mimeModes[spec];\n  if (typeof spec == \"string\")\n    var mname = spec, config = {};\n  else if (spec != null)\n    var mname = spec.name, config = spec;\n  var mfactory = modes[mname];\n  if (!mfactory) throw new Error(\"Unknown mode: \" + spec);\n  return mfactory(options, config || {});\n};\n\nCodeMirror.runMode = function (string, modespec, callback, options) {\n  var mode = CodeMirror.getMode({ indentUnit: 2 }, modespec);\n\n  if (callback.nodeType == 1) {\n    var tabSize = (options && options.tabSize) || 4;\n    var node = callback, col = 0;\n    node.innerHTML = \"\";\n    callback = function (text, style) {\n      if (text == \"\\n\") {\n        node.appendChild(document.createElement(\"br\"));\n        col = 0;\n        return;\n      }\n      var content = \"\";\n      // replace tabs\n      for (var pos = 0; ;) {\n        var idx = text.indexOf(\"\\t\", pos);\n        if (idx == -1) {\n          content += text.slice(pos);\n          col += text.length - pos;\n          break;\n        } else {\n          col += idx - pos;\n          content += text.slice(pos, idx);\n          var size = tabSize - col % tabSize;\n          col += size;\n          for (var i = 0; i < size; ++i) content += \" \";\n          pos = idx + 1;\n        }\n      }\n\n      if (style) {\n        var sp = node.appendChild(document.createElement(\"span\"));\n        sp.className = \"cm-\" + style.replace(/ +/g, \" cm-\");\n        sp.appendChild(document.createTextNode(content));\n      } else {\n        node.appendChild(document.createTextNode(content));\n      }\n    };\n  }\n\n  var lines = splitLines(string), state = CodeMirror.startState(mode);\n  for (var i = 0, e = lines.length; i < e; ++i) {\n    if (i) callback(\"\\n\");\n    var stream = new CodeMirror.StringStream(lines[i]);\n    while (!stream.eol()) {\n      var style = mode.token(stream, state);\n      callback(stream.current(), style, i, stream.start);\n      stream.start = stream.pos;\n    }\n  }\n};\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/runmode/runmode.js",
    "content": "CodeMirror.runMode = function(string, modespec, callback, options) {\n  var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);\n\n  if (callback.nodeType == 1) {\n    var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;\n    var node = callback, col = 0;\n    node.innerHTML = \"\";\n    callback = function(text, style) {\n      if (text == \"\\n\") {\n        node.appendChild(document.createElement(\"br\"));\n        col = 0;\n        return;\n      }\n      var content = \"\";\n      // replace tabs\n      for (var pos = 0;;) {\n        var idx = text.indexOf(\"\\t\", pos);\n        if (idx == -1) {\n          content += text.slice(pos);\n          col += text.length - pos;\n          break;\n        } else {\n          col += idx - pos;\n          content += text.slice(pos, idx);\n          var size = tabSize - col % tabSize;\n          col += size;\n          for (var i = 0; i < size; ++i) content += \" \";\n          pos = idx + 1;\n        }\n      }\n\n      if (style) {\n        var sp = node.appendChild(document.createElement(\"span\"));\n        sp.className = \"cm-\" + style.replace(/ +/g, \" cm-\");\n        sp.appendChild(document.createTextNode(content));\n      } else {\n        node.appendChild(document.createTextNode(content));\n      }\n    };\n  }\n\n  var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);\n  for (var i = 0, e = lines.length; i < e; ++i) {\n    if (i) callback(\"\\n\");\n    var stream = new CodeMirror.StringStream(lines[i]);\n    while (!stream.eol()) {\n      var style = mode.token(stream, state);\n      callback(stream.current(), style, i, stream.start);\n      stream.start = stream.pos;\n    }\n  }\n};\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/runmode/runmode.node.js",
    "content": "/* Just enough of CodeMirror to run runMode under node.js */\n\nfunction splitLines(string){ return string.split(/\\r?\\n|\\r/); };\n\nfunction StringStream(string) {\n  this.pos = this.start = 0;\n  this.string = string;\n}\nStringStream.prototype = {\n  eol: function() {return this.pos >= this.string.length;},\n  sol: function() {return this.pos == 0;},\n  peek: function() {return this.string.charAt(this.pos) || null;},\n  next: function() {\n    if (this.pos < this.string.length)\n      return this.string.charAt(this.pos++);\n  },\n  eat: function(match) {\n    var ch = this.string.charAt(this.pos);\n    if (typeof match == \"string\") var ok = ch == match;\n    else var ok = ch && (match.test ? match.test(ch) : match(ch));\n    if (ok) {++this.pos; return ch;}\n  },\n  eatWhile: function(match) {\n    var start = this.pos;\n    while (this.eat(match)){}\n    return this.pos > start;\n  },\n  eatSpace: function() {\n    var start = this.pos;\n    while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;\n    return this.pos > start;\n  },\n  skipToEnd: function() {this.pos = this.string.length;},\n  skipTo: function(ch) {\n    var found = this.string.indexOf(ch, this.pos);\n    if (found > -1) {this.pos = found; return true;}\n  },\n  backUp: function(n) {this.pos -= n;},\n  column: function() {return this.start;},\n  indentation: function() {return 0;},\n  match: function(pattern, consume, caseInsensitive) {\n    if (typeof pattern == \"string\") {\n      function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}\n      if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {\n        if (consume !== false) this.pos += pattern.length;\n        return true;\n      }\n    }\n    else {\n      var match = this.string.slice(this.pos).match(pattern);\n      if (match && consume !== false) this.pos += match[0].length;\n      return match;\n    }\n  },\n  current: function(){return this.string.slice(this.start, this.pos);}\n};\nexports.StringStream = StringStream;\n\nexports.startState = function(mode, a1, a2) {\n  return mode.startState ? mode.startState(a1, a2) : true;\n};\n\nvar modes = exports.modes = {}, mimeModes = exports.mimeModes = {};\nexports.defineMode = function(name, mode) { modes[name] = mode; };\nexports.defineMIME = function(mime, spec) { mimeModes[mime] = spec; };\nexports.getMode = function(options, spec) {\n  if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec))\n    spec = mimeModes[spec];\n  if (typeof spec == \"string\")\n    var mname = spec, config = {};\n  else if (spec != null)\n    var mname = spec.name, config = spec;\n  var mfactory = modes[mname];\n  if (!mfactory) throw new Error(\"Unknown mode: \" + spec);\n  return mfactory(options, config || {});\n};\n\nexports.runMode = function(string, modespec, callback) {\n  var mode = exports.getMode({indentUnit: 2}, modespec);\n  var lines = splitLines(string), state = exports.startState(mode);\n  for (var i = 0, e = lines.length; i < e; ++i) {\n    if (i) callback(\"\\n\");\n    var stream = new exports.StringStream(lines[i]);\n    while (!stream.eol()) {\n      var style = mode.token(stream, state);\n      callback(stream.current(), style, i, stream.start);\n      stream.start = stream.pos;\n    }\n  }\n};\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/search/match-highlighter.js",
    "content": "// Define match-highlighter commands. Depends on searchcursor.js\n// Use by attaching the following function call to the cursorActivity event:\n\t//myCodeMirror.matchHighlight(minChars);\n// And including a special span.CodeMirror-matchhighlight css class (also optionally a separate one for .CodeMirror-focused -- see demo matchhighlighter.html)\n\n(function() {\n  var DEFAULT_MIN_CHARS = 2;\n  \n  function MatchHighlightState() {\n\tthis.marked = [];\n  }\n  function getMatchHighlightState(cm) {\n\treturn cm._matchHighlightState || (cm._matchHighlightState = new MatchHighlightState());\n  }\n  \n  function clearMarks(cm) {\n\tvar state = getMatchHighlightState(cm);\n\tfor (var i = 0; i < state.marked.length; ++i)\n\t\tstate.marked[i].clear();\n\tstate.marked = [];\n  }\n  \n  function markDocument(cm, className, minChars) {\n    clearMarks(cm);\n\tminChars = (typeof minChars !== 'undefined' ? minChars : DEFAULT_MIN_CHARS);\n\tif (cm.somethingSelected() && cm.getSelection().replace(/^\\s+|\\s+$/g, \"\").length >= minChars) {\n\t\tvar state = getMatchHighlightState(cm);\n\t\tvar query = cm.getSelection();\n\t\tcm.operation(function() {\n\t\t\tif (cm.lineCount() < 2000) { // This is too expensive on big documents.\n\t\t\t  for (var cursor = cm.getSearchCursor(query); cursor.findNext();) {\n\t\t\t\t//Only apply matchhighlight to the matches other than the one actually selected\n\t\t\t\tif (cursor.from().line !== cm.getCursor(true).line ||\n                                    cursor.from().ch !== cm.getCursor(true).ch)\n\t\t\t\t\tstate.marked.push(cm.markText(cursor.from(), cursor.to(),\n                                                                      {className: className}));\n\t\t\t  }\n\t\t\t}\n\t\t  });\n\t}\n  }\n\n  CodeMirror.defineExtension(\"matchHighlight\", function(className, minChars) {\n    markDocument(this, className, minChars);\n  });\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/search/search.js",
    "content": "// Define search commands. Depends on dialog.js or another\n// implementation of the openDialog method.\n\n// Replace works a little oddly -- it will do the replace on the next\n// Ctrl-G (or whatever is bound to findNext) press. You prevent a\n// replace by making sure the match is no longer selected when hitting\n// Ctrl-G.\n\n(function() {\n  function searchOverlay(query) {\n    if (typeof query == \"string\") return {token: function(stream) {\n      if (stream.match(query)) return \"searching\";\n      stream.next();\n      stream.skipTo(query.charAt(0)) || stream.skipToEnd();\n    }};\n    return {token: function(stream) {\n      if (stream.match(query)) return \"searching\";\n      while (!stream.eol()) {\n        stream.next();\n        if (stream.match(query, false)) break;\n      }\n    }};\n  }\n\n  function SearchState() {\n    this.posFrom = this.posTo = this.query = null;\n    this.overlay = null;\n  }\n  function getSearchState(cm) {\n    return cm._searchState || (cm._searchState = new SearchState());\n  }\n  function getSearchCursor(cm, query, pos) {\n    // Heuristic: if the query string is all lowercase, do a case insensitive search.\n    return cm.getSearchCursor(query, pos, typeof query == \"string\" && query == query.toLowerCase());\n  }\n  function dialog(cm, text, shortText, f) {\n    if (cm.openDialog) cm.openDialog(text, f);\n    else f(prompt(shortText, \"\"));\n  }\n  function confirmDialog(cm, text, shortText, fs) {\n    if (cm.openConfirm) cm.openConfirm(text, fs);\n    else if (confirm(shortText)) fs[0]();\n  }\n  function parseQuery(query) {\n    var isRE = query.match(/^\\/(.*)\\/([a-z]*)$/);\n    return isRE ? new RegExp(isRE[1], isRE[2].indexOf(\"i\") == -1 ? \"\" : \"i\") : query;\n  }\n  var queryDialog =\n    'Search: <input type=\"text\" style=\"width: 10em\"/> <span style=\"color: #888\">(Use /re/ syntax for regexp search)</span>';\n  function doSearch(cm, rev) {\n    var state = getSearchState(cm);\n    if (state.query) return findNext(cm, rev);\n    dialog(cm, queryDialog, \"Search for:\", function(query) {\n      cm.operation(function() {\n        if (!query || state.query) return;\n        state.query = parseQuery(query);\n        cm.removeOverlay(state.overlay);\n        state.overlay = searchOverlay(query);\n        cm.addOverlay(state.overlay);\n        state.posFrom = state.posTo = cm.getCursor();\n        findNext(cm, rev);\n      });\n    });\n  }\n  function findNext(cm, rev) {cm.operation(function() {\n    var state = getSearchState(cm);\n    var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);\n    if (!cursor.find(rev)) {\n      cursor = getSearchCursor(cm, state.query, rev ? {line: cm.lineCount() - 1} : {line: 0, ch: 0});\n      if (!cursor.find(rev)) return;\n    }\n    cm.setSelection(cursor.from(), cursor.to());\n    state.posFrom = cursor.from(); state.posTo = cursor.to();\n  });}\n  function clearSearch(cm) {cm.operation(function() {\n    var state = getSearchState(cm);\n    if (!state.query) return;\n    state.query = null;\n    cm.removeOverlay(state.overlay);\n  });}\n\n  var replaceQueryDialog =\n    'Replace: <input type=\"text\" style=\"width: 10em\"/> <span style=\"color: #888\">(Use /re/ syntax for regexp search)</span>';\n  var replacementQueryDialog = 'With: <input type=\"text\" style=\"width: 10em\"/>';\n  var doReplaceConfirm = \"Replace? <button>Yes</button> <button>No</button> <button>Stop</button>\";\n  function replace(cm, all) {\n    dialog(cm, replaceQueryDialog, \"Replace:\", function(query) {\n      if (!query) return;\n      query = parseQuery(query);\n      dialog(cm, replacementQueryDialog, \"Replace with:\", function(text) {\n        if (all) {\n          cm.operation(function() {\n            for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {\n              if (typeof query != \"string\") {\n                var match = cm.getRange(cursor.from(), cursor.to()).match(query);\n                cursor.replace(text.replace(/\\$(\\d)/, function(_, i) {return match[i];}));\n              } else cursor.replace(text);\n            }\n          });\n        } else {\n          clearSearch(cm);\n          var cursor = getSearchCursor(cm, query, cm.getCursor());\n          function advance() {\n            var start = cursor.from(), match;\n            if (!(match = cursor.findNext())) {\n              cursor = getSearchCursor(cm, query);\n              if (!(match = cursor.findNext()) ||\n                  (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;\n            }\n            cm.setSelection(cursor.from(), cursor.to());\n            confirmDialog(cm, doReplaceConfirm, \"Replace?\",\n                          [function() {doReplace(match);}, advance]);\n          }\n          function doReplace(match) {\n            cursor.replace(typeof query == \"string\" ? text :\n                           text.replace(/\\$(\\d)/, function(_, i) {return match[i];}));\n            advance();\n          }\n          advance();\n        }\n      });\n    });\n  }\n\n  CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};\n  CodeMirror.commands.findNext = doSearch;\n  CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};\n  CodeMirror.commands.clearSearch = clearSearch;\n  CodeMirror.commands.replace = replace;\n  CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/addon/search/searchcursor.js",
    "content": "(function(){\n  function SearchCursor(cm, query, pos, caseFold) {\n    this.atOccurrence = false; this.cm = cm;\n    if (caseFold == null && typeof query == \"string\") caseFold = false;\n\n    pos = pos ? cm.clipPos(pos) : {line: 0, ch: 0};\n    this.pos = {from: pos, to: pos};\n\n    // The matches method is filled in based on the type of query.\n    // It takes a position and a direction, and returns an object\n    // describing the next occurrence of the query, or null if no\n    // more matches were found.\n    if (typeof query != \"string\") { // Regexp match\n      if (!query.global) query = new RegExp(query.source, query.ignoreCase ? \"ig\" : \"g\");\n      this.matches = function(reverse, pos) {\n        if (reverse) {\n          query.lastIndex = 0;\n          var line = cm.getLine(pos.line).slice(0, pos.ch), match = query.exec(line), start = 0;\n          while (match) {\n            start += match.index + 1;\n            line = line.slice(start);\n            query.lastIndex = 0;\n            var newmatch = query.exec(line);\n            if (newmatch) match = newmatch;\n            else break;\n          }\n          start--;\n        } else {\n          query.lastIndex = pos.ch;\n          var line = cm.getLine(pos.line), match = query.exec(line),\n          start = match && match.index;\n        }\n        if (match && match[0])\n          return {from: {line: pos.line, ch: start},\n                  to: {line: pos.line, ch: start + match[0].length},\n                  match: match};\n      };\n    } else { // String query\n      if (caseFold) query = query.toLowerCase();\n      var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};\n      var target = query.split(\"\\n\");\n      // Different methods for single-line and multi-line queries\n      if (target.length == 1) {\n        if (!query.length) {\n          // Empty string would match anything and never progress, so\n          // we define it to match nothing instead.\n          this.matches = function() {};\n        } else {\n          this.matches = function(reverse, pos) {\n            var line = fold(cm.getLine(pos.line)), len = query.length, match;\n            if (reverse ? (pos.ch >= len && (match = line.lastIndexOf(query, pos.ch - len)) != -1)\n                        : (match = line.indexOf(query, pos.ch)) != -1)\n              return {from: {line: pos.line, ch: match},\n                      to: {line: pos.line, ch: match + len}};\n          };\n        }\n      } else {\n        this.matches = function(reverse, pos) {\n          var ln = pos.line, idx = (reverse ? target.length - 1 : 0), match = target[idx], line = fold(cm.getLine(ln));\n          var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match));\n          if (reverse ? offsetA >= pos.ch || offsetA != match.length\n              : offsetA <= pos.ch || offsetA != line.length - match.length)\n            return;\n          for (;;) {\n            if (reverse ? !ln : ln == cm.lineCount() - 1) return;\n            line = fold(cm.getLine(ln += reverse ? -1 : 1));\n            match = target[reverse ? --idx : ++idx];\n            if (idx > 0 && idx < target.length - 1) {\n              if (line != match) return;\n              else continue;\n            }\n            var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length);\n            if (reverse ? offsetB != line.length - match.length : offsetB != match.length)\n              return;\n            var start = {line: pos.line, ch: offsetA}, end = {line: ln, ch: offsetB};\n            return {from: reverse ? end : start, to: reverse ? start : end};\n          }\n        };\n      }\n    }\n  }\n\n  SearchCursor.prototype = {\n    findNext: function() {return this.find(false);},\n    findPrevious: function() {return this.find(true);},\n\n    find: function(reverse) {\n      var self = this, pos = this.cm.clipPos(reverse ? this.pos.from : this.pos.to);\n      function savePosAndFail(line) {\n        var pos = {line: line, ch: 0};\n        self.pos = {from: pos, to: pos};\n        self.atOccurrence = false;\n        return false;\n      }\n\n      for (;;) {\n        if (this.pos = this.matches(reverse, pos)) {\n          this.atOccurrence = true;\n          return this.pos.match || true;\n        }\n        if (reverse) {\n          if (!pos.line) return savePosAndFail(0);\n          pos = {line: pos.line-1, ch: this.cm.getLine(pos.line-1).length};\n        }\n        else {\n          var maxLine = this.cm.lineCount();\n          if (pos.line == maxLine - 1) return savePosAndFail(maxLine);\n          pos = {line: pos.line+1, ch: 0};\n        }\n      }\n    },\n\n    from: function() {if (this.atOccurrence) return this.pos.from;},\n    to: function() {if (this.atOccurrence) return this.pos.to;},\n\n    replace: function(newText) {\n      var self = this;\n      if (this.atOccurrence)\n        self.pos.to = this.cm.replaceRange(newText, self.pos.from, self.pos.to);\n    }\n  };\n\n  CodeMirror.defineExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n    return new SearchCursor(this, query, pos, caseFold);\n  });\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/keymap/emacs.js",
    "content": "// TODO number prefixes\n(function() {\n  // Really primitive kill-ring implementation.\n  var killRing = [];\n  function addToRing(str) {\n    killRing.push(str);\n    if (killRing.length > 50) killRing.shift();\n  }\n  function getFromRing() { return killRing[killRing.length - 1] || \"\"; }\n  function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); }\n\n  CodeMirror.keyMap.emacs = {\n    \"Ctrl-X\": function(cm) {cm.setOption(\"keyMap\", \"emacs-Ctrl-X\");},\n    \"Ctrl-W\": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection(\"\");},\n    \"Ctrl-Alt-W\": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection(\"\");},\n    \"Alt-W\": function(cm) {addToRing(cm.getSelection());},\n    \"Ctrl-Y\": function(cm) {cm.replaceSelection(getFromRing());},\n    \"Alt-Y\": function(cm) {cm.replaceSelection(popFromRing());},\n    \"Ctrl-/\": \"undo\", \"Shift-Ctrl--\": \"undo\", \"Shift-Alt-,\": \"goDocStart\", \"Shift-Alt-.\": \"goDocEnd\",\n    \"Ctrl-S\": \"findNext\", \"Ctrl-R\": \"findPrev\", \"Ctrl-G\": \"clearSearch\", \"Shift-Alt-5\": \"replace\",\n    \"Ctrl-Z\": \"undo\", \"Cmd-Z\": \"undo\", \"Alt-/\": \"autocomplete\", \"Alt-V\": \"goPageUp\",\n    \"Ctrl-J\": \"newlineAndIndent\", \"Enter\": false, \"Tab\": \"indentAuto\",\n    fallthrough: [\"basic\", \"emacsy\"]\n  };\n\n  CodeMirror.keyMap[\"emacs-Ctrl-X\"] = {\n    \"Ctrl-S\": \"save\", \"Ctrl-W\": \"save\", \"S\": \"saveAll\", \"F\": \"open\", \"U\": \"undo\", \"K\": \"close\",\n    auto: \"emacs\", nofallthrough: true\n  };\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/keymap/vim.js",
    "content": "/**\n * Supported keybindings:\n *\n *   Motion:\n *   h, j, k, l\n *   e, E, w, W, b, B, ge, gE\n *   f<character>, F<character>, t<character>, T<character>\n *   $, ^, 0\n *   gg, G\n *   %\n *   '<character>, `<character>\n *\n *   Operator:\n *   d, y, c\n *   dd, yy, cc\n *   g~, g~g~\n *   >, <, >>, <<\n *\n *   Operator-Motion:\n *   x, X, D, Y, C, ~\n *\n *   Action:\n *   a, i, s, A, I, S, o, O\n *   J\n *   u, Ctrl-r\n *   m<character>\n *   r<character>\n *\n *   Modes:\n *   ESC - leave insert mode, visual mode, and clear input state.\n *   Ctrl-[, Ctrl-c - same as ESC.\n *\n * Registers: unamed, -, a-z, A-Z, 0-9\n *   (Does not respect the special case for number registers when delete\n *    operator is made with these commands: %, (, ),  , /, ?, n, N, {, } )\n *   TODO: Implement the remaining registers.\n * Marks: a-z, A-Z, and 0-9\n *   TODO: Implement the remaining special marks. They have more complex\n *       behavior.\n *\n * Code structure:\n *  1. Default keymap\n *  2. Variable declarations and short basic helpers\n *  3. Instance (External API) implementation\n *  4. Internal state tracking objects (input state, counter) implementation\n *     and instanstiation\n *  5. Key handler (the main command dispatcher) implementation\n *  6. Motion, operator, and action implementations\n *  7. Helper functions for the key handler, motions, operators, and actions\n *  8. Set up Vim to work as a keymap for CodeMirror.\n */\n\n(function() {\n  'use strict';\n\n  var defaultKeymap = [\n    // Key to key mapping. This goes first to make it possible to override\n    // existing mappings.\n    { keys: ['Left'], type: 'keyToKey', toKeys: ['h'] },\n    { keys: ['Right'], type: 'keyToKey', toKeys: ['l'] },\n    { keys: ['Up'], type: 'keyToKey', toKeys: ['k'] },\n    { keys: ['Down'], type: 'keyToKey', toKeys: ['j'] },\n    { keys: ['Space'], type: 'keyToKey', toKeys: ['l'] },\n    { keys: ['Backspace'], type: 'keyToKey', toKeys: ['h'] },\n    { keys: ['Ctrl-Space'], type: 'keyToKey', toKeys: ['W'] },\n    { keys: ['Ctrl-Backspace'], type: 'keyToKey', toKeys: ['B'] },\n    { keys: ['Shift-Space'], type: 'keyToKey', toKeys: ['w'] },\n    { keys: ['Shift-Backspace'], type: 'keyToKey', toKeys: ['b'] },\n    { keys: ['Ctrl-n'], type: 'keyToKey', toKeys: ['j'] },\n    { keys: ['Ctrl-p'], type: 'keyToKey', toKeys: ['k'] },\n    { keys: ['Ctrl-['], type: 'keyToKey', toKeys: ['Esc'] },\n    { keys: ['Ctrl-c'], type: 'keyToKey', toKeys: ['Esc'] },\n    { keys: ['s'], type: 'keyToKey', toKeys: ['c', 'l'] },\n    { keys: ['S'], type: 'keyToKey', toKeys: ['c', 'c'] },\n    { keys: ['Home'], type: 'keyToKey', toKeys: ['0'] },\n    { keys: ['End'], type: 'keyToKey', toKeys: ['$'] },\n    { keys: ['PageUp'], type: 'keyToKey', toKeys: ['Ctrl-b'] },\n    { keys: ['PageDown'], type: 'keyToKey', toKeys: ['Ctrl-f'] },\n    // Motions\n    { keys: ['h'], type: 'motion',\n        motion: 'moveByCharacters',\n        motionArgs: { forward: false }},\n    { keys: ['l'], type: 'motion',\n        motion: 'moveByCharacters',\n        motionArgs: { forward: true }},\n    { keys: ['j'], type: 'motion',\n        motion: 'moveByLines',\n        motionArgs: { forward: true, linewise: true }},\n    { keys: ['k'], type: 'motion',\n        motion: 'moveByLines',\n        motionArgs: { forward: false, linewise: true }},\n    { keys: ['w'], type: 'motion',\n        motion: 'moveByWords',\n        motionArgs: { forward: true, wordEnd: false }},\n    { keys: ['W'], type: 'motion',\n        motion: 'moveByWords',\n        motionArgs: { forward: true, wordEnd: false, bigWord: true }},\n    { keys: ['e'], type: 'motion',\n        motion: 'moveByWords',\n        motionArgs: { forward: true, wordEnd: true, inclusive: true }},\n    { keys: ['E'], type: 'motion',\n        motion: 'moveByWords',\n        motionArgs: { forward: true, wordEnd: true, bigWord: true,\n            inclusive: true }},\n    { keys: ['b'], type: 'motion',\n        motion: 'moveByWords',\n        motionArgs: { forward: false, wordEnd: false }},\n    { keys: ['B'], type: 'motion',\n        motion: 'moveByWords',\n        motionArgs: { forward: false, wordEnd: false, bigWord: true }},\n    { keys: ['g', 'e'], type: 'motion',\n        motion: 'moveByWords',\n        motionArgs: { forward: false, wordEnd: true, inclusive: true }},\n    { keys: ['g', 'E'], type: 'motion',\n        motion: 'moveByWords',\n        motionArgs: { forward: false, wordEnd: true, bigWord: true,\n            inclusive: true }},\n    { keys: ['{'], type: 'motion', motion: 'moveByParagraph',\n        motionArgs: { forward: false }},\n    { keys: ['}'], type: 'motion', motion: 'moveByParagraph',\n        motionArgs: { forward: true }},\n    { keys: ['Ctrl-f'], type: 'motion',\n        motion: 'moveByPage', motionArgs: { forward: true }},\n    { keys: ['Ctrl-b'], type: 'motion',\n        motion: 'moveByPage', motionArgs: { forward: false }},\n    { keys: ['g', 'g'], type: 'motion',\n        motion: 'moveToLineOrEdgeOfDocument',\n        motionArgs: { forward: false, explicitRepeat: true, linewise: true }},\n    { keys: ['G'], type: 'motion',\n        motion: 'moveToLineOrEdgeOfDocument',\n        motionArgs: { forward: true, explicitRepeat: true, linewise: true }},\n    { keys: ['0'], type: 'motion', motion: 'moveToStartOfLine' },\n    { keys: ['^'], type: 'motion',\n        motion: 'moveToFirstNonWhiteSpaceCharacter' },\n    { keys: ['$'], type: 'motion',\n        motion: 'moveToEol',\n        motionArgs: { inclusive: true }},\n    { keys: ['%'], type: 'motion',\n        motion: 'moveToMatchedSymbol',\n        motionArgs: { inclusive: true }},\n    { keys: ['f', 'character'], type: 'motion',\n        motion: 'moveToCharacter',\n        motionArgs: { forward: true , inclusive: true }},\n    { keys: ['F', 'character'], type: 'motion',\n        motion: 'moveToCharacter',\n        motionArgs: { forward: false }},\n    { keys: ['t', 'character'], type: 'motion',\n        motion: 'moveTillCharacter',\n        motionArgs: { forward: true, inclusive: true }},\n    { keys: ['T', 'character'], type: 'motion',\n        motion: 'moveTillCharacter',\n        motionArgs: { forward: false }},\n    { keys: ['\\'', 'character'], type: 'motion', motion: 'goToMark' },\n    { keys: ['`', 'character'], type: 'motion', motion: 'goToMark' },\n    { keys: ['|'], type: 'motion',\n        motion: 'moveToColumn',\n        motionArgs: { }},\n    // Operators\n    { keys: ['d'], type: 'operator', operator: 'delete' },\n    { keys: ['y'], type: 'operator', operator: 'yank' },\n    { keys: ['c'], type: 'operator', operator: 'change',\n        operatorArgs: { enterInsertMode: true } },\n    { keys: ['>'], type: 'operator', operator: 'indent',\n        operatorArgs: { indentRight: true }},\n    { keys: ['<'], type: 'operator', operator: 'indent',\n        operatorArgs: { indentRight: false }},\n    { keys: ['g', '~'], type: 'operator', operator: 'swapcase' },\n    { keys: ['n'], type: 'motion', motion: 'findNext' },\n    { keys: ['N'], type: 'motion', motion: 'findPrev' },\n    // Operator-Motion dual commands\n    { keys: ['x'], type: 'operatorMotion', operator: 'delete',\n        motion: 'moveByCharacters', motionArgs: { forward: true },\n        operatorMotionArgs: { visualLine: false }},\n    { keys: ['X'], type: 'operatorMotion', operator: 'delete',\n        motion: 'moveByCharacters', motionArgs: { forward: false },\n        operatorMotionArgs: { visualLine: true }},\n    { keys: ['D'], type: 'operatorMotion', operator: 'delete',\n      motion: 'moveToEol', motionArgs: { inclusive: true },\n        operatorMotionArgs: { visualLine: true }},\n    { keys: ['Y'], type: 'operatorMotion', operator: 'yank',\n        motion: 'moveToEol', motionArgs: { inclusive: true },\n        operatorMotionArgs: { visualLine: true }},\n    { keys: ['C'], type: 'operatorMotion',\n        operator: 'change', operatorArgs: { enterInsertMode: true },\n        motion: 'moveToEol', motionArgs: { inclusive: true },\n        operatorMotionArgs: { visualLine: true }},\n    { keys: ['~'], type: 'operatorMotion', operator: 'swapcase',\n        motion: 'moveByCharacters', motionArgs: { forward: true }},\n    // Actions\n    { keys: ['a'], type: 'action', action: 'enterInsertMode',\n        actionArgs: { insertAt: 'charAfter' }},\n    { keys: ['A'], type: 'action', action: 'enterInsertMode',\n        actionArgs: { insertAt: 'eol' }},\n    { keys: ['i'], type: 'action', action: 'enterInsertMode' },\n    { keys: ['I'], type: 'action', action: 'enterInsertMode',\n        motion: 'moveToFirstNonWhiteSpaceCharacter' },\n    { keys: ['o'], type: 'action', action: 'newLineAndEnterInsertMode',\n        actionArgs: { after: true }},\n    { keys: ['O'], type: 'action', action: 'newLineAndEnterInsertMode',\n        actionArgs: { after: false }},\n    { keys: ['v'], type: 'action', action: 'toggleVisualMode' },\n    { keys: ['V'], type: 'action', action: 'toggleVisualMode',\n        actionArgs: { linewise: true }},\n    { keys: ['J'], type: 'action', action: 'joinLines' },\n    { keys: ['p'], type: 'action', action: 'paste',\n        actionArgs: { after: true }},\n    { keys: ['P'], type: 'action', action: 'paste',\n        actionArgs: { after: false }},\n    { keys: ['r', 'character'], type: 'action', action: 'replace' },\n    { keys: ['u'], type: 'action', action: 'undo' },\n    { keys: ['Ctrl-r'], type: 'action', action: 'redo' },\n    { keys: ['m', 'character'], type: 'action', action: 'setMark' },\n    { keys: ['\\\"', 'character'], type: 'action', action: 'setRegister' },\n    { keys: [',', '/'], type: 'action', action: 'clearSearchHighlight' },\n    // Text object motions\n    { keys: ['a', 'character'], type: 'motion',\n        motion: 'textObjectManipulation' },\n    { keys: ['i', 'character'], type: 'motion',\n        motion: 'textObjectManipulation',\n        motionArgs: { textObjectInner: true }},\n    // Search\n    { keys: ['/'], type: 'search',\n        searchArgs: { forward: true, querySrc: 'prompt' }},\n    { keys: ['?'], type: 'search',\n        searchArgs: { forward: false, querySrc: 'prompt' }},\n    { keys: ['*'], type: 'search',\n        searchArgs: { forward: true, querySrc: 'wordUnderCursor' }},\n    { keys: ['#'], type: 'search',\n        searchArgs: { forward: false, querySrc: 'wordUnderCursor' }},\n    // Ex command\n    { keys: [':'], type: 'ex' }\n  ];\n\n  var Vim = function() {\n    var alphabetRegex = /[A-Za-z]/;\n    var numberRegex = /[\\d]/;\n    var whiteSpaceRegex = /\\s/;\n    var wordRegexp = [(/\\w/), (/[^\\w\\s]/)], bigWordRegexp = [(/\\S/)];\n    function makeKeyRange(start, size) {\n      var keys = [];\n      for (var i = start; i < start + size; i++) {\n        keys.push(String.fromCharCode(i));\n      }\n      return keys;\n    }\n    var upperCaseAlphabet = makeKeyRange(65, 26);\n    var lowerCaseAlphabet = makeKeyRange(97, 26);\n    var numbers = makeKeyRange(48, 10);\n    var SPECIAL_SYMBOLS = '~`!@#$%^&*()_-+=[{}]\\\\|/?.,<>:;\\\"\\'';\n    var specialSymbols = SPECIAL_SYMBOLS.split('');\n    var specialKeys = ['Left', 'Right', 'Up', 'Down', 'Space', 'Backspace',\n        'Esc', 'Home', 'End', 'PageUp', 'PageDown'];\n    var validMarks = upperCaseAlphabet.concat(lowerCaseAlphabet).concat(\n        numbers).concat(['<', '>']);\n    var validRegisters = upperCaseAlphabet.concat(lowerCaseAlphabet).concat(\n        numbers).concat('-\\\"'.split(''));\n\n    function isAlphabet(k) {\n      return alphabetRegex.test(k);\n    }\n    function isLine(cm, line) {\n      return line >= 0 && line < cm.lineCount();\n    }\n    function isLowerCase(k) {\n      return (/^[a-z]$/).test(k);\n    }\n    function isMatchableSymbol(k) {\n      return '()[]{}'.indexOf(k) != -1;\n    }\n    function isNumber(k) {\n      return numberRegex.test(k);\n    }\n    function isUpperCase(k) {\n      return (/^[A-Z]$/).test(k);\n    }\n    function isAlphanumeric(k) {\n      return (/^[\\w]$/).test(k);\n    }\n    function isWhiteSpace(k) {\n      return whiteSpaceRegex.test(k);\n    }\n    function isWhiteSpaceString(k) {\n      return (/^\\s*$/).test(k);\n    }\n    function inRangeInclusive(x, start, end) {\n      return x >= start && x <= end;\n    }\n    function inArray(val, arr) {\n      for (var i = 0; i < arr.length; i++) {\n        if (arr[i] == val) {\n          return true;\n        }\n      }\n      return false;\n    }\n\n    // Global Vim state. Call getVimGlobalState to get and initialize.\n    var vimGlobalState;\n    function getVimGlobalState() {\n      if (!vimGlobalState) {\n        vimGlobalState = {\n          // The current search query.\n          searchQuery: null,\n          // Whether we are searching backwards.\n          searchIsReversed: false,\n          registerController: new RegisterController({})\n        };\n      }\n      return vimGlobalState;\n    }\n    function getVimState(cm) {\n      if (!cm.vimState) {\n        // Store instance state in the CodeMirror object.\n        cm.vimState = {\n          inputState: new InputState(),\n          // When using jk for navigation, if you move from a longer line to a\n          // shorter line, the cursor may clip to the end of the shorter line.\n          // If j is pressed again and cursor goes to the next line, the\n          // cursor should go back to its horizontal position on the longer\n          // line if it can. This is to keep track of the horizontal position.\n          lastHPos: -1,\n          // The last motion command run. Cleared if a non-motion command gets\n          // executed in between.\n          lastMotion: null,\n          marks: {},\n          visualMode: false,\n          // If we are in visual line mode. No effect if visualMode is false.\n          visualLine: false\n        };\n      }\n      return cm.vimState;\n    }\n\n    var vimApi= {\n      buildKeyMap: function() {\n        // TODO: Convert keymap into dictionary format for fast lookup.\n      },\n      // Testing hook, though it might be useful to expose the register\n      // controller anyways.\n      getRegisterController: function() {\n        return getVimGlobalState().registerController;\n      },\n      // Testing hook.\n      clearVimGlobalState_: function() {\n        vimGlobalState = null;\n      },\n      map: function(lhs, rhs) {\n        // Add user defined key bindings.\n        exCommandDispatcher.map(lhs, rhs);\n      },\n      // Initializes vim state variable on the CodeMirror object. Should only be\n      // called lazily by handleKey or for testing.\n      maybeInitState: function(cm) {\n        getVimState(cm);\n      },\n      // This is the outermost function called by CodeMirror, after keys have\n      // been mapped to their Vim equivalents.\n      handleKey: function(cm, key) {\n        var command;\n        var vim = getVimState(cm);\n        if (key == 'Esc') {\n          // Clear input state and get back to normal mode.\n          vim.inputState.reset();\n          if (vim.visualMode) {\n            exitVisualMode(cm, vim);\n          }\n          return;\n        }\n        if (vim.visualMode &&\n            cursorEqual(cm.getCursor('head'), cm.getCursor('anchor'))) {\n          // The selection was cleared. Exit visual mode.\n          exitVisualMode(cm, vim);\n        }\n        if (!vim.visualMode &&\n            !cursorEqual(cm.getCursor('head'), cm.getCursor('anchor'))) {\n          vim.visualMode = true;\n          vim.visualLine = false;\n        }\n        if (key != '0' || (key == '0' && vim.inputState.getRepeat() === 0)) {\n          // Have to special case 0 since it's both a motion and a number.\n          command = commandDispatcher.matchCommand(key, defaultKeymap, vim);\n        }\n        if (!command) {\n          if (isNumber(key)) {\n            // Increment count unless count is 0 and key is 0.\n            vim.inputState.pushRepeatDigit(key);\n          }\n          return;\n        }\n        if (command.type == 'keyToKey') {\n          // TODO: prevent infinite recursion.\n          for (var i = 0; i < command.toKeys.length; i++) {\n            this.handleKey(cm, command.toKeys[i]);\n          }\n        } else {\n          commandDispatcher.processCommand(cm, vim, command);\n        }\n      }\n    };\n\n    // Represents the current input state.\n    function InputState() {\n      this.reset();\n    }\n    InputState.prototype.reset = function() {\n      this.prefixRepeat = [];\n      this.motionRepeat = [];\n\n      this.operator = null;\n      this.operatorArgs = null;\n      this.motion = null;\n      this.motionArgs = null;\n      this.keyBuffer = []; // For matching multi-key commands.\n      this.registerName = null; // Defaults to the unamed register.\n    };\n    InputState.prototype.pushRepeatDigit = function(n) {\n      if (!this.operator) {\n        this.prefixRepeat = this.prefixRepeat.concat(n);\n      } else {\n        this.motionRepeat = this.motionRepeat.concat(n);\n      }\n    };\n    InputState.prototype.getRepeat = function() {\n      var repeat = 0;\n      if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) {\n        repeat = 1;\n        if (this.prefixRepeat.length > 0) {\n          repeat *= parseInt(this.prefixRepeat.join(''), 10);\n        }\n        if (this.motionRepeat.length > 0) {\n          repeat *= parseInt(this.motionRepeat.join(''), 10);\n        }\n      }\n      return repeat;\n    };\n\n    /*\n     * Register stores information about copy and paste registers.  Besides\n     * text, a register must store whether it is linewise (i.e., when it is\n     * pasted, should it insert itself into a new line, or should the text be\n     * inserted at the cursor position.)\n     */\n    function Register(text, linewise) {\n      this.clear();\n      if (text) {\n        this.set(text, linewise);\n      }\n    }\n    Register.prototype = {\n      set: function(text, linewise) {\n        this.text = text;\n        this.linewise = !!linewise;\n      },\n      append: function(text, linewise) {\n        // if this register has ever been set to linewise, use linewise.\n        if (linewise || this.linewise) {\n          this.text += '\\n' + text;\n          this.linewise = true;\n        } else {\n          this.text += text;\n        }\n      },\n      clear: function() {\n        this.text = '';\n        this.linewise = false;\n      },\n      toString: function() { return this.text; }\n    };\n\n    /*\n     * vim registers allow you to keep many independent copy and paste buffers.\n     * See http://usevim.com/2012/04/13/registers/ for an introduction.\n     *\n     * RegisterController keeps the state of all the registers.  An initial\n     * state may be passed in.  The unnamed register '\"' will always be\n     * overridden.\n     */\n    function RegisterController(registers) {\n      this.registers = registers;\n      this.unamedRegister = registers['\\\"'] = new Register();\n    }\n    RegisterController.prototype = {\n      pushText: function(registerName, operator, text, linewise) {\n        // Lowercase and uppercase registers refer to the same register.\n        // Uppercase just means append.\n        var register = this.isValidRegister(registerName) ?\n            this.getRegister(registerName) : null;\n        // if no register/an invalid register was specified, things go to the\n        // default registers\n        if (!register) {\n          switch (operator) {\n            case 'yank':\n              // The 0 register contains the text from the most recent yank.\n              this.registers['0'] = new Register(text, linewise);\n              break;\n            case 'delete':\n            case 'change':\n              if (text.indexOf('\\n') == -1) {\n                // Delete less than 1 line. Update the small delete register.\n                this.registers['-'] = new Register(text, linewise);\n              } else {\n                // Shift down the contents of the numbered registers and put the\n                // deleted text into register 1.\n                this.shiftNumericRegisters_();\n                this.registers['1'] = new Register(text, linewise);\n              }\n              break;\n          }\n          // Make sure the unnamed register is set to what just happened\n          this.unamedRegister.set(text, linewise);\n          return;\n        }\n\n        // If we've gotten to this point, we've actually specified a register\n        var append = isUpperCase(registerName);\n        if (append) {\n          register.append(text, linewise);\n          // The unamed register always has the same value as the last used\n          // register.\n          this.unamedRegister.append(text, linewise);\n        } else {\n          register.set(text, linewise);\n          this.unamedRegister.set(text, linewise);\n        }\n      },\n      // Gets the register named @name.  If one of @name doesn't already exist,\n      // create it.  If @name is invalid, return the unamedRegister.\n      getRegister: function(name) {\n        if (!this.isValidRegister(name)) {\n          return this.unamedRegister;\n        }\n        name = name.toLowerCase();\n        if (!this.registers[name]) {\n          this.registers[name] = new Register();\n        }\n        return this.registers[name];\n      },\n      isValidRegister: function(name) {\n        return name && inArray(name, validRegisters);\n      },\n      shiftNumericRegisters_: function() {\n        for (var i = 9; i >= 2; i--) {\n          this.registers[i] = this.getRegister('' + (i - 1));\n        }\n      }\n    };\n\n    var commandDispatcher = {\n      matchCommand: function(key, keyMap, vim) {\n        var inputState = vim.inputState;\n        var keys = inputState.keyBuffer.concat(key);\n        for (var i = 0; i < keyMap.length; i++) {\n          var command = keyMap[i];\n          if (matchKeysPartial(keys, command.keys)) {\n            if (keys.length < command.keys.length) {\n              // Matches part of a multi-key command. Buffer and wait for next\n              // stroke.\n              inputState.keyBuffer.push(key);\n              return null;\n            } else {\n              if (inputState.operator && command.type == 'action') {\n                // Ignore matched action commands after an operator. Operators\n                // only operate on motions. This check is really for text\n                // objects since aW, a[ etcs conflicts with a.\n                continue;\n              }\n              // Matches whole comand. Return the command.\n              if (command.keys[keys.length - 1] == 'character') {\n                inputState.selectedCharacter = keys[keys.length - 1];\n              }\n              inputState.keyBuffer = [];\n              return command;\n            }\n          }\n        }\n        // Clear the buffer since there are no partial matches.\n        inputState.keyBuffer = [];\n        return null;\n      },\n      processCommand: function(cm, vim, command) {\n        switch (command.type) {\n          case 'motion':\n            this.processMotion(cm, vim, command);\n            break;\n          case 'operator':\n            this.processOperator(cm, vim, command);\n            break;\n          case 'operatorMotion':\n            this.processOperatorMotion(cm, vim, command);\n            break;\n          case 'action':\n            this.processAction(cm, vim, command);\n            break;\n          case 'search':\n            this.processSearch(cm, vim, command);\n            break;\n          case 'ex':\n          case 'keyToEx':\n            this.processEx(cm, vim, command);\n            break;\n          default:\n            break;\n        }\n      },\n      processMotion: function(cm, vim, command) {\n        vim.inputState.motion = command.motion;\n        vim.inputState.motionArgs = copyArgs(command.motionArgs);\n        this.evalInput(cm, vim);\n      },\n      processOperator: function(cm, vim, command) {\n        var inputState = vim.inputState;\n        if (inputState.operator) {\n          if (inputState.operator == command.operator) {\n            // Typing an operator twice like 'dd' makes the operator operate\n            // linewise\n            inputState.motion = 'expandToLine';\n            inputState.motionArgs = { linewise: true };\n            this.evalInput(cm, vim);\n            return;\n          } else {\n            // 2 different operators in a row doesn't make sense.\n            inputState.reset();\n          }\n        }\n        inputState.operator = command.operator;\n        inputState.operatorArgs = copyArgs(command.operatorArgs);\n        if (vim.visualMode) {\n          // Operating on a selection in visual mode. We don't need a motion.\n          this.evalInput(cm, vim);\n        }\n      },\n      processOperatorMotion: function(cm, vim, command) {\n        var visualMode = vim.visualMode;\n        var operatorMotionArgs = copyArgs(command.operatorMotionArgs);\n        if (operatorMotionArgs) {\n          // Operator motions may have special behavior in visual mode.\n          if (visualMode && operatorMotionArgs.visualLine) {\n            vim.visualLine = true;\n          }\n        }\n        this.processOperator(cm, vim, command);\n        if (!visualMode) {\n          this.processMotion(cm, vim, command);\n        }\n      },\n      processAction: function(cm, vim, command) {\n        var inputState = vim.inputState;\n        var repeat = inputState.getRepeat();\n        var repeatIsExplicit = !!repeat;\n        var actionArgs = copyArgs(command.actionArgs) || {};\n        if (inputState.selectedCharacter) {\n          actionArgs.selectedCharacter = inputState.selectedCharacter;\n        }\n        // Actions may or may not have motions and operators. Do these first.\n        if (command.operator) {\n          this.processOperator(cm, vim, command);\n        }\n        if (command.motion) {\n          this.processMotion(cm, vim, command);\n        }\n        if (command.motion || command.operator) {\n          this.evalInput(cm, vim);\n        }\n        actionArgs.repeat = repeat || 1;\n        actionArgs.repeatIsExplicit = repeatIsExplicit;\n        actionArgs.registerName = inputState.registerName;\n        inputState.reset();\n        vim.lastMotion = null,\n        actions[command.action](cm, actionArgs, vim);\n      },\n      processSearch: function(cm, vim, command) {\n        if (!cm.getSearchCursor) {\n          // Search depends on SearchCursor.\n          return;\n        }\n        var forward = command.searchArgs.forward;\n        getSearchState(cm).setReversed(!forward);\n        var promptPrefix = (forward) ? '/' : '?';\n        function handleQuery(query, ignoreCase, smartCase) {\n          updateSearchQuery(cm, query, ignoreCase, smartCase);\n          commandDispatcher.processMotion(cm, vim, {\n            type: 'motion',\n            motion: 'findNext'\n          });\n        }\n        function onPromptClose(query) {\n          handleQuery(query, true /** ignoreCase */, true /** smartCase */);\n        }\n        switch (command.searchArgs.querySrc) {\n          case 'prompt':\n            showPrompt(cm, onPromptClose, promptPrefix, searchPromptDesc);\n            break;\n          case 'wordUnderCursor':\n            var word = expandWordUnderCursor(cm, false /** inclusive */,\n                true /** forward */, false /** bigWord */,\n                true /** noSymbol */);\n            var isKeyword = true;\n            if (!word) {\n              word = expandWordUnderCursor(cm, false /** inclusive */,\n                  true /** forward */, false /** bigWord */,\n                  false /** noSymbol */);\n              isKeyword = false;\n            }\n            if (!word) {\n              return;\n            }\n            var query = cm.getLine(word.start.line).substring(word.start.ch,\n                word.end.ch + 1);\n            if (isKeyword) {\n              query = '\\\\b' + query + '\\\\b';\n            } else {\n              query = escapeRegex(query);\n            }\n            cm.setCursor(word.start);\n            handleQuery(query, true /** ignoreCase */, false /** smartCase */);\n            break;\n        }\n      },\n      processEx: function(cm, vim, command) {\n        function onPromptClose(input) {\n          exCommandDispatcher.processCommand(cm, input);\n        }\n        if (command.type == 'keyToEx') {\n          // Handle user defined Ex to Ex mappings\n          exCommandDispatcher.processCommand(cm, command.exArgs.input);\n        } else {\n          if (vim.visualMode) {\n            showPrompt(cm, onPromptClose, ':', undefined, '\\'<,\\'>');\n          } else {\n            showPrompt(cm, onPromptClose, ':');\n          }\n        }\n      },\n      evalInput: function(cm, vim) {\n        // If the motion comand is set, execute both the operator and motion.\n        // Otherwise return.\n        var inputState = vim.inputState;\n        var motion = inputState.motion;\n        var motionArgs = inputState.motionArgs || {};\n        var operator = inputState.operator;\n        var operatorArgs = inputState.operatorArgs || {};\n        var registerName = inputState.registerName;\n        var selectionEnd = cm.getCursor('head');\n        var selectionStart = cm.getCursor('anchor');\n        // The difference between cur and selection cursors are that cur is\n        // being operated on and ignores that there is a selection.\n        var curStart = copyCursor(selectionEnd);\n        var curOriginal = copyCursor(curStart);\n        var curEnd;\n        var repeat;\n        if (motionArgs.repeat !== undefined) {\n          // If motionArgs specifies a repeat, that takes precedence over the\n          // input state's repeat. Used by Ex mode and can be user defined.\n          repeat = inputState.motionArgs.repeat;\n        } else {\n          repeat = inputState.getRepeat();\n        }\n        if (repeat > 0 && motionArgs.explicitRepeat) {\n          motionArgs.repeatIsExplicit = true;\n        } else if (motionArgs.noRepeat ||\n            (!motionArgs.explicitRepeat && repeat === 0)) {\n          repeat = 1;\n          motionArgs.repeatIsExplicit = false;\n        }\n        if (inputState.selectedCharacter) {\n          // If there is a character input, stick it in all of the arg arrays.\n          motionArgs.selectedCharacter = operatorArgs.selectedCharacter =\n              inputState.selectedCharacter;\n        }\n        motionArgs.repeat = repeat;\n        inputState.reset();\n        if (motion) {\n          var motionResult = motions[motion](cm, motionArgs, vim);\n          vim.lastMotion = motions[motion];\n          if (!motionResult) {\n            return;\n          }\n          if (motionResult instanceof Array) {\n            curStart = motionResult[0];\n            curEnd = motionResult[1];\n          } else {\n            curEnd = motionResult;\n          }\n          // TODO: Handle null returns from motion commands better.\n          if (!curEnd) {\n            curEnd = { ch: curStart.ch, line: curStart.line };\n          }\n          if (vim.visualMode) {\n            // Check if the selection crossed over itself. Will need to shift\n            // the start point if that happened.\n            if (cursorIsBefore(selectionStart, selectionEnd) &&\n                (cursorEqual(selectionStart, curEnd) ||\n                    cursorIsBefore(curEnd, selectionStart))) {\n              // The end of the selection has moved from after the start to\n              // before the start. We will shift the start right by 1.\n              selectionStart.ch += 1;\n            } else if (cursorIsBefore(selectionEnd, selectionStart) &&\n                (cursorEqual(selectionStart, curEnd) ||\n                    cursorIsBefore(selectionStart, curEnd))) {\n              // The opposite happened. We will shift the start left by 1.\n              selectionStart.ch -= 1;\n            }\n            selectionEnd = curEnd;\n            if (vim.visualLine) {\n              if (cursorIsBefore(selectionStart, selectionEnd)) {\n                selectionStart.ch = 0;\n                selectionEnd.ch = lineLength(cm, selectionEnd.line);\n              } else {\n                selectionEnd.ch = 0;\n                selectionStart.ch = lineLength(cm, selectionStart.line);\n              }\n            }\n            // Need to set the cursor to clear the selection. Otherwise,\n            // CodeMirror can't figure out that we changed directions...\n            cm.setCursor(selectionStart);\n            cm.setSelection(selectionStart, selectionEnd);\n            updateMark(cm, vim, '<',\n                cursorIsBefore(selectionStart, selectionEnd) ? selectionStart\n                    : selectionEnd);\n            updateMark(cm, vim, '>',\n                cursorIsBefore(selectionStart, selectionEnd) ? selectionEnd\n                    : selectionStart);\n          } else if (!operator) {\n            curEnd = clipCursorToContent(cm, curEnd);\n            cm.setCursor(curEnd.line, curEnd.ch);\n          }\n        }\n\n        if (operator) {\n          var inverted = false;\n          vim.lastMotion = null;\n          operatorArgs.repeat = repeat; // Indent in visual mode needs this.\n          if (vim.visualMode) {\n            curStart = selectionStart;\n            curEnd = selectionEnd;\n            motionArgs.inclusive = true;\n          }\n          // Swap start and end if motion was backward.\n          if (cursorIsBefore(curEnd, curStart)) {\n            var tmp = curStart;\n            curStart = curEnd;\n            curEnd = tmp;\n            inverted = true;\n          }\n          if (motionArgs.inclusive && !(vim.visualMode && inverted)) {\n            // Move the selection end one to the right to include the last\n            // character.\n            curEnd.ch++;\n          }\n          var linewise = motionArgs.linewise ||\n              (vim.visualMode && vim.visualLine);\n          if (linewise) {\n            // Expand selection to entire line.\n            expandSelectionToLine(cm, curStart, curEnd);\n          } else if (motionArgs.forward) {\n            // Clip to trailing newlines only if we the motion goes forward.\n            clipToLine(cm, curStart, curEnd);\n          }\n          operatorArgs.registerName = registerName;\n          // Keep track of linewise as it affects how paste and change behave.\n          operatorArgs.linewise = linewise;\n          operators[operator](cm, operatorArgs, vim, curStart,\n              curEnd, curOriginal);\n          if (vim.visualMode) {\n            exitVisualMode(cm, vim);\n          }\n          if (operatorArgs.enterInsertMode) {\n            actions.enterInsertMode(cm);\n          }\n        }\n      }\n    };\n\n    /**\n     * typedef {Object{line:number,ch:number}} Cursor An object containing the\n     *     position of the cursor.\n     */\n    // All of the functions below return Cursor objects.\n    var motions = {\n      expandToLine: function(cm, motionArgs) {\n        // Expands forward to end of line, and then to next line if repeat is\n        // >1. Does not handle backward motion!\n        var cur = cm.getCursor();\n        return { line: cur.line + motionArgs.repeat - 1, ch: Infinity };\n      },\n      findNext: function(cm, motionArgs, vim) {\n        return findNext(cm, false /** prev */, motionArgs.repeat);\n      },\n      findPrev: function(cm, motionArgs, vim) {\n        return findNext(cm, true /** prev */, motionArgs.repeat);\n      },\n      goToMark: function(cm, motionArgs, vim) {\n        var mark = vim.marks[motionArgs.selectedCharacter];\n        if (mark) {\n          return mark.find();\n        }\n        return null;\n      },\n      moveByCharacters: function(cm, motionArgs) {\n        var cur = cm.getCursor();\n        var repeat = motionArgs.repeat;\n        var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat;\n        return { line: cur.line, ch: ch };\n      },\n      moveByLines: function(cm, motionArgs, vim) {\n        var endCh = cm.getCursor().ch;\n        // Depending what our last motion was, we may want to do different\n        // things. If our last motion was moving vertically, we want to\n        // preserve the HPos from our last horizontal move.  If our last motion\n        // was going to the end of a line, moving vertically we should go to\n        // the end of the line, etc.\n        switch (vim.lastMotion) {\n          case this.moveByLines:\n          case this.moveToColumn:\n          case this.moveToEol:\n            endCh = vim.lastHPos;\n            break;\n          default:\n            vim.lastHPos = endCh;\n        }\n        var cur = cm.getCursor();\n        var repeat = motionArgs.repeat;\n        var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat;\n        if (line < 0 || line > cm.lineCount() - 1) {\n          return null;\n        }\n        return { line: line, ch: endCh };\n      },\n      moveByPage: function(cm, motionArgs) {\n        // CodeMirror only exposes functions that move the cursor page down, so\n        // doing this bad hack to move the cursor and move it back. evalInput\n        // will move the cursor to where it should be in the end.\n        var curStart = cm.getCursor();\n        var repeat = motionArgs.repeat;\n        cm.moveV((motionArgs.forward ? repeat : -repeat), 'page');\n        var curEnd = cm.getCursor();\n        cm.setCursor(curStart);\n        return curEnd;\n      },\n      moveByParagraph: function(cm, motionArgs) {\n        var line = cm.getCursor().line;\n        var repeat = motionArgs.repeat;\n        var inc = motionArgs.forward ? 1 : -1;\n        for (var i = 0; i < repeat; i++) {\n          if ((!motionArgs.forward && line === 0) ||\n              (motionArgs.forward && line == cm.lineCount() - 1)) {\n            break;\n          }\n          line += inc;\n          while (line !== 0 && line != cm.lineCount - 1 && cm.getLine(line)) {\n            line += inc;\n          }\n        }\n        return { line: line, ch: 0 };\n      },\n      moveByWords: function(cm, motionArgs) {\n        return moveToWord(cm, motionArgs.repeat, !!motionArgs.forward,\n            !!motionArgs.wordEnd, !!motionArgs.bigWord);\n      },\n      moveTillCharacter: function(cm, motionArgs) {\n        var repeat = motionArgs.repeat;\n        var curEnd = moveToCharacter(cm, repeat, motionArgs.forward,\n            motionArgs.selectedCharacter);\n        var increment = motionArgs.forward ? -1 : 1;\n        curEnd.ch += increment;\n        return curEnd;\n      },\n      moveToCharacter: function(cm, motionArgs) {\n        var repeat = motionArgs.repeat;\n        return moveToCharacter(cm, repeat, motionArgs.forward,\n            motionArgs.selectedCharacter);\n      },\n      moveToColumn: function(cm, motionArgs, vim) {\n        var repeat = motionArgs.repeat;\n        // repeat is equivalent to which column we want to move to!\n        vim.lastHPos = repeat - 1;\n        return moveToColumn(cm, repeat);\n      },\n      moveToEol: function(cm, motionArgs, vim) {\n        var cur = cm.getCursor();\n        vim.lastHPos = Infinity;\n        return { line: cur.line + motionArgs.repeat - 1, ch: Infinity };\n      },\n      moveToFirstNonWhiteSpaceCharacter: function(cm) {\n        // Go to the start of the line where the text begins, or the end for\n        // whitespace-only lines\n        var cursor = cm.getCursor();\n        var line = cm.getLine(cursor.line);\n        return { line: cursor.line,\n            ch: findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line)) };\n      },\n      moveToMatchedSymbol: function(cm, motionArgs) {\n        var cursor = cm.getCursor();\n        var symbol = cm.getLine(cursor.line).charAt(cursor.ch);\n        if (isMatchableSymbol(symbol)) {\n          return findMatchedSymbol(cm, cm.getCursor(), motionArgs.symbol);\n        } else {\n          return cursor;\n        }\n      },\n      moveToStartOfLine: function(cm) {\n        var cursor = cm.getCursor();\n        return { line: cursor.line, ch: 0 };\n      },\n      moveToLineOrEdgeOfDocument: function(cm, motionArgs) {\n        var lineNum = motionArgs.forward ? cm.lineCount() - 1 : 0;\n        if (motionArgs.repeatIsExplicit) {\n          lineNum = motionArgs.repeat - 1;\n        }\n        return { line: lineNum,\n            ch: findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum)) };\n      },\n      textObjectManipulation: function(cm, motionArgs) {\n        var character = motionArgs.selectedCharacter;\n        // Inclusive is the difference between a and i\n        // TODO: Instead of using the additional text object map to perform text\n        //     object operations, merge the map into the defaultKeyMap and use\n        //     motionArgs to define behavior. Define separate entries for 'aw',\n        //     'iw', 'a[', 'i[', etc.\n        var inclusive = !motionArgs.textObjectInner;\n        if (!textObjects[character]) {\n          // No text object defined for this, don't move.\n          return null;\n        }\n        var tmp = textObjects[character](cm, inclusive);\n        var start = tmp.start;\n        var end = tmp.end;\n        return [start, end];\n      }\n    };\n\n    var operators = {\n      change: function(cm, operatorArgs, vim, curStart, curEnd) {\n        getVimGlobalState().registerController.pushText(\n            operatorArgs.registerName, 'change', cm.getRange(curStart, curEnd),\n            operatorArgs.linewise);\n        if (operatorArgs.linewise) {\n          // Delete starting at the first nonwhitespace character of the first\n          // line, instead of from the start of the first line. This way we get\n          // an indent when we get into insert mode. This behavior isn't quite\n          // correct because we should treat this as a completely new line, and\n          // indent should be whatever codemirror thinks is the right indent.\n          // But cm.indentLine doesn't seem work on empty lines.\n          // TODO: Fix the above.\n          curStart.ch =\n              findFirstNonWhiteSpaceCharacter(cm.getLine(curStart.line));\n          // Insert an additional newline so that insert mode can start there.\n          // curEnd should be on the first character of the new line.\n          cm.replaceRange('\\n', curStart, curEnd);\n        } else {\n          cm.replaceRange('', curStart, curEnd);\n        }\n        cm.setCursor(curStart);\n      },\n      // delete is a javascript keyword.\n      'delete': function(cm, operatorArgs, vim, curStart, curEnd) {\n        getVimGlobalState().registerController.pushText(\n            operatorArgs.registerName, 'delete', cm.getRange(curStart, curEnd),\n            operatorArgs.linewise);\n        cm.replaceRange('', curStart, curEnd);\n        if (operatorArgs.linewise) {\n          cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm));\n        } else {\n          cm.setCursor(curStart);\n        }\n      },\n      indent: function(cm, operatorArgs, vim, curStart, curEnd) {\n        var startLine = curStart.line;\n        var endLine = curEnd.line;\n        // In visual mode, n> shifts the selection right n times, instead of\n        // shifting n lines right once.\n        var repeat = (vim.visualMode) ? operatorArgs.repeat : 1;\n        if (operatorArgs.linewise) {\n          // The only way to delete a newline is to delete until the start of\n          // the next line, so in linewise mode evalInput will include the next\n          // line. We don't want this in indent, so we go back a line.\n          endLine--;\n        }\n        for (var i = startLine; i <= endLine; i++) {\n          for (var j = 0; j < repeat; j++) {\n            cm.indentLine(i, operatorArgs.indentRight);\n          }\n        }\n        cm.setCursor(curStart);\n        cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm));\n      },\n      swapcase: function(cm, operatorArgs, vim, curStart, curEnd, curOriginal) {\n        var toSwap = cm.getRange(curStart, curEnd);\n        var swapped = '';\n        for (var i = 0; i < toSwap.length; i++) {\n          var character = toSwap.charAt(i);\n          swapped += isUpperCase(character) ? character.toLowerCase() :\n              character.toUpperCase();\n        }\n        cm.replaceRange(swapped, curStart, curEnd);\n        cm.setCursor(curOriginal);\n      },\n      yank: function(cm, operatorArgs, vim, curStart, curEnd, curOriginal) {\n        getVimGlobalState().registerController.pushText(\n            operatorArgs.registerName, 'yank',\n            cm.getRange(curStart, curEnd), operatorArgs.linewise);\n        cm.setCursor(curOriginal);\n      }\n    };\n\n    var actions = {\n      clearSearchHighlight: clearSearchHighlight,\n      enterInsertMode: function(cm, actionArgs) {\n        var insertAt = (actionArgs) ? actionArgs.insertAt : null;\n        if (insertAt == 'eol') {\n          var cursor = cm.getCursor();\n          cursor = { line: cursor.line, ch: lineLength(cm, cursor.line) };\n          cm.setCursor(cursor);\n        } else if (insertAt == 'charAfter') {\n          cm.setCursor(offsetCursor(cm.getCursor(), 0, 1));\n        }\n        cm.setOption('keyMap', 'vim-insert');\n      },\n      toggleVisualMode: function(cm, actionArgs, vim) {\n        var repeat = actionArgs.repeat;\n        var curStart = cm.getCursor();\n        var curEnd;\n        // TODO: The repeat should actually select number of characters/lines\n        //     equal to the repeat times the size of the previous visual\n        //     operation.\n        if (!vim.visualMode) {\n          vim.visualMode = true;\n          vim.visualLine = !!actionArgs.linewise;\n          if (vim.visualLine) {\n            curStart.ch = 0;\n            curEnd = clipCursorToContent(cm, {\n              line: curStart.line + repeat - 1,\n              ch: lineLength(cm, curStart.line)\n            }, true /** includeLineBreak */);\n          } else {\n            curEnd = clipCursorToContent(cm, {\n              line: curStart.line,\n              ch: curStart.ch + repeat\n            }, true /** includeLineBreak */);\n          }\n          // Make the initial selection.\n          if (!actionArgs.repeatIsExplicit && !vim.visualLine) {\n            // This is a strange case. Here the implicit repeat is 1. The\n            // following commands lets the cursor hover over the 1 character\n            // selection.\n            cm.setCursor(curEnd);\n            cm.setSelection(curEnd, curStart);\n          } else {\n            cm.setSelection(curStart, curEnd);\n          }\n        } else {\n          curStart = cm.getCursor('anchor');\n          curEnd = cm.getCursor('head');\n          if (!vim.visualLine && actionArgs.linewise) {\n            // Shift-V pressed in characterwise visual mode. Switch to linewise\n            // visual mode instead of exiting visual mode.\n            vim.visualLine = true;\n            curStart.ch = cursorIsBefore(curStart, curEnd) ? 0 :\n                lineLength(cm, curStart.line);\n            curEnd.ch = cursorIsBefore(curStart, curEnd) ?\n                lineLength(cm, curEnd.line) : 0;\n            cm.setSelection(curStart, curEnd);\n          } else if (vim.visualLine && !actionArgs.linewise) {\n            // v pressed in linewise visual mode. Switch to characterwise visual\n            // mode instead of exiting visual mode.\n            vim.visualLine = false;\n          } else {\n            exitVisualMode(cm, vim);\n          }\n        }\n        updateMark(cm, vim, '<', cursorIsBefore(curStart, curEnd) ? curStart\n            : curEnd);\n        updateMark(cm, vim, '>', cursorIsBefore(curStart, curEnd) ? curEnd\n            : curStart);\n      },\n      joinLines: function(cm, actionArgs, vim) {\n        var curStart, curEnd;\n        if (vim.visualMode) {\n          curStart = cm.getCursor('anchor');\n          curEnd = cm.getCursor('head');\n          curEnd.ch = lineLength(cm, curEnd.line) - 1;\n        } else {\n          // Repeat is the number of lines to join. Minimum 2 lines.\n          var repeat = Math.max(actionArgs.repeat, 2);\n          curStart = cm.getCursor();\n          curEnd = clipCursorToContent(cm, { line: curStart.line + repeat - 1,\n              ch: Infinity });\n        }\n        var finalCh = 0;\n        cm.operation(function() {\n          for (var i = curStart.line; i < curEnd.line; i++) {\n            finalCh = lineLength(cm, curStart.line);\n            var tmp = { line: curStart.line + 1,\n                ch: lineLength(cm, curStart.line + 1) };\n            var text = cm.getRange(curStart, tmp);\n            text = text.replace(/\\n\\s*/g, ' ');\n            cm.replaceRange(text, curStart, tmp);\n          }\n          var curFinalPos = { line: curStart.line, ch: finalCh };\n          cm.setCursor(curFinalPos);\n        });\n      },\n      newLineAndEnterInsertMode: function(cm, actionArgs) {\n        var insertAt = cm.getCursor();\n        if (insertAt.line === 0 && !actionArgs.after) {\n          // Special case for inserting newline before start of document.\n          cm.replaceRange('\\n', { line: 0, ch: 0 });\n          cm.setCursor(0, 0);\n        } else {\n          insertAt.line = (actionArgs.after) ? insertAt.line :\n              insertAt.line - 1;\n          insertAt.ch = lineLength(cm, insertAt.line);\n          cm.setCursor(insertAt);\n          var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment ||\n              CodeMirror.commands.newlineAndIndent;\n          newlineFn(cm);\n        }\n        this.enterInsertMode(cm);\n      },\n      paste: function(cm, actionArgs, vim) {\n        var cur = cm.getCursor();\n        var register = getVimGlobalState().registerController.getRegister(\n            actionArgs.registerName);\n        if (!register.text) {\n          return;\n        }\n        for (var text = '', i = 0; i < actionArgs.repeat; i++) {\n          text += register.text;\n        }\n        var linewise = register.linewise;\n        if (linewise) {\n          if (actionArgs.after) {\n            // Move the newline at the end to the start instead, and paste just\n            // before the newline character of the line we are on right now.\n            text = '\\n' + text.slice(0, text.length - 1);\n            cur.ch = lineLength(cm, cur.line);\n          } else {\n            cur.ch = 0;\n          }\n        } else {\n          cur.ch += actionArgs.after ? 1 : 0;\n        }\n        cm.replaceRange(text, cur);\n        // Now fine tune the cursor to where we want it.\n        var curPosFinal;\n        var idx;\n        if (linewise && actionArgs.after) {\n          curPosFinal = { line: cur.line + 1,\n              ch: findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1)) };\n        } else if (linewise && !actionArgs.after) {\n          curPosFinal = { line: cur.line,\n              ch: findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line)) };\n        } else if (!linewise && actionArgs.after) {\n          idx = cm.indexFromPos(cur);\n          curPosFinal = cm.posFromIndex(idx + text.length - 1);\n        } else {\n          idx = cm.indexFromPos(cur);\n          curPosFinal = cm.posFromIndex(idx + text.length);\n        }\n        cm.setCursor(curPosFinal);\n      },\n      undo: function(cm, actionArgs) {\n        repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)();\n      },\n      redo: function(cm, actionArgs) {\n        repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)();\n      },\n      setRegister: function(cm, actionArgs, vim) {\n        vim.inputState.registerName = actionArgs.selectedCharacter;\n      },\n      setMark: function(cm, actionArgs, vim) {\n        var markName = actionArgs.selectedCharacter;\n        updateMark(cm, vim, markName, cm.getCursor());\n      },\n      replace: function(cm, actionArgs) {\n        var replaceWith = actionArgs.selectedCharacter;\n        var curStart = cm.getCursor();\n        var line = cm.getLine(curStart.line);\n        var replaceTo = curStart.ch + actionArgs.repeat;\n        if (replaceTo > line.length) {\n          return;\n        }\n        var curEnd = { line: curStart.line, ch: replaceTo };\n        var replaceWithStr = '';\n        for (var i = 0; i < curEnd.ch - curStart.ch; i++) {\n          replaceWithStr += replaceWith;\n        }\n        cm.replaceRange(replaceWithStr, curStart, curEnd);\n        cm.setCursor(offsetCursor(curEnd, 0, -1));\n      }\n    };\n\n    var textObjects = {\n      // TODO: lots of possible exceptions that can be thrown here. Try da(\n      //     outside of a () block.\n      // TODO: implement text objects for the reverse like }. Should just be\n      //     an additional mapping after moving to the defaultKeyMap.\n      'w': function(cm, inclusive) {\n        return expandWordUnderCursor(cm, inclusive, true /** forward */,\n            false /** bigWord */);\n      },\n      'W': function(cm, inclusive) {\n        return expandWordUnderCursor(cm, inclusive,\n            true /** forward */, true /** bigWord */);\n      },\n      '{': function(cm, inclusive) {\n        return selectCompanionObject(cm, '}', inclusive);\n      },\n      '(': function(cm, inclusive) {\n        return selectCompanionObject(cm, ')', inclusive);\n      },\n      '[': function(cm, inclusive) {\n        return selectCompanionObject(cm, ']', inclusive);\n      },\n      '\\'': function(cm, inclusive) {\n        return findBeginningAndEnd(cm, \"'\", inclusive);\n      },\n      '\\\"': function(cm, inclusive) {\n        return findBeginningAndEnd(cm, '\"', inclusive);\n      }\n    };\n\n    /*\n     * Below are miscellaneous utility functions used by vim.js\n     */\n\n    /**\n     * Clips cursor to ensure that:\n     *   0 <= cur.ch < lineLength\n     *       AND\n     *   0 <= cur.line < lineCount\n     * If includeLineBreak is true, then allow cur.ch == lineLength.\n     */\n    function clipCursorToContent(cm, cur, includeLineBreak) {\n      var line = Math.min(Math.max(0, cur.line), cm.lineCount() - 1);\n      var maxCh = lineLength(cm, line) - 1;\n      maxCh = (includeLineBreak) ? maxCh + 1 : maxCh;\n      var ch = Math.min(Math.max(0, cur.ch), maxCh);\n      return { line: line, ch: ch };\n    }\n    // Merge arguments in place, for overriding arguments.\n    function mergeArgs(to, from) {\n      for (var prop in from) {\n        if (from.hasOwnProperty(prop)) {\n          to[prop] = from[prop];\n        }\n      }\n    }\n    function copyArgs(args) {\n      var ret = {};\n      for (var prop in args) {\n        if (args.hasOwnProperty(prop)) {\n          ret[prop] = args[prop];\n        }\n      }\n      return ret;\n    }\n    function offsetCursor(cur, offsetLine, offsetCh) {\n      return { line: cur.line + offsetLine, ch: cur.ch + offsetCh };\n    }\n    function arrayEq(a1, a2) {\n      if (a1.length != a2.length) {\n        return false;\n      }\n      for (var i = 0; i < a1.length; i++) {\n        if (a1[i] != a2[i]) {\n          return false;\n        }\n      }\n      return true;\n    }\n    function matchKeysPartial(pressed, mapped) {\n      for (var i = 0; i < pressed.length; i++) {\n        // 'character' means any character. For mark, register commads, etc.\n        if (pressed[i] != mapped[i] && mapped[i] != 'character') {\n          return false;\n        }\n      }\n      return true;\n    }\n    function arrayIsSubsetFromBeginning(small, big) {\n      for (var i = 0; i < small.length; i++) {\n        if (small[i] != big[i]) {\n          return false;\n        }\n      }\n      return true;\n    }\n    function repeatFn(cm, fn, repeat) {\n      return function() {\n        for (var i = 0; i < repeat; i++) {\n          fn(cm);\n        }\n      };\n    }\n    function copyCursor(cur) {\n      return { line: cur.line, ch: cur.ch };\n    }\n    function cursorEqual(cur1, cur2) {\n      return cur1.ch == cur2.ch && cur1.line == cur2.line;\n    }\n    function cursorIsBefore(cur1, cur2) {\n      if (cur1.line < cur2.line) {\n        return true;\n      } else if (cur1.line == cur2.line && cur1.ch < cur2.ch) {\n        return true;\n      }\n      return false;\n    }\n    function lineLength(cm, lineNum) {\n      return cm.getLine(lineNum).length;\n    }\n    function reverse(s){\n      return s.split(\"\").reverse().join(\"\");\n    }\n    function trim(s) {\n      if (s.trim) {\n        return s.trim();\n      } else {\n        return s.replace(/^\\s+|\\s+$/g, '');\n      }\n    }\n    function escapeRegex(s) {\n      return s.replace(/([.?*+$\\[\\]\\/\\\\(){}|\\-])/g, \"\\\\$1\");\n    }\n\n    function exitVisualMode(cm, vim) {\n      vim.visualMode = false;\n      vim.visualLine = false;\n      var selectionStart = cm.getCursor('anchor');\n      var selectionEnd = cm.getCursor('head');\n      if (!cursorEqual(selectionStart, selectionEnd)) {\n        // Clear the selection and set the cursor only if the selection has not\n        // already been cleared. Otherwise we risk moving the cursor somewhere\n        // it's not supposed to be.\n        cm.setCursor(clipCursorToContent(cm, selectionEnd));\n      }\n    }\n\n    // Remove any trailing newlines from the selection. For\n    // example, with the caret at the start of the last word on the line,\n    // 'dw' should word, but not the newline, while 'w' should advance the\n    // caret to the first character of the next line.\n    function clipToLine(cm, curStart, curEnd) {\n      var selection = cm.getRange(curStart, curEnd);\n      var lines = selection.split('\\n');\n      if (lines.length > 1 && isWhiteSpaceString(lines.pop())) {\n        curEnd.line--;\n        curEnd.ch = lineLength(cm, curEnd.line);\n      }\n    }\n\n    // Expand the selection to line ends.\n    function expandSelectionToLine(cm, curStart, curEnd) {\n      curStart.ch = 0;\n      curEnd.ch = 0;\n      curEnd.line++;\n    }\n\n    function findFirstNonWhiteSpaceCharacter(text) {\n      if (!text) {\n        return 0;\n      }\n      var firstNonWS = text.search(/\\S/);\n      return firstNonWS == -1 ? text.length : firstNonWS;\n    }\n\n    function expandWordUnderCursor(cm, inclusive, forward, bigWord, noSymbol) {\n      var cur = cm.getCursor();\n      var line = cm.getLine(cur.line);\n      var idx = cur.ch;\n\n      // Seek to first word or non-whitespace character, depending on if\n      // noSymbol is true.\n      var textAfterIdx = line.substring(idx);\n      var firstMatchedChar;\n      if (noSymbol) {\n        firstMatchedChar = textAfterIdx.search(/\\w/);\n      } else {\n        firstMatchedChar = textAfterIdx.search(/\\S/);\n      }\n      if (firstMatchedChar == -1) {\n        return null;\n      }\n      idx += firstMatchedChar;\n      textAfterIdx = line.substring(idx);\n      var textBeforeIdx = line.substring(0, idx);\n\n      var matchRegex;\n      // Greedy matchers for the \"word\" we are trying to expand.\n      if (bigWord) {\n        matchRegex = /^\\S+/;\n      } else {\n        if ((/\\w/).test(line.charAt(idx))) {\n          matchRegex = /^\\w+/;\n        } else {\n          matchRegex = /^[^\\w\\s]+/;\n        }\n      }\n\n      var wordAfterRegex = matchRegex.exec(textAfterIdx);\n      var wordStart = idx;\n      var wordEnd = idx + wordAfterRegex[0].length - 1;\n      // TODO: Find a better way to do this. It will be slow on very long lines.\n      var wordBeforeRegex = matchRegex.exec(reverse(textBeforeIdx));\n      if (wordBeforeRegex) {\n        wordStart -= wordBeforeRegex[0].length;\n      }\n\n      if (inclusive) {\n        wordEnd++;\n      }\n\n      return { start: { line: cur.line, ch: wordStart },\n        end: { line: cur.line, ch: wordEnd }};\n    }\n\n    /*\n     * Returns the boundaries of the next word. If the cursor in the middle of\n     * the word, then returns the boundaries of the current word, starting at\n     * the cursor. If the cursor is at the start/end of a word, and we are going\n     * forward/backward, respectively, find the boundaries of the next word.\n     *\n     * @param {CodeMirror} cm CodeMirror object.\n     * @param {Cursor} cur The cursor position.\n     * @param {boolean} forward True to search forward. False to search\n     *     backward.\n     * @param {boolean} bigWord True if punctuation count as part of the word.\n     *     False if only [a-zA-Z0-9] characters count as part of the word.\n     * @return {Object{from:number, to:number, line: number}} The boundaries of\n     *     the word, or null if there are no more words.\n     */\n    // TODO: Treat empty lines (with no whitespace) as words.\n    function findWord(cm, cur, forward, bigWord) {\n      var lineNum = cur.line;\n      var pos = cur.ch;\n      var line = cm.getLine(lineNum);\n      var dir = forward ? 1 : -1;\n      var regexps = bigWord ? bigWordRegexp : wordRegexp;\n\n      while (true) {\n        var stop = (dir > 0) ? line.length : -1;\n        var wordStart = stop, wordEnd = stop;\n        // Find bounds of next word.\n        while (pos != stop) {\n          var foundWord = false;\n          for (var i = 0; i < regexps.length && !foundWord; ++i) {\n            if (regexps[i].test(line.charAt(pos))) {\n              wordStart = pos;\n              // Advance to end of word.\n              while (pos != stop && regexps[i].test(line.charAt(pos))) {\n                pos += dir;\n              }\n              wordEnd = pos;\n              foundWord = wordStart != wordEnd;\n              if (wordStart == cur.ch && lineNum == cur.line &&\n                  wordEnd == wordStart + dir) {\n                // We started at the end of a word. Find the next one.\n                continue;\n              } else {\n                return {\n                  from: Math.min(wordStart, wordEnd + 1),\n                  to: Math.max(wordStart, wordEnd),\n                  line: lineNum };\n              }\n            }\n          }\n          if (!foundWord) {\n            pos += dir;\n          }\n        }\n        // Advance to next/prev line.\n        lineNum += dir;\n        if (!isLine(cm, lineNum)) {\n          return null;\n        }\n        line = cm.getLine(lineNum);\n        pos = (dir > 0) ? 0 : line.length;\n      }\n      // Should never get here.\n      throw 'The impossible happened.';\n    }\n\n    /**\n     * @param {CodeMirror} cm CodeMirror object.\n     * @param {int} repeat Number of words to move past.\n     * @param {boolean} forward True to search forward. False to search\n     *     backward.\n     * @param {boolean} wordEnd True to move to end of word. False to move to\n     *     beginning of word.\n     * @param {boolean} bigWord True if punctuation count as part of the word.\n     *     False if only alphabet characters count as part of the word.\n     * @return {Cursor} The position the cursor should move to.\n     */\n    function moveToWord(cm, repeat, forward, wordEnd, bigWord) {\n      var cur = cm.getCursor();\n      for (var i = 0; i < repeat; i++) {\n        var startCh = cur.ch, startLine = cur.line, word;\n        var movedToNextWord = false;\n        while (!movedToNextWord) {\n          // Search and advance.\n          word = findWord(cm, cur, forward, bigWord);\n          movedToNextWord = true;\n          if (word) {\n            // Move to the word we just found. If by moving to the word we end\n            // up in the same spot, then move an extra character and search\n            // again.\n            cur.line = word.line;\n            if (forward && wordEnd) {\n              // 'e'\n              cur.ch = word.to - 1;\n            } else if (forward && !wordEnd) {\n              // 'w'\n              if (inRangeInclusive(cur.ch, word.from, word.to) &&\n                  word.line == startLine) {\n                // Still on the same word. Go to the next one.\n                movedToNextWord = false;\n                cur.ch = word.to - 1;\n              } else {\n                cur.ch = word.from;\n              }\n            } else if (!forward && wordEnd) {\n              // 'ge'\n              if (inRangeInclusive(cur.ch, word.from, word.to) &&\n                  word.line == startLine) {\n                // still on the same word. Go to the next one.\n                movedToNextWord = false;\n                cur.ch = word.from;\n              } else {\n                cur.ch = word.to;\n              }\n            } else if (!forward && !wordEnd) {\n              // 'b'\n              cur.ch = word.from;\n            }\n          } else {\n            // No more words to be found. Move to the end.\n            if (forward) {\n              return { line: cur.line, ch: lineLength(cm, cur.line) };\n            } else {\n              return { line: cur.line, ch: 0 };\n            }\n          }\n        }\n      }\n      return cur;\n    }\n\n    function moveToCharacter(cm, repeat, forward, character) {\n      var cur = cm.getCursor();\n      var start = cur.ch;\n      var idx;\n      for (var i = 0; i < repeat; i ++) {\n        var line = cm.getLine(cur.line);\n        idx = charIdxInLine(start, line, character, forward, true);\n        if (idx == -1) {\n          return cur;\n        }\n        start = idx;\n      }\n      return { line: cm.getCursor().line, ch: idx };\n    }\n\n    function moveToColumn(cm, repeat) {\n      // repeat is always >= 1, so repeat - 1 always corresponds\n      // to the column we want to go to.\n      var line = cm.getCursor().line;\n      return clipCursorToContent(cm, { line: line, ch: repeat - 1 });\n    }\n\n    function updateMark(cm, vim, markName, pos) {\n      if (!inArray(markName, validMarks)) {\n        return;\n      }\n      if (vim.marks[markName]) {\n        vim.marks[markName].clear();\n      }\n      vim.marks[markName] = cm.setBookmark(pos);\n    }\n\n    function charIdxInLine(start, line, character, forward, includeChar) {\n      // Search for char in line.\n      // motion_options: {forward, includeChar}\n      // If includeChar = true, include it too.\n      // If forward = true, search forward, else search backwards.\n      // If char is not found on this line, do nothing\n      var idx;\n      if (forward) {\n        idx = line.indexOf(character, start + 1);\n        if (idx != -1 && !includeChar) {\n          idx -= 1;\n        }\n      } else {\n        idx = line.lastIndexOf(character, start - 1);\n        if (idx != -1 && !includeChar) {\n          idx += 1;\n        }\n      }\n      return idx;\n    }\n\n    function findMatchedSymbol(cm, cur, symb) {\n      var line = cur.line;\n      symb = symb ? symb : cm.getLine(line).charAt(cur.ch);\n\n      // Are we at the opening or closing char\n      var forwards = inArray(symb, ['(', '[', '{']);\n\n      var reverseSymb = ({\n        '(': ')', ')': '(',\n        '[': ']', ']': '[',\n        '{': '}', '}': '{'})[symb];\n\n      // Couldn't find a matching symbol, abort\n      if (!reverseSymb) {\n        return cur;\n      }\n\n      // set our increment to move forward (+1) or backwards (-1)\n      // depending on which bracket we're matching\n      var increment = ({'(': 1, '{': 1, '[': 1})[symb] || -1;\n      var depth = 1, nextCh = symb, index = cur.ch, lineText = cm.getLine(line);\n      // Simple search for closing paren--just count openings and closings till\n      // we find our match\n      // TODO: use info from CodeMirror to ignore closing brackets in comments\n      // and quotes, etc.\n      while (nextCh && depth > 0) {\n        index += increment;\n        nextCh = lineText.charAt(index);\n        if (!nextCh) {\n          line += increment;\n          index = 0;\n          lineText = cm.getLine(line) || '';\n          nextCh = lineText.charAt(index);\n        }\n        if (nextCh === symb) {\n          depth++;\n        } else if (nextCh === reverseSymb) {\n          depth--;\n        }\n      }\n\n      if (nextCh) {\n        return { line: line, ch: index };\n      }\n      return cur;\n    }\n\n    function selectCompanionObject(cm, revSymb, inclusive) {\n      var cur = cm.getCursor();\n\n      var end = findMatchedSymbol(cm, cur, revSymb);\n      var start = findMatchedSymbol(cm, end);\n      start.ch += inclusive ? 1 : 0;\n      end.ch += inclusive ? 0 : 1;\n\n      return { start: start, end: end };\n    }\n\n    function regexLastIndexOf(string, pattern, startIndex) {\n      for (var i = !startIndex ? string.length : startIndex;\n          i >= 0; --i) {\n        if (pattern.test(string.charAt(i))) {\n          return i;\n        }\n      }\n      return -1;\n    }\n\n    // Takes in a symbol and a cursor and tries to simulate text objects that\n    // have identical opening and closing symbols\n    // TODO support across multiple lines\n    function findBeginningAndEnd(cm, symb, inclusive) {\n      var cur = cm.getCursor();\n      var line = cm.getLine(cur.line);\n      var chars = line.split('');\n      var start, end, i, len;\n      var firstIndex = chars.indexOf(symb);\n\n      // the decision tree is to always look backwards for the beginning first,\n      // but if the cursor is in front of the first instance of the symb,\n      // then move the cursor forward\n      if (cur.ch < firstIndex) {\n        cur.ch = firstIndex;\n        // Why is this line even here???\n        // cm.setCursor(cur.line, firstIndex+1);\n      }\n      // otherwise if the cursor is currently on the closing symbol\n      else if (firstIndex < cur.ch && chars[cur.ch] == symb) {\n        end = cur.ch; // assign end to the current cursor\n        --cur.ch; // make sure to look backwards\n      }\n\n      // if we're currently on the symbol, we've got a start\n      if (chars[cur.ch] == symb && !end) {\n        start = cur.ch + 1; // assign start to ahead of the cursor\n      } else {\n        // go backwards to find the start\n        for (i = cur.ch; i > -1 && !start; i--) {\n          if (chars[i] == symb) {\n            start = i + 1;\n          }\n        }\n      }\n\n      // look forwards for the end symbol\n      if (start && !end) {\n        for (i = start, len = chars.length; i < len && !end; i++) {\n          if (chars[i] == symb) {\n            end = i;\n          }\n        }\n      }\n\n      // nothing found\n      if (!start || !end) {\n        return { start: cur, end: cur };\n      }\n\n      // include the symbols\n      if (inclusive) {\n        --start; ++end;\n      }\n\n      return {\n        start: { line: cur.line, ch: start },\n        end: { line: cur.line, ch: end }\n      };\n    }\n\n    // Search functions\n    function SearchState() {\n      // Highlighted text that match the query.\n      this.marked = null;\n    }\n    SearchState.prototype = {\n      getQuery: function() {\n        return getVimGlobalState().query;\n      },\n      setQuery: function(query) {\n        getVimGlobalState().query = query;\n      },\n      getMarked: function() {\n        return this.marked;\n      },\n      setMarked: function(marked) {\n        this.marked = marked;\n      },\n      getOverlay: function() {\n        return this.searchOverlay;\n      },\n      setOverlay: function(overlay) {\n        this.searchOverlay = overlay;\n      },\n      isReversed: function() {\n        return getVimGlobalState().isReversed;\n      },\n      setReversed: function(reversed) {\n        getVimGlobalState().isReversed = reversed;\n      }\n    };\n    function getSearchState(cm) {\n      var vim = getVimState(cm);\n      return vim.searchState_ || (vim.searchState_ = new SearchState());\n    }\n    function dialog(cm, text, shortText, callback, initialValue) {\n      if (cm.openDialog) {\n        cm.openDialog(text, callback, { bottom: true, value: initialValue });\n      }\n      else {\n        callback(prompt(shortText, \"\"));\n      }\n    }\n    function findUnescapedSlashes(str) {\n      var escapeNextChar = false;\n      var slashes = [];\n      for (var i = 0; i < str.length; i++) {\n        var c = str.charAt(i);\n        if (!escapeNextChar && c == '/') {\n          slashes.push(i);\n        }\n        escapeNextChar = (c == '\\\\');\n      }\n      return slashes;\n    }\n    /**\n     * Extract the regular expression from the query and return a Regexp object.\n     * Returns null if the query is blank.\n     * If ignoreCase is passed in, the Regexp object will have the 'i' flag set.\n     * If smartCase is passed in, and the query contains upper case letters,\n     *   then ignoreCase is overridden, and the 'i' flag will not be set.\n     * If the query contains the /i in the flag part of the regular expression,\n     *   then both ignoreCase and smartCase are ignored, and 'i' will be passed\n     *   through to the Regex object.\n     */\n    function parseQuery(cm, query, ignoreCase, smartCase) {\n      // First try to extract regex + flags from the input. If no flags found,\n      // extract just the regex. IE does not accept flags directly defined in\n      // the regex string in the form /regex/flags\n      var slashes = findUnescapedSlashes(query);\n      var regexPart;\n      var forceIgnoreCase;\n      if (!slashes.length) {\n        // Query looks like 'regexp'\n        regexPart = query;\n      } else {\n        // Query looks like 'regexp/...'\n        regexPart = query.substring(0, slashes[0]);\n        var flagsPart = query.substring(slashes[0]);\n        forceIgnoreCase = (flagsPart.indexOf('i') != -1);\n      }\n      if (!regexPart) {\n        return null;\n      }\n      if (smartCase) {\n        ignoreCase = (/^[^A-Z]*$/).test(regexPart);\n      }\n      try {\n        var regexp = new RegExp(regexPart,\n            (ignoreCase || forceIgnoreCase) ? 'i' : undefined);\n        return regexp;\n      } catch (e) {\n        showConfirm(cm, 'Invalid regex: ' + regexPart);\n      }\n    }\n    function showConfirm(cm, text) {\n      if (cm.openConfirm) {\n        cm.openConfirm('<span style=\"color: red\">' + text +\n            '</span> <button type=\"button\">OK</button>', function() {},\n            {bottom: true});\n      } else {\n        alert(text);\n      }\n    }\n    function makePrompt(prefix, desc) {\n      var raw = '';\n      if (prefix) {\n        raw += '<span style=\"font-family: monospace\">' + prefix + '</span>';\n      }\n      raw += '<input type=\"text\"/> ' +\n          '<span style=\"color: #888\">';\n      if (desc) {\n        raw += '<span style=\"color: #888\">';\n        raw += desc;\n        raw += '</span>';\n      }\n      return raw;\n    }\n    var searchPromptDesc = '(Javascript regexp)';\n    function showPrompt(cm, onPromptClose, prefix, desc, initialValue) {\n      var shortText = (prefix || '') + ' ' + (desc || '');\n      dialog(cm, makePrompt(prefix, desc), shortText, onPromptClose,\n         initialValue);\n    }\n    function regexEqual(r1, r2) {\n      if (r1 instanceof RegExp && r2 instanceof RegExp) {\n          var props = [\"global\", \"multiline\", \"ignoreCase\", \"source\"];\n          for (var i = 0; i < props.length; i++) {\n              var prop = props[i];\n              if (r1[prop] !== r2[prop]) {\n                  return(false);\n              }\n          }\n          return(true);\n      }\n      return(false);\n    }\n    function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) {\n      cm.operation(function() {\n        var state = getSearchState(cm);\n        if (!rawQuery) {\n          return;\n        }\n        var query = parseQuery(cm, rawQuery, !!ignoreCase, !!smartCase);\n        if (!query) {\n          return;\n        }\n        if (regexEqual(query, state.getQuery())) {\n          return;\n        }\n        clearSearchHighlight(cm);\n        highlightSearchMatches(cm, query);\n        state.setQuery(query);\n      });\n    }\n    function searchOverlay(query) {\n      return {\n        token: function(stream) {\n          var match = stream.match(query, false);\n          if (match) {\n            if (!stream.sol()) {\n              // Backtrack 1 to match \\b\n              stream.backUp(1);\n              if (!query.exec(stream.next() + match[0])) {\n                stream.next();\n                return null;\n              }\n            }\n            stream.match(query);\n            return \"searching\";\n          }\n          while (!stream.eol()) {\n            stream.next();\n            if (stream.match(query, false)) break;\n          }\n        },\n        query: query\n      };\n    }\n    function highlightSearchMatches(cm, query) {\n      if (cm.addOverlay) {\n        var overlay = getSearchState(cm).getOverlay();\n        if (!overlay || query != overlay.query) {\n          if (overlay) {\n            cm.removeOverlay(overlay);\n          }\n          overlay = searchOverlay(query);\n          cm.addOverlay(overlay);\n          getSearchState(cm).setOverlay(overlay);\n        }\n      } else {\n        // TODO: Highlight only text inside the viewport. Highlighting everything\n        // is inefficient and expensive.\n        if (cm.lineCount() < 2000) { // This is too expensive on big documents.\n          var marked = [];\n          for (var cursor = cm.getSearchCursor(query);\n              cursor.findNext();) {\n            marked.push(cm.markText(cursor.from(), cursor.to(),\n                { className: 'cm-searching' }));\n          }\n          getSearchState(cm).setMarked(marked);\n        }\n      }\n    }\n    function findNext(cm, prev, repeat) {\n      return cm.operation(function() {\n        var state = getSearchState(cm);\n        var query = state.getQuery();\n        if (!query) {\n          return;\n        }\n        if (!state.getMarked()) {\n          highlightSearchMatches(cm, query);\n        }\n        var pos = cm.getCursor();\n        // If search is initiated with ? instead of /, negate direction.\n        prev = (state.isReversed()) ? !prev : prev;\n        if (!prev) {\n          pos.ch += 1;\n        }\n        var cursor = cm.getSearchCursor(query, pos);\n        for (var i = 0; i < repeat; i++) {\n          if (!cursor.find(prev)) {\n            // SearchCursor may have returned null because it hit EOF, wrap\n            // around and try again.\n            cursor = cm.getSearchCursor(query,\n                (prev) ? { line: cm.lineCount() - 1} : {line: 0, ch: 0} );\n            if (!cursor.find(prev)) {\n              return;\n            }\n          }\n        }\n        return cursor.from();\n      });}\n    function clearSearchHighlight(cm) {\n      if (cm.addOverlay) {\n        cm.removeOverlay(getSearchState(cm).getOverlay());\n        getSearchState(cm).setOverlay(null);\n      } else {\n        cm.operation(function() {\n          var state = getSearchState(cm);\n          if (!state.getQuery()) {\n            return;\n          }\n          var marked = state.getMarked();\n          if (!marked) {\n            return;\n          }\n          for (var i = 0; i < marked.length; ++i) {\n            marked[i].clear();\n          }\n          state.setMarked(null);\n        });\n      }\n    }\n    /**\n     * Check if pos is in the specified range, INCLUSIVE.\n     * Range can be specified with 1 or 2 arguments.\n     * If the first range argument is an array, treat it as an array of line\n     * numbers. Match pos against any of the lines.\n     * If the first range argument is a number,\n     *   if there is only 1 range argument, check if pos has the same line\n     *       number\n     *   if there are 2 range arguments, then check if pos is in between the two\n     *       range arguments.\n     */\n    function isInRange(pos, start, end) {\n      if (typeof pos != 'number') {\n        // Assume it is a cursor position. Get the line number.\n        pos = pos.line;\n      }\n      if (start instanceof Array) {\n        return inArray(pos, start);\n      } else {\n        if (end) {\n          return (pos >= start && pos <= end);\n        } else {\n          return pos == start;\n        }\n      }\n    }\n\n    // Ex command handling\n    // Care must be taken when adding to the default Ex command map. For any\n    // pair of commands that have a shared prefix, at least one of their\n    // shortNames must not match the prefix of the other command.\n    var defaultExCommandMap = [\n      { name: 'map', type: 'builtIn' },\n      { name: 'write', shortName: 'w', type: 'builtIn' },\n      { name: 'undo', shortName: 'u', type: 'builtIn' },\n      { name: 'redo', shortName: 'red', type: 'builtIn' },\n      { name: 'substitute', shortName: 's', type: 'builtIn'}\n    ];\n    Vim.ExCommandDispatcher = function() {\n      this.buildCommandMap_();\n    };\n    Vim.ExCommandDispatcher.prototype = {\n      processCommand: function(cm, input) {\n        var inputStream = new CodeMirror.StringStream(input);\n        var params = {};\n        params.input = input;\n        try {\n          this.parseInput_(cm, inputStream, params);\n        } catch(e) {\n          showConfirm(cm, e);\n          return;\n        }\n        var commandName;\n        if (!params.commandName) {\n          // If only a line range is defined, move to the line.\n          if (params.line !== undefined) {\n            commandName = 'move';\n          }\n        } else {\n          var command = this.matchCommand_(params.commandName);\n          if (command) {\n            commandName = command.name;\n            this.parseCommandArgs_(inputStream, params, command);\n            if (command.type == 'exToKey') {\n              // Handle Ex to Key mapping.\n              for (var i = 0; i < command.toKeys.length; i++) {\n                vim.handleKey(cm, command.toKeys[i]);\n              }\n              return;\n            } else if (command.type == 'exToEx') {\n              // Handle Ex to Ex mapping.\n              this.processCommand(cm, command.toInput);\n              return;\n            }\n          }\n        }\n        if (!commandName) {\n          showConfirm(cm, 'Not an editor command \":' + input + '\"');\n          return;\n        }\n        exCommands[commandName](cm, params);\n      },\n      parseInput_: function(cm, inputStream, result) {\n        inputStream.eatWhile(':');\n        // Parse range.\n        if (inputStream.eat('%')) {\n          result.line = 0;\n          result.lineEnd = cm.lineCount() - 1;\n        } else {\n          result.line = this.parseLineSpec_(cm, inputStream);\n          if (result.line !== undefined && inputStream.eat(',')) {\n            result.lineEnd = this.parseLineSpec_(cm, inputStream);\n          }\n        }\n\n        // Parse command name.\n        var commandMatch = inputStream.match(/^(\\w+)/);\n        if (commandMatch) {\n          result.commandName = commandMatch[1];\n        } else {\n          result.commandName = inputStream.match(/.*/)[0];\n        }\n\n        return result;\n      },\n      parseLineSpec_: function(cm, inputStream) {\n        var numberMatch = inputStream.match(/^(\\d+)/);\n        if (numberMatch) {\n          return parseInt(numberMatch[1], 10) - 1;\n        }\n        switch (inputStream.next()) {\n          case '.':\n            return cm.getCursor().line;\n          case '$':\n            return cm.lineCount() - 1;\n          case '\\'':\n            var mark = getVimState(cm).marks[inputStream.next()];\n            if (mark && mark.find()) {\n              return mark.find().line;\n            } else {\n              throw \"Mark not set\";\n            }\n            break;\n          default:\n            inputStream.backUp(1);\n            return cm.getCursor().line;\n        }\n      },\n      parseCommandArgs_: function(inputStream, params, command) {\n        if (inputStream.eol()) {\n          return;\n        }\n        params.argString = inputStream.match(/.*/)[0];\n        // Parse command-line arguments\n        var delim = command.argDelimiter || /\\s+/;\n        var args = trim(params.argString).split(delim);\n        if (args.length && args[0]) {\n          params.args = args;\n        }\n      },\n      matchCommand_: function(commandName) {\n        // Return the command in the command map that matches the shortest\n        // prefix of the passed in command name. The match is guaranteed to be\n        // unambiguous if the defaultExCommandMap's shortNames are set up\n        // correctly. (see @code{defaultExCommandMap}).\n        for (var i = commandName.length; i > 0; i--) {\n          var prefix = commandName.substring(0, i);\n          if (this.commandMap_[prefix]) {\n            var command = this.commandMap_[prefix];\n            if (command.name.indexOf(commandName) === 0) {\n              return command;\n            }\n          }\n        }\n        return null;\n      },\n      buildCommandMap_: function() {\n        this.commandMap_ = {};\n        for (var i = 0; i < defaultExCommandMap.length; i++) {\n          var command = defaultExCommandMap[i];\n          var key = command.shortName || command.name;\n          this.commandMap_[key] = command;\n        }\n      },\n      map: function(lhs, rhs) {\n        if (lhs != ':' && lhs.charAt(0) == ':') {\n          var commandName = lhs.substring(1);\n          if (rhs != ':' && rhs.charAt(0) == ':') {\n            // Ex to Ex mapping\n            this.commandMap_[commandName] = {\n              name: commandName,\n              type: 'exToEx',\n              toInput: rhs.substring(1)\n            };\n          } else {\n            // Ex to key mapping\n            this.commandMap_[commandName] = {\n              name: commandName,\n              type: 'exToKey',\n              toKeys: parseKeyString(rhs)\n            };\n          }\n        } else {\n          if (rhs != ':' && rhs.charAt(0) == ':') {\n            // Key to Ex mapping.\n            defaultKeymap.unshift({\n              keys: parseKeyString(lhs),\n              type: 'keyToEx',\n              exArgs: { input: rhs.substring(1) }});\n          } else {\n            // Key to key mapping\n            defaultKeymap.unshift({\n              keys: parseKeyString(lhs),\n              type: 'keyToKey',\n              toKeys: parseKeyString(rhs)\n            });\n          }\n        }\n      }\n    };\n\n    // Converts a key string sequence of the form a<C-w>bd<Left> into Vim's\n    // keymap representation.\n    function parseKeyString(str) {\n      var idx = 0;\n      var keys = [];\n      while (idx < str.length) {\n        if (str.charAt(idx) != '<') {\n          keys.push(str.charAt(idx));\n          idx++;\n          continue;\n        }\n        // Vim key notation here means desktop Vim key-notation.\n        // See :help key-notation in desktop Vim.\n        var vimKeyNotationStart = ++idx;\n        while (str.charAt(idx++) != '>') {}\n        var vimKeyNotation = str.substring(vimKeyNotationStart, idx - 1);\n        var match = (/^C-(.+)$/).exec(vimKeyNotation);\n        if (match) {\n          var key;\n          switch (match[1]) {\n            case 'BS':\n              key = 'Backspace';\n              break;\n            case 'CR':\n              key = 'Enter';\n              break;\n            case 'Del':\n              key = 'Delete';\n              break;\n            default:\n              key = match[1];\n              break;\n          }\n          keys.push('Ctrl-' + key);\n        }\n      }\n      return keys;\n    }\n\n    var exCommands = {\n      map: function(cm, params) {\n        var mapArgs = params.args;\n        if (!mapArgs || mapArgs.length < 2) {\n          if (cm) {\n            showConfirm(cm, 'Invalid mapping: ' + params.input);\n          }\n          return;\n        }\n        exCommandDispatcher.map(mapArgs[0], mapArgs[1], cm);\n      },\n      move: function(cm, params) {\n        commandDispatcher.processMotion(cm, getVimState(cm), {\n            motion: 'moveToLineOrEdgeOfDocument',\n            motionArgs: { forward: false, explicitRepeat: true,\n              linewise: true, repeat: params.line }});\n      },\n      substitute: function(cm, params) {\n        var argString = params.argString;\n        var slashes = findUnescapedSlashes(argString);\n        if (slashes[0] !== 0) {\n          showConfirm(cm, 'Substitutions should be of the form ' +\n              ':s/pattern/replace/');\n          return;\n        }\n        var regexPart = argString.substring(slashes[0] + 1, slashes[1]);\n        var replacePart = '';\n        var flagsPart;\n        var count;\n        if (slashes[1]) {\n          replacePart = argString.substring(slashes[1] + 1, slashes[2]);\n        }\n        if (slashes[2]) {\n          // After the 3rd slash, we can have flags followed by a space followed\n          // by count.\n          var trailing = argString.substring(slashes[2] + 1).split(' ');\n          flagsPart = trailing[0];\n          count = parseInt(trailing[1]);\n        }\n        if (flagsPart) {\n          regexPart = regexPart + '/' + flagsPart;\n        }\n        if (regexPart) {\n          // If regex part is empty, then use the previous query. Otherwise use\n          // the regex part as the new query.\n          updateSearchQuery(cm, regexPart, true /** ignoreCase */,\n            true /** smartCase */);\n        }\n        var state = getSearchState(cm);\n        var query = state.getQuery();\n        var lineStart = params.line || 0;\n        var lineEnd = params.lineEnd || lineStart;\n        if (count) {\n          lineStart = lineEnd;\n          lineEnd = lineStart + count - 1;\n        }\n        var startPos = clipCursorToContent(cm, { line: lineStart, ch: 0 });\n        function doReplace() {\n          for (var cursor = cm.getSearchCursor(query, startPos);\n               cursor.findNext() &&\n                   isInRange(cursor.from(), lineStart, lineEnd);) {\n            var text = cm.getRange(cursor.from(), cursor.to());\n            var newText = text.replace(query, replacePart);\n            cursor.replace(newText);\n          }\n          var vim = getVimState(cm);\n          if (vim.visualMode) {\n            exitVisualMode(cm, vim);\n          }\n        }\n        if (cm.compoundChange) {\n          // Only exists in v2\n          cm.compoundChange(doReplace);\n        } else {\n          cm.operation(doReplace);\n        }\n      },\n      redo: CodeMirror.commands.redo,\n      undo: CodeMirror.commands.undo,\n      write: function(cm) {\n        if (CodeMirror.commands.save) {\n          // If a save command is defined, call it.\n          CodeMirror.commands.save(cm);\n        } else {\n          // Saves to text area if no save command is defined.\n          cm.save();\n        }\n      }\n    };\n\n    var exCommandDispatcher = new Vim.ExCommandDispatcher();\n\n    // Register Vim with CodeMirror\n    function buildVimKeyMap() {\n      /**\n       * Handle the raw key event from CodeMirror. Translate the\n       * Shift + key modifier to the resulting letter, while preserving other\n       * modifers.\n       */\n      // TODO: Figure out a way to catch capslock.\n      function handleKeyEvent_(cm, key, modifier) {\n        if (isUpperCase(key)) {\n          // Convert to lower case if shift is not the modifier since the key\n          // we get from CodeMirror is always upper case.\n          if (modifier == 'Shift') {\n            modifier = null;\n          }\n          else {\n            key = key.toLowerCase();\n          }\n        }\n        if (modifier) {\n          // Vim will parse modifier+key combination as a single key.\n          key = modifier + '-' + key;\n        }\n        vim.handleKey(cm, key);\n      }\n\n      // Closure to bind CodeMirror, key, modifier.\n      function keyMapper(key, modifier) {\n        return function(cm) {\n          handleKeyEvent_(cm, key, modifier);\n        };\n      }\n\n      var modifiers = ['Shift', 'Ctrl'];\n      var keyMap = {\n        'nofallthrough': true,\n        'style': 'fat-cursor'\n      };\n      function bindKeys(keys, modifier) {\n        for (var i = 0; i < keys.length; i++) {\n          var key = keys[i];\n          if (!modifier && inArray(key, specialSymbols)) {\n            // Wrap special symbols with '' because that's how CodeMirror binds\n            // them.\n            key = \"'\" + key + \"'\";\n          }\n          if (modifier) {\n            keyMap[modifier + '-' + key] = keyMapper(keys[i], modifier);\n          } else {\n            keyMap[key] = keyMapper(keys[i]);\n          }\n        }\n      }\n      bindKeys(upperCaseAlphabet);\n      bindKeys(upperCaseAlphabet, 'Shift');\n      bindKeys(upperCaseAlphabet, 'Ctrl');\n      bindKeys(specialSymbols);\n      bindKeys(specialSymbols, 'Ctrl');\n      bindKeys(numbers);\n      bindKeys(numbers, 'Ctrl');\n      bindKeys(specialKeys);\n      bindKeys(specialKeys, 'Ctrl');\n      return keyMap;\n    }\n    CodeMirror.keyMap.vim = buildVimKeyMap();\n\n    function exitInsertMode(cm) {\n      cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1, true);\n      cm.setOption('keyMap', 'vim');\n    }\n\n    CodeMirror.keyMap['vim-insert'] = {\n      // TODO: override navigation keys so that Esc will cancel automatic\n      // indentation from o, O, i_<CR>\n      'Esc': exitInsertMode,\n      'Ctrl-[': exitInsertMode,\n      'Ctrl-C': exitInsertMode,\n      'Ctrl-N': 'autocomplete',\n      'Ctrl-P': 'autocomplete',\n      'Enter': function(cm) {\n        var fn = CodeMirror.commands.newlineAndIndentContinueComment ||\n            CodeMirror.commands.newlineAndIndent;\n        fn(cm);\n      },\n      fallthrough: ['default']\n    };\n\n    return vimApi;\n  };\n  // Initialize Vim and make it available as an API.\n  var vim = Vim();\n  CodeMirror.Vim = vim;\n}\n)();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/lib/codemirror.css",
    "content": "/* BASICS */\n\n.CodeMirror {\n  /* Set height, width, borders, and global font properties here */\n  font-family: monospace;\n  height: 300px;\n}\n.CodeMirror-scroll {\n  /* Set scrolling behaviour here */\n  overflow: auto;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n  padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre {\n  padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler {\n  background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n  border-right: 1px solid #ddd;\n  background-color: #f7f7f7;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n  padding: 0 3px 0 5px;\n  min-width: 20px;\n  text-align: right;\n  color: #999;\n}\n\n/* CURSOR */\n\n.CodeMirror div.CodeMirror-cursor {\n  border-left: 1px solid black;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n  border-left: 1px solid silver;\n}\n.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {\n  width: auto;\n  border: 0;\n  background: transparent;\n  background: rgba(0, 200, 0, .4);\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);\n}\n/* Kludge to turn off filter in ie9+, which also accepts rgba */\n.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor:not(#nonsense_id) {\n  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);\n}\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable {color: black;}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3 {color: #085;}\n.cm-s-default .cm-property {color: black;}\n.cm-s-default .cm-operator {color: black;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-error {color: #f00;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-emstrong {font-style: italic; font-weight: bold;}\n.cm-link {text-decoration: underline;}\n\n.cm-invalidchar {color: #f00;}\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n   the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n  line-height: 1;\n  position: relative;\n  overflow: hidden;\n}\n\n.CodeMirror-scroll {\n  /* 30px is the magic margin used to hide the element's real scrollbars */\n  /* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */\n  margin-bottom: -30px; margin-right: -30px;\n  padding-bottom: 30px; padding-right: 30px;\n  height: 100%;\n  outline: none; /* Prevent dragging from highlighting the element */\n  position: relative;\n}\n.CodeMirror-sizer {\n  position: relative;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n   before actuall scrolling happens, thus preventing shaking and\n   flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler {\n  position: absolute;\n  z-index: 6;\n  display: none;\n}\n.CodeMirror-vscrollbar {\n  right: 0; top: 0;\n  overflow-x: hidden;\n  overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n  bottom: 0; left: 0;\n  overflow-y: hidden;\n  overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n  right: 0; bottom: 0;\n  z-index: 6;\n}\n\n.CodeMirror-gutters {\n  position: absolute; left: 0; top: 0;\n  height: 100%;\n  z-index: 3;\n}\n.CodeMirror-gutter {\n  height: 100%;\n  display: inline-block;\n  /* Hack to make IE7 behave */\n  *zoom:1;\n  *display:inline;\n}\n.CodeMirror-gutter-elt {\n  position: absolute;\n  cursor: default;\n  z-index: 4;\n}\n\n.CodeMirror-lines {\n  cursor: text;\n}\n.CodeMirror pre {\n  /* Reset some styles that the rest of the page might have set */\n  -moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0;\n  border-width: 0;\n  background: transparent;\n  font-family: inherit;\n  font-size: inherit;\n  margin: 0;\n  white-space: pre;\n  word-wrap: normal;\n  line-height: inherit;\n  color: inherit;\n  z-index: 2;\n  position: relative;\n  overflow: visible;\n}\n.CodeMirror-wrap pre {\n  word-wrap: break-word;\n  white-space: pre-wrap;\n  word-break: normal;\n}\n.CodeMirror-linebackground {\n  position: absolute;\n  left: 0; right: 0; top: 0; bottom: 0;\n  z-index: 0;\n}\n\n.CodeMirror-linewidget {\n  position: relative;\n  z-index: 2;\n  overflow: auto;\n}\n\n.CodeMirror-wrap .CodeMirror-scroll {\n  overflow-x: hidden;\n}\n\n.CodeMirror-measure {\n  position: absolute;\n  width: 100%; height: 0px;\n  overflow: hidden;\n  visibility: hidden;\n}\n.CodeMirror-measure pre { position: static; }\n\n.CodeMirror div.CodeMirror-cursor {\n  position: absolute;\n  visibility: hidden;\n  border-right: none;\n  width: 0;\n}\n.CodeMirror-focused div.CodeMirror-cursor {\n  visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n\n.cm-searching {\n  background: #ffa;\n  background: rgba(255, 255, 0, .4);\n}\n\n/* IE7 hack to prevent it from returning funny offsetTops on the spans */\n.CodeMirror span { *vertical-align: text-bottom; }\n\n@media print {\n  /* Hide the cursor when printing */\n  .CodeMirror div.CodeMirror-cursor {\n    visibility: hidden;\n  }\n}\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/lib/codemirror.js",
    "content": "// CodeMirror version 3.02\n//\n// CodeMirror is the only global var we claim\nwindow.CodeMirror = (function() {\n  \"use strict\";\n\n  // BROWSER SNIFFING\n\n  // Crude, but necessary to handle a number of hard-to-feature-detect\n  // bugs and behavior differences.\n  var gecko = /gecko\\/\\d/i.test(navigator.userAgent);\n  var ie = /MSIE \\d/.test(navigator.userAgent);\n  var ie_lt8 = ie && (document.documentMode == null || document.documentMode < 8);\n  var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);\n  var webkit = /WebKit\\//.test(navigator.userAgent);\n  var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(navigator.userAgent);\n  var chrome = /Chrome\\//.test(navigator.userAgent);\n  var opera = /Opera\\//.test(navigator.userAgent);\n  var safari = /Apple Computer/.test(navigator.vendor);\n  var khtml = /KHTML\\//.test(navigator.userAgent);\n  var mac_geLion = /Mac OS X 1\\d\\D([7-9]|\\d\\d)\\D/.test(navigator.userAgent);\n  var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(navigator.userAgent);\n  var phantom = /PhantomJS/.test(navigator.userAgent);\n\n  var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\\/\\w+/.test(navigator.userAgent);\n  // This is woefully incomplete. Suggestions for alternative methods welcome.\n  var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);\n  var mac = ios || /Mac/.test(navigator.platform);\n  var windows = /windows/i.test(navigator.platform);\n\n  var opera_version = opera && navigator.userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n  if (opera_version) opera_version = Number(opera_version[1]);\n  // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n  var flipCtrlCmd = mac && (qtwebkit || opera && (opera_version == null || opera_version < 12.11));\n\n  // Optimize some code when these features are not used\n  var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n  // CONSTRUCTOR\n\n  function CodeMirror(place, options) {\n    if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);\n    \n    this.options = options = options || {};\n    // Determine effective options based on given values and defaults.\n    for (var opt in defaults) if (!options.hasOwnProperty(opt) && defaults.hasOwnProperty(opt))\n      options[opt] = defaults[opt];\n    setGuttersForLineNumbers(options);\n\n    var display = this.display = makeDisplay(place);\n    display.wrapper.CodeMirror = this;\n    updateGutters(this);\n    if (options.autofocus && !mobile) focusInput(this);\n\n    this.view = makeView(new BranchChunk([new LeafChunk([makeLine(\"\", null, textHeight(display))])]));\n    this.nextOpId = 0;\n    loadMode(this);\n    themeChanged(this);\n    if (options.lineWrapping)\n      this.display.wrapper.className += \" CodeMirror-wrap\";\n\n    // Initialize the content.\n    this.setValue(options.value || \"\");\n    // Override magic textarea content restore that IE sometimes does\n    // on our hidden textarea on reload\n    if (ie) setTimeout(bind(resetInput, this, true), 20);\n    this.view.history = makeHistory();\n\n    registerEventHandlers(this);\n    // IE throws unspecified error in certain cases, when\n    // trying to access activeElement before onload\n    var hasFocus; try { hasFocus = (document.activeElement == display.input); } catch(e) { }\n    if (hasFocus || (options.autofocus && !mobile)) setTimeout(bind(onFocus, this), 20);\n    else onBlur(this);\n\n    operation(this, function() {\n      for (var opt in optionHandlers)\n        if (optionHandlers.propertyIsEnumerable(opt))\n          optionHandlers[opt](this, options[opt], Init);\n      for (var i = 0; i < initHooks.length; ++i) initHooks[i](this);\n    })();\n  }\n\n  // DISPLAY CONSTRUCTOR\n\n  function makeDisplay(place) {\n    var d = {};\n    var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none;\");\n    if (webkit) input.style.width = \"1000px\";\n    else input.setAttribute(\"wrap\", \"off\");\n    input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\");\n    // Wraps and hides input textarea\n    d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n    // The actual fake scrollbars.\n    d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 1px\")], \"CodeMirror-hscrollbar\");\n    d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"width: 1px\")], \"CodeMirror-vscrollbar\");\n    d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n    // DIVs containing the selection and the actual code\n    d.lineDiv = elt(\"div\");\n    d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n    // Blinky cursor, and element used to ensure cursor fits at the end of a line\n    d.cursor = elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\");\n    // Secondary cursor, shown when on a 'jump' in bi-directional text\n    d.otherCursor = elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\");\n    // Used to measure text size\n    d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n    // Wraps everything that needs to exist inside the vertically-padded coordinate system\n    d.lineSpace = elt(\"div\", [d.measure, d.selectionDiv, d.lineDiv, d.cursor, d.otherCursor],\n                         null, \"position: relative; outline: none\");\n    // Moved around its parent to cover visible view\n    d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n    // Set to the height of the text, causes scrolling\n    d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n    // D is needed because behavior of elts with overflow: auto and padding is inconsistent across browsers\n    d.heightForcer = elt(\"div\", \"\\u00a0\", null, \"position: absolute; height: \" + scrollerCutOff + \"px\");\n    // Will contain the gutters, if any\n    d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n    d.lineGutter = null;\n    // Helper element to properly size the gutter backgrounds\n    var scrollerInner = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], null, \"position: relative; min-height: 100%\");\n    // Provides scrolling\n    d.scroller = elt(\"div\", [scrollerInner], \"CodeMirror-scroll\");\n    d.scroller.setAttribute(\"tabIndex\", \"-1\");\n    // The element in which the editor lives.\n    d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV,\n                            d.scrollbarFiller, d.scroller], \"CodeMirror\");\n    // Work around IE7 z-index bug\n    if (ie_lt8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n    if (place.appendChild) place.appendChild(d.wrapper); else place(d.wrapper);\n\n    // Needed to hide big blue blinking cursor on Mobile Safari\n    if (ios) input.style.width = \"0px\";\n    if (!webkit) d.scroller.draggable = true;\n    // Needed to handle Tab key in KHTML\n    if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n    // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n    else if (ie_lt8) d.scrollbarH.style.minWidth = d.scrollbarV.style.minWidth = \"18px\";\n\n    // Current visible range (may be bigger than the view window).\n    d.viewOffset = d.showingFrom = d.showingTo = d.lastSizeC = 0;\n\n    // Used to only resize the line number gutter when necessary (when\n    // the amount of lines crosses a boundary that makes its width change)\n    d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n    // See readInput and resetInput\n    d.prevInput = \"\";\n    // Set to true when a non-horizontal-scrolling widget is added. As\n    // an optimization, widget aligning is skipped when d is false.\n    d.alignWidgets = false;\n    // Flag that indicates whether we currently expect input to appear\n    // (after some event like 'keypress' or 'input') and are polling\n    // intensively.\n    d.pollingFast = false;\n    // Self-resetting timeout for the poller\n    d.poll = new Delayed();\n    // True when a drag from the editor is active\n    d.draggingText = false;\n\n    d.cachedCharWidth = d.cachedTextHeight = null;\n    d.measureLineCache = [];\n    d.measureLineCachePos = 0;\n\n    // Tracks when resetInput has punted to just putting a short\n    // string instead of the (large) selection.\n    d.inaccurateSelection = false;\n\n    // Used to adjust overwrite behaviour when a paste has been\n    // detected\n    d.pasteIncoming = false;\n\n    // Used for measuring wheel scrolling granularity\n    d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n    \n    return d;\n  }\n\n  // VIEW CONSTRUCTOR\n\n  function makeView(doc) {\n    var selPos = {line: 0, ch: 0};\n    return {\n      doc: doc,\n      // frontier is the point up to which the content has been parsed,\n      frontier: 0, highlight: new Delayed(),\n      sel: {from: selPos, to: selPos, head: selPos, anchor: selPos, shift: false, extend: false},\n      scrollTop: 0, scrollLeft: 0,\n      overwrite: false, focused: false,\n      // Tracks the maximum line length so that\n      // the horizontal scrollbar can be kept\n      // static when scrolling.\n      maxLine: getLine(doc, 0),\n      maxLineLength: 0,\n      maxLineChanged: false,\n      suppressEdits: false,\n      goalColumn: null,\n      cantEdit: false,\n      keyMaps: [],\n      overlays: [],\n      modeGen: 0\n    };\n  }\n\n  // STATE UPDATES\n\n  // Used to get the editor into a consistent state again when options change.\n\n  function loadMode(cm) {\n    var doc = cm.view.doc;\n    cm.view.mode = CodeMirror.getMode(cm.options, cm.options.mode);\n    doc.iter(0, doc.size, function(line) {\n      if (line.stateAfter) line.stateAfter = null;\n      if (line.styles) line.styles = null;\n    });\n    cm.view.frontier = 0;\n    startWorker(cm, 100);\n    cm.view.modeGen++;\n    if (cm.curOp) regChange(cm, 0, doc.size);\n  }\n\n  function wrappingChanged(cm) {\n    var doc = cm.view.doc, th = textHeight(cm.display);\n    if (cm.options.lineWrapping) {\n      cm.display.wrapper.className += \" CodeMirror-wrap\";\n      var perLine = cm.display.scroller.clientWidth / charWidth(cm.display) - 3;\n      doc.iter(0, doc.size, function(line) {\n        if (line.height == 0) return;\n        var guess = Math.ceil(line.text.length / perLine) || 1;\n        if (guess != 1) updateLineHeight(line, guess * th);\n      });\n      cm.display.sizer.style.minWidth = \"\";\n    } else {\n      cm.display.wrapper.className = cm.display.wrapper.className.replace(\" CodeMirror-wrap\", \"\");\n      computeMaxLength(cm.view);\n      doc.iter(0, doc.size, function(line) {\n        if (line.height != 0) updateLineHeight(line, th);\n      });\n    }\n    regChange(cm, 0, doc.size);\n    clearCaches(cm);\n    setTimeout(function(){updateScrollbars(cm.display, cm.view.doc.height);}, 100);\n  }\n\n  function keyMapChanged(cm) {\n    var style = keyMap[cm.options.keyMap].style;\n    cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-keymap-\\S+/g, \"\") +\n      (style ? \" cm-keymap-\" + style : \"\");\n  }\n\n  function themeChanged(cm) {\n    cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n      cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n    clearCaches(cm);\n  }\n\n  function guttersChanged(cm) {\n    updateGutters(cm);\n    updateDisplay(cm, true);\n  }\n\n  function updateGutters(cm) {\n    var gutters = cm.display.gutters, specs = cm.options.gutters;\n    removeChildren(gutters);\n    for (var i = 0; i < specs.length; ++i) {\n      var gutterClass = specs[i];\n      var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n      if (gutterClass == \"CodeMirror-linenumbers\") {\n        cm.display.lineGutter = gElt;\n        gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n      }\n    }\n    gutters.style.display = i ? \"\" : \"none\";\n  }\n\n  function lineLength(doc, line) {\n    if (line.height == 0) return 0;\n    var len = line.text.length, merged, cur = line;\n    while (merged = collapsedSpanAtStart(cur)) {\n      var found = merged.find();\n      cur = getLine(doc, found.from.line);\n      len += found.from.ch - found.to.ch;\n    }\n    cur = line;\n    while (merged = collapsedSpanAtEnd(cur)) {\n      var found = merged.find();\n      len -= cur.text.length - found.from.ch;\n      cur = getLine(doc, found.to.line);\n      len += cur.text.length - found.to.ch;\n    }\n    return len;\n  }\n\n  function computeMaxLength(view) {\n    view.maxLine = getLine(view.doc, 0);\n    view.maxLineLength = lineLength(view.doc, view.maxLine);\n    view.maxLineChanged = true;\n    view.doc.iter(1, view.doc.size, function(line) {\n      var len = lineLength(view.doc, line);\n      if (len > view.maxLineLength) {\n        view.maxLineLength = len;\n        view.maxLine = line;\n      }\n    });\n  }\n\n  // Make sure the gutters options contains the element\n  // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n  function setGuttersForLineNumbers(options) {\n    var found = false;\n    for (var i = 0; i < options.gutters.length; ++i) {\n      if (options.gutters[i] == \"CodeMirror-linenumbers\") {\n        if (options.lineNumbers) found = true;\n        else options.gutters.splice(i--, 1);\n      }\n    }\n    if (!found && options.lineNumbers)\n      options.gutters.push(\"CodeMirror-linenumbers\");\n  }\n\n  // SCROLLBARS\n\n  // Re-synchronize the fake scrollbars with the actual size of the\n  // content. Optionally force a scrollTop.\n  function updateScrollbars(d /* display */, docHeight) {\n    var totalHeight = docHeight + 2 * paddingTop(d);\n    d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n    var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n    var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n    var needsV = scrollHeight > d.scroller.clientHeight;\n    if (needsV) {\n      d.scrollbarV.style.display = \"block\";\n      d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n      d.scrollbarV.firstChild.style.height = \n        (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n    } else d.scrollbarV.style.display = \"\";\n    if (needsH) {\n      d.scrollbarH.style.display = \"block\";\n      d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n      d.scrollbarH.firstChild.style.width =\n        (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n    } else d.scrollbarH.style.display = \"\";\n    if (needsH && needsV) {\n      d.scrollbarFiller.style.display = \"block\";\n      d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n    } else d.scrollbarFiller.style.display = \"\";\n\n    if (mac_geLion && scrollbarWidth(d.measure) === 0)\n      d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n  }\n\n  function visibleLines(display, doc, viewPort) {\n    var top = display.scroller.scrollTop, height = display.wrapper.clientHeight;\n    if (typeof viewPort == \"number\") top = viewPort;\n    else if (viewPort) {top = viewPort.top; height = viewPort.bottom - viewPort.top;}\n    top = Math.floor(top - paddingTop(display));\n    var bottom = Math.ceil(top + height);\n    return {from: lineAtHeight(doc, top), to: lineAtHeight(doc, bottom)};\n  }\n\n  // LINE NUMBERS\n\n  function alignHorizontally(cm) {\n    var display = cm.display;\n    if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n    var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.view.scrollLeft;\n    var gutterW = display.gutters.offsetWidth, l = comp + \"px\";\n    for (var n = display.lineDiv.firstChild; n; n = n.nextSibling) if (n.alignable) {\n      for (var i = 0, a = n.alignable; i < a.length; ++i) a[i].style.left = l;\n    }\n    if (cm.options.fixedGutter)\n      display.gutters.style.left = (comp + gutterW) + \"px\";\n  }\n\n  function maybeUpdateLineNumberWidth(cm) {\n    if (!cm.options.lineNumbers) return false;\n    var doc = cm.view.doc, last = lineNumberFor(cm.options, doc.size - 1), display = cm.display;\n    if (last.length != display.lineNumChars) {\n      var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n                                                 \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n      var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n      display.lineGutter.style.width = \"\";\n      display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n      display.lineNumWidth = display.lineNumInnerWidth + padding;\n      display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n      display.lineGutter.style.width = display.lineNumWidth + \"px\";\n      return true;\n    }\n    return false;\n  }\n\n  function lineNumberFor(options, i) {\n    return String(options.lineNumberFormatter(i + options.firstLineNumber));\n  }\n  function compensateForHScroll(display) {\n    return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n  }\n\n  // DISPLAY DRAWING\n\n  function updateDisplay(cm, changes, viewPort) {\n    var oldFrom = cm.display.showingFrom, oldTo = cm.display.showingTo;\n    var updated = updateDisplayInner(cm, changes, viewPort);\n    if (updated) {\n      signalLater(cm, cm, \"update\", cm);\n      if (cm.display.showingFrom != oldFrom || cm.display.showingTo != oldTo)\n        signalLater(cm, cm, \"viewportChange\", cm, cm.display.showingFrom, cm.display.showingTo);\n    }\n    updateSelection(cm);\n    updateScrollbars(cm.display, cm.view.doc.height);\n\n    return updated;\n  }\n\n  // Uses a set of changes plus the current scroll position to\n  // determine which DOM updates have to be made, and makes the\n  // updates.\n  function updateDisplayInner(cm, changes, viewPort) {\n    var display = cm.display, doc = cm.view.doc;\n    if (!display.wrapper.clientWidth) {\n      display.showingFrom = display.showingTo = display.viewOffset = 0;\n      return;\n    }\n\n    // Compute the new visible window\n    // If scrollTop is specified, use that to determine which lines\n    // to render instead of the current scrollbar position.\n    var visible = visibleLines(display, doc, viewPort);\n    // Bail out if the visible area is already rendered and nothing changed.\n    if (changes !== true && changes.length == 0 &&\n        visible.from > display.showingFrom && visible.to < display.showingTo)\n      return;\n\n    if (changes && maybeUpdateLineNumberWidth(cm))\n      changes = true;\n    var gutterW = display.sizer.style.marginLeft = display.gutters.offsetWidth + \"px\";\n    display.scrollbarH.style.left = cm.options.fixedGutter ? gutterW : \"0\";\n\n    // When merged lines are present, the line that needs to be\n    // redrawn might not be the one that was changed.\n    if (changes !== true && sawCollapsedSpans)\n      for (var i = 0; i < changes.length; ++i) {\n        var ch = changes[i], merged;\n        while (merged = collapsedSpanAtStart(getLine(doc, ch.from))) {\n          var from = merged.find().from.line;\n          if (ch.diff) ch.diff -= ch.from - from;\n          ch.from = from;\n        }\n      }\n\n    // Used to determine which lines need their line numbers updated\n    var positionsChangedFrom = changes === true ? 0 : Infinity;\n    if (cm.options.lineNumbers && changes && changes !== true)\n      for (var i = 0; i < changes.length; ++i)\n        if (changes[i].diff) { positionsChangedFrom = changes[i].from; break; }\n\n    var from = Math.max(visible.from - cm.options.viewportMargin, 0);\n    var to = Math.min(doc.size, visible.to + cm.options.viewportMargin);\n    if (display.showingFrom < from && from - display.showingFrom < 20) from = display.showingFrom;\n    if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(doc.size, display.showingTo);\n    if (sawCollapsedSpans) {\n      from = lineNo(visualLine(doc, getLine(doc, from)));\n      while (to < doc.size && lineIsHidden(getLine(doc, to))) ++to;\n    }\n\n    // Create a range of theoretically intact lines, and punch holes\n    // in that using the change info.\n    var intact = changes === true ? [] :\n      computeIntact([{from: display.showingFrom, to: display.showingTo}], changes);\n    // Clip off the parts that won't be visible\n    var intactLines = 0;\n    for (var i = 0; i < intact.length; ++i) {\n      var range = intact[i];\n      if (range.from < from) range.from = from;\n      if (range.to > to) range.to = to;\n      if (range.from >= range.to) intact.splice(i--, 1);\n      else intactLines += range.to - range.from;\n    }\n    if (intactLines == to - from && from == display.showingFrom && to == display.showingTo)\n      return;\n    intact.sort(function(a, b) {return a.from - b.from;});\n\n    var focused = document.activeElement;\n    if (intactLines < (to - from) * .7) display.lineDiv.style.display = \"none\";\n    patchDisplay(cm, from, to, intact, positionsChangedFrom);\n    display.lineDiv.style.display = \"\";\n    if (document.activeElement != focused && focused.offsetHeight) focused.focus();\n\n    var different = from != display.showingFrom || to != display.showingTo ||\n      display.lastSizeC != display.wrapper.clientHeight;\n    // This is just a bogus formula that detects when the editor is\n    // resized or the font size changes.\n    if (different) display.lastSizeC = display.wrapper.clientHeight;\n    display.showingFrom = from; display.showingTo = to;\n    startWorker(cm, 100);\n\n    var prevBottom = display.lineDiv.offsetTop;\n    for (var node = display.lineDiv.firstChild, height; node; node = node.nextSibling) if (node.lineObj) {\n      if (ie_lt8) {\n        var bot = node.offsetTop + node.offsetHeight;\n        height = bot - prevBottom;\n        prevBottom = bot;\n      } else {\n        var box = node.getBoundingClientRect();\n        height = box.bottom - box.top;\n      }\n      var diff = node.lineObj.height - height;\n      if (height < 2) height = textHeight(display);\n      if (diff > .001 || diff < -.001) {\n        updateLineHeight(node.lineObj, height);\n        var widgets = node.lineObj.widgets;\n        if (widgets) for (var i = 0; i < widgets.length; ++i)\n          widgets[i].height = widgets[i].node.offsetHeight;\n      }\n    }\n    display.viewOffset = heightAtLine(cm, getLine(doc, from));\n    // Position the mover div to align with the current virtual scroll position\n    display.mover.style.top = display.viewOffset + \"px\";\n\n    if (visibleLines(display, doc, viewPort).to >= to)\n      updateDisplayInner(cm, [], viewPort);\n    return true;\n  }\n\n  function computeIntact(intact, changes) {\n    for (var i = 0, l = changes.length || 0; i < l; ++i) {\n      var change = changes[i], intact2 = [], diff = change.diff || 0;\n      for (var j = 0, l2 = intact.length; j < l2; ++j) {\n        var range = intact[j];\n        if (change.to <= range.from && change.diff) {\n          intact2.push({from: range.from + diff, to: range.to + diff});\n        } else if (change.to <= range.from || change.from >= range.to) {\n          intact2.push(range);\n        } else {\n          if (change.from > range.from)\n            intact2.push({from: range.from, to: change.from});\n          if (change.to < range.to)\n            intact2.push({from: change.to + diff, to: range.to + diff});\n        }\n      }\n      intact = intact2;\n    }\n    return intact;\n  }\n\n  function getDimensions(cm) {\n    var d = cm.display, left = {}, width = {};\n    for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n      left[cm.options.gutters[i]] = n.offsetLeft;\n      width[cm.options.gutters[i]] = n.offsetWidth;\n    }\n    return {fixedPos: compensateForHScroll(d),\n            gutterTotalWidth: d.gutters.offsetWidth,\n            gutterLeft: left,\n            gutterWidth: width,\n            wrapperWidth: d.wrapper.clientWidth};\n  }\n\n  function patchDisplay(cm, from, to, intact, updateNumbersFrom) {\n    var dims = getDimensions(cm);\n    var display = cm.display, lineNumbers = cm.options.lineNumbers;\n    if (!intact.length && (!webkit || !cm.display.currentWheelTarget))\n      removeChildren(display.lineDiv);\n    var container = display.lineDiv, cur = container.firstChild;\n\n    function rm(node) {\n      var next = node.nextSibling;\n      if (webkit && mac && cm.display.currentWheelTarget == node) {\n        node.style.display = \"none\";\n        node.lineObj = null;\n      } else {\n        node.parentNode.removeChild(node);\n      }\n      return next;\n    }\n\n    var nextIntact = intact.shift(), lineNo = from;\n    cm.view.doc.iter(from, to, function(line) {\n      if (nextIntact && nextIntact.to == lineNo) nextIntact = intact.shift();\n      if (lineIsHidden(line)) {\n        if (line.height != 0) updateLineHeight(line, 0);\n        if (line.widgets && cur.previousSibling) for (var i = 0; i < line.widgets.length; ++i)\n          if (line.widgets[i].showIfHidden) {\n            var prev = cur.previousSibling;\n            if (prev.nodeType == \"pre\") {\n              var wrap = elt(\"div\", null, null, \"position: relative\");\n              prev.parentNode.replaceChild(wrap, prev);\n              wrap.appendChild(prev);\n              prev = wrap;\n            }\n            prev.appendChild(buildLineWidget(line.widgets[i], prev, dims));\n          }\n      } else if (nextIntact && nextIntact.from <= lineNo && nextIntact.to > lineNo) {\n        // This line is intact. Skip to the actual node. Update its\n        // line number if needed.\n        while (cur.lineObj != line) cur = rm(cur);\n        if (lineNumbers && updateNumbersFrom <= lineNo && cur.lineNumber)\n          setTextContent(cur.lineNumber, lineNumberFor(cm.options, lineNo));\n        cur = cur.nextSibling;\n      } else {\n        // This line needs to be generated.\n        var lineNode = buildLineElement(cm, line, lineNo, dims);\n        container.insertBefore(lineNode, cur);\n        lineNode.lineObj = line;\n      }\n      ++lineNo;\n    });\n    while (cur) cur = rm(cur);\n  }\n\n  function buildLineElement(cm, line, lineNo, dims) {\n    var lineElement = lineContent(cm, line);\n    var markers = line.gutterMarkers, display = cm.display;\n\n    if (!cm.options.lineNumbers && !markers && !line.bgClass && !line.wrapClass &&\n        (!line.widgets || !line.widgets.length)) return lineElement;\n\n    // Lines with gutter elements or a background class need\n    // to be wrapped again, and have the extra elements added\n    // to the wrapper div\n\n    var wrap = elt(\"div\", null, line.wrapClass, \"position: relative\");\n    if (cm.options.lineNumbers || markers) {\n      var gutterWrap = wrap.appendChild(elt(\"div\", null, null, \"position: absolute; left: \" +\n                                            (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n      if (cm.options.fixedGutter) wrap.alignable = [gutterWrap];\n      if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n        wrap.lineNumber = gutterWrap.appendChild(\n          elt(\"div\", lineNumberFor(cm.options, lineNo),\n              \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n              \"left: \" + dims.gutterLeft[\"CodeMirror-linenumbers\"] + \"px; width: \"\n              + display.lineNumInnerWidth + \"px\"));\n      if (markers)\n        for (var k = 0; k < cm.options.gutters.length; ++k) {\n          var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n          if (found)\n            gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\", \"left: \" +\n                                       dims.gutterLeft[id] + \"px; width: \" + dims.gutterWidth[id] + \"px\"));\n        }\n    }\n    // Kludge to make sure the styled element lies behind the selection (by z-index)\n    if (line.bgClass)\n      wrap.appendChild(elt(\"div\", \"\\u00a0\", line.bgClass + \" CodeMirror-linebackground\"));\n    wrap.appendChild(lineElement);\n    if (line.widgets) for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n      var widget = ws[i], node = buildLineWidget(widget, wrap, dims);\n      if (widget.above)\n        wrap.insertBefore(node, cm.options.lineNumbers && line.height != 0 ? gutterWrap : lineElement);\n      else\n        wrap.appendChild(node);\n    }\n    if (ie_lt8) wrap.style.zIndex = 2;\n    return wrap;\n  }\n\n  function buildLineWidget(widget, wrap, dims) {\n    var node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n    node.widget = widget;\n    if (widget.noHScroll) {\n      (wrap.alignable || (wrap.alignable = [])).push(node);\n      var width = dims.wrapperWidth;\n      node.style.left = dims.fixedPos + \"px\";\n      if (!widget.coverGutter) {\n        width -= dims.gutterTotalWidth;\n        node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n      }\n      node.style.width = width + \"px\";\n    }\n    if (widget.coverGutter) {\n      node.style.zIndex = 5;\n      node.style.position = \"relative\";\n      if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + \"px\";\n    }\n    return node;\n  }\n\n  // SELECTION / CURSOR\n\n  function updateSelection(cm) {\n    var display = cm.display;\n    var collapsed = posEq(cm.view.sel.from, cm.view.sel.to);\n    if (collapsed || cm.options.showCursorWhenSelecting)\n      updateSelectionCursor(cm);\n    else\n      display.cursor.style.display = display.otherCursor.style.display = \"none\";\n    if (!collapsed)\n      updateSelectionRange(cm);\n    else\n      display.selectionDiv.style.display = \"none\";\n\n    // Move the hidden textarea near the cursor to prevent scrolling artifacts\n    var headPos = cursorCoords(cm, cm.view.sel.head, \"div\");\n    var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n    display.inputDiv.style.top = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n                                                      headPos.top + lineOff.top - wrapOff.top)) + \"px\";\n    display.inputDiv.style.left = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n                                                       headPos.left + lineOff.left - wrapOff.left)) + \"px\";\n  }\n\n  // No selection, plain cursor\n  function updateSelectionCursor(cm) {\n    var display = cm.display, pos = cursorCoords(cm, cm.view.sel.head, \"div\");\n    display.cursor.style.left = pos.left + \"px\";\n    display.cursor.style.top = pos.top + \"px\";\n    display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n    display.cursor.style.display = \"\";\n\n    if (pos.other) {\n      display.otherCursor.style.display = \"\";\n      display.otherCursor.style.left = pos.other.left + \"px\";\n      display.otherCursor.style.top = pos.other.top + \"px\";\n      display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n    } else { display.otherCursor.style.display = \"none\"; }\n  }\n\n  // Highlight selection\n  function updateSelectionRange(cm) {\n    var display = cm.display, doc = cm.view.doc, sel = cm.view.sel;\n    var fragment = document.createDocumentFragment();\n    var clientWidth = display.lineSpace.offsetWidth, pl = paddingLeft(cm.display);\n\n    function add(left, top, width, bottom) {\n      if (top < 0) top = 0;\n      fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n                               \"px; top: \" + top + \"px; width: \" + (width == null ? clientWidth - left : width) +\n                               \"px; height: \" + (bottom - top) + \"px\"));\n    }\n\n    function drawForLine(line, fromArg, toArg, retTop) {\n      var lineObj = getLine(doc, line);\n      var lineLen = lineObj.text.length, rVal = retTop ? Infinity : -Infinity;\n      function coords(ch) {\n        return charCoords(cm, {line: line, ch: ch}, \"div\", lineObj);\n      }\n\n      iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n        var leftPos = coords(dir == \"rtl\" ? to - 1 : from);\n        var rightPos = coords(dir == \"rtl\" ? from : to - 1);\n        var left = leftPos.left, right = rightPos.right;\n        if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n          add(left, leftPos.top, null, leftPos.bottom);\n          left = pl;\n          if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n        }\n        if (toArg == null && to == lineLen) right = clientWidth;\n        if (fromArg == null && from == 0) left = pl;\n        rVal = retTop ? Math.min(rightPos.top, rVal) : Math.max(rightPos.bottom, rVal);\n        if (left < pl + 1) left = pl;\n        add(left, rightPos.top, right - left, rightPos.bottom);\n      });\n      return rVal;\n    }\n\n    if (sel.from.line == sel.to.line) {\n      drawForLine(sel.from.line, sel.from.ch, sel.to.ch);\n    } else {\n      var fromObj = getLine(doc, sel.from.line);\n      var cur = fromObj, merged, path = [sel.from.line, sel.from.ch], singleLine;\n      while (merged = collapsedSpanAtEnd(cur)) {\n        var found = merged.find();\n        path.push(found.from.ch, found.to.line, found.to.ch);\n        if (found.to.line == sel.to.line) {\n          path.push(sel.to.ch);\n          singleLine = true;\n          break;\n        }\n        cur = getLine(doc, found.to.line);\n      }\n\n      // This is a single, merged line\n      if (singleLine) {\n        for (var i = 0; i < path.length; i += 3)\n          drawForLine(path[i], path[i+1], path[i+2]);\n      } else {\n        var middleTop, middleBot, toObj = getLine(doc, sel.to.line);\n        if (sel.from.ch)\n          // Draw the first line of selection.\n          middleTop = drawForLine(sel.from.line, sel.from.ch, null, false);\n        else\n          // Simply include it in the middle block.\n          middleTop = heightAtLine(cm, fromObj) - display.viewOffset;\n\n        if (!sel.to.ch)\n          middleBot = heightAtLine(cm, toObj) - display.viewOffset;\n        else\n          middleBot = drawForLine(sel.to.line, collapsedSpanAtStart(toObj) ? null : 0, sel.to.ch, true);\n\n        if (middleTop < middleBot) add(pl, middleTop, null, middleBot);\n      }\n    }\n\n    removeChildrenAndAdd(display.selectionDiv, fragment);\n    display.selectionDiv.style.display = \"\";\n  }\n\n  // Cursor-blinking\n  function restartBlink(cm) {\n    var display = cm.display;\n    clearInterval(display.blinker);\n    var on = true;\n    display.cursor.style.visibility = display.otherCursor.style.visibility = \"\";\n    display.blinker = setInterval(function() {\n      if (!display.cursor.offsetHeight) return;\n      display.cursor.style.visibility = display.otherCursor.style.visibility = (on = !on) ? \"\" : \"hidden\";\n    }, cm.options.cursorBlinkRate);\n  }\n\n  // HIGHLIGHT WORKER\n\n  function startWorker(cm, time) {\n    if (cm.view.mode.startState && cm.view.frontier < cm.display.showingTo)\n      cm.view.highlight.set(time, bind(highlightWorker, cm));\n  }\n\n  function highlightWorker(cm) {\n    var view = cm.view, doc = view.doc;\n    if (view.frontier >= cm.display.showingTo) return;\n    var end = +new Date + cm.options.workTime;\n    var state = copyState(view.mode, getStateBefore(cm, view.frontier));\n    var changed = [], prevChange;\n    doc.iter(view.frontier, Math.min(doc.size, cm.display.showingTo + 500), function(line) {\n      if (view.frontier >= cm.display.showingFrom) { // Visible\n        var oldStyles = line.styles;\n        line.styles = highlightLine(cm, line, state);\n        var ischange = !oldStyles || oldStyles.length != line.styles.length;\n        for (var i = 0; !ischange && i < oldStyles.length; ++i)\n          ischange = oldStyles[i] != line.styles[i];\n        if (ischange) {\n          if (prevChange && prevChange.end == view.frontier) prevChange.end++;\n          else changed.push(prevChange = {start: view.frontier, end: view.frontier + 1});\n        }\n        line.stateAfter = copyState(view.mode, state);\n      } else {\n        processLine(cm, line, state);\n        line.stateAfter = view.frontier % 5 == 0 ? copyState(view.mode, state) : null;\n      }\n      ++view.frontier;\n      if (+new Date > end) {\n        startWorker(cm, cm.options.workDelay);\n        return true;\n      }\n    });\n    if (changed.length)\n      operation(cm, function() {\n        for (var i = 0; i < changed.length; ++i)\n          regChange(this, changed[i].start, changed[i].end);\n      })();\n  }\n\n  // Finds the line to start with when starting a parse. Tries to\n  // find a line with a stateAfter, so that it can start with a\n  // valid state. If that fails, it returns the line with the\n  // smallest indentation, which tends to need the least context to\n  // parse correctly.\n  function findStartLine(cm, n) {\n    var minindent, minline, doc = cm.view.doc;\n    for (var search = n, lim = n - 100; search > lim; --search) {\n      if (search == 0) return 0;\n      var line = getLine(doc, search-1);\n      if (line.stateAfter) return search;\n      var indented = countColumn(line.text, null, cm.options.tabSize);\n      if (minline == null || minindent > indented) {\n        minline = search - 1;\n        minindent = indented;\n      }\n    }\n    return minline;\n  }\n\n  function getStateBefore(cm, n) {\n    var view = cm.view;\n    if (!view.mode.startState) return true;\n    var pos = findStartLine(cm, n), state = pos && getLine(view.doc, pos-1).stateAfter;\n    if (!state) state = startState(view.mode);\n    else state = copyState(view.mode, state);\n    view.doc.iter(pos, n, function(line) {\n      processLine(cm, line, state);\n      var save = pos == n - 1 || pos % 5 == 0 || pos >= view.showingFrom && pos < view.showingTo;\n      line.stateAfter = save ? copyState(view.mode, state) : null;\n      ++pos;\n    });\n    return state;\n  }\n\n  // POSITION MEASUREMENT\n  \n  function paddingTop(display) {return display.lineSpace.offsetTop;}\n  function paddingLeft(display) {\n    var e = removeChildrenAndAdd(display.measure, elt(\"pre\")).appendChild(elt(\"span\", \"x\"));\n    return e.offsetLeft;\n  }\n\n  function measureChar(cm, line, ch, data) {\n    var dir = -1;\n    data = data || measureLine(cm, line);\n    \n    for (var pos = ch;; pos += dir) {\n      var r = data[pos];\n      if (r) break;\n      if (dir < 0 && pos == 0) dir = 1;\n    }\n    return {left: pos < ch ? r.right : r.left,\n            right: pos > ch ? r.left : r.right,\n            top: r.top, bottom: r.bottom};\n  }\n\n  function measureLine(cm, line) {\n    // First look in the cache\n    var display = cm.display, cache = cm.display.measureLineCache;\n    for (var i = 0; i < cache.length; ++i) {\n      var memo = cache[i];\n      if (memo.text == line.text && memo.markedSpans == line.markedSpans &&\n          display.scroller.clientWidth == memo.width)\n        return memo.measure;\n    }\n    \n    var measure = measureLineInner(cm, line);\n    // Store result in the cache\n    var memo = {text: line.text, width: display.scroller.clientWidth,\n                markedSpans: line.markedSpans, measure: measure};\n    if (cache.length == 16) cache[++display.measureLineCachePos % 16] = memo;\n    else cache.push(memo);\n    return measure;\n  }\n\n  function measureLineInner(cm, line) {\n    var display = cm.display, measure = emptyArray(line.text.length);\n    var pre = lineContent(cm, line, measure);\n\n    // IE does not cache element positions of inline elements between\n    // calls to getBoundingClientRect. This makes the loop below,\n    // which gathers the positions of all the characters on the line,\n    // do an amount of layout work quadratic to the number of\n    // characters. When line wrapping is off, we try to improve things\n    // by first subdividing the line into a bunch of inline blocks, so\n    // that IE can reuse most of the layout information from caches\n    // for those blocks. This does interfere with line wrapping, so it\n    // doesn't work when wrapping is on, but in that case the\n    // situation is slightly better, since IE does cache line-wrapping\n    // information and only recomputes per-line.\n    if (ie && !ie_lt8 && !cm.options.lineWrapping && pre.childNodes.length > 100) {\n      var fragment = document.createDocumentFragment();\n      var chunk = 10, n = pre.childNodes.length;\n      for (var i = 0, chunks = Math.ceil(n / chunk); i < chunks; ++i) {\n        var wrap = elt(\"div\", null, null, \"display: inline-block\");\n        for (var j = 0; j < chunk && n; ++j) {\n          wrap.appendChild(pre.firstChild);\n          --n;\n        }\n        fragment.appendChild(wrap);\n      }\n      pre.appendChild(fragment);\n    }\n\n    removeChildrenAndAdd(display.measure, pre);\n\n    var outer = display.lineDiv.getBoundingClientRect();\n    var vranges = [], data = emptyArray(line.text.length), maxBot = pre.offsetHeight;\n    for (var i = 0, cur; i < measure.length; ++i) if (cur = measure[i]) {\n      var size = cur.getBoundingClientRect();\n      var top = Math.max(0, size.top - outer.top), bot = Math.min(size.bottom - outer.top, maxBot);\n      for (var j = 0; j < vranges.length; j += 2) {\n        var rtop = vranges[j], rbot = vranges[j+1];\n        if (rtop > bot || rbot < top) continue;\n        if (rtop <= top && rbot >= bot ||\n            top <= rtop && bot >= rbot ||\n            Math.min(bot, rbot) - Math.max(top, rtop) >= (bot - top) >> 1) {\n          vranges[j] = Math.min(top, rtop);\n          vranges[j+1] = Math.max(bot, rbot);\n          break;\n        }\n      }\n      if (j == vranges.length) vranges.push(top, bot);\n      data[i] = {left: size.left - outer.left, right: size.right - outer.left, top: j};\n    }\n    for (var i = 0, cur; i < data.length; ++i) if (cur = data[i]) {\n      var vr = cur.top;\n      cur.top = vranges[vr]; cur.bottom = vranges[vr+1];\n    }\n    return data;\n  }\n\n  function clearCaches(cm) {\n    cm.display.measureLineCache.length = cm.display.measureLineCachePos = 0;\n    cm.display.cachedCharWidth = cm.display.cachedTextHeight = null;\n    cm.view.maxLineChanged = true;\n  }\n\n  // Context is one of \"line\", \"div\" (display.lineDiv), \"local\"/null (editor), or \"page\"\n  function intoCoordSystem(cm, lineObj, rect, context) {\n    if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n      var size = widgetHeight(lineObj.widgets[i]);\n      rect.top += size; rect.bottom += size;\n    }\n    if (context == \"line\") return rect;\n    if (!context) context = \"local\";\n    var yOff = heightAtLine(cm, lineObj);\n    if (context != \"local\") yOff -= cm.display.viewOffset;\n    if (context == \"page\") {\n      var lOff = cm.display.lineSpace.getBoundingClientRect();\n      yOff += lOff.top + (window.pageYOffset || (document.documentElement || document.body).scrollTop);\n      var xOff = lOff.left + (window.pageXOffset || (document.documentElement || document.body).scrollLeft);\n      rect.left += xOff; rect.right += xOff;\n    }\n    rect.top += yOff; rect.bottom += yOff;\n    return rect;\n  }\n\n  function charCoords(cm, pos, context, lineObj) {\n    if (!lineObj) lineObj = getLine(cm.view.doc, pos.line);\n    return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch), context);\n  }\n\n  function cursorCoords(cm, pos, context, lineObj, measurement) {\n    lineObj = lineObj || getLine(cm.view.doc, pos.line);\n    if (!measurement) measurement = measureLine(cm, lineObj);\n    function get(ch, right) {\n      var m = measureChar(cm, lineObj, ch, measurement);\n      if (right) m.left = m.right; else m.right = m.left;\n      return intoCoordSystem(cm, lineObj, m, context);\n    }\n    var order = getOrder(lineObj), ch = pos.ch;\n    if (!order) return get(ch);\n    var main, other, linedir = order[0].level;\n    for (var i = 0; i < order.length; ++i) {\n      var part = order[i], rtl = part.level % 2, nb, here;\n      if (part.from < ch && part.to > ch) return get(ch, rtl);\n      var left = rtl ? part.to : part.from, right = rtl ? part.from : part.to;\n      if (left == ch) {\n        // Opera and IE return bogus offsets and widths for edges\n        // where the direction flips, but only for the side with the\n        // lower level. So we try to use the side with the higher\n        // level.\n        if (i && part.level < (nb = order[i-1]).level) here = get(nb.level % 2 ? nb.from : nb.to - 1, true);\n        else here = get(rtl && part.from != part.to ? ch - 1 : ch);\n        if (rtl == linedir) main = here; else other = here;\n      } else if (right == ch) {\n        var nb = i < order.length - 1 && order[i+1];\n        if (!rtl && nb && nb.from == nb.to) continue;\n        if (nb && part.level < nb.level) here = get(nb.level % 2 ? nb.to - 1 : nb.from);\n        else here = get(rtl ? ch : ch - 1, true);\n        if (rtl == linedir) main = here; else other = here;\n      }\n    }\n    if (linedir && !ch) other = get(order[0].to - 1);\n    if (!main) return other;\n    if (other) main.other = other;\n    return main;\n  }\n\n  // Coords must be lineSpace-local\n  function coordsChar(cm, x, y) {\n    var doc = cm.view.doc;\n    y += cm.display.viewOffset;\n    if (y < 0) return {line: 0, ch: 0, outside: true};\n    var lineNo = lineAtHeight(doc, y);\n    if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length};\n    if (x < 0) x = 0;\n\n    for (;;) {\n      var lineObj = getLine(doc, lineNo);\n      var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n      var merged = collapsedSpanAtEnd(lineObj);\n      var mergedPos = merged && merged.find();\n      if (merged && found.ch >= mergedPos.from.ch)\n        lineNo = mergedPos.to.line;\n      else\n        return found;\n    }\n  }\n\n  function coordsCharInner(cm, lineObj, lineNo, x, y) {\n    var innerOff = y - heightAtLine(cm, lineObj);\n    var wrongLine = false, cWidth = cm.display.wrapper.clientWidth;\n    var measurement = measureLine(cm, lineObj);\n\n    function getX(ch) {\n      var sp = cursorCoords(cm, {line: lineNo, ch: ch}, \"line\",\n                            lineObj, measurement);\n      wrongLine = true;\n      if (innerOff > sp.bottom) return Math.max(0, sp.left - cWidth);\n      else if (innerOff < sp.top) return sp.left + cWidth;\n      else wrongLine = false;\n      return sp.left;\n    }\n\n    var bidi = getOrder(lineObj), dist = lineObj.text.length;\n    var from = lineLeft(lineObj), to = lineRight(lineObj);\n    var fromX = paddingLeft(cm.display), toX = getX(to);\n\n    if (x > toX) return {line: lineNo, ch: to, outside: wrongLine};\n    // Do a binary search between these bounds.\n    for (;;) {\n      if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {\n        var after = x - fromX < toX - x, ch = after ? from : to;\n        while (isExtendingChar.test(lineObj.text.charAt(ch))) ++ch;\n        return {line: lineNo, ch: ch, after: after, outside: wrongLine};\n      }\n      var step = Math.ceil(dist / 2), middle = from + step;\n      if (bidi) {\n        middle = from;\n        for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1);\n      }\n      var middleX = getX(middle);\n      if (middleX > x) {to = middle; toX = middleX; if (wrongLine) toX += 1000; dist -= step;}\n      else {from = middle; fromX = middleX; dist = step;}\n    }\n  }\n\n  var measureText;\n  function textHeight(display) {\n    if (display.cachedTextHeight != null) return display.cachedTextHeight;\n    if (measureText == null) {\n      measureText = elt(\"pre\");\n      // Measure a bunch of lines, for browsers that compute\n      // fractional heights.\n      for (var i = 0; i < 49; ++i) {\n        measureText.appendChild(document.createTextNode(\"x\"));\n        measureText.appendChild(elt(\"br\"));\n      }\n      measureText.appendChild(document.createTextNode(\"x\"));\n    }\n    removeChildrenAndAdd(display.measure, measureText);\n    var height = measureText.offsetHeight / 50;\n    if (height > 3) display.cachedTextHeight = height;\n    removeChildren(display.measure);\n    return height || 1;\n  }\n\n  function charWidth(display) {\n    if (display.cachedCharWidth != null) return display.cachedCharWidth;\n    var anchor = elt(\"span\", \"x\");\n    var pre = elt(\"pre\", [anchor]);\n    removeChildrenAndAdd(display.measure, pre);\n    var width = anchor.offsetWidth;\n    if (width > 2) display.cachedCharWidth = width;\n    return width || 10;\n  }\n\n  // OPERATIONS\n\n  // Operations are used to wrap changes in such a way that each\n  // change won't have to update the cursor and display (which would\n  // be awkward, slow, and error-prone), but instead updates are\n  // batched and then all combined and executed at once.\n\n  function startOperation(cm) {\n    if (cm.curOp) ++cm.curOp.depth;\n    else cm.curOp = {\n      // Nested operations delay update until the outermost one\n      // finishes.\n      depth: 1,\n      // An array of ranges of lines that have to be updated. See\n      // updateDisplay.\n      changes: [],\n      delayedCallbacks: [],\n      updateInput: null,\n      userSelChange: null,\n      textChanged: null,\n      selectionChanged: false,\n      updateMaxLine: false,\n      id: ++cm.nextOpId\n    };\n  }\n\n  function endOperation(cm) {\n    var op = cm.curOp;\n    if (--op.depth) return;\n    cm.curOp = null;\n    var view = cm.view, display = cm.display;\n    if (op.updateMaxLine) computeMaxLength(view);\n    if (view.maxLineChanged && !cm.options.lineWrapping) {\n      var width = measureChar(cm, view.maxLine, view.maxLine.text.length).right;\n      display.sizer.style.minWidth = (width + 3 + scrollerCutOff) + \"px\";\n      view.maxLineChanged = false;\n      var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + display.sizer.offsetWidth - display.scroller.clientWidth);\n      if (maxScrollLeft < view.scrollLeft)\n        setScrollLeft(cm, Math.min(display.scroller.scrollLeft, maxScrollLeft), true);\n    }\n    var newScrollPos, updated;\n    if (op.selectionChanged) {\n      var coords = cursorCoords(cm, view.sel.head);\n      newScrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom);\n    }\n    if (op.changes.length || newScrollPos && newScrollPos.scrollTop != null)\n      updated = updateDisplay(cm, op.changes, newScrollPos && newScrollPos.scrollTop);\n    if (!updated && op.selectionChanged) updateSelection(cm);\n    if (newScrollPos) scrollCursorIntoView(cm);\n    if (op.selectionChanged) restartBlink(cm);\n\n    if (view.focused && op.updateInput)\n      resetInput(cm, op.userSelChange);\n\n    if (op.textChanged)\n      signal(cm, \"change\", cm, op.textChanged);\n    if (op.selectionChanged) signal(cm, \"cursorActivity\", cm);\n    for (var i = 0; i < op.delayedCallbacks.length; ++i) op.delayedCallbacks[i](cm);\n  }\n\n  // Wraps a function in an operation. Returns the wrapped function.\n  function operation(cm1, f) {\n    return function() {\n      var cm = cm1 || this;\n      startOperation(cm);\n      try {var result = f.apply(cm, arguments);}\n      finally {endOperation(cm);}\n      return result;\n    };\n  }\n\n  function regChange(cm, from, to, lendiff) {\n    cm.curOp.changes.push({from: from, to: to, diff: lendiff});\n  }\n\n  // INPUT HANDLING\n\n  function slowPoll(cm) {\n    if (cm.view.pollingFast) return;\n    cm.display.poll.set(cm.options.pollInterval, function() {\n      readInput(cm);\n      if (cm.view.focused) slowPoll(cm);\n    });\n  }\n\n  function fastPoll(cm) {\n    var missed = false;\n    cm.display.pollingFast = true;\n    function p() {\n      var changed = readInput(cm);\n      if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n      else {cm.display.pollingFast = false; slowPoll(cm);}\n    }\n    cm.display.poll.set(20, p);\n  }\n\n  // prevInput is a hack to work with IME. If we reset the textarea\n  // on every change, that breaks IME. So we look for changes\n  // compared to the previous content instead. (Modern browsers have\n  // events that indicate IME taking place, but these are not widely\n  // supported or compatible enough yet to rely on.)\n  function readInput(cm) {\n    var input = cm.display.input, prevInput = cm.display.prevInput, view = cm.view, sel = view.sel;\n    if (!view.focused || hasSelection(input) || isReadOnly(cm)) return false;\n    var text = input.value;\n    if (text == prevInput && posEq(sel.from, sel.to)) return false;\n    startOperation(cm);\n    view.sel.shift = false;\n    var same = 0, l = Math.min(prevInput.length, text.length);\n    while (same < l && prevInput[same] == text[same]) ++same;\n    var from = sel.from, to = sel.to;\n    if (same < prevInput.length)\n      from = {line: from.line, ch: from.ch - (prevInput.length - same)};\n    else if (view.overwrite && posEq(from, to) && !cm.display.pasteIncoming)\n      to = {line: to.line, ch: Math.min(getLine(cm.view.doc, to.line).text.length, to.ch + (text.length - same))};\n    var updateInput = cm.curOp.updateInput;\n    updateDoc(cm, from, to, splitLines(text.slice(same)), \"end\",\n              cm.display.pasteIncoming ? \"paste\" : \"input\", {from: from, to: to});\n    cm.curOp.updateInput = updateInput;\n    if (text.length > 1000) input.value = cm.display.prevInput = \"\";\n    else cm.display.prevInput = text;\n    endOperation(cm);\n    cm.display.pasteIncoming = false;\n    return true;\n  }\n\n  function resetInput(cm, user) {\n    var view = cm.view, minimal, selected;\n    if (!posEq(view.sel.from, view.sel.to)) {\n      cm.display.prevInput = \"\";\n      minimal = hasCopyEvent &&\n        (view.sel.to.line - view.sel.from.line > 100 || (selected = cm.getSelection()).length > 1000);\n      if (minimal) cm.display.input.value = \"-\";\n      else cm.display.input.value = selected || cm.getSelection();\n      if (view.focused) selectInput(cm.display.input);\n    } else if (user) cm.display.prevInput = cm.display.input.value = \"\";\n    cm.display.inaccurateSelection = minimal;\n  }\n\n  function focusInput(cm) {\n    if (cm.options.readOnly != \"nocursor\" && (ie || document.activeElement != cm.display.input))\n      cm.display.input.focus();\n  }\n\n  function isReadOnly(cm) {\n    return cm.options.readOnly || cm.view.cantEdit;\n  }\n\n  // EVENT HANDLERS\n\n  function registerEventHandlers(cm) {\n    var d = cm.display;\n    on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n    on(d.scroller, \"dblclick\", operation(cm, e_preventDefault));\n    on(d.lineSpace, \"selectstart\", function(e) {\n      if (!eventInWidget(d, e)) e_preventDefault(e);\n    });\n    // Gecko browsers fire contextmenu *after* opening the menu, at\n    // which point we can't mess with it anymore. Context menu is\n    // handled in onMouseDown for Gecko.\n    if (!gecko) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n    on(d.scroller, \"scroll\", function() {\n      setScrollTop(cm, d.scroller.scrollTop);\n      setScrollLeft(cm, d.scroller.scrollLeft, true);\n      signal(cm, \"scroll\", cm);\n    });\n    on(d.scrollbarV, \"scroll\", function() {\n      setScrollTop(cm, d.scrollbarV.scrollTop);\n    });\n    on(d.scrollbarH, \"scroll\", function() {\n      setScrollLeft(cm, d.scrollbarH.scrollLeft);\n    });\n\n    on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n    on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n    function reFocus() { if (cm.view.focused) setTimeout(bind(focusInput, cm), 0); }\n    on(d.scrollbarH, \"mousedown\", reFocus);\n    on(d.scrollbarV, \"mousedown\", reFocus);\n    // Prevent wrapper from ever scrolling\n    on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n    if (!window.registered) window.registered = 0;\n    ++window.registered;\n    function onResize() {\n      // Might be a text scaling operation, clear size caches.\n      d.cachedCharWidth = d.cachedTextHeight = null;\n      clearCaches(cm);\n      updateDisplay(cm, true);\n    }\n    on(window, \"resize\", onResize);\n    // Above handler holds on to the editor and its data structures.\n    // Here we poll to unregister it when the editor is no longer in\n    // the document, so that it can be garbage-collected.\n    setTimeout(function unregister() {\n      for (var p = d.wrapper.parentNode; p && p != document.body; p = p.parentNode) {}\n      if (p) setTimeout(unregister, 5000);\n      else {--window.registered; off(window, \"resize\", onResize);}\n    }, 5000);\n\n    on(d.input, \"keyup\", operation(cm, function(e) {\n      if (cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;\n      if (e_prop(e, \"keyCode\") == 16) cm.view.sel.shift = false;\n    }));\n    on(d.input, \"input\", bind(fastPoll, cm));\n    on(d.input, \"keydown\", operation(cm, onKeyDown));\n    on(d.input, \"keypress\", operation(cm, onKeyPress));\n    on(d.input, \"focus\", bind(onFocus, cm));\n    on(d.input, \"blur\", bind(onBlur, cm));\n\n    function drag_(e) {\n      if (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))) return;\n      e_stop(e);\n    }\n    if (cm.options.dragDrop) {\n      on(d.scroller, \"dragstart\", function(e){onDragStart(cm, e);});\n      on(d.scroller, \"dragenter\", drag_);\n      on(d.scroller, \"dragover\", drag_);\n      on(d.scroller, \"drop\", operation(cm, onDrop));\n    }\n    on(d.scroller, \"paste\", function(e){\n      if (eventInWidget(d, e)) return;\n      focusInput(cm); \n      fastPoll(cm);\n    });\n    on(d.input, \"paste\", function() {\n      d.pasteIncoming = true;\n      fastPoll(cm);\n    });\n\n    function prepareCopy() {\n      if (d.inaccurateSelection) {\n        d.prevInput = \"\";\n        d.inaccurateSelection = false;\n        d.input.value = cm.getSelection();\n        selectInput(d.input);\n      }\n    }\n    on(d.input, \"cut\", prepareCopy);\n    on(d.input, \"copy\", prepareCopy);\n\n    // Needed to handle Tab key in KHTML\n    if (khtml) on(d.sizer, \"mouseup\", function() {\n        if (document.activeElement == d.input) d.input.blur();\n        focusInput(cm);\n    });\n  }\n\n  function eventInWidget(display, e) {\n    for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n      if (!n) return true;\n      if (/\\bCodeMirror-(?:line)?widget\\b/.test(n.className) ||\n          n.parentNode == display.sizer && n != display.mover) return true;\n    }\n  }\n\n  function posFromMouse(cm, e, liberal) {\n    var display = cm.display;\n    if (!liberal) {\n      var target = e_target(e);\n      if (target == display.scrollbarH || target == display.scrollbarH.firstChild ||\n          target == display.scrollbarV || target == display.scrollbarV.firstChild ||\n          target == display.scrollbarFiller) return null;\n    }\n    var x, y, space = display.lineSpace.getBoundingClientRect();\n    // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n    try { x = e.clientX; y = e.clientY; } catch (e) { return null; }\n    return coordsChar(cm, x - space.left, y - space.top);\n  }\n\n  var lastClick, lastDoubleClick;\n  function onMouseDown(e) {\n    var cm = this, display = cm.display, view = cm.view, sel = view.sel, doc = view.doc;\n    sel.shift = e_prop(e, \"shiftKey\");\n\n    if (eventInWidget(display, e)) {\n      if (!webkit) {\n        display.scroller.draggable = false;\n        setTimeout(function(){display.scroller.draggable = true;}, 100);\n      }\n      return;\n    }\n    if (clickInGutter(cm, e)) return;\n    var start = posFromMouse(cm, e);\n\n    switch (e_button(e)) {\n    case 3:\n      if (gecko) onContextMenu.call(cm, cm, e);\n      return;\n    case 2:\n      if (start) extendSelection(cm, start);\n      setTimeout(bind(focusInput, cm), 20);\n      e_preventDefault(e);\n      return;\n    }\n    // For button 1, if it was clicked inside the editor\n    // (posFromMouse returning non-null), we have to adjust the\n    // selection.\n    if (!start) {if (e_target(e) == display.scroller) e_preventDefault(e); return;}\n\n    if (!view.focused) onFocus(cm);\n\n    var now = +new Date, type = \"single\";\n    if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) {\n      type = \"triple\";\n      e_preventDefault(e);\n      setTimeout(bind(focusInput, cm), 20);\n      selectLine(cm, start.line);\n    } else if (lastClick && lastClick.time > now - 400 && posEq(lastClick.pos, start)) {\n      type = \"double\";\n      lastDoubleClick = {time: now, pos: start};\n      e_preventDefault(e);\n      var word = findWordAt(getLine(doc, start.line).text, start);\n      extendSelection(cm, word.from, word.to);\n    } else { lastClick = {time: now, pos: start}; }\n\n    var last = start;\n    if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && !posEq(sel.from, sel.to) &&\n        !posLess(start, sel.from) && !posLess(sel.to, start) && type == \"single\") {\n      var dragEnd = operation(cm, function(e2) {\n        if (webkit) display.scroller.draggable = false;\n        view.draggingText = false;\n        off(document, \"mouseup\", dragEnd);\n        off(display.scroller, \"drop\", dragEnd);\n        if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {\n          e_preventDefault(e2);\n          extendSelection(cm, start);\n          focusInput(cm);\n        }\n      });\n      // Let the drag handler handle this.\n      if (webkit) display.scroller.draggable = true;\n      view.draggingText = dragEnd;\n      // IE's approach to draggable\n      if (display.scroller.dragDrop) display.scroller.dragDrop();\n      on(document, \"mouseup\", dragEnd);\n      on(display.scroller, \"drop\", dragEnd);\n      return;\n    }\n    e_preventDefault(e);\n    if (type == \"single\") extendSelection(cm, clipPos(doc, start));\n\n    var startstart = sel.from, startend = sel.to;\n\n    function doSelect(cur) {\n      if (type == \"single\") {\n        extendSelection(cm, clipPos(doc, start), cur);\n        return;\n      }\n\n      startstart = clipPos(doc, startstart);\n      startend = clipPos(doc, startend);\n      if (type == \"double\") {\n        var word = findWordAt(getLine(doc, cur.line).text, cur);\n        if (posLess(cur, startstart)) extendSelection(cm, word.from, startend);\n        else extendSelection(cm, startstart, word.to);\n      } else if (type == \"triple\") {\n        if (posLess(cur, startstart)) extendSelection(cm, startend, clipPos(doc, {line: cur.line, ch: 0}));\n        else extendSelection(cm, startstart, clipPos(doc, {line: cur.line + 1, ch: 0}));\n      }\n    }\n\n    var editorSize = display.wrapper.getBoundingClientRect();\n    // Used to ensure timeout re-tries don't fire when another extend\n    // happened in the meantime (clearTimeout isn't reliable -- at\n    // least on Chrome, the timeouts still happen even when cleared,\n    // if the clear happens after their scheduled firing time).\n    var counter = 0;\n\n    function extend(e) {\n      var curCount = ++counter;\n      var cur = posFromMouse(cm, e, true);\n      if (!cur) return;\n      if (!posEq(cur, last)) {\n        if (!view.focused) onFocus(cm);\n        last = cur;\n        doSelect(cur);\n        var visible = visibleLines(display, doc);\n        if (cur.line >= visible.to || cur.line < visible.from)\n          setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n      } else {\n        var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n        if (outside) setTimeout(operation(cm, function() {\n          if (counter != curCount) return;\n          display.scroller.scrollTop += outside;\n          extend(e);\n        }), 50);\n      }\n    }\n\n    function done(e) {\n      counter = Infinity;\n      var cur = posFromMouse(cm, e);\n      if (cur) doSelect(cur);\n      e_preventDefault(e);\n      focusInput(cm);\n      off(document, \"mousemove\", move);\n      off(document, \"mouseup\", up);\n    }\n\n    var move = operation(cm, function(e) {\n      if (!ie && !e_button(e)) done(e);\n      else extend(e);\n    });\n    var up = operation(cm, done);\n    on(document, \"mousemove\", move);\n    on(document, \"mouseup\", up);\n  }\n\n  function onDrop(e) {\n    var cm = this;\n    if (eventInWidget(cm.display, e) || (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))))\n      return;\n    e_preventDefault(e);\n    var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n    if (!pos || isReadOnly(cm)) return;\n    if (files && files.length && window.FileReader && window.File) {\n      var n = files.length, text = Array(n), read = 0;\n      var loadFile = function(file, i) {\n        var reader = new FileReader;\n        reader.onload = function() {\n          text[i] = reader.result;\n          if (++read == n) {\n            pos = clipPos(cm.view.doc, pos);\n            operation(cm, function() {\n              var end = replaceRange(cm, text.join(\"\"), pos, pos, \"paste\");\n              setSelection(cm, pos, end);\n            })();\n          }\n        };\n        reader.readAsText(file);\n      };\n      for (var i = 0; i < n; ++i) loadFile(files[i], i);\n    } else {\n      // Don't do a replace if the drop happened inside of the selected text.\n      if (cm.view.draggingText && !(posLess(pos, cm.view.sel.from) || posLess(cm.view.sel.to, pos))) {\n        cm.view.draggingText(e);\n        // Ensure the editor is re-focused\n        setTimeout(bind(focusInput, cm), 20);\n        return;\n      }\n      try {\n        var text = e.dataTransfer.getData(\"Text\");\n        if (text) {\n          var curFrom = cm.view.sel.from, curTo = cm.view.sel.to;\n          setSelection(cm, pos, pos);\n          if (cm.view.draggingText) replaceRange(cm, \"\", curFrom, curTo, \"paste\");\n          cm.replaceSelection(text, null, \"paste\");\n          focusInput(cm);\n          onFocus(cm);\n        }\n      }\n      catch(e){}\n    }\n  }\n\n  function clickInGutter(cm, e) {\n    var display = cm.display;\n    try { var mX = e.clientX, mY = e.clientY; }\n    catch(e) { return false; }\n\n    if (mX >= Math.floor(display.gutters.getBoundingClientRect().right)) return false;\n    e_preventDefault(e);\n    if (!hasHandler(cm, \"gutterClick\")) return true;\n\n    var lineBox = display.lineDiv.getBoundingClientRect();\n    if (mY > lineBox.bottom) return true;\n    mY -= lineBox.top - display.viewOffset;\n\n    for (var i = 0; i < cm.options.gutters.length; ++i) {\n      var g = display.gutters.childNodes[i];\n      if (g && g.getBoundingClientRect().right >= mX) {\n        var line = lineAtHeight(cm.view.doc, mY);\n        var gutter = cm.options.gutters[i];\n        signalLater(cm, cm, \"gutterClick\", cm, line, gutter, e);\n        break;\n      }\n    }\n    return true;\n  }\n\n  function onDragStart(cm, e) {\n    if (eventInWidget(cm.display, e)) return;\n    \n    var txt = cm.getSelection();\n    e.dataTransfer.setData(\"Text\", txt);\n\n    // Use dummy image instead of default browsers image.\n    // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n    if (e.dataTransfer.setDragImage && !safari) {\n      var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n      if (opera) {\n        img.width = img.height = 1;\n        cm.display.wrapper.appendChild(img);\n        // Force a relayout, or Opera won't use our image for some obscure reason\n        img._top = img.offsetTop;\n      }\n      e.dataTransfer.setDragImage(img, 0, 0);\n      if (opera) img.parentNode.removeChild(img);\n    }\n  }\n\n  function setScrollTop(cm, val) {\n    if (Math.abs(cm.view.scrollTop - val) < 2) return;\n    cm.view.scrollTop = val;\n    if (!gecko) updateDisplay(cm, [], val);\n    if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val;\n    if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val;\n    if (gecko) updateDisplay(cm, []);\n  }\n  function setScrollLeft(cm, val, isScroller) {\n    if (isScroller ? val == cm.view.scrollLeft : Math.abs(cm.view.scrollLeft - val) < 2) return;\n    val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n    cm.view.scrollLeft = val;\n    alignHorizontally(cm);\n    if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val;\n    if (cm.display.scrollbarH.scrollLeft != val) cm.display.scrollbarH.scrollLeft = val;\n  }\n\n  // Since the delta values reported on mouse wheel events are\n  // unstandardized between browsers and even browser versions, and\n  // generally horribly unpredictable, this code starts by measuring\n  // the scroll effect that the first few mouse wheel events have,\n  // and, from that, detects the way it can convert deltas to pixel\n  // offsets afterwards.\n  //\n  // The reason we want to know the amount a wheel event will scroll\n  // is that it gives us a chance to update the display before the\n  // actual scrolling happens, reducing flickering.\n\n  var wheelSamples = 0, wheelPixelsPerUnit = null;\n  // Fill in a browser-detected starting value on browsers where we\n  // know one. These don't have to be accurate -- the result of them\n  // being wrong would just be a slight flicker on the first wheel\n  // scroll (if it is large enough).\n  if (ie) wheelPixelsPerUnit = -.53;\n  else if (gecko) wheelPixelsPerUnit = 15;\n  else if (chrome) wheelPixelsPerUnit = -.7;\n  else if (safari) wheelPixelsPerUnit = -1/3;\n\n  function onScrollWheel(cm, e) {\n    var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n    if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail;\n    if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail;\n    else if (dy == null) dy = e.wheelDelta;\n\n    // Webkit browsers on OS X abort momentum scrolls when the target\n    // of the scroll event is removed from the scrollable element.\n    // This hack (see related code in patchDisplay) makes sure the\n    // element is kept around.\n    if (dy && mac && webkit) {\n      for (var cur = e.target; cur != scroll; cur = cur.parentNode) {\n        if (cur.lineObj) {\n          cm.display.currentWheelTarget = cur;\n          break;\n        }\n      }\n    }\n\n    var display = cm.display, scroll = display.scroller;\n    // On some browsers, horizontal scrolling will cause redraws to\n    // happen before the gutter has been realigned, causing it to\n    // wriggle around in a most unseemly way. When we have an\n    // estimated pixels/delta value, we just handle horizontal\n    // scrolling entirely here. It'll be slightly off from native, but\n    // better than glitching out.\n    if (dx && !gecko && !opera && wheelPixelsPerUnit != null) {\n      if (dy)\n        setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight)));\n      setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)));\n      e_preventDefault(e);\n      display.wheelStartX = null; // Abort measurement, if in progress\n      return;\n    }\n\n    if (dy && wheelPixelsPerUnit != null) {\n      var pixels = dy * wheelPixelsPerUnit;\n      var top = cm.view.scrollTop, bot = top + display.wrapper.clientHeight;\n      if (pixels < 0) top = Math.max(0, top + pixels - 50);\n      else bot = Math.min(cm.view.doc.height, bot + pixels + 50);\n      updateDisplay(cm, [], {top: top, bottom: bot});\n    }\n\n    if (wheelSamples < 20) {\n      if (display.wheelStartX == null) {\n        display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n        display.wheelDX = dx; display.wheelDY = dy;\n        setTimeout(function() {\n          if (display.wheelStartX == null) return;\n          var movedX = scroll.scrollLeft - display.wheelStartX;\n          var movedY = scroll.scrollTop - display.wheelStartY;\n          var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n            (movedX && display.wheelDX && movedX / display.wheelDX);\n          display.wheelStartX = display.wheelStartY = null;\n          if (!sample) return;\n          wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n          ++wheelSamples;\n        }, 200);\n      } else {\n        display.wheelDX += dx; display.wheelDY += dy;\n      }\n    }\n  }\n\n  function doHandleBinding(cm, bound, dropShift) {\n    if (typeof bound == \"string\") {\n      bound = commands[bound];\n      if (!bound) return false;\n    }\n    // Ensure previous input has been read, so that the handler sees a\n    // consistent view of the document\n    if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false;\n    var view = cm.view, prevShift = view.sel.shift;\n    try {\n      if (isReadOnly(cm)) view.suppressEdits = true;\n      if (dropShift) view.sel.shift = false;\n      bound(cm);\n    } catch(e) {\n      if (e != Pass) throw e;\n      return false;\n    } finally {\n      view.sel.shift = prevShift;\n      view.suppressEdits = false;\n    }\n    return true;\n  }\n\n  function allKeyMaps(cm) {\n    var maps = cm.view.keyMaps.slice(0);\n    maps.push(cm.options.keyMap);\n    if (cm.options.extraKeys) maps.unshift(cm.options.extraKeys);\n    return maps;\n  }\n\n  var maybeTransition;\n  function handleKeyBinding(cm, e) {\n    // Handle auto keymap transitions\n    var startMap = getKeyMap(cm.options.keyMap), next = startMap.auto;\n    clearTimeout(maybeTransition);\n    if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() {\n      if (getKeyMap(cm.options.keyMap) == startMap)\n        cm.options.keyMap = (next.call ? next.call(null, cm) : next);\n    }, 50);\n\n    var name = keyNames[e_prop(e, \"keyCode\")], handled = false;\n    if (name == null || e.altGraphKey) return false;\n    if (e_prop(e, \"altKey\")) name = \"Alt-\" + name;\n    if (e_prop(e, flipCtrlCmd ? \"metaKey\" : \"ctrlKey\")) name = \"Ctrl-\" + name;\n    if (e_prop(e, flipCtrlCmd ? \"ctrlKey\" : \"metaKey\")) name = \"Cmd-\" + name;\n\n    var stopped = false;\n    function stop() { stopped = true; }\n    var keymaps = allKeyMaps(cm);\n\n    if (e_prop(e, \"shiftKey\")) {\n      handled = lookupKey(\"Shift-\" + name, keymaps,\n                          function(b) {return doHandleBinding(cm, b, true);}, stop)\n        || lookupKey(name, keymaps, function(b) {\n          if (typeof b == \"string\" && /^go[A-Z]/.test(b)) return doHandleBinding(cm, b);\n        }, stop);\n    } else {\n      handled = lookupKey(name, keymaps,\n                          function(b) { return doHandleBinding(cm, b); }, stop);\n    }\n    if (stopped) handled = false;\n    if (handled) {\n      e_preventDefault(e);\n      restartBlink(cm);\n      if (ie_lt9) { e.oldKeyCode = e.keyCode; e.keyCode = 0; }\n    }\n    return handled;\n  }\n\n  function handleCharBinding(cm, e, ch) {\n    var handled = lookupKey(\"'\" + ch + \"'\", allKeyMaps(cm),\n                            function(b) { return doHandleBinding(cm, b, true); });\n    if (handled) {\n      e_preventDefault(e);\n      restartBlink(cm);\n    }\n    return handled;\n  }\n\n  var lastStoppedKey = null;\n  function onKeyDown(e) {\n    var cm = this;\n    if (!cm.view.focused) onFocus(cm);\n    if (ie && e.keyCode == 27) { e.returnValue = false; }\n    if (cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;\n    var code = e_prop(e, \"keyCode\");\n    // IE does strange things with escape.\n    cm.view.sel.shift = code == 16 || e_prop(e, \"shiftKey\");\n    // First give onKeyEvent option a chance to handle this.\n    var handled = handleKeyBinding(cm, e);\n    if (opera) {\n      lastStoppedKey = handled ? code : null;\n      // Opera has no cut event... we try to at least catch the key combo\n      if (!handled && code == 88 && !hasCopyEvent && e_prop(e, mac ? \"metaKey\" : \"ctrlKey\"))\n        cm.replaceSelection(\"\");\n    }\n  }\n\n  function onKeyPress(e) {\n    var cm = this;\n    if (cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;\n    var keyCode = e_prop(e, \"keyCode\"), charCode = e_prop(e, \"charCode\");\n    if (opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;}\n    if (((opera && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return;\n    var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n    if (this.options.electricChars && this.view.mode.electricChars &&\n        this.options.smartIndent && !isReadOnly(this) &&\n        this.view.mode.electricChars.indexOf(ch) > -1)\n      setTimeout(operation(cm, function() {indentLine(cm, cm.view.sel.to.line, \"smart\");}), 75);\n    if (handleCharBinding(cm, e, ch)) return;\n    fastPoll(cm);\n  }\n\n  function onFocus(cm) {\n    if (cm.options.readOnly == \"nocursor\") return;\n    if (!cm.view.focused) {\n      signal(cm, \"focus\", cm);\n      cm.view.focused = true;\n      if (cm.display.scroller.className.search(/\\bCodeMirror-focused\\b/) == -1)\n        cm.display.scroller.className += \" CodeMirror-focused\";\n      resetInput(cm, true);\n    }\n    slowPoll(cm);\n    restartBlink(cm);\n  }\n  function onBlur(cm) {\n    if (cm.view.focused) {\n      signal(cm, \"blur\", cm);\n      cm.view.focused = false;\n      cm.display.scroller.className = cm.display.scroller.className.replace(\" CodeMirror-focused\", \"\");\n    }\n    clearInterval(cm.display.blinker);\n    setTimeout(function() {if (!cm.view.focused) cm.view.sel.shift = false;}, 150);\n  }\n\n  var detectingSelectAll;\n  function onContextMenu(cm, e) {\n    var display = cm.display;\n    if (eventInWidget(display, e)) return;\n    \n    var sel = cm.view.sel;\n    var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n    if (!pos || opera) return; // Opera is difficult.\n    if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to))\n      operation(cm, setSelection)(cm, pos, pos);\n\n    var oldCSS = display.input.style.cssText;\n    display.inputDiv.style.position = \"absolute\";\n    display.input.style.cssText = \"position: fixed; width: 30px; height: 30px; top: \" + (e.clientY - 5) +\n      \"px; left: \" + (e.clientX - 5) + \"px; z-index: 1000; background: white; outline: none;\" +\n      \"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n    focusInput(cm);\n    resetInput(cm, true);\n    // Adds \"Select all\" to context menu in FF\n    if (posEq(sel.from, sel.to)) display.input.value = display.prevInput = \" \";\n\n    function rehide() {\n      display.inputDiv.style.position = \"relative\";\n      display.input.style.cssText = oldCSS;\n      if (ie_lt9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos;\n      slowPoll(cm);\n\n      // Try to detect the user choosing select-all \n      if (display.input.selectionStart != null) {\n        clearTimeout(detectingSelectAll);\n        var extval = display.input.value = \" \" + (posEq(sel.from, sel.to) ? \"\" : display.input.value), i = 0;\n        display.prevInput = \" \";\n        display.input.selectionStart = 1; display.input.selectionEnd = extval.length;\n        detectingSelectAll = setTimeout(function poll(){\n          if (display.prevInput == \" \" && display.input.selectionStart == 0)\n            operation(cm, commands.selectAll)(cm);\n          else if (i++ < 10) detectingSelectAll = setTimeout(poll, 500);\n          else resetInput(cm);\n        }, 200);\n      }\n    }\n\n    if (gecko) {\n      e_stop(e);\n      on(window, \"mouseup\", function mouseup() {\n        off(window, \"mouseup\", mouseup);\n        setTimeout(rehide, 20);\n      });\n    } else {\n      setTimeout(rehide, 50);\n    }\n  }\n\n  // UPDATING\n\n  // Replace the range from from to to by the strings in newText.\n  // Afterwards, set the selection to selFrom, selTo.\n  function updateDoc(cm, from, to, newText, selUpdate, origin) {\n    // Possibly split or suppress the update based on the presence\n    // of read-only spans in its range.\n    var split = sawReadOnlySpans &&\n      removeReadOnlyRanges(cm.view.doc, from, to);\n    if (split) {\n      for (var i = split.length - 1; i >= 1; --i)\n        updateDocInner(cm, split[i].from, split[i].to, [\"\"], origin);\n      if (split.length)\n        return updateDocInner(cm, split[0].from, split[0].to, newText, selUpdate, origin);\n    } else {\n      return updateDocInner(cm, from, to, newText, selUpdate, origin);\n    }\n  }\n\n  function updateDocInner(cm, from, to, newText, selUpdate, origin) {\n    if (cm.view.suppressEdits) return;\n\n    var view = cm.view, doc = view.doc, old = [];\n    doc.iter(from.line, to.line + 1, function(line) {\n      old.push(newHL(line.text, line.markedSpans));\n    });\n    var startSelFrom = view.sel.from, startSelTo = view.sel.to;\n    var lines = updateMarkedSpans(hlSpans(old[0]), hlSpans(lst(old)), from.ch, to.ch, newText);\n    var retval = updateDocNoUndo(cm, from, to, lines, selUpdate, origin);\n    if (view.history) addChange(cm, from.line, newText.length, old, origin,\n                                startSelFrom, startSelTo, view.sel.from, view.sel.to);\n    return retval;\n  }\n\n  function unredoHelper(cm, type) {\n    var doc = cm.view.doc, hist = cm.view.history;\n    var set = (type == \"undo\" ? hist.done : hist.undone).pop();\n    if (!set) return;\n    var anti = {events: [], fromBefore: set.fromAfter, toBefore: set.toAfter,\n                fromAfter: set.fromBefore, toAfter: set.toBefore};\n    for (var i = set.events.length - 1; i >= 0; i -= 1) {\n      hist.dirtyCounter += type == \"undo\" ? -1 : 1;\n      var change = set.events[i];\n      var replaced = [], end = change.start + change.added;\n      doc.iter(change.start, end, function(line) { replaced.push(newHL(line.text, line.markedSpans)); });\n      anti.events.push({start: change.start, added: change.old.length, old: replaced});\n      var selPos = i ? null : {from: set.fromBefore, to: set.toBefore};\n      updateDocNoUndo(cm, {line: change.start, ch: 0}, {line: end - 1, ch: getLine(doc, end-1).text.length},\n                      change.old, selPos, type);\n    }\n    (type == \"undo\" ? hist.undone : hist.done).push(anti);\n  }\n\n  function updateDocNoUndo(cm, from, to, lines, selUpdate, origin) {\n    var view = cm.view, doc = view.doc, display = cm.display;\n    if (view.suppressEdits) return;\n\n    var nlines = to.line - from.line, firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n    var recomputeMaxLength = false, checkWidthStart = from.line;\n    if (!cm.options.lineWrapping) {\n      checkWidthStart = lineNo(visualLine(doc, firstLine));\n      doc.iter(checkWidthStart, to.line + 1, function(line) {\n        if (line == view.maxLine) {\n          recomputeMaxLength = true;\n          return true;\n        }\n      });\n    }\n\n    var lastHL = lst(lines), th = textHeight(display);\n\n    // First adjust the line structure\n    if (from.ch == 0 && to.ch == 0 && hlText(lastHL) == \"\") {\n      // This is a whole-line replace. Treated specially to make\n      // sure line objects move the way they are supposed to.\n      var added = [];\n      for (var i = 0, e = lines.length - 1; i < e; ++i)\n        added.push(makeLine(hlText(lines[i]), hlSpans(lines[i]), th));\n      updateLine(cm, lastLine, lastLine.text, hlSpans(lastHL));\n      if (nlines) doc.remove(from.line, nlines, cm);\n      if (added.length) doc.insert(from.line, added);\n    } else if (firstLine == lastLine) {\n      if (lines.length == 1) {\n        updateLine(cm, firstLine, firstLine.text.slice(0, from.ch) + hlText(lines[0]) +\n                   firstLine.text.slice(to.ch), hlSpans(lines[0]));\n      } else {\n        for (var added = [], i = 1, e = lines.length - 1; i < e; ++i)\n          added.push(makeLine(hlText(lines[i]), hlSpans(lines[i]), th));\n        added.push(makeLine(hlText(lastHL) + firstLine.text.slice(to.ch), hlSpans(lastHL), th));\n        updateLine(cm, firstLine, firstLine.text.slice(0, from.ch) + hlText(lines[0]), hlSpans(lines[0]));\n        doc.insert(from.line + 1, added);\n      }\n    } else if (lines.length == 1) {\n      updateLine(cm, firstLine, firstLine.text.slice(0, from.ch) + hlText(lines[0]) +\n                 lastLine.text.slice(to.ch), hlSpans(lines[0]));\n      doc.remove(from.line + 1, nlines, cm);\n    } else {\n      var added = [];\n      updateLine(cm, firstLine, firstLine.text.slice(0, from.ch) + hlText(lines[0]), hlSpans(lines[0]));\n      updateLine(cm, lastLine, hlText(lastHL) + lastLine.text.slice(to.ch), hlSpans(lastHL));\n      for (var i = 1, e = lines.length - 1; i < e; ++i)\n        added.push(makeLine(hlText(lines[i]), hlSpans(lines[i]), th));\n      if (nlines > 1) doc.remove(from.line + 1, nlines - 1, cm);\n      doc.insert(from.line + 1, added);\n    }\n\n    if (cm.options.lineWrapping) {\n      var perLine = Math.max(5, display.scroller.clientWidth / charWidth(display) - 3);\n      doc.iter(from.line, from.line + lines.length, function(line) {\n        if (line.height == 0) return;\n        var guess = (Math.ceil(line.text.length / perLine) || 1) * th;\n        if (guess != line.height) updateLineHeight(line, guess);\n      });\n    } else {\n      doc.iter(checkWidthStart, from.line + lines.length, function(line) {\n        var len = lineLength(doc, line);\n        if (len > view.maxLineLength) {\n          view.maxLine = line;\n          view.maxLineLength = len;\n          view.maxLineChanged = true;\n          recomputeMaxLength = false;\n        }\n      });\n      if (recomputeMaxLength) cm.curOp.updateMaxLine = true;\n    }\n\n    // Adjust frontier, schedule worker\n    view.frontier = Math.min(view.frontier, from.line);\n    startWorker(cm, 400);\n\n    var lendiff = lines.length - nlines - 1;\n    // Remember that these lines changed, for updating the display\n    regChange(cm, from.line, to.line + 1, lendiff);\n    if (hasHandler(cm, \"change\")) {\n      // Normalize lines to contain only strings, since that's what\n      // the change event handler expects\n      for (var i = 0; i < lines.length; ++i)\n        if (typeof lines[i] != \"string\") lines[i] = lines[i].text;\n      var changeObj = {from: from, to: to, text: lines, origin: origin};\n      if (cm.curOp.textChanged) {\n        for (var cur = cm.curOp.textChanged; cur.next; cur = cur.next) {}\n        cur.next = changeObj;\n      } else cm.curOp.textChanged = changeObj;\n    }\n\n    // Update the selection\n    var newSelFrom, newSelTo, end = {line: from.line + lines.length - 1,\n                                     ch: hlText(lastHL).length  + (lines.length == 1 ? from.ch : 0)};\n    if (selUpdate && typeof selUpdate != \"string\") {\n      if (selUpdate.from) { newSelFrom = selUpdate.from; newSelTo = selUpdate.to; }\n      else newSelFrom = newSelTo = selUpdate;\n    } else if (selUpdate == \"end\") {\n      newSelFrom = newSelTo = end;\n    } else if (selUpdate == \"start\") {\n      newSelFrom = newSelTo = from;\n    } else if (selUpdate == \"around\") {\n      newSelFrom = from; newSelTo = end;\n    } else {\n      var adjustPos = function(pos) {\n        if (posLess(pos, from)) return pos;\n        if (!posLess(to, pos)) return end;\n        var line = pos.line + lendiff;\n        var ch = pos.ch;\n        if (pos.line == to.line)\n          ch += hlText(lastHL).length - (to.ch - (to.line == from.line ? from.ch : 0));\n        return {line: line, ch: ch};\n      };\n      newSelFrom = adjustPos(view.sel.from);\n      newSelTo = adjustPos(view.sel.to);\n    }\n    setSelection(cm, newSelFrom, newSelTo, null, true);\n    return end;\n  }\n\n  function replaceRange(cm, code, from, to, origin) {\n    if (!to) to = from;\n    if (posLess(to, from)) { var tmp = to; to = from; from = tmp; }\n    return updateDoc(cm, from, to, splitLines(code), null, origin);\n  }\n\n  // SELECTION\n\n  function posEq(a, b) {return a.line == b.line && a.ch == b.ch;}\n  function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);}\n  function copyPos(x) {return {line: x.line, ch: x.ch};}\n\n  function clipLine(doc, n) {return Math.max(0, Math.min(n, doc.size-1));}\n  function clipPos(doc, pos) {\n    if (pos.line < 0) return {line: 0, ch: 0};\n    if (pos.line >= doc.size) return {line: doc.size-1, ch: getLine(doc, doc.size-1).text.length};\n    var ch = pos.ch, linelen = getLine(doc, pos.line).text.length;\n    if (ch == null || ch > linelen) return {line: pos.line, ch: linelen};\n    else if (ch < 0) return {line: pos.line, ch: 0};\n    else return pos;\n  }\n  function isLine(doc, l) {return l >= 0 && l < doc.size;}\n\n  // If shift is held, this will move the selection anchor. Otherwise,\n  // it'll set the whole selection.\n  function extendSelection(cm, pos, other, bias) {\n    var sel = cm.view.sel;\n    if (sel.shift || sel.extend) {\n      var anchor = sel.anchor;\n      if (other) {\n        var posBefore = posLess(pos, anchor);\n        if (posBefore != posLess(other, anchor)) {\n          anchor = pos;\n          pos = other;\n        } else if (posBefore != posLess(pos, other)) {\n          pos = other;\n        }\n      }\n      setSelection(cm, anchor, pos, bias);\n    } else {\n      setSelection(cm, pos, other || pos, bias);\n    }\n    cm.curOp.userSelChange = true;\n  }\n\n  // Update the selection. Last two args are only used by\n  // updateDoc, since they have to be expressed in the line\n  // numbers before the update.\n  function setSelection(cm, anchor, head, bias, checkAtomic) {\n    cm.view.goalColumn = null;\n    var sel = cm.view.sel;\n    // Skip over atomic spans.\n    if (checkAtomic || !posEq(anchor, sel.anchor))\n      anchor = skipAtomic(cm, anchor, bias, checkAtomic != \"push\");\n    if (checkAtomic || !posEq(head, sel.head))\n      head = skipAtomic(cm, head, bias, checkAtomic != \"push\");\n\n    if (posEq(sel.anchor, anchor) && posEq(sel.head, head)) return;\n\n    sel.anchor = anchor; sel.head = head;\n    var inv = posLess(head, anchor);\n    sel.from = inv ? head : anchor;\n    sel.to = inv ? anchor : head;\n\n    cm.curOp.updateInput = true;\n    cm.curOp.selectionChanged = true;\n  }\n\n  function reCheckSelection(cm) {\n    setSelection(cm, cm.view.sel.from, cm.view.sel.to, null, \"push\");\n  }\n\n  function skipAtomic(cm, pos, bias, mayClear) {\n    var doc = cm.view.doc, flipped = false, curPos = pos;\n    var dir = bias || 1;\n    cm.view.cantEdit = false;\n    search: for (;;) {\n      var line = getLine(doc, curPos.line), toClear;\n      if (line.markedSpans) {\n        for (var i = 0; i < line.markedSpans.length; ++i) {\n          var sp = line.markedSpans[i], m = sp.marker;\n          if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) &&\n              (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) {\n            if (mayClear && m.clearOnEnter) {\n              (toClear || (toClear = [])).push(m);\n              continue;\n            } else if (!m.atomic) continue;\n            var newPos = m.find()[dir < 0 ? \"from\" : \"to\"];\n            if (posEq(newPos, curPos)) {\n              newPos.ch += dir;\n              if (newPos.ch < 0) {\n                if (newPos.line) newPos = clipPos(doc, {line: newPos.line - 1});\n                else newPos = null;\n              } else if (newPos.ch > line.text.length) {\n                if (newPos.line < doc.size - 1) newPos = {line: newPos.line + 1, ch: 0};\n                else newPos = null;\n              }\n              if (!newPos) {\n                if (flipped) {\n                  // Driven in a corner -- no valid cursor position found at all\n                  // -- try again *with* clearing, if we didn't already\n                  if (!mayClear) return skipAtomic(cm, pos, bias, true);\n                  // Otherwise, turn off editing until further notice, and return the start of the doc\n                  cm.view.cantEdit = true;\n                  return {line: 0, ch: 0};\n                }\n                flipped = true; newPos = pos; dir = -dir;\n              }\n            }\n            curPos = newPos;\n            continue search;\n          }\n        }\n        if (toClear) for (var i = 0; i < toClear.length; ++i) toClear[i].clear();\n      }\n      return curPos;\n    }\n  }\n\n  // SCROLLING\n\n  function scrollCursorIntoView(cm) {\n    var view = cm.view;\n    var coords = scrollPosIntoView(cm, view.sel.head);\n    if (!view.focused) return;\n    var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n    if (coords.top + box.top < 0) doScroll = true;\n    else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false;\n    if (doScroll != null && !phantom) {\n      var hidden = display.cursor.style.display == \"none\";\n      if (hidden) {\n        display.cursor.style.display = \"\";\n        display.cursor.style.left = coords.left + \"px\";\n        display.cursor.style.top = (coords.top - display.viewOffset) + \"px\";\n      }\n      display.cursor.scrollIntoView(doScroll);\n      if (hidden) display.cursor.style.display = \"none\";\n    }\n  }\n\n  function scrollPosIntoView(cm, pos) {\n    for (;;) {\n      var changed = false, coords = cursorCoords(cm, pos);\n      var scrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom);\n      var startTop = cm.view.scrollTop, startLeft = cm.view.scrollLeft;\n      if (scrollPos.scrollTop != null) {\n        setScrollTop(cm, scrollPos.scrollTop);\n        if (Math.abs(cm.view.scrollTop - startTop) > 1) changed = true;\n      }\n      if (scrollPos.scrollLeft != null) {\n        setScrollLeft(cm, scrollPos.scrollLeft);\n        if (Math.abs(cm.view.scrollLeft - startLeft) > 1) changed = true;\n      }\n      if (!changed) return coords;\n    }\n  }\n\n  function scrollIntoView(cm, x1, y1, x2, y2) {\n    var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n    if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n    if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n  }\n\n  function calculateScrollPos(cm, x1, y1, x2, y2) {\n    var display = cm.display, pt = paddingTop(display);\n    y1 += pt; y2 += pt;\n    var screen = display.scroller.clientHeight - scrollerCutOff, screentop = display.scroller.scrollTop, result = {};\n    var docBottom = cm.view.doc.height + 2 * pt;\n    var atTop = y1 < pt + 10, atBottom = y2 + pt > docBottom - 10;\n    if (y1 < screentop) result.scrollTop = atTop ? 0 : Math.max(0, y1);\n    else if (y2 > screentop + screen) result.scrollTop = (atBottom ? docBottom : y2) - screen;\n\n    var screenw = display.scroller.clientWidth - scrollerCutOff, screenleft = display.scroller.scrollLeft;\n    x1 += display.gutters.offsetWidth; x2 += display.gutters.offsetWidth;\n    var gutterw = display.gutters.offsetWidth;\n    var atLeft = x1 < gutterw + 10;\n    if (x1 < screenleft + gutterw || atLeft) {\n      if (atLeft) x1 = 0;\n      result.scrollLeft = Math.max(0, x1 - 10 - gutterw);\n    } else if (x2 > screenw + screenleft - 3) {\n      result.scrollLeft = x2 + 10 - screenw;\n    }\n    return result;\n  }\n\n  // API UTILITIES\n\n  function indentLine(cm, n, how, aggressive) {\n    var doc = cm.view.doc;\n    if (!how) how = \"add\";\n    if (how == \"smart\") {\n      if (!cm.view.mode.indent) how = \"prev\";\n      else var state = getStateBefore(cm, n);\n    }\n\n    var tabSize = cm.options.tabSize;\n    var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n    var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n    if (how == \"smart\") {\n      indentation = cm.view.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n      if (indentation == Pass) {\n        if (!aggressive) return;\n        how = \"prev\";\n      }\n    }\n    if (how == \"prev\") {\n      if (n) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);\n      else indentation = 0;\n    }\n    else if (how == \"add\") indentation = curSpace + cm.options.indentUnit;\n    else if (how == \"subtract\") indentation = curSpace - cm.options.indentUnit;\n    indentation = Math.max(0, indentation);\n\n    var indentString = \"\", pos = 0;\n    if (cm.options.indentWithTabs)\n      for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";}\n    if (pos < indentation) indentString += spaceStr(indentation - pos);\n\n    if (indentString != curSpaceString)\n      replaceRange(cm, indentString, {line: n, ch: 0}, {line: n, ch: curSpaceString.length}, \"input\");\n    line.stateAfter = null;\n  }\n\n  function changeLine(cm, handle, op) {\n    var no = handle, line = handle, doc = cm.view.doc;\n    if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n    else no = lineNo(handle);\n    if (no == null) return null;\n    if (op(line, no)) regChange(cm, no, no + 1);\n    else return null;\n    return line;\n  }\n\n  function findPosH(cm, dir, unit, visually) {\n    var doc = cm.view.doc, end = cm.view.sel.head, line = end.line, ch = end.ch;\n    var lineObj = getLine(doc, line);\n    function findNextLine() {\n      var l = line + dir;\n      if (l < 0 || l == doc.size) return false;\n      line = l;\n      return lineObj = getLine(doc, l);\n    }\n    function moveOnce(boundToLine) {\n      var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true);\n      if (next == null) {\n        if (!boundToLine && findNextLine()) {\n          if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj);\n          else ch = dir < 0 ? lineObj.text.length : 0;\n        } else return false;\n      } else ch = next;\n      return true;\n    }\n    if (unit == \"char\") moveOnce();\n    else if (unit == \"column\") moveOnce(true);\n    else if (unit == \"word\") {\n      var sawWord = false;\n      for (;;) {\n        if (dir < 0) if (!moveOnce()) break;\n        if (isWordChar(lineObj.text.charAt(ch))) sawWord = true;\n        else if (sawWord) {if (dir < 0) {dir = 1; moveOnce();} break;}\n        if (dir > 0) if (!moveOnce()) break;\n      }\n    }\n    return skipAtomic(cm, {line: line, ch: ch}, dir, true);\n  }\n\n  function findWordAt(line, pos) {\n    var start = pos.ch, end = pos.ch;\n    if (line) {\n      if (pos.after === false || end == line.length) --start; else ++end;\n      var startChar = line.charAt(start);\n      var check = isWordChar(startChar) ? isWordChar :\n        /\\s/.test(startChar) ? function(ch) {return /\\s/.test(ch);} :\n      function(ch) {return !/\\s/.test(ch) && !isWordChar(ch);};\n      while (start > 0 && check(line.charAt(start - 1))) --start;\n      while (end < line.length && check(line.charAt(end))) ++end;\n    }\n    return {from: {line: pos.line, ch: start}, to: {line: pos.line, ch: end}};\n  }\n\n  function selectLine(cm, line) {\n    extendSelection(cm, {line: line, ch: 0}, clipPos(cm.view.doc, {line: line + 1, ch: 0}));\n  }\n\n  // PROTOTYPE\n\n  // The publicly visible API. Note that operation(null, f) means\n  // 'wrap f in an operation, performed on its `this` parameter'\n\n  CodeMirror.prototype = {\n    getValue: function(lineSep) {\n      var text = [], doc = this.view.doc;\n      doc.iter(0, doc.size, function(line) { text.push(line.text); });\n      return text.join(lineSep || \"\\n\");\n    },\n\n    setValue: operation(null, function(code) {\n      var doc = this.view.doc, top = {line: 0, ch: 0}, lastLen = getLine(doc, doc.size-1).text.length;\n      updateDocInner(this, top, {line: doc.size - 1, ch: lastLen}, splitLines(code), top, top, \"setValue\");\n    }),\n\n    getSelection: function(lineSep) { return this.getRange(this.view.sel.from, this.view.sel.to, lineSep); },\n\n    replaceSelection: operation(null, function(code, collapse, origin) {\n      var sel = this.view.sel;\n      updateDoc(this, sel.from, sel.to, splitLines(code), collapse || \"around\", origin);\n    }),\n\n    focus: function(){window.focus(); focusInput(this); onFocus(this); fastPoll(this);},\n\n    setOption: function(option, value) {\n      var options = this.options, old = options[option];\n      if (options[option] == value && option != \"mode\") return;\n      options[option] = value;\n      if (optionHandlers.hasOwnProperty(option))\n        operation(this, optionHandlers[option])(this, value, old);\n    },\n\n    getOption: function(option) {return this.options[option];},\n\n    getMode: function() {return this.view.mode;},\n\n    addKeyMap: function(map) {\n      this.view.keyMaps.push(map);\n    },\n\n    removeKeyMap: function(map) {\n      var maps = this.view.keyMaps;\n      for (var i = 0; i < maps.length; ++i)\n        if ((typeof map == \"string\" ? maps[i].name : maps[i]) == map) {\n          maps.splice(i, 1);\n          return true;\n        }\n    },\n\n    addOverlay: operation(null, function(spec, options) {\n      var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n      if (mode.startState) throw new Error(\"Overlays may not be stateful.\");\n      this.view.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque});\n      this.view.modeGen++;\n      regChange(this, 0, this.view.doc.size);\n    }),\n    removeOverlay: operation(null, function(spec) {\n      var overlays = this.view.overlays;\n      for (var i = 0; i < overlays.length; ++i) {\n        if (overlays[i].modeSpec == spec) {\n          overlays.splice(i, 1);\n          this.view.modeGen++;\n          regChange(this, 0, this.view.doc.size);\n          return;\n        }\n      }\n    }),\n\n    undo: operation(null, function() {unredoHelper(this, \"undo\");}),\n    redo: operation(null, function() {unredoHelper(this, \"redo\");}),\n\n    indentLine: operation(null, function(n, dir, aggressive) {\n      if (typeof dir != \"string\") {\n        if (dir == null) dir = this.options.smartIndent ? \"smart\" : \"prev\";\n        else dir = dir ? \"add\" : \"subtract\";\n      }\n      if (isLine(this.view.doc, n)) indentLine(this, n, dir, aggressive);\n    }),\n\n    indentSelection: operation(null, function(how) {\n      var sel = this.view.sel;\n      if (posEq(sel.from, sel.to)) return indentLine(this, sel.from.line, how);\n      var e = sel.to.line - (sel.to.ch ? 0 : 1);\n      for (var i = sel.from.line; i <= e; ++i) indentLine(this, i, how);\n    }),\n\n    historySize: function() {\n      var hist = this.view.history;\n      return {undo: hist.done.length, redo: hist.undone.length};\n    },\n\n    clearHistory: function() {this.view.history = makeHistory();},\n\n    markClean: function() {\n      this.view.history.dirtyCounter = 0;\n      this.view.history.lastOp = this.view.history.lastOrigin = null;\n    },\n\n    isClean: function () {return this.view.history.dirtyCounter == 0;},\n      \n    getHistory: function() {\n      var hist = this.view.history;\n      function cp(arr) {\n        for (var i = 0, nw = [], nwelt; i < arr.length; ++i) {\n          var set = arr[i];\n          nw.push({events: nwelt = [], fromBefore: set.fromBefore, toBefore: set.toBefore,\n                   fromAfter: set.fromAfter, toAfter: set.toAfter});\n          for (var j = 0, elt = set.events; j < elt.length; ++j) {\n            var old = [], cur = elt[j];\n            nwelt.push({start: cur.start, added: cur.added, old: old});\n            for (var k = 0; k < cur.old.length; ++k) old.push(hlText(cur.old[k]));\n          }\n        }\n        return nw;\n      }\n      return {done: cp(hist.done), undone: cp(hist.undone)};\n    },\n\n    setHistory: function(histData) {\n      var hist = this.view.history = makeHistory();\n      hist.done = histData.done;\n      hist.undone = histData.undone;\n    },\n\n    // Fetch the parser token for a given character. Useful for hacks\n    // that want to inspect the mode state (say, for completion).\n    getTokenAt: function(pos) {\n      var doc = this.view.doc;\n      pos = clipPos(doc, pos);\n      var state = getStateBefore(this, pos.line), mode = this.view.mode;\n      var line = getLine(doc, pos.line);\n      var stream = new StringStream(line.text, this.options.tabSize);\n      while (stream.pos < pos.ch && !stream.eol()) {\n        stream.start = stream.pos;\n        var style = mode.token(stream, state);\n      }\n      return {start: stream.start,\n              end: stream.pos,\n              string: stream.current(),\n              className: style || null, // Deprecated, use 'type' instead\n              type: style || null,\n              state: state};\n    },\n\n    getStateAfter: function(line) {\n      var doc = this.view.doc;\n      line = clipLine(doc, line == null ? doc.size - 1: line);\n      return getStateBefore(this, line + 1);\n    },\n\n    cursorCoords: function(start, mode) {\n      var pos, sel = this.view.sel;\n      if (start == null) pos = sel.head;\n      else if (typeof start == \"object\") pos = clipPos(this.view.doc, start);\n      else pos = start ? sel.from : sel.to;\n      return cursorCoords(this, pos, mode || \"page\");\n    },\n\n    charCoords: function(pos, mode) {\n      return charCoords(this, clipPos(this.view.doc, pos), mode || \"page\");\n    },\n\n    coordsChar: function(coords) {\n      var off = this.display.lineSpace.getBoundingClientRect();\n      return coordsChar(this, coords.left - off.left, coords.top - off.top);\n    },\n\n    defaultTextHeight: function() { return textHeight(this.display); },\n\n    markText: operation(null, function(from, to, options) {\n      return markText(this, clipPos(this.view.doc, from), clipPos(this.view.doc, to),\n                      options, \"range\");\n    }),\n\n    setBookmark: operation(null, function(pos, widget) {\n      pos = clipPos(this.view.doc, pos);\n      return markText(this, pos, pos, widget ? {replacedWith: widget} : {}, \"bookmark\");\n    }),\n\n    findMarksAt: function(pos) {\n      var doc = this.view.doc;\n      pos = clipPos(doc, pos);\n      var markers = [], spans = getLine(doc, pos.line).markedSpans;\n      if (spans) for (var i = 0; i < spans.length; ++i) {\n        var span = spans[i];\n        if ((span.from == null || span.from <= pos.ch) &&\n            (span.to == null || span.to >= pos.ch))\n          markers.push(span.marker);\n      }\n      return markers;\n    },\n\n    setGutterMarker: operation(null, function(line, gutterID, value) {\n      return changeLine(this, line, function(line) {\n        var markers = line.gutterMarkers || (line.gutterMarkers = {});\n        markers[gutterID] = value;\n        if (!value && isEmpty(markers)) line.gutterMarkers = null;\n        return true;\n      });\n    }),\n\n    clearGutter: operation(null, function(gutterID) {\n      var i = 0, cm = this, doc = cm.view.doc;\n      doc.iter(0, doc.size, function(line) {\n        if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n          line.gutterMarkers[gutterID] = null;\n          regChange(cm, i, i + 1);\n          if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null;\n        }\n        ++i;\n      });\n    }),\n\n    addLineClass: operation(null, function(handle, where, cls) {\n      return changeLine(this, handle, function(line) {\n        var prop = where == \"text\" ? \"textClass\" : where == \"background\" ? \"bgClass\" : \"wrapClass\";\n        if (!line[prop]) line[prop] = cls;\n        else if (new RegExp(\"\\\\b\" + cls + \"\\\\b\").test(line[prop])) return false;\n        else line[prop] += \" \" + cls;\n        return true;\n      });\n    }),\n\n    removeLineClass: operation(null, function(handle, where, cls) {\n      return changeLine(this, handle, function(line) {\n        var prop = where == \"text\" ? \"textClass\" : where == \"background\" ? \"bgClass\" : \"wrapClass\";\n        var cur = line[prop];\n        if (!cur) return false;\n        else if (cls == null) line[prop] = null;\n        else {\n          var upd = cur.replace(new RegExp(\"^\" + cls + \"\\\\b\\\\s*|\\\\s*\\\\b\" + cls + \"\\\\b\"), \"\");\n          if (upd == cur) return false;\n          line[prop] = upd || null;\n        }\n        return true;\n      });\n    }),\n\n    addLineWidget: operation(null, function(handle, node, options) {\n      return addLineWidget(this, handle, node, options);\n    }),\n\n    removeLineWidget: function(widget) { widget.clear(); },\n\n    lineInfo: function(line) {\n      if (typeof line == \"number\") {\n        if (!isLine(this.view.doc, line)) return null;\n        var n = line;\n        line = getLine(this.view.doc, line);\n        if (!line) return null;\n      } else {\n        var n = lineNo(line);\n        if (n == null) return null;\n      }\n      return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n              textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n              widgets: line.widgets};\n    },\n\n    getViewport: function() { return {from: this.display.showingFrom, to: this.display.showingTo};},\n\n    addWidget: function(pos, node, scroll, vert, horiz) {\n      var display = this.display;\n      pos = cursorCoords(this, clipPos(this.view.doc, pos));\n      var top = pos.top, left = pos.left;\n      node.style.position = \"absolute\";\n      display.sizer.appendChild(node);\n      if (vert == \"over\") top = pos.top;\n      else if (vert == \"near\") {\n        var vspace = Math.max(display.wrapper.clientHeight, this.view.doc.height),\n        hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n        if (pos.bottom + node.offsetHeight > vspace && pos.top > node.offsetHeight)\n          top = pos.top - node.offsetHeight;\n        if (left + node.offsetWidth > hspace)\n          left = hspace - node.offsetWidth;\n      }\n      node.style.top = (top + paddingTop(display)) + \"px\";\n      node.style.left = node.style.right = \"\";\n      if (horiz == \"right\") {\n        left = display.sizer.clientWidth - node.offsetWidth;\n        node.style.right = \"0px\";\n      } else {\n        if (horiz == \"left\") left = 0;\n        else if (horiz == \"middle\") left = (display.sizer.clientWidth - node.offsetWidth) / 2;\n        node.style.left = left + \"px\";\n      }\n      if (scroll)\n        scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight);\n    },\n\n    lineCount: function() {return this.view.doc.size;},\n\n    clipPos: function(pos) {return clipPos(this.view.doc, pos);},\n\n    getCursor: function(start) {\n      var sel = this.view.sel, pos;\n      if (start == null || start == \"head\") pos = sel.head;\n      else if (start == \"anchor\") pos = sel.anchor;\n      else if (start == \"end\" || start === false) pos = sel.to;\n      else pos = sel.from;\n      return copyPos(pos);\n    },\n\n    somethingSelected: function() {return !posEq(this.view.sel.from, this.view.sel.to);},\n\n    setCursor: operation(null, function(line, ch, extend) {\n      var pos = clipPos(this.view.doc, typeof line == \"number\" ? {line: line, ch: ch || 0} : line);\n      if (extend) extendSelection(this, pos);\n      else setSelection(this, pos, pos);\n    }),\n\n    setSelection: operation(null, function(anchor, head) {\n      var doc = this.view.doc;\n      setSelection(this, clipPos(doc, anchor), clipPos(doc, head || anchor));\n    }),\n\n    extendSelection: operation(null, function(from, to) {\n      var doc = this.view.doc;\n      extendSelection(this, clipPos(doc, from), to && clipPos(doc, to));\n    }),\n\n    setExtending: function(val) {this.view.sel.extend = val;},\n\n    getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;},\n\n    getLineHandle: function(line) {\n      var doc = this.view.doc;\n      if (isLine(doc, line)) return getLine(doc, line);\n    },\n\n    getLineNumber: function(line) {return lineNo(line);},\n\n    setLine: operation(null, function(line, text) {\n      if (isLine(this.view.doc, line))\n        replaceRange(this, text, {line: line, ch: 0}, {line: line, ch: getLine(this.view.doc, line).text.length});\n    }),\n\n    removeLine: operation(null, function(line) {\n      if (isLine(this.view.doc, line))\n        replaceRange(this, \"\", {line: line, ch: 0}, clipPos(this.view.doc, {line: line+1, ch: 0}));\n    }),\n\n    replaceRange: operation(null, function(code, from, to) {\n      var doc = this.view.doc;\n      from = clipPos(doc, from);\n      to = to ? clipPos(doc, to) : from;\n      return replaceRange(this, code, from, to);\n    }),\n\n    getRange: function(from, to, lineSep) {\n      var doc = this.view.doc;\n      from = clipPos(doc, from); to = clipPos(doc, to);\n      var l1 = from.line, l2 = to.line;\n      if (l1 == l2) return getLine(doc, l1).text.slice(from.ch, to.ch);\n      var code = [getLine(doc, l1).text.slice(from.ch)];\n      doc.iter(l1 + 1, l2, function(line) { code.push(line.text); });\n      code.push(getLine(doc, l2).text.slice(0, to.ch));\n      return code.join(lineSep || \"\\n\");\n    },\n\n    triggerOnKeyDown: operation(null, onKeyDown),\n\n    execCommand: function(cmd) {return commands[cmd](this);},\n\n    // Stuff used by commands, probably not much use to outside code.\n    moveH: operation(null, function(dir, unit) {\n      var sel = this.view.sel, pos = dir < 0 ? sel.from : sel.to;\n      if (sel.shift || sel.extend || posEq(sel.from, sel.to))\n        pos = findPosH(this, dir, unit, this.options.rtlMoveVisually);\n      extendSelection(this, pos, pos, dir);\n    }),\n\n    deleteH: operation(null, function(dir, unit) {\n      var sel = this.view.sel;\n      if (!posEq(sel.from, sel.to)) replaceRange(this, \"\", sel.from, sel.to, \"delete\");\n      else replaceRange(this, \"\", sel.from, findPosH(this, dir, unit, false), \"delete\");\n      this.curOp.userSelChange = true;\n    }),\n\n    moveV: operation(null, function(dir, unit) {\n      var view = this.view, doc = view.doc, display = this.display;\n      var cur = view.sel.head, pos = cursorCoords(this, cur, \"div\");\n      var x = pos.left, y;\n      if (view.goalColumn != null) x = view.goalColumn;\n      if (unit == \"page\") {\n        var pageSize = Math.min(display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n        y = pos.top + dir * pageSize;\n      } else if (unit == \"line\") {\n        y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n      }\n      do {\n        var target = coordsChar(this, x, y);\n        y += dir * 5;\n      } while (target.outside && (dir < 0 ? y > 0 : y < doc.height));\n\n      if (unit == \"page\") display.scrollbarV.scrollTop += charCoords(this, target, \"div\").top - pos.top;\n      extendSelection(this, target, target, dir);\n      view.goalColumn = x;\n    }),\n\n    toggleOverwrite: function() {\n      if (this.view.overwrite = !this.view.overwrite)\n        this.display.cursor.className += \" CodeMirror-overwrite\";\n      else\n        this.display.cursor.className = this.display.cursor.className.replace(\" CodeMirror-overwrite\", \"\");\n    },\n\n    posFromIndex: function(off) {\n      var lineNo = 0, ch, doc = this.view.doc;\n      doc.iter(0, doc.size, function(line) {\n        var sz = line.text.length + 1;\n        if (sz > off) { ch = off; return true; }\n        off -= sz;\n        ++lineNo;\n      });\n      return clipPos(doc, {line: lineNo, ch: ch});\n    },\n    indexFromPos: function (coords) {\n      coords = clipPos(this.view.doc, coords);\n      var index = coords.ch;\n      this.view.doc.iter(0, coords.line, function (line) {\n        index += line.text.length + 1;\n      });\n      return index;\n    },\n\n    scrollTo: function(x, y) {\n      if (x != null) this.display.scrollbarH.scrollLeft = this.display.scroller.scrollLeft = x;\n      if (y != null) this.display.scrollbarV.scrollTop = this.display.scroller.scrollTop = y;\n      updateDisplay(this, []);\n    },\n    getScrollInfo: function() {\n      var scroller = this.display.scroller, co = scrollerCutOff;\n      return {left: scroller.scrollLeft, top: scroller.scrollTop,\n              height: scroller.scrollHeight - co, width: scroller.scrollWidth - co,\n              clientHeight: scroller.clientHeight - co, clientWidth: scroller.clientWidth - co};\n    },\n\n    scrollIntoView: function(pos) {\n      if (typeof pos == \"number\") pos = {line: pos, ch: 0};\n      if (!pos || pos.line != null) {\n        pos = pos ? clipPos(this.view.doc, pos) : this.view.sel.head;\n        scrollPosIntoView(this, pos);\n      } else {\n        scrollIntoView(this, pos.left, pos.top, pos.right, pos.bottom);\n      }\n    },\n\n    setSize: function(width, height) {\n      function interpret(val) {\n        return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val;\n      }\n      if (width != null) this.display.wrapper.style.width = interpret(width);\n      if (height != null) this.display.wrapper.style.height = interpret(height);\n      this.refresh();\n    },\n\n    on: function(type, f) {on(this, type, f);},\n    off: function(type, f) {off(this, type, f);},\n\n    operation: function(f){return operation(this, f)();},\n\n    refresh: function() {\n      clearCaches(this);\n      var sTop = this.view.scrollTop, sLeft = this.view.scrollLeft;\n      if (this.display.scroller.scrollHeight > sTop)\n        this.display.scrollbarV.scrollTop = this.display.scroller.scrollTop = sTop;\n      if (this.display.scroller.scrollWidth > sLeft)\n        this.display.scrollbarH.scrollLeft = this.display.scroller.scrollLeft = sLeft;\n      updateDisplay(this, true);\n    },\n\n    getInputField: function(){return this.display.input;},\n    getWrapperElement: function(){return this.display.wrapper;},\n    getScrollerElement: function(){return this.display.scroller;},\n    getGutterElement: function(){return this.display.gutters;}\n  };\n\n  // OPTION DEFAULTS\n\n  var optionHandlers = CodeMirror.optionHandlers = {};\n\n  // The default configuration options.\n  var defaults = CodeMirror.defaults = {};\n\n  function option(name, deflt, handle, notOnInit) {\n    CodeMirror.defaults[name] = deflt;\n    if (handle) optionHandlers[name] =\n      notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle;\n  }\n\n  var Init = CodeMirror.Init = {toString: function(){return \"CodeMirror.Init\";}};\n\n  // These two are, on init, called from the constructor because they\n  // have to be initialized before the editor can start at all.\n  option(\"value\", \"\", function(cm, val) {cm.setValue(val);}, true);\n  option(\"mode\", null, loadMode, true);\n\n  option(\"indentUnit\", 2, loadMode, true);\n  option(\"indentWithTabs\", false);\n  option(\"smartIndent\", true);\n  option(\"tabSize\", 4, function(cm) {\n    loadMode(cm);\n    clearCaches(cm);\n    updateDisplay(cm, true);\n  }, true);\n  option(\"electricChars\", true);\n  option(\"rtlMoveVisually\", !windows);\n\n  option(\"theme\", \"default\", function(cm) {\n    themeChanged(cm);\n    guttersChanged(cm);\n  }, true);\n  option(\"keyMap\", \"default\", keyMapChanged);\n  option(\"extraKeys\", null);\n\n  option(\"onKeyEvent\", null);\n  option(\"onDragEvent\", null);\n\n  option(\"lineWrapping\", false, wrappingChanged, true);\n  option(\"gutters\", [], function(cm) {\n    setGuttersForLineNumbers(cm.options);\n    guttersChanged(cm);\n  }, true);\n  option(\"fixedGutter\", true, function(cm, val) {\n    cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n    cm.refresh();\n  }, true);\n  option(\"lineNumbers\", false, function(cm) {\n    setGuttersForLineNumbers(cm.options);\n    guttersChanged(cm);\n  }, true);\n  option(\"firstLineNumber\", 1, guttersChanged, true);\n  option(\"lineNumberFormatter\", function(integer) {return integer;}, guttersChanged, true);\n  option(\"showCursorWhenSelecting\", false, updateSelection, true);\n  \n  option(\"readOnly\", false, function(cm, val) {\n    if (val == \"nocursor\") {onBlur(cm); cm.display.input.blur();}\n    else if (!val) resetInput(cm, true);\n  });\n  option(\"dragDrop\", true);\n\n  option(\"cursorBlinkRate\", 530);\n  option(\"cursorHeight\", 1);\n  option(\"workTime\", 100);\n  option(\"workDelay\", 100);\n  option(\"flattenSpans\", true);\n  option(\"pollInterval\", 100);\n  option(\"undoDepth\", 40);\n  option(\"viewportMargin\", 10, function(cm){cm.refresh();}, true);\n\n  option(\"tabindex\", null, function(cm, val) {\n    cm.display.input.tabIndex = val || \"\";\n  });\n  option(\"autofocus\", null);\n\n  // MODE DEFINITION AND QUERYING\n\n  // Known modes, by name and by MIME\n  var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {};\n\n  CodeMirror.defineMode = function(name, mode) {\n    if (!CodeMirror.defaults.mode && name != \"null\") CodeMirror.defaults.mode = name;\n    if (arguments.length > 2) {\n      mode.dependencies = [];\n      for (var i = 2; i < arguments.length; ++i) mode.dependencies.push(arguments[i]);\n    }\n    modes[name] = mode;\n  };\n\n  CodeMirror.defineMIME = function(mime, spec) {\n    mimeModes[mime] = spec;\n  };\n\n  CodeMirror.resolveMode = function(spec) {\n    if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec))\n      spec = mimeModes[spec];\n    else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec))\n      return CodeMirror.resolveMode(\"application/xml\");\n    if (typeof spec == \"string\") return {name: spec};\n    else return spec || {name: \"null\"};\n  };\n\n  CodeMirror.getMode = function(options, spec) {\n    spec = CodeMirror.resolveMode(spec);\n    var mfactory = modes[spec.name];\n    if (!mfactory) return CodeMirror.getMode(options, \"text/plain\");\n    var modeObj = mfactory(options, spec);\n    if (modeExtensions.hasOwnProperty(spec.name)) {\n      var exts = modeExtensions[spec.name];\n      for (var prop in exts) {\n        if (!exts.hasOwnProperty(prop)) continue;\n        if (modeObj.hasOwnProperty(prop)) modeObj[\"_\" + prop] = modeObj[prop];\n        modeObj[prop] = exts[prop];\n      }\n    }\n    modeObj.name = spec.name;\n    return modeObj;\n  };\n\n  CodeMirror.defineMode(\"null\", function() {\n    return {token: function(stream) {stream.skipToEnd();}};\n  });\n  CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n  var modeExtensions = CodeMirror.modeExtensions = {};\n  CodeMirror.extendMode = function(mode, properties) {\n    var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n    for (var prop in properties) if (properties.hasOwnProperty(prop))\n      exts[prop] = properties[prop];\n  };\n\n  // EXTENSIONS\n\n  CodeMirror.defineExtension = function(name, func) {\n    CodeMirror.prototype[name] = func;\n  };\n\n  CodeMirror.defineOption = option;\n\n  var initHooks = [];\n  CodeMirror.defineInitHook = function(f) {initHooks.push(f);};\n\n  // MODE STATE HANDLING\n\n  // Utility functions for working with state. Exported because modes\n  // sometimes need to do this.\n  function copyState(mode, state) {\n    if (state === true) return state;\n    if (mode.copyState) return mode.copyState(state);\n    var nstate = {};\n    for (var n in state) {\n      var val = state[n];\n      if (val instanceof Array) val = val.concat([]);\n      nstate[n] = val;\n    }\n    return nstate;\n  }\n  CodeMirror.copyState = copyState;\n\n  function startState(mode, a1, a2) {\n    return mode.startState ? mode.startState(a1, a2) : true;\n  }\n  CodeMirror.startState = startState;\n\n  CodeMirror.innerMode = function(mode, state) {\n    while (mode.innerMode) {\n      var info = mode.innerMode(state);\n      state = info.state;\n      mode = info.mode;\n    }\n    return info || {mode: mode, state: state};\n  };\n\n  // STANDARD COMMANDS\n\n  var commands = CodeMirror.commands = {\n    selectAll: function(cm) {cm.setSelection({line: 0, ch: 0}, {line: cm.lineCount() - 1});},\n    killLine: function(cm) {\n      var from = cm.getCursor(true), to = cm.getCursor(false), sel = !posEq(from, to);\n      if (!sel && cm.getLine(from.line).length == from.ch)\n        cm.replaceRange(\"\", from, {line: from.line + 1, ch: 0}, \"delete\");\n      else cm.replaceRange(\"\", from, sel ? to : {line: from.line}, \"delete\");\n    },\n    deleteLine: function(cm) {\n      var l = cm.getCursor().line;\n      cm.replaceRange(\"\", {line: l, ch: 0}, {line: l}, \"delete\");\n    },\n    undo: function(cm) {cm.undo();},\n    redo: function(cm) {cm.redo();},\n    goDocStart: function(cm) {cm.extendSelection({line: 0, ch: 0});},\n    goDocEnd: function(cm) {cm.extendSelection({line: cm.lineCount() - 1});},\n    goLineStart: function(cm) {\n      cm.extendSelection(lineStart(cm, cm.getCursor().line));\n    },\n    goLineStartSmart: function(cm) {\n      var cur = cm.getCursor(), start = lineStart(cm, cur.line);\n      var line = cm.getLineHandle(start.line);\n      var order = getOrder(line);\n      if (!order || order[0].level == 0) {\n        var firstNonWS = Math.max(0, line.text.search(/\\S/));\n        var inWS = cur.line == start.line && cur.ch <= firstNonWS && cur.ch;\n        cm.extendSelection({line: start.line, ch: inWS ? 0 : firstNonWS});\n      } else cm.extendSelection(start);\n    },\n    goLineEnd: function(cm) {\n      cm.extendSelection(lineEnd(cm, cm.getCursor().line));\n    },\n    goLineUp: function(cm) {cm.moveV(-1, \"line\");},\n    goLineDown: function(cm) {cm.moveV(1, \"line\");},\n    goPageUp: function(cm) {cm.moveV(-1, \"page\");},\n    goPageDown: function(cm) {cm.moveV(1, \"page\");},\n    goCharLeft: function(cm) {cm.moveH(-1, \"char\");},\n    goCharRight: function(cm) {cm.moveH(1, \"char\");},\n    goColumnLeft: function(cm) {cm.moveH(-1, \"column\");},\n    goColumnRight: function(cm) {cm.moveH(1, \"column\");},\n    goWordLeft: function(cm) {cm.moveH(-1, \"word\");},\n    goWordRight: function(cm) {cm.moveH(1, \"word\");},\n    delCharBefore: function(cm) {cm.deleteH(-1, \"char\");},\n    delCharAfter: function(cm) {cm.deleteH(1, \"char\");},\n    delWordBefore: function(cm) {cm.deleteH(-1, \"word\");},\n    delWordAfter: function(cm) {cm.deleteH(1, \"word\");},\n    indentAuto: function(cm) {cm.indentSelection(\"smart\");},\n    indentMore: function(cm) {cm.indentSelection(\"add\");},\n    indentLess: function(cm) {cm.indentSelection(\"subtract\");},\n    insertTab: function(cm) {cm.replaceSelection(\"\\t\", \"end\", \"input\");},\n    defaultTab: function(cm) {\n      if (cm.somethingSelected()) cm.indentSelection(\"add\");\n      else cm.replaceSelection(\"\\t\", \"end\", \"input\");\n    },\n    transposeChars: function(cm) {\n      var cur = cm.getCursor(), line = cm.getLine(cur.line);\n      if (cur.ch > 0 && cur.ch < line.length - 1)\n        cm.replaceRange(line.charAt(cur.ch) + line.charAt(cur.ch - 1),\n                        {line: cur.line, ch: cur.ch - 1}, {line: cur.line, ch: cur.ch + 1});\n    },\n    newlineAndIndent: function(cm) {\n      operation(cm, function() {\n        cm.replaceSelection(\"\\n\", \"end\", \"input\");\n        cm.indentLine(cm.getCursor().line, null, true);\n      })();\n    },\n    toggleOverwrite: function(cm) {cm.toggleOverwrite();}\n  };\n\n  // STANDARD KEYMAPS\n\n  var keyMap = CodeMirror.keyMap = {};\n  keyMap.basic = {\n    \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n    \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n    \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n    \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\"\n  };\n  // Note that the save and find-related commands aren't defined by\n  // default. Unknown commands are simply ignored.\n  keyMap.pcDefault = {\n    \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n    \"Ctrl-Home\": \"goDocStart\", \"Alt-Up\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Down\": \"goDocEnd\",\n    \"Ctrl-Left\": \"goWordLeft\", \"Ctrl-Right\": \"goWordRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n    \"Ctrl-Backspace\": \"delWordBefore\", \"Ctrl-Delete\": \"delWordAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n    \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n    \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n    fallthrough: \"basic\"\n  };\n  keyMap.macDefault = {\n    \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n    \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goWordLeft\",\n    \"Alt-Right\": \"goWordRight\", \"Cmd-Left\": \"goLineStart\", \"Cmd-Right\": \"goLineEnd\", \"Alt-Backspace\": \"delWordBefore\",\n    \"Ctrl-Alt-Backspace\": \"delWordAfter\", \"Alt-Delete\": \"delWordAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n    \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n    \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\",\n    fallthrough: [\"basic\", \"emacsy\"]\n  };\n  keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n  keyMap.emacsy = {\n    \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n    \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n    \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n    \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\"\n  };\n\n  // KEYMAP DISPATCH\n\n  function getKeyMap(val) {\n    if (typeof val == \"string\") return keyMap[val];\n    else return val;\n  }\n\n  function lookupKey(name, maps, handle, stop) {\n    function lookup(map) {\n      map = getKeyMap(map);\n      var found = map[name];\n      if (found === false) {\n        if (stop) stop();\n        return true;\n      }\n      if (found != null && handle(found)) return true;\n      if (map.nofallthrough) {\n        if (stop) stop();\n        return true;\n      }\n      var fallthrough = map.fallthrough;\n      if (fallthrough == null) return false;\n      if (Object.prototype.toString.call(fallthrough) != \"[object Array]\")\n        return lookup(fallthrough);\n      for (var i = 0, e = fallthrough.length; i < e; ++i) {\n        if (lookup(fallthrough[i])) return true;\n      }\n      return false;\n    }\n\n    for (var i = 0; i < maps.length; ++i)\n      if (lookup(maps[i])) return true;\n  }\n  function isModifierKey(event) {\n    var name = keyNames[e_prop(event, \"keyCode\")];\n    return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\";\n  }\n  CodeMirror.isModifierKey = isModifierKey;\n\n  // FROMTEXTAREA\n\n  CodeMirror.fromTextArea = function(textarea, options) {\n    if (!options) options = {};\n    options.value = textarea.value;\n    if (!options.tabindex && textarea.tabindex)\n      options.tabindex = textarea.tabindex;\n    // Set autofocus to true if this textarea is focused, or if it has\n    // autofocus and no other element is focused.\n    if (options.autofocus == null) {\n      var hasFocus = document.body;\n      // doc.activeElement occasionally throws on IE\n      try { hasFocus = document.activeElement; } catch(e) {}\n      options.autofocus = hasFocus == textarea ||\n        textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n    }\n\n    function save() {textarea.value = cm.getValue();}\n    if (textarea.form) {\n      // Deplorable hack to make the submit method do the right thing.\n      on(textarea.form, \"submit\", save);\n      var form = textarea.form, realSubmit = form.submit;\n      try {\n        form.submit = function wrappedSubmit() {\n          save();\n          form.submit = realSubmit;\n          form.submit();\n          form.submit = wrappedSubmit;\n        };\n      } catch(e) {}\n    }\n\n    textarea.style.display = \"none\";\n    var cm = CodeMirror(function(node) {\n      textarea.parentNode.insertBefore(node, textarea.nextSibling);\n    }, options);\n    cm.save = save;\n    cm.getTextArea = function() { return textarea; };\n    cm.toTextArea = function() {\n      save();\n      textarea.parentNode.removeChild(cm.getWrapperElement());\n      textarea.style.display = \"\";\n      if (textarea.form) {\n        off(textarea.form, \"submit\", save);\n        if (typeof textarea.form.submit == \"function\")\n          textarea.form.submit = realSubmit;\n      }\n    };\n    return cm;\n  };\n\n  // STRING STREAM\n\n  // Fed to the mode parsers, provides helper functions to make\n  // parsers more succinct.\n\n  // The character stream used by a mode's parser.\n  function StringStream(string, tabSize) {\n    this.pos = this.start = 0;\n    this.string = string;\n    this.tabSize = tabSize || 8;\n  }\n\n  StringStream.prototype = {\n    eol: function() {return this.pos >= this.string.length;},\n    sol: function() {return this.pos == 0;},\n    peek: function() {return this.string.charAt(this.pos) || undefined;},\n    next: function() {\n      if (this.pos < this.string.length)\n        return this.string.charAt(this.pos++);\n    },\n    eat: function(match) {\n      var ch = this.string.charAt(this.pos);\n      if (typeof match == \"string\") var ok = ch == match;\n      else var ok = ch && (match.test ? match.test(ch) : match(ch));\n      if (ok) {++this.pos; return ch;}\n    },\n    eatWhile: function(match) {\n      var start = this.pos;\n      while (this.eat(match)){}\n      return this.pos > start;\n    },\n    eatSpace: function() {\n      var start = this.pos;\n      while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;\n      return this.pos > start;\n    },\n    skipToEnd: function() {this.pos = this.string.length;},\n    skipTo: function(ch) {\n      var found = this.string.indexOf(ch, this.pos);\n      if (found > -1) {this.pos = found; return true;}\n    },\n    backUp: function(n) {this.pos -= n;},\n    column: function() {return countColumn(this.string, this.start, this.tabSize);},\n    indentation: function() {return countColumn(this.string, null, this.tabSize);},\n    match: function(pattern, consume, caseInsensitive) {\n      if (typeof pattern == \"string\") {\n        var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};\n        if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {\n          if (consume !== false) this.pos += pattern.length;\n          return true;\n        }\n      } else {\n        var match = this.string.slice(this.pos).match(pattern);\n        if (match && match.index > 0) return null;\n        if (match && consume !== false) this.pos += match[0].length;\n        return match;\n      }\n    },\n    current: function(){return this.string.slice(this.start, this.pos);}\n  };\n  CodeMirror.StringStream = StringStream;\n\n  // TEXTMARKERS\n\n  function TextMarker(cm, type) {\n    this.lines = [];\n    this.type = type;\n    this.cm = cm;\n  }\n  CodeMirror.TextMarker = TextMarker;\n\n  TextMarker.prototype.clear = function() {\n    if (this.explicitlyCleared) return;\n    startOperation(this.cm);\n    var view = this.cm.view, min = null, max = null;\n    for (var i = 0; i < this.lines.length; ++i) {\n      var line = this.lines[i];\n      var span = getMarkedSpanFor(line.markedSpans, this);\n      if (span.to != null) max = lineNo(line);\n      line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n      if (span.from != null)\n        min = lineNo(line);\n      else if (this.collapsed && !lineIsHidden(line))\n        updateLineHeight(line, textHeight(this.cm.display));\n    }\n    if (this.collapsed && !this.cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) {\n      var visual = visualLine(view.doc, this.lines[i]), len = lineLength(view.doc, visual);\n      if (len > view.maxLineLength) {\n        view.maxLine = visual;\n        view.maxLineLength = len;\n        view.maxLineChanged = true;\n      }\n    }\n\n    if (min != null) regChange(this.cm, min, max + 1);\n    this.lines.length = 0;\n    this.explicitlyCleared = true;\n    if (this.collapsed && this.cm.view.cantEdit) {\n      this.cm.view.cantEdit = false;\n      reCheckSelection(this.cm);\n    }\n    endOperation(this.cm);\n    signalLater(this.cm, this, \"clear\");\n  };\n\n  TextMarker.prototype.find = function() {\n    var from, to;\n    for (var i = 0; i < this.lines.length; ++i) {\n      var line = this.lines[i];\n      var span = getMarkedSpanFor(line.markedSpans, this);\n      if (span.from != null || span.to != null) {\n        var found = lineNo(line);\n        if (span.from != null) from = {line: found, ch: span.from};\n        if (span.to != null) to = {line: found, ch: span.to};\n      }\n    }\n    if (this.type == \"bookmark\") return from;\n    return from && {from: from, to: to};\n  };\n\n  TextMarker.prototype.getOptions = function(copyWidget) {\n    var repl = this.replacedWith;\n    return {className: this.className,\n            inclusiveLeft: this.inclusiveLeft, inclusiveRight: this.inclusiveRight,\n            atomic: this.atomic,\n            collapsed: this.collapsed,\n            clearOnEnter: this.clearOnEnter,\n            replacedWith: copyWidget ? repl && repl.cloneNode(true) : repl,\n            readOnly: this.readOnly,\n            startStyle: this.startStyle, endStyle: this.endStyle};\n  };\n\n  function markText(cm, from, to, options, type) {\n    var doc = cm.view.doc;\n    var marker = new TextMarker(cm, type);\n    if (type == \"range\" && !posLess(from, to)) return marker;\n    if (options) for (var opt in options) if (options.hasOwnProperty(opt))\n      marker[opt] = options[opt];\n    if (marker.replacedWith) {\n      marker.collapsed = true;\n      marker.replacedWith = elt(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n    }\n    if (marker.collapsed) sawCollapsedSpans = true;\n\n    var curLine = from.line, size = 0, collapsedAtStart, collapsedAtEnd;\n    doc.iter(curLine, to.line + 1, function(line) {\n      if (marker.collapsed && !cm.options.lineWrapping && visualLine(doc, line) == cm.view.maxLine)\n        cm.curOp.updateMaxLine = true;\n      var span = {from: null, to: null, marker: marker};\n      size += line.text.length;\n      if (curLine == from.line) {span.from = from.ch; size -= from.ch;}\n      if (curLine == to.line) {span.to = to.ch; size -= line.text.length - to.ch;}\n      if (marker.collapsed) {\n        if (curLine == to.line) collapsedAtEnd = collapsedSpanAt(line, to.ch);\n        if (curLine == from.line) collapsedAtStart = collapsedSpanAt(line, from.ch);\n        else updateLineHeight(line, 0);\n      }\n      addMarkedSpan(line, span);\n      ++curLine;\n    });\n    if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) {\n      if (lineIsHidden(line)) updateLineHeight(line, 0);\n    });\n\n    if (marker.readOnly) {\n      sawReadOnlySpans = true;\n      if (cm.view.history.done.length || cm.view.history.undone.length)\n        cm.clearHistory();\n    }\n    if (marker.collapsed) {\n      if (collapsedAtStart != collapsedAtEnd)\n        throw new Error(\"Inserting collapsed marker overlapping an existing one\");\n      marker.size = size;\n      marker.atomic = true;\n    }\n    if (marker.className || marker.startStyle || marker.endStyle || marker.collapsed)\n      regChange(cm, from.line, to.line + 1);\n    if (marker.atomic) reCheckSelection(cm);\n    return marker;\n  }\n\n  // TEXTMARKER SPANS\n\n  function getMarkedSpanFor(spans, marker) {\n    if (spans) for (var i = 0; i < spans.length; ++i) {\n      var span = spans[i];\n      if (span.marker == marker) return span;\n    }\n  }\n  function removeMarkedSpan(spans, span) {\n    for (var r, i = 0; i < spans.length; ++i)\n      if (spans[i] != span) (r || (r = [])).push(spans[i]);\n    return r;\n  }\n  function addMarkedSpan(line, span) {\n    line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n    span.marker.lines.push(line);\n  }\n\n  function markedSpansBefore(old, startCh) {\n    if (old) for (var i = 0, nw; i < old.length; ++i) {\n      var span = old[i], marker = span.marker;\n      var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n      if (startsBefore || marker.type == \"bookmark\" && span.from == startCh) {\n        var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);\n        (nw || (nw = [])).push({from: span.from,\n                                to: endsAfter ? null : span.to,\n                                marker: marker});\n      }\n    }\n    return nw;\n  }\n\n  function markedSpansAfter(old, startCh, endCh) {\n    if (old) for (var i = 0, nw; i < old.length; ++i) {\n      var span = old[i], marker = span.marker;\n      var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n      if (endsAfter || marker.type == \"bookmark\" && span.from == endCh && span.from != startCh) {\n        var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);\n        (nw || (nw = [])).push({from: startsBefore ? null : span.from - endCh,\n                                to: span.to == null ? null : span.to - endCh,\n                                marker: marker});\n      }\n    }\n    return nw;\n  }\n\n  function updateMarkedSpans(oldFirst, oldLast, startCh, endCh, newText) {\n    if (!oldFirst && !oldLast) return newText;\n    // Get the spans that 'stick out' on both sides\n    var first = markedSpansBefore(oldFirst, startCh);\n    var last = markedSpansAfter(oldLast, startCh, endCh);\n\n    // Next, merge those two ends\n    var sameLine = newText.length == 1, offset = lst(newText).length + (sameLine ? startCh : 0);\n    if (first) {\n      // Fix up .to properties of first\n      for (var i = 0; i < first.length; ++i) {\n        var span = first[i];\n        if (span.to == null) {\n          var found = getMarkedSpanFor(last, span.marker);\n          if (!found) span.to = startCh;\n          else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n        }\n      }\n    }\n    if (last) {\n      // Fix up .from in last (or move them into first in case of sameLine)\n      for (var i = 0; i < last.length; ++i) {\n        var span = last[i];\n        if (span.to != null) span.to += offset;\n        if (span.from == null) {\n          var found = getMarkedSpanFor(first, span.marker);\n          if (!found) {\n            span.from = offset;\n            if (sameLine) (first || (first = [])).push(span);\n          }\n        } else {\n          span.from += offset;\n          if (sameLine) (first || (first = [])).push(span);\n        }\n      }\n    }\n\n    var newMarkers = [newHL(newText[0], first)];\n    if (!sameLine) {\n      // Fill gap with whole-line-spans\n      var gap = newText.length - 2, gapMarkers;\n      if (gap > 0 && first)\n        for (var i = 0; i < first.length; ++i)\n          if (first[i].to == null)\n            (gapMarkers || (gapMarkers = [])).push({from: null, to: null, marker: first[i].marker});\n      for (var i = 0; i < gap; ++i)\n        newMarkers.push(newHL(newText[i+1], gapMarkers));\n      newMarkers.push(newHL(lst(newText), last));\n    }\n    return newMarkers;\n  }\n\n  function removeReadOnlyRanges(doc, from, to) {\n    var markers = null;\n    doc.iter(from.line, to.line + 1, function(line) {\n      if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n        var mark = line.markedSpans[i].marker;\n        if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n          (markers || (markers = [])).push(mark);\n      }\n    });\n    if (!markers) return null;\n    var parts = [{from: from, to: to}];\n    for (var i = 0; i < markers.length; ++i) {\n      var m = markers[i].find();\n      for (var j = 0; j < parts.length; ++j) {\n        var p = parts[j];\n        if (!posLess(m.from, p.to) || posLess(m.to, p.from)) continue;\n        var newParts = [j, 1];\n        if (posLess(p.from, m.from)) newParts.push({from: p.from, to: m.from});\n        if (posLess(m.to, p.to)) newParts.push({from: m.to, to: p.to});\n        parts.splice.apply(parts, newParts);\n        j += newParts.length - 1;\n      }\n    }\n    return parts;\n  }\n\n  function collapsedSpanAt(line, ch) {\n    var sps = sawCollapsedSpans && line.markedSpans, found;\n    if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n      sp = sps[i];\n      if (!sp.marker.collapsed) continue;\n      if ((sp.from == null || sp.from < ch) &&\n          (sp.to == null || sp.to > ch) &&\n          (!found || found.width < sp.marker.width))\n        found = sp.marker;\n    }\n    return found;\n  }\n  function collapsedSpanAtStart(line) { return collapsedSpanAt(line, -1); }\n  function collapsedSpanAtEnd(line) { return collapsedSpanAt(line, line.text.length + 1); }\n\n  function visualLine(doc, line) {\n    var merged;\n    while (merged = collapsedSpanAtStart(line))\n      line = getLine(doc, merged.find().from.line);\n    return line;\n  }\n\n  function lineIsHidden(line) {\n    var sps = sawCollapsedSpans && line.markedSpans;\n    if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n      sp = sps[i];\n      if (!sp.marker.collapsed) continue;\n      if (sp.from == null) return true;\n      if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(line, sp))\n        return true;\n    }\n  }\n  function lineIsHiddenInner(line, span) {\n    if (span.to == null) {\n      var end = span.marker.find().to, endLine = getLine(lineDoc(line), end.line);\n      return lineIsHiddenInner(endLine, getMarkedSpanFor(endLine.markedSpans, span.marker));\n    }\n    if (span.marker.inclusiveRight && span.to == line.text.length)\n      return true;\n    for (var sp, i = 0; i < line.markedSpans.length; ++i) {\n      sp = line.markedSpans[i];\n      if (sp.marker.collapsed && sp.from == span.to &&\n          (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n          lineIsHiddenInner(line, sp)) return true;\n    }\n  }\n\n  // hl stands for history-line, a data structure that can be either a\n  // string (line without markers) or a {text, markedSpans} object.\n  function hlText(val) { return typeof val == \"string\" ? val : val.text; }\n  function hlSpans(val) {\n    if (typeof val == \"string\") return null;\n    var spans = val.markedSpans, out = null;\n    for (var i = 0; i < spans.length; ++i) {\n      if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n      else if (out) out.push(spans[i]);\n    }\n    return !out ? spans : out.length ? out : null;\n  }\n  function newHL(text, spans) { return spans ? {text: text, markedSpans: spans} : text; }\n\n  function detachMarkedSpans(line) {\n    var spans = line.markedSpans;\n    if (!spans) return;\n    for (var i = 0; i < spans.length; ++i) {\n      var lines = spans[i].marker.lines;\n      var ix = indexOf(lines, line);\n      lines.splice(ix, 1);\n    }\n    line.markedSpans = null;\n  }\n\n  function attachMarkedSpans(line, spans) {\n    if (!spans) return;\n    for (var i = 0; i < spans.length; ++i)\n      spans[i].marker.lines.push(line);\n    line.markedSpans = spans;\n  }\n\n  // LINE WIDGETS\n\n  var LineWidget = CodeMirror.LineWidget = function(cm, node, options) {\n    for (var opt in options) if (options.hasOwnProperty(opt))\n      this[opt] = options[opt];\n    this.cm = cm;\n    this.node = node;\n  };\n  function widgetOperation(f) {\n    return function() {\n      startOperation(this.cm);\n      try {var result = f.apply(this, arguments);}\n      finally {endOperation(this.cm);}\n      return result;\n    };\n  }\n  LineWidget.prototype.clear = widgetOperation(function() {\n    var ws = this.line.widgets, no = lineNo(this.line);\n    if (no == null || !ws) return;\n    for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1);\n    updateLineHeight(this.line, Math.max(0, this.line.height - widgetHeight(this)));\n    regChange(this.cm, no, no + 1);\n  });\n  LineWidget.prototype.changed = widgetOperation(function() {\n    var oldH = this.height;\n    this.height = null;\n    var diff = widgetHeight(this) - oldH;\n    if (!diff) return;\n    updateLineHeight(this.line, this.line.height + diff);\n    var no = lineNo(this.line);\n    regChange(this.cm, no, no + 1);\n  });\n\n  function widgetHeight(widget) {\n    if (widget.height != null) return widget.height;\n    if (!widget.node.parentNode || widget.node.parentNode.nodeType != 1)\n      removeChildrenAndAdd(widget.cm.display.measure, elt(\"div\", [widget.node], null, \"position: relative\"));\n    return widget.height = widget.node.offsetHeight;\n  }\n\n  function addLineWidget(cm, handle, node, options) {\n    var widget = new LineWidget(cm, node, options);\n    if (widget.noHScroll) cm.display.alignWidgets = true;\n    changeLine(cm, handle, function(line) {\n      (line.widgets || (line.widgets = [])).push(widget);\n      widget.line = line;\n      if (!lineIsHidden(line) || widget.showIfHidden) {\n        var aboveVisible = heightAtLine(cm, line) < cm.display.scroller.scrollTop;\n        updateLineHeight(line, line.height + widgetHeight(widget));\n        if (aboveVisible)\n          setTimeout(function() {cm.display.scroller.scrollTop += widget.height;});\n      }\n      return true;\n    });\n    return widget;\n  }\n\n  // LINE DATA STRUCTURE\n\n  // Line objects. These hold state related to a line, including\n  // highlighting info (the styles array).\n  function makeLine(text, markedSpans, height) {\n    var line = {text: text, height: height};\n    attachMarkedSpans(line, markedSpans);\n    if (lineIsHidden(line)) line.height = 0;\n    return line;\n  }\n\n  function updateLine(cm, line, text, markedSpans) {\n    line.text = text;\n    if (line.stateAfter) line.stateAfter = null;\n    if (line.styles) line.styles = null;\n    if (line.order != null) line.order = null;\n    detachMarkedSpans(line);\n    attachMarkedSpans(line, markedSpans);\n    if (lineIsHidden(line)) line.height = 0;\n    else if (!line.height) line.height = textHeight(cm.display);\n    signalLater(cm, line, \"change\");\n  }\n\n  function cleanUpLine(line) {\n    line.parent = null;\n    detachMarkedSpans(line);\n  }\n\n  // Run the given mode's parser over a line, update the styles\n  // array, which contains alternating fragments of text and CSS\n  // classes.\n  function runMode(cm, text, mode, state, f) {\n    var flattenSpans = cm.options.flattenSpans;\n    var curText = \"\", curStyle = null;\n    var stream = new StringStream(text, cm.options.tabSize);\n    if (text == \"\" && mode.blankLine) mode.blankLine(state);\n    while (!stream.eol()) {\n      var style = mode.token(stream, state);\n      if (stream.pos > 5000) {\n        flattenSpans = false;\n        // Webkit seems to refuse to render text nodes longer than 57444 characters\n        stream.pos = Math.min(text.length, stream.start + 50000);\n        style = null;\n      }\n      var substr = stream.current();\n      stream.start = stream.pos;\n      if (!flattenSpans || curStyle != style) {\n        if (curText) f(curText, curStyle);\n        curText = substr; curStyle = style;\n      } else curText = curText + substr;\n    }\n    if (curText) f(curText, curStyle);\n  }\n\n  function highlightLine(cm, line, state) {\n    // A styles array always starts with a number identifying the\n    // mode/overlays that it is based on (for easy invalidation).\n    var st = [cm.view.modeGen];\n    // Compute the base array of styles\n    runMode(cm, line.text, cm.view.mode, state, function(txt, style) {st.push(txt, style);});\n\n    // Run overlays, adjust style array.\n    for (var o = 0; o < cm.view.overlays.length; ++o) {\n      var overlay = cm.view.overlays[o], i = 1;\n      runMode(cm, line.text, overlay.mode, true, function(txt, style) {\n        var start = i, len = txt.length;\n        // Ensure there's a token end at the current position, and that i points at it\n        while (len) {\n          var cur = st[i], len_ = cur.length;\n          if (len_ <= len) {\n            len -= len_;\n          } else {\n            st.splice(i, 1, cur.slice(0, len), st[i+1], cur.slice(len));\n            len = 0;\n          }\n          i += 2;\n        }\n        if (!style) return;\n        if (overlay.opaque) {\n          st.splice(start, i - start, txt, style);\n          i = start + 2;\n        } else {\n          for (; start < i; start += 2) {\n            var cur = st[start+1];\n            st[start+1] = cur ? cur + \" \" + style : style;\n          }\n        }\n      });\n    }\n\n    return st;\n  }\n\n  function getLineStyles(cm, line) {\n    if (!line.styles || line.styles[0] != cm.view.modeGen)\n      line.styles = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line)));\n    return line.styles;\n  }\n\n  // Lightweight form of highlight -- proceed over this line and\n  // update state, but don't save a style array.\n  function processLine(cm, line, state) {\n    var mode = cm.view.mode;\n    var stream = new StringStream(line.text, cm.options.tabSize);\n    if (line.text == \"\" && mode.blankLine) mode.blankLine(state);\n    while (!stream.eol() && stream.pos <= 5000) {\n      mode.token(stream, state);\n      stream.start = stream.pos;\n    }\n  }\n\n  var styleToClassCache = {};\n  function styleToClass(style) {\n    if (!style) return null;\n    return styleToClassCache[style] ||\n      (styleToClassCache[style] = \"cm-\" + style.replace(/ +/g, \" cm-\"));\n  }\n\n  function lineContent(cm, realLine, measure) {\n    var merged, line = realLine, lineBefore, sawBefore, simple = true;\n    while (merged = collapsedSpanAtStart(line)) {\n      simple = false;\n      line = getLine(cm.view.doc, merged.find().from.line);\n      if (!lineBefore) lineBefore = line;\n    }\n\n    var builder = {pre: elt(\"pre\"), col: 0, pos: 0, display: !measure,\n                   measure: null, addedOne: false, cm: cm};\n    if (line.textClass) builder.pre.className = line.textClass;\n\n    do {\n      builder.measure = line == realLine && measure;\n      builder.pos = 0;\n      builder.addToken = builder.measure ? buildTokenMeasure : buildToken;\n      if (measure && sawBefore && line != realLine && !builder.addedOne) {\n        measure[0] = builder.pre.appendChild(zeroWidthElement(cm.display.measure));\n        builder.addedOne = true;\n      }\n      var next = insertLineContent(line, builder, getLineStyles(cm, line));\n      sawBefore = line == lineBefore;\n      if (next) {\n        line = getLine(cm.view.doc, next.to.line);\n        simple = false;\n      }\n    } while (next);\n\n    if (measure && !builder.addedOne)\n      measure[0] = builder.pre.appendChild(simple ? elt(\"span\", \"\\u00a0\") : zeroWidthElement(cm.display.measure));\n    if (!builder.pre.firstChild && !lineIsHidden(realLine))\n      builder.pre.appendChild(document.createTextNode(\"\\u00a0\"));\n\n    return builder.pre;\n  }\n\n  var tokenSpecialChars = /[\\t\\u0000-\\u0019\\u200b\\u2028\\u2029\\uFEFF]/g;\n  function buildToken(builder, text, style, startStyle, endStyle) {\n    if (!text) return;\n    if (!tokenSpecialChars.test(text)) {\n      builder.col += text.length;\n      var content = document.createTextNode(text);\n    } else {\n      var content = document.createDocumentFragment(), pos = 0;\n      while (true) {\n        tokenSpecialChars.lastIndex = pos;\n        var m = tokenSpecialChars.exec(text);\n        var skipped = m ? m.index - pos : text.length - pos;\n        if (skipped) {\n          content.appendChild(document.createTextNode(text.slice(pos, pos + skipped)));\n          builder.col += skipped;\n        }\n        if (!m) break;\n        pos += skipped + 1;\n        if (m[0] == \"\\t\") {\n          var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n          content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n          builder.col += tabWidth;\n        } else {\n          var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n          token.title = \"\\\\u\" + m[0].charCodeAt(0).toString(16);\n          content.appendChild(token);\n          builder.col += 1;\n        }\n      }\n    }\n    if (style || startStyle || endStyle || builder.measure) {\n      var fullStyle = style || \"\";\n      if (startStyle) fullStyle += startStyle;\n      if (endStyle) fullStyle += endStyle;\n      return builder.pre.appendChild(elt(\"span\", [content], fullStyle));\n    }\n    builder.pre.appendChild(content);\n  }\n\n  function buildTokenMeasure(builder, text, style, startStyle, endStyle) {\n    for (var i = 0; i < text.length; ++i) {\n      if (i && i < text.length &&\n          builder.cm.options.lineWrapping &&\n          spanAffectsWrapping.test(text.slice(i - 1, i + 1)))\n        builder.pre.appendChild(elt(\"wbr\"));\n      builder.measure[builder.pos++] =\n        buildToken(builder, text.charAt(i), style,\n                   i == 0 && startStyle, i == text.length - 1 && endStyle);\n    }\n    if (text.length) builder.addedOne = true;\n  }\n\n  function buildCollapsedSpan(builder, size, widget) {\n    if (widget) {\n      if (!builder.display) widget = widget.cloneNode(true);\n      builder.pre.appendChild(widget);\n      if (builder.measure && size) {\n        builder.measure[builder.pos] = widget;\n        builder.addedOne = true;\n      }\n    }\n    builder.pos += size;\n  }\n\n  // Outputs a number of spans to make up a line, taking highlighting\n  // and marked text into account.\n  function insertLineContent(line, builder, styles) {\n    var spans = line.markedSpans;\n    if (!spans) {\n      for (var i = 1; i < styles.length; i+=2)\n        builder.addToken(builder, styles[i], styleToClass(styles[i+1]));\n      return;\n    }\n\n    var allText = line.text, len = allText.length;\n    var pos = 0, i = 1, text = \"\", style;\n    var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed;\n    for (;;) {\n      if (nextChange == pos) { // Update current marker set\n        spanStyle = spanEndStyle = spanStartStyle = \"\";\n        collapsed = null; nextChange = Infinity;\n        var foundBookmark = null;\n        for (var j = 0; j < spans.length; ++j) {\n          var sp = spans[j], m = sp.marker;\n          if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n            if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n            if (m.className) spanStyle += \" \" + m.className;\n            if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n            if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n            if (m.collapsed && (!collapsed || collapsed.marker.width < m.width))\n              collapsed = sp;\n          } else if (sp.from > pos && nextChange > sp.from) {\n            nextChange = sp.from;\n          }\n          if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith)\n            foundBookmark = m.replacedWith;\n        }\n        if (collapsed && (collapsed.from || 0) == pos) {\n          buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n                             collapsed.from != null && collapsed.marker.replacedWith);\n          if (collapsed.to == null) return collapsed.marker.find();\n        }\n        if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n      }\n      if (pos >= len) break;\n\n      var upto = Math.min(len, nextChange);\n      while (true) {\n        if (text) {\n          var end = pos + text.length;\n          if (!collapsed) {\n            var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n            builder.addToken(builder, tokenText, style + spanStyle,\n                             spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\");\n          }\n          if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n          pos = end;\n          spanStartStyle = \"\";\n        }\n        text = styles[i++]; style = styleToClass(styles[i++]);\n      }\n    }\n  }\n\n  // DOCUMENT DATA STRUCTURE\n\n  function LeafChunk(lines) {\n    this.lines = lines;\n    this.parent = null;\n    for (var i = 0, e = lines.length, height = 0; i < e; ++i) {\n      lines[i].parent = this;\n      height += lines[i].height;\n    }\n    this.height = height;\n  }\n\n  LeafChunk.prototype = {\n    chunkSize: function() { return this.lines.length; },\n    remove: function(at, n, cm) {\n      for (var i = at, e = at + n; i < e; ++i) {\n        var line = this.lines[i];\n        this.height -= line.height;\n        cleanUpLine(line);\n        signalLater(cm, line, \"delete\");\n      }\n      this.lines.splice(at, n);\n    },\n    collapse: function(lines) {\n      lines.splice.apply(lines, [lines.length, 0].concat(this.lines));\n    },\n    insertHeight: function(at, lines, height) {\n      this.height += height;\n      this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n      for (var i = 0, e = lines.length; i < e; ++i) lines[i].parent = this;\n    },\n    iterN: function(at, n, op) {\n      for (var e = at + n; at < e; ++at)\n        if (op(this.lines[at])) return true;\n    }\n  };\n\n  function BranchChunk(children) {\n    this.children = children;\n    var size = 0, height = 0;\n    for (var i = 0, e = children.length; i < e; ++i) {\n      var ch = children[i];\n      size += ch.chunkSize(); height += ch.height;\n      ch.parent = this;\n    }\n    this.size = size;\n    this.height = height;\n    this.parent = null;\n  }\n\n  BranchChunk.prototype = {\n    chunkSize: function() { return this.size; },\n    remove: function(at, n, callbacks) {\n      this.size -= n;\n      for (var i = 0; i < this.children.length; ++i) {\n        var child = this.children[i], sz = child.chunkSize();\n        if (at < sz) {\n          var rm = Math.min(n, sz - at), oldHeight = child.height;\n          child.remove(at, rm, callbacks);\n          this.height -= oldHeight - child.height;\n          if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n          if ((n -= rm) == 0) break;\n          at = 0;\n        } else at -= sz;\n      }\n      if (this.size - n < 25) {\n        var lines = [];\n        this.collapse(lines);\n        this.children = [new LeafChunk(lines)];\n        this.children[0].parent = this;\n      }\n    },\n    collapse: function(lines) {\n      for (var i = 0, e = this.children.length; i < e; ++i) this.children[i].collapse(lines);\n    },\n    insert: function(at, lines) {\n      var height = 0;\n      for (var i = 0, e = lines.length; i < e; ++i) height += lines[i].height;\n      this.insertHeight(at, lines, height);\n    },\n    insertHeight: function(at, lines, height) {\n      this.size += lines.length;\n      this.height += height;\n      for (var i = 0, e = this.children.length; i < e; ++i) {\n        var child = this.children[i], sz = child.chunkSize();\n        if (at <= sz) {\n          child.insertHeight(at, lines, height);\n          if (child.lines && child.lines.length > 50) {\n            while (child.lines.length > 50) {\n              var spilled = child.lines.splice(child.lines.length - 25, 25);\n              var newleaf = new LeafChunk(spilled);\n              child.height -= newleaf.height;\n              this.children.splice(i + 1, 0, newleaf);\n              newleaf.parent = this;\n            }\n            this.maybeSpill();\n          }\n          break;\n        }\n        at -= sz;\n      }\n    },\n    maybeSpill: function() {\n      if (this.children.length <= 10) return;\n      var me = this;\n      do {\n        var spilled = me.children.splice(me.children.length - 5, 5);\n        var sibling = new BranchChunk(spilled);\n        if (!me.parent) { // Become the parent node\n          var copy = new BranchChunk(me.children);\n          copy.parent = me;\n          me.children = [copy, sibling];\n          me = copy;\n        } else {\n          me.size -= sibling.size;\n          me.height -= sibling.height;\n          var myIndex = indexOf(me.parent.children, me);\n          me.parent.children.splice(myIndex + 1, 0, sibling);\n        }\n        sibling.parent = me.parent;\n      } while (me.children.length > 10);\n      me.parent.maybeSpill();\n    },\n    iter: function(from, to, op) { this.iterN(from, to - from, op); },\n    iterN: function(at, n, op) {\n      for (var i = 0, e = this.children.length; i < e; ++i) {\n        var child = this.children[i], sz = child.chunkSize();\n        if (at < sz) {\n          var used = Math.min(n, sz - at);\n          if (child.iterN(at, used, op)) return true;\n          if ((n -= used) == 0) break;\n          at = 0;\n        } else at -= sz;\n      }\n    }\n  };\n\n  // LINE UTILITIES\n\n  function getLine(chunk, n) {\n    while (!chunk.lines) {\n      for (var i = 0;; ++i) {\n        var child = chunk.children[i], sz = child.chunkSize();\n        if (n < sz) { chunk = child; break; }\n        n -= sz;\n      }\n    }\n    return chunk.lines[n];\n  }\n\n  function updateLineHeight(line, height) {\n    var diff = height - line.height;\n    for (var n = line; n; n = n.parent) n.height += diff;\n  }\n\n  function lineNo(line) {\n    if (line.parent == null) return null;\n    var cur = line.parent, no = indexOf(cur.lines, line);\n    for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n      for (var i = 0;; ++i) {\n        if (chunk.children[i] == cur) break;\n        no += chunk.children[i].chunkSize();\n      }\n    }\n    return no;\n  }\n\n  function lineDoc(line) {\n    for (var d = line.parent; d.parent; d = d.parent) {}\n    return d;\n  }\n\n  function lineAtHeight(chunk, h) {\n    var n = 0;\n    outer: do {\n      for (var i = 0, e = chunk.children.length; i < e; ++i) {\n        var child = chunk.children[i], ch = child.height;\n        if (h < ch) { chunk = child; continue outer; }\n        h -= ch;\n        n += child.chunkSize();\n      }\n      return n;\n    } while (!chunk.lines);\n    for (var i = 0, e = chunk.lines.length; i < e; ++i) {\n      var line = chunk.lines[i], lh = line.height;\n      if (h < lh) break;\n      h -= lh;\n    }\n    return n + i;\n  }\n\n  function heightAtLine(cm, lineObj) {\n    lineObj = visualLine(cm.view.doc, lineObj);\n\n    var h = 0, chunk = lineObj.parent;\n    for (var i = 0; i < chunk.lines.length; ++i) {\n      var line = chunk.lines[i];\n      if (line == lineObj) break;\n      else h += line.height;\n    }\n    for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n      for (var i = 0; i < p.children.length; ++i) {\n        var cur = p.children[i];\n        if (cur == chunk) break;\n        else h += cur.height;\n      }\n    }\n    return h;\n  }\n\n  function getOrder(line) {\n    var order = line.order;\n    if (order == null) order = line.order = bidiOrdering(line.text);\n    return order;\n  }\n\n  // HISTORY\n\n  function makeHistory() {\n    return {\n      // Arrays of history events. Doing something adds an event to\n      // done and clears undo. Undoing moves events from done to\n      // undone, redoing moves them in the other direction.\n      done: [], undone: [],\n      // Used to track when changes can be merged into a single undo\n      // event\n      lastTime: 0, lastOp: null, lastOrigin: null,\n      // Used by the isClean() method\n      dirtyCounter: 0\n    };\n  }\n\n  function addChange(cm, start, added, old, origin, fromBefore, toBefore, fromAfter, toAfter) {\n    var history = cm.view.history;\n    history.undone.length = 0;\n    var time = +new Date, cur = lst(history.done);\n    \n    if (cur &&\n        (history.lastOp == cm.curOp.id ||\n         history.lastOrigin == origin && (origin == \"input\" || origin == \"delete\") &&\n         history.lastTime > time - 600)) {\n      // Merge this change into the last event\n      var last = lst(cur.events);\n      if (last.start > start + old.length || last.start + last.added < start) {\n        // Doesn't intersect with last sub-event, add new sub-event\n        cur.events.push({start: start, added: added, old: old});\n      } else {\n        // Patch up the last sub-event\n        var startBefore = Math.max(0, last.start - start),\n        endAfter = Math.max(0, (start + old.length) - (last.start + last.added));\n        for (var i = startBefore; i > 0; --i) last.old.unshift(old[i - 1]);\n        for (var i = endAfter; i > 0; --i) last.old.push(old[old.length - i]);\n        if (startBefore) last.start = start;\n        last.added += added - (old.length - startBefore - endAfter);\n      }\n      cur.fromAfter = fromAfter; cur.toAfter = toAfter;\n    } else {\n      // Can not be merged, start a new event.\n      cur = {events: [{start: start, added: added, old: old}],\n             fromBefore: fromBefore, toBefore: toBefore, fromAfter: fromAfter, toAfter: toAfter};\n      history.done.push(cur);\n      while (history.done.length > cm.options.undoDepth)\n        history.done.shift();\n      if (history.dirtyCounter < 0)\n          // The user has made a change after undoing past the last clean state. \n          // We can never get back to a clean state now until markClean() is called.\n          history.dirtyCounter = NaN;\n      else\n        history.dirtyCounter++;\n    }\n    history.lastTime = time;\n    history.lastOp = cm.curOp.id;\n    history.lastOrigin = origin;\n  }\n\n  // EVENT OPERATORS\n\n  function stopMethod() {e_stop(this);}\n  // Ensure an event has a stop method.\n  function addStop(event) {\n    if (!event.stop) event.stop = stopMethod;\n    return event;\n  }\n\n  function e_preventDefault(e) {\n    if (e.preventDefault) e.preventDefault();\n    else e.returnValue = false;\n  }\n  function e_stopPropagation(e) {\n    if (e.stopPropagation) e.stopPropagation();\n    else e.cancelBubble = true;\n  }\n  function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n  CodeMirror.e_stop = e_stop;\n  CodeMirror.e_preventDefault = e_preventDefault;\n  CodeMirror.e_stopPropagation = e_stopPropagation;\n\n  function e_target(e) {return e.target || e.srcElement;}\n  function e_button(e) {\n    var b = e.which;\n    if (b == null) {\n      if (e.button & 1) b = 1;\n      else if (e.button & 2) b = 3;\n      else if (e.button & 4) b = 2;\n    }\n    if (mac && e.ctrlKey && b == 1) b = 3;\n    return b;\n  }\n\n  // Allow 3rd-party code to override event properties by adding an override\n  // object to an event object.\n  function e_prop(e, prop) {\n    var overridden = e.override && e.override.hasOwnProperty(prop);\n    return overridden ? e.override[prop] : e[prop];\n  }\n\n  // EVENT HANDLING\n\n  function on(emitter, type, f) {\n    if (emitter.addEventListener)\n      emitter.addEventListener(type, f, false);\n    else if (emitter.attachEvent)\n      emitter.attachEvent(\"on\" + type, f);\n    else {\n      var map = emitter._handlers || (emitter._handlers = {});\n      var arr = map[type] || (map[type] = []);\n      arr.push(f);\n    }\n  }\n\n  function off(emitter, type, f) {\n    if (emitter.removeEventListener)\n      emitter.removeEventListener(type, f, false);\n    else if (emitter.detachEvent)\n      emitter.detachEvent(\"on\" + type, f);\n    else {\n      var arr = emitter._handlers && emitter._handlers[type];\n      if (!arr) return;\n      for (var i = 0; i < arr.length; ++i)\n        if (arr[i] == f) { arr.splice(i, 1); break; }\n    }\n  }\n\n  function signal(emitter, type /*, values...*/) {\n    var arr = emitter._handlers && emitter._handlers[type];\n    if (!arr) return;\n    var args = Array.prototype.slice.call(arguments, 2);\n    for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args);\n  }\n\n  function signalLater(cm, emitter, type /*, values...*/) {\n    var arr = emitter._handlers && emitter._handlers[type];\n    if (!arr) return;\n    var args = Array.prototype.slice.call(arguments, 3), flist = cm.curOp && cm.curOp.delayedCallbacks;\n    function bnd(f) {return function(){f.apply(null, args);};};\n    for (var i = 0; i < arr.length; ++i)\n      if (flist) flist.push(bnd(arr[i]));\n      else arr[i].apply(null, args);\n  }\n\n  function hasHandler(emitter, type) {\n    var arr = emitter._handlers && emitter._handlers[type];\n    return arr && arr.length > 0;\n  }\n\n  CodeMirror.on = on; CodeMirror.off = off; CodeMirror.signal = signal;\n\n  // MISC UTILITIES\n\n  // Number of pixels added to scroller and sizer to hide scrollbar\n  var scrollerCutOff = 30;\n\n  // Returned or thrown by various protocols to signal 'I'm not\n  // handling this'.\n  var Pass = CodeMirror.Pass = {toString: function(){return \"CodeMirror.Pass\";}};\n\n  function Delayed() {this.id = null;}\n  Delayed.prototype = {set: function(ms, f) {clearTimeout(this.id); this.id = setTimeout(f, ms);}};\n\n  // Counts the column offset in a string, taking tabs into account.\n  // Used mostly to find indentation.\n  function countColumn(string, end, tabSize) {\n    if (end == null) {\n      end = string.search(/[^\\s\\u00a0]/);\n      if (end == -1) end = string.length;\n    }\n    for (var i = 0, n = 0; i < end; ++i) {\n      if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n      else ++n;\n    }\n    return n;\n  }\n  CodeMirror.countColumn = countColumn;\n\n  var spaceStrs = [\"\"];\n  function spaceStr(n) {\n    while (spaceStrs.length <= n)\n      spaceStrs.push(lst(spaceStrs) + \" \");\n    return spaceStrs[n];\n  }\n\n  function lst(arr) { return arr[arr.length-1]; }\n\n  function selectInput(node) {\n    if (ios) { // Mobile Safari apparently has a bug where select() is broken.\n      node.selectionStart = 0;\n      node.selectionEnd = node.value.length;\n    } else node.select();\n  }\n\n  function indexOf(collection, elt) {\n    if (collection.indexOf) return collection.indexOf(elt);\n    for (var i = 0, e = collection.length; i < e; ++i)\n      if (collection[i] == elt) return i;\n    return -1;\n  }\n\n  function emptyArray(size) {\n    for (var a = [], i = 0; i < size; ++i) a.push(undefined);\n    return a;\n  }\n\n  function bind(f) {\n    var args = Array.prototype.slice.call(arguments, 1);\n    return function(){return f.apply(null, args);};\n  }\n\n  var nonASCIISingleCaseWordChar = /[\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc]/;\n  function isWordChar(ch) {\n    return /\\w/.test(ch) || ch > \"\\x80\" &&\n      (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch));\n  }\n\n  function isEmpty(obj) {\n    var c = 0;\n    for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) ++c;\n    return !c;\n  }\n\n  var isExtendingChar = /[\\u0300-\\u036F\\u0483-\\u0487\\u0488-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1-\\u05C2\\u05C4-\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7-\\u06E8\\u06EA-\\u06ED\\uA66F\\uA670-\\uA672\\uA674-\\uA67D\\uA69F]/;\n\n  // DOM UTILITIES\n\n  function elt(tag, content, className, style) {\n    var e = document.createElement(tag);\n    if (className) e.className = className;\n    if (style) e.style.cssText = style;\n    if (typeof content == \"string\") setTextContent(e, content);\n    else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]);\n    return e;\n  }\n\n  function removeChildren(e) {\n    // IE will break all parent-child relations in subnodes when setting innerHTML\n    if (!ie) e.innerHTML = \"\";\n    else while (e.firstChild) e.removeChild(e.firstChild);\n    return e;\n  }\n\n  function removeChildrenAndAdd(parent, e) {\n    return removeChildren(parent).appendChild(e);\n  }\n\n  function setTextContent(e, str) {\n    if (ie_lt9) {\n      e.innerHTML = \"\";\n      e.appendChild(document.createTextNode(str));\n    } else e.textContent = str;\n  }\n\n  // FEATURE DETECTION\n\n  // Detect drag-and-drop\n  var dragAndDrop = function() {\n    // There is *some* kind of drag-and-drop support in IE6-8, but I\n    // couldn't get it to work yet.\n    if (ie_lt9) return false;\n    var div = elt('div');\n    return \"draggable\" in div || \"dragDrop\" in div;\n  }();\n\n  // For a reason I have yet to figure out, some browsers disallow\n  // word wrapping between certain characters *only* if a new inline\n  // element is started between them. This makes it hard to reliably\n  // measure the position of things, since that requires inserting an\n  // extra span. This terribly fragile set of regexps matches the\n  // character combinations that suffer from this phenomenon on the\n  // various browsers.\n  var spanAffectsWrapping = /^$/; // Won't match any two-character string\n  if (gecko) spanAffectsWrapping = /$'/;\n  else if (safari) spanAffectsWrapping = /\\-[^ \\-?]|\\?[^ !'\\\"\\),.\\-\\/:;\\?\\]\\}]/;\n  else if (chrome) spanAffectsWrapping = /\\-[^ \\-\\.?]|\\?[^ \\-\\.?\\]\\}:;!'\\\"\\),\\/]|[\\.!\\\"#&%\\)*+,:;=>\\]|\\}~][\\(\\{\\[<]|\\$'/;\n\n  var knownScrollbarWidth;\n  function scrollbarWidth(measure) {\n    if (knownScrollbarWidth != null) return knownScrollbarWidth;\n    var test = elt(\"div\", null, null, \"width: 50px; height: 50px; overflow-x: scroll\");\n    removeChildrenAndAdd(measure, test);\n    if (test.offsetWidth)\n      knownScrollbarWidth = test.offsetHeight - test.clientHeight;\n    return knownScrollbarWidth || 0;\n  }\n\n  var zwspSupported;\n  function zeroWidthElement(measure) {\n    if (zwspSupported == null) {\n      var test = elt(\"span\", \"\\u200b\");\n      removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n      if (measure.firstChild.offsetHeight != 0)\n        zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_lt8;\n    }\n    if (zwspSupported) return elt(\"span\", \"\\u200b\");\n    else return elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n  }\n\n  // See if \"\".split is the broken IE version, if so, provide an\n  // alternative way to split lines.\n  var splitLines = \"\\n\\nb\".split(/\\n/).length != 3 ? function(string) {\n    var pos = 0, result = [], l = string.length;\n    while (pos <= l) {\n      var nl = string.indexOf(\"\\n\", pos);\n      if (nl == -1) nl = string.length;\n      var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n      var rt = line.indexOf(\"\\r\");\n      if (rt != -1) {\n        result.push(line.slice(0, rt));\n        pos += rt + 1;\n      } else {\n        result.push(line);\n        pos = nl + 1;\n      }\n    }\n    return result;\n  } : function(string){return string.split(/\\r\\n?|\\n/);};\n  CodeMirror.splitLines = splitLines;\n\n  var hasSelection = window.getSelection ? function(te) {\n    try { return te.selectionStart != te.selectionEnd; }\n    catch(e) { return false; }\n  } : function(te) {\n    try {var range = te.ownerDocument.selection.createRange();}\n    catch(e) {}\n    if (!range || range.parentElement() != te) return false;\n    return range.compareEndPoints(\"StartToEnd\", range) != 0;\n  };\n\n  var hasCopyEvent = (function() {\n    var e = elt(\"div\");\n    if (\"oncopy\" in e) return true;\n    e.setAttribute(\"oncopy\", \"return;\");\n    return typeof e.oncopy == 'function';\n  })();\n\n  // KEY NAMING\n\n  var keyNames = {3: \"Enter\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n                  19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n                  36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n                  46: \"Delete\", 59: \";\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\", 109: \"-\", 107: \"=\", 127: \"Delete\",\n                  186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n                  221: \"]\", 222: \"'\", 63276: \"PageUp\", 63277: \"PageDown\", 63275: \"End\", 63273: \"Home\",\n                  63234: \"Left\", 63232: \"Up\", 63235: \"Right\", 63233: \"Down\", 63302: \"Insert\", 63272: \"Delete\"};\n  CodeMirror.keyNames = keyNames;\n  (function() {\n    // Number keys\n    for (var i = 0; i < 10; i++) keyNames[i + 48] = String(i);\n    // Alphabetic keys\n    for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i);\n    // Function keys\n    for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = \"F\" + i;\n  })();\n\n  // BIDI HELPERS\n\n  function iterateBidiSections(order, from, to, f) {\n    if (!order) return f(from, to, \"ltr\");\n    for (var i = 0; i < order.length; ++i) {\n      var part = order[i];\n      if (part.from < to && part.to > from || from == to && part.to == from)\n        f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\");\n    }\n  }\n\n  function bidiLeft(part) { return part.level % 2 ? part.to : part.from; }\n  function bidiRight(part) { return part.level % 2 ? part.from : part.to; }\n\n  function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; }\n  function lineRight(line) {\n    var order = getOrder(line);\n    if (!order) return line.text.length;\n    return bidiRight(lst(order));\n  }\n\n  function lineStart(cm, lineN) {\n    var line = getLine(cm.view.doc, lineN);\n    var visual = visualLine(cm.view.doc, line);\n    if (visual != line) lineN = lineNo(visual);\n    var order = getOrder(visual);\n    var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual);\n    return {line: lineN, ch: ch};\n  }\n  function lineEnd(cm, lineNo) {\n    var merged, line;\n    while (merged = collapsedSpanAtEnd(line = getLine(cm.view.doc, lineNo)))\n      lineNo = merged.find().to.line;\n    var order = getOrder(line);\n    var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line);\n    return {line: lineNo, ch: ch};\n  }\n\n  // This is somewhat involved. It is needed in order to move\n  // 'visually' through bi-directional text -- i.e., pressing left\n  // should make the cursor go left, even when in RTL text. The\n  // tricky part is the 'jumps', where RTL and LTR text touch each\n  // other. This often requires the cursor offset to move more than\n  // one unit, in order to visually move one unit.\n  function moveVisually(line, start, dir, byUnit) {\n    var bidi = getOrder(line);\n    if (!bidi) return moveLogically(line, start, dir, byUnit);\n    var moveOneUnit = byUnit ? function(pos, dir) {\n      do pos += dir;\n      while (pos > 0 && isExtendingChar.test(line.text.charAt(pos)));\n      return pos;\n    } : function(pos, dir) { return pos + dir; };\n    var linedir = bidi[0].level;\n    for (var i = 0; i < bidi.length; ++i) {\n      var part = bidi[i], sticky = part.level % 2 == linedir;\n      if ((part.from < start && part.to > start) ||\n          (sticky && (part.from == start || part.to == start))) break;\n    }\n    var target = moveOneUnit(start, part.level % 2 ? -dir : dir);\n\n    while (target != null) {\n      if (part.level % 2 == linedir) {\n        if (target < part.from || target > part.to) {\n          part = bidi[i += dir];\n          target = part && (dir > 0 == part.level % 2 ? moveOneUnit(part.to, -1) : moveOneUnit(part.from, 1));\n        } else break;\n      } else {\n        if (target == bidiLeft(part)) {\n          part = bidi[--i];\n          target = part && bidiRight(part);\n        } else if (target == bidiRight(part)) {\n          part = bidi[++i];\n          target = part && bidiLeft(part);\n        } else break;\n      }\n    }\n\n    return target < 0 || target > line.text.length ? null : target;\n  }\n\n  function moveLogically(line, start, dir, byUnit) {\n    var target = start + dir;\n    if (byUnit) while (target > 0 && isExtendingChar.test(line.text.charAt(target))) target += dir;\n    return target < 0 || target > line.text.length ? null : target;\n  }\n\n  // Bidirectional ordering algorithm\n  // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n  // that this (partially) implements.\n\n  // One-char codes used for character types:\n  // L (L):   Left-to-Right\n  // R (R):   Right-to-Left\n  // r (AL):  Right-to-Left Arabic\n  // 1 (EN):  European Number\n  // + (ES):  European Number Separator\n  // % (ET):  European Number Terminator\n  // n (AN):  Arabic Number\n  // , (CS):  Common Number Separator\n  // m (NSM): Non-Spacing Mark\n  // b (BN):  Boundary Neutral\n  // s (B):   Paragraph Separator\n  // t (S):   Segment Separator\n  // w (WS):  Whitespace\n  // N (ON):  Other Neutrals\n\n  // Returns null if characters are ordered as they appear\n  // (left-to-right), or an array of sections ({from, to, level}\n  // objects) in the order in which they occur visually.\n  var bidiOrdering = (function() {\n    // Character types for codepoints 0 to 0xff\n    var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL\";\n    // Character types for codepoints 0x600 to 0x6ff\n    var arabicTypes = \"rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr\";\n    function charType(code) {\n      if (code <= 0xff) return lowTypes.charAt(code);\n      else if (0x590 <= code && code <= 0x5f4) return \"R\";\n      else if (0x600 <= code && code <= 0x6ff) return arabicTypes.charAt(code - 0x600);\n      else if (0x700 <= code && code <= 0x8ac) return \"r\";\n      else return \"L\";\n    }\n\n    var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n    var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n    // Browsers seem to always treat the boundaries of block elements as being L.\n    var outerType = \"L\";\n\n    return function charOrdering(str) {\n      if (!bidiRE.test(str)) return false;\n      var len = str.length, types = [];\n      for (var i = 0, type; i < len; ++i)\n        types.push(type = charType(str.charCodeAt(i)));\n\n      // W1. Examine each non-spacing mark (NSM) in the level run, and\n      // change the type of the NSM to the type of the previous\n      // character. If the NSM is at the start of the level run, it will\n      // get the type of sor.\n      for (var i = 0, prev = outerType; i < len; ++i) {\n        var type = types[i];\n        if (type == \"m\") types[i] = prev;\n        else prev = type;\n      }\n\n      // W2. Search backwards from each instance of a European number\n      // until the first strong type (R, L, AL, or sor) is found. If an\n      // AL is found, change the type of the European number to Arabic\n      // number.\n      // W3. Change all ALs to R.\n      for (var i = 0, cur = outerType; i < len; ++i) {\n        var type = types[i];\n        if (type == \"1\" && cur == \"r\") types[i] = \"n\";\n        else if (isStrong.test(type)) { cur = type; if (type == \"r\") types[i] = \"R\"; }\n      }\n\n      // W4. A single European separator between two European numbers\n      // changes to a European number. A single common separator between\n      // two numbers of the same type changes to that type.\n      for (var i = 1, prev = types[0]; i < len - 1; ++i) {\n        var type = types[i];\n        if (type == \"+\" && prev == \"1\" && types[i+1] == \"1\") types[i] = \"1\";\n        else if (type == \",\" && prev == types[i+1] &&\n                 (prev == \"1\" || prev == \"n\")) types[i] = prev;\n        prev = type;\n      }\n\n      // W5. A sequence of European terminators adjacent to European\n      // numbers changes to all European numbers.\n      // W6. Otherwise, separators and terminators change to Other\n      // Neutral.\n      for (var i = 0; i < len; ++i) {\n        var type = types[i];\n        if (type == \",\") types[i] = \"N\";\n        else if (type == \"%\") {\n          for (var end = i + 1; end < len && types[end] == \"%\"; ++end) {}\n          var replace = (i && types[i-1] == \"!\") || (end < len - 1 && types[end] == \"1\") ? \"1\" : \"N\";\n          for (var j = i; j < end; ++j) types[j] = replace;\n          i = end - 1;\n        }\n      }\n\n      // W7. Search backwards from each instance of a European number\n      // until the first strong type (R, L, or sor) is found. If an L is\n      // found, then change the type of the European number to L.\n      for (var i = 0, cur = outerType; i < len; ++i) {\n        var type = types[i];\n        if (cur == \"L\" && type == \"1\") types[i] = \"L\";\n        else if (isStrong.test(type)) cur = type;\n      }\n\n      // N1. A sequence of neutrals takes the direction of the\n      // surrounding strong text if the text on both sides has the same\n      // direction. European and Arabic numbers act as if they were R in\n      // terms of their influence on neutrals. Start-of-level-run (sor)\n      // and end-of-level-run (eor) are used at level run boundaries.\n      // N2. Any remaining neutrals take the embedding direction.\n      for (var i = 0; i < len; ++i) {\n        if (isNeutral.test(types[i])) {\n          for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {}\n          var before = (i ? types[i-1] : outerType) == \"L\";\n          var after = (end < len - 1 ? types[end] : outerType) == \"L\";\n          var replace = before || after ? \"L\" : \"R\";\n          for (var j = i; j < end; ++j) types[j] = replace;\n          i = end - 1;\n        }\n      }\n\n      // Here we depart from the documented algorithm, in order to avoid\n      // building up an actual levels array. Since there are only three\n      // levels (0, 1, 2) in an implementation that doesn't take\n      // explicit embedding into account, we can build up the order on\n      // the fly, without following the level-based algorithm.\n      var order = [], m;\n      for (var i = 0; i < len;) {\n        if (countsAsLeft.test(types[i])) {\n          var start = i;\n          for (++i; i < len && countsAsLeft.test(types[i]); ++i) {}\n          order.push({from: start, to: i, level: 0});\n        } else {\n          var pos = i, at = order.length;\n          for (++i; i < len && types[i] != \"L\"; ++i) {}\n          for (var j = pos; j < i;) {\n            if (countsAsNum.test(types[j])) {\n              if (pos < j) order.splice(at, 0, {from: pos, to: j, level: 1});\n              var nstart = j;\n              for (++j; j < i && countsAsNum.test(types[j]); ++j) {}\n              order.splice(at, 0, {from: nstart, to: j, level: 2});\n              pos = j;\n            } else ++j;\n          }\n          if (pos < i) order.splice(at, 0, {from: pos, to: i, level: 1});\n        }\n      }\n      if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n        order[0].from = m[0].length;\n        order.unshift({from: 0, to: m[0].length, level: 0});\n      }\n      if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n        lst(order).to -= m[0].length;\n        order.push({from: len - m[0].length, to: len, level: 0});\n      }\n      if (order[0].level != lst(order).level)\n        order.push({from: len, to: len, level: order[0].level});\n\n      return order;\n    };\n  })();\n\n  // THE END\n\n  CodeMirror.version = \"3.02\";\n\n  return CodeMirror;\n})();\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/mode/meta.js",
    "content": "CodeMirror.modeInfo = [\n  {name: 'NTriples', mime: 'text/n-triples', mode: 'ntriples'},\n  {name: 'SPARQL', mime: 'application/x-sparql-query', mode: 'sparql'},\n  {name: 'XML', mime: 'application/xml', mode: 'xml'},\n];\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/mode/ntriples/ntriples.js",
    "content": "/**********************************************************\n* This script provides syntax highlighting support for \n* the Ntriples format.\n* Ntriples format specification: \n*     http://www.w3.org/TR/rdf-testcases/#ntriples\n***********************************************************/\n\n/* \n    The following expression defines the defined ASF grammar transitions.\n\n    pre_subject ->\n        {\n        ( writing_subject_uri | writing_bnode_uri )\n            -> pre_predicate \n                -> writing_predicate_uri \n                    -> pre_object \n                        -> writing_object_uri | writing_object_bnode | \n                          ( \n                            writing_object_literal \n                                -> writing_literal_lang | writing_literal_type\n                          )\n                            -> post_object\n                                -> BEGIN\n         } otherwise {\n             -> ERROR\n         }\n*/\nCodeMirror.defineMode(\"ntriples\", function() {  \n\n  var Location = {\n    PRE_SUBJECT         : 0,\n    WRITING_SUB_URI     : 1,\n    WRITING_BNODE_URI   : 2,\n    PRE_PRED            : 3,\n    WRITING_PRED_URI    : 4,\n    PRE_OBJ             : 5,\n    WRITING_OBJ_URI     : 6,\n    WRITING_OBJ_BNODE   : 7,\n    WRITING_OBJ_LITERAL : 8,\n    WRITING_LIT_LANG    : 9,\n    WRITING_LIT_TYPE    : 10,\n    POST_OBJ            : 11,\n    ERROR               : 12\n  };\n  function transitState(currState, c) {\n    var currLocation = currState.location;\n    var ret;\n    \n    // Opening.\n    if     (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI;\n    else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI;\n    else if(currLocation == Location.PRE_PRED    && c == '<') ret = Location.WRITING_PRED_URI;\n    else if(currLocation == Location.PRE_OBJ     && c == '<') ret = Location.WRITING_OBJ_URI;\n    else if(currLocation == Location.PRE_OBJ     && c == '_') ret = Location.WRITING_OBJ_BNODE;\n    else if(currLocation == Location.PRE_OBJ     && c == '\"') ret = Location.WRITING_OBJ_LITERAL;\n    \n    // Closing.\n    else if(currLocation == Location.WRITING_SUB_URI     && c == '>') ret = Location.PRE_PRED;\n    else if(currLocation == Location.WRITING_BNODE_URI   && c == ' ') ret = Location.PRE_PRED;\n    else if(currLocation == Location.WRITING_PRED_URI    && c == '>') ret = Location.PRE_OBJ;\n    else if(currLocation == Location.WRITING_OBJ_URI     && c == '>') ret = Location.POST_OBJ;\n    else if(currLocation == Location.WRITING_OBJ_BNODE   && c == ' ') ret = Location.POST_OBJ;\n    else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '\"') ret = Location.POST_OBJ;\n    else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ;\n    else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ;\n    \n    // Closing typed and language literal.\n    else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG;\n    else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE;\n\n    // Spaces.\n    else if( c == ' ' &&                             \n             (\n               currLocation == Location.PRE_SUBJECT || \n               currLocation == Location.PRE_PRED    || \n               currLocation == Location.PRE_OBJ     || \n               currLocation == Location.POST_OBJ\n             )\n           ) ret = currLocation;\n    \n    // Reset.\n    else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT;    \n    \n    // Error\n    else ret = Location.ERROR;\n    \n    currState.location=ret;\n  }\n\n  return {\n    startState: function() {\n       return { \n           location : Location.PRE_SUBJECT,\n           uris     : [],\n           anchors  : [],\n           bnodes   : [],\n           langs    : [],\n           types    : []\n       };\n    },\n    token: function(stream, state) {\n      var ch = stream.next();\n      if(ch == '<') {\n         transitState(state, ch);\n         var parsedURI = '';\n         stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} );\n         state.uris.push(parsedURI);\n         if( stream.match('#', false) ) return 'variable';\n         stream.next();\n         transitState(state, '>');\n         return 'variable';\n      }\n      if(ch == '#') {\n        var parsedAnchor = '';\n        stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false;});\n        state.anchors.push(parsedAnchor);\n        return 'variable-2';\n      }\n      if(ch == '>') {\n          transitState(state, '>');\n          return 'variable';\n      }\n      if(ch == '_') {\n          transitState(state, ch);\n          var parsedBNode = '';\n          stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;});\n          state.bnodes.push(parsedBNode);\n          stream.next();\n          transitState(state, ' ');\n          return 'builtin';\n      }\n      if(ch == '\"') {\n          transitState(state, ch);\n          stream.eatWhile( function(c) { return c != '\"'; } );\n          stream.next();\n          if( stream.peek() != '@' && stream.peek() != '^' ) {\n              transitState(state, '\"');\n          }\n          return 'string';\n      }\n      if( ch == '@' ) {\n          transitState(state, '@');\n          var parsedLang = '';\n          stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;});\n          state.langs.push(parsedLang);\n          stream.next();\n          transitState(state, ' ');\n          return 'string-2';\n      }\n      if( ch == '^' ) {\n          stream.next();\n          transitState(state, '^');\n          var parsedType = '';\n          stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} );\n          state.types.push(parsedType);\n          stream.next();\n          transitState(state, '>');\n          return 'variable';\n      }\n      if( ch == ' ' ) {\n          transitState(state, ch);\n      }\n      if( ch == '.' ) {\n          transitState(state, ch);\n      }\n    }\n  };\n});\n\nCodeMirror.defineMIME(\"text/n-triples\", \"ntriples\");\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/mode/sparql/sparql.js",
    "content": "CodeMirror.defineMode(\"sparql\", function(config) {\n  var indentUnit = config.indentUnit;\n  var curPunc;\n\n  function wordRegexp(words) {\n    return new RegExp(\"^(?:\" + words.join(\"|\") + \")$\", \"i\");\n  }\n  var ops = wordRegexp([\"str\", \"lang\", \"langmatches\", \"datatype\", \"bound\", \"sameterm\", \"isiri\", \"isuri\",\n                        \"isblank\", \"isliteral\", \"union\", \"a\"]);\n  var keywords = wordRegexp([\"base\", \"prefix\", \"select\", \"distinct\", \"reduced\", \"construct\", \"describe\",\n                             \"ask\", \"from\", \"named\", \"where\", \"order\", \"limit\", \"offset\", \"filter\", \"optional\",\n                             \"graph\", \"by\", \"asc\", \"desc\"]);\n  var operatorChars = /[*+\\-<>=&|]/;\n\n  function tokenBase(stream, state) {\n    var ch = stream.next();\n    curPunc = null;\n    if (ch == \"$\" || ch == \"?\") {\n      stream.match(/^[\\w\\d]*/);\n      return \"variable-2\";\n    }\n    else if (ch == \"<\" && !stream.match(/^[\\s\\u00a0=]/, false)) {\n      stream.match(/^[^\\s\\u00a0>]*>?/);\n      return \"atom\";\n    }\n    else if (ch == \"\\\"\" || ch == \"'\") {\n      state.tokenize = tokenLiteral(ch);\n      return state.tokenize(stream, state);\n    }\n    else if (/[{}\\(\\),\\.;\\[\\]]/.test(ch)) {\n      curPunc = ch;\n      return null;\n    }\n    else if (ch == \"#\") {\n      stream.skipToEnd();\n      return \"comment\";\n    }\n    else if (operatorChars.test(ch)) {\n      stream.eatWhile(operatorChars);\n      return null;\n    }\n    else if (ch == \":\") {\n      stream.eatWhile(/[\\w\\d\\._\\-]/);\n      return \"atom\";\n    }\n    else {\n      stream.eatWhile(/[_\\w\\d]/);\n      if (stream.eat(\":\")) {\n        stream.eatWhile(/[\\w\\d_\\-]/);\n        return \"atom\";\n      }\n      var word = stream.current();\n      if (ops.test(word))\n        return null;\n      else if (keywords.test(word))\n        return \"keyword\";\n      else\n        return \"variable\";\n    }\n  }\n\n  function tokenLiteral(quote) {\n    return function(stream, state) {\n      var escaped = false, ch;\n      while ((ch = stream.next()) != null) {\n        if (ch == quote && !escaped) {\n          state.tokenize = tokenBase;\n          break;\n        }\n        escaped = !escaped && ch == \"\\\\\";\n      }\n      return \"string\";\n    };\n  }\n\n  function pushContext(state, type, col) {\n    state.context = {prev: state.context, indent: state.indent, col: col, type: type};\n  }\n  function popContext(state) {\n    state.indent = state.context.indent;\n    state.context = state.context.prev;\n  }\n\n  return {\n    startState: function() {\n      return {tokenize: tokenBase,\n              context: null,\n              indent: 0,\n              col: 0};\n    },\n\n    token: function(stream, state) {\n      if (stream.sol()) {\n        if (state.context && state.context.align == null) state.context.align = false;\n        state.indent = stream.indentation();\n      }\n      if (stream.eatSpace()) return null;\n      var style = state.tokenize(stream, state);\n\n      if (style != \"comment\" && state.context && state.context.align == null && state.context.type != \"pattern\") {\n        state.context.align = true;\n      }\n\n      if (curPunc == \"(\") pushContext(state, \")\", stream.column());\n      else if (curPunc == \"[\") pushContext(state, \"]\", stream.column());\n      else if (curPunc == \"{\") pushContext(state, \"}\", stream.column());\n      else if (/[\\]\\}\\)]/.test(curPunc)) {\n        while (state.context && state.context.type == \"pattern\") popContext(state);\n        if (state.context && curPunc == state.context.type) popContext(state);\n      }\n      else if (curPunc == \".\" && state.context && state.context.type == \"pattern\") popContext(state);\n      else if (/atom|string|variable/.test(style) && state.context) {\n        if (/[\\}\\]]/.test(state.context.type))\n          pushContext(state, \"pattern\", stream.column());\n        else if (state.context.type == \"pattern\" && !state.context.align) {\n          state.context.align = true;\n          state.context.col = stream.column();\n        }\n      }\n      \n      return style;\n    },\n\n    indent: function(state, textAfter) {\n      var firstChar = textAfter && textAfter.charAt(0);\n      var context = state.context;\n      if (/[\\]\\}]/.test(firstChar))\n        while (context && context.type == \"pattern\") context = context.prev;\n\n      var closing = context && firstChar == context.type;\n      if (!context)\n        return 0;\n      else if (context.type == \"pattern\")\n        return context.col;\n      else if (context.align)\n        return context.col + (closing ? 0 : 1);\n      else\n        return context.indent + (closing ? 0 : indentUnit);\n    }\n  };\n});\n\nCodeMirror.defineMIME(\"application/x-sparql-query\", \"sparql\");\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/mode/xml/xml.js",
    "content": "CodeMirror.defineMode(\"xml\", function(config, parserConfig) {\n  var indentUnit = config.indentUnit;\n  var Kludges = parserConfig.htmlMode ? {\n    autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,\n                      'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,\n                      'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,\n                      'track': true, 'wbr': true},\n    implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,\n                       'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,\n                       'th': true, 'tr': true},\n    contextGrabbers: {\n      'dd': {'dd': true, 'dt': true},\n      'dt': {'dd': true, 'dt': true},\n      'li': {'li': true},\n      'option': {'option': true, 'optgroup': true},\n      'optgroup': {'optgroup': true},\n      'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,\n            'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,\n            'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,\n            'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,\n            'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},\n      'rp': {'rp': true, 'rt': true},\n      'rt': {'rp': true, 'rt': true},\n      'tbody': {'tbody': true, 'tfoot': true},\n      'td': {'td': true, 'th': true},\n      'tfoot': {'tbody': true},\n      'th': {'td': true, 'th': true},\n      'thead': {'tbody': true, 'tfoot': true},\n      'tr': {'tr': true}\n    },\n    doNotIndent: {\"pre\": true},\n    allowUnquoted: true,\n    allowMissing: true\n  } : {\n    autoSelfClosers: {},\n    implicitlyClosed: {},\n    contextGrabbers: {},\n    doNotIndent: {},\n    allowUnquoted: false,\n    allowMissing: false\n  };\n  var alignCDATA = parserConfig.alignCDATA;\n\n  // Return variables for tokenizers\n  var tagName, type;\n\n  function inText(stream, state) {\n    function chain(parser) {\n      state.tokenize = parser;\n      return parser(stream, state);\n    }\n\n    var ch = stream.next();\n    if (ch == \"<\") {\n      if (stream.eat(\"!\")) {\n        if (stream.eat(\"[\")) {\n          if (stream.match(\"CDATA[\")) return chain(inBlock(\"atom\", \"]]>\"));\n          else return null;\n        }\n        else if (stream.match(\"--\")) return chain(inBlock(\"comment\", \"-->\"));\n        else if (stream.match(\"DOCTYPE\", true, true)) {\n          stream.eatWhile(/[\\w\\._\\-]/);\n          return chain(doctype(1));\n        }\n        else return null;\n      }\n      else if (stream.eat(\"?\")) {\n        stream.eatWhile(/[\\w\\._\\-]/);\n        state.tokenize = inBlock(\"meta\", \"?>\");\n        return \"meta\";\n      }\n      else {\n        var isClose = stream.eat(\"/\");\n        tagName = \"\";\n        var c;\n        while ((c = stream.eat(/[^\\s\\u00a0=<>\\\"\\'\\/?]/))) tagName += c;\n        if (!tagName) return \"error\";\n        type = isClose ? \"closeTag\" : \"openTag\";\n        state.tokenize = inTag;\n        return \"tag\";\n      }\n    }\n    else if (ch == \"&\") {\n      var ok;\n      if (stream.eat(\"#\")) {\n        if (stream.eat(\"x\")) {\n          ok = stream.eatWhile(/[a-fA-F\\d]/) && stream.eat(\";\");          \n        } else {\n          ok = stream.eatWhile(/[\\d]/) && stream.eat(\";\");\n        }\n      } else {\n        ok = stream.eatWhile(/[\\w\\.\\-:]/) && stream.eat(\";\");\n      }\n      return ok ? \"atom\" : \"error\";\n    }\n    else {\n      stream.eatWhile(/[^&<]/);\n      return null;\n    }\n  }\n\n  function inTag(stream, state) {\n    var ch = stream.next();\n    if (ch == \">\" || (ch == \"/\" && stream.eat(\">\"))) {\n      state.tokenize = inText;\n      type = ch == \">\" ? \"endTag\" : \"selfcloseTag\";\n      return \"tag\";\n    }\n    else if (ch == \"=\") {\n      type = \"equals\";\n      return null;\n    }\n    else if (/[\\'\\\"]/.test(ch)) {\n      state.tokenize = inAttribute(ch);\n      return state.tokenize(stream, state);\n    }\n    else {\n      stream.eatWhile(/[^\\s\\u00a0=<>\\\"\\']/);\n      return \"word\";\n    }\n  }\n\n  function inAttribute(quote) {\n    return function(stream, state) {\n      while (!stream.eol()) {\n        if (stream.next() == quote) {\n          state.tokenize = inTag;\n          break;\n        }\n      }\n      return \"string\";\n    };\n  }\n\n  function inBlock(style, terminator) {\n    return function(stream, state) {\n      while (!stream.eol()) {\n        if (stream.match(terminator)) {\n          state.tokenize = inText;\n          break;\n        }\n        stream.next();\n      }\n      return style;\n    };\n  }\n  function doctype(depth) {\n    return function(stream, state) {\n      var ch;\n      while ((ch = stream.next()) != null) {\n        if (ch == \"<\") {\n          state.tokenize = doctype(depth + 1);\n          return state.tokenize(stream, state);\n        } else if (ch == \">\") {\n          if (depth == 1) {\n            state.tokenize = inText;\n            break;\n          } else {\n            state.tokenize = doctype(depth - 1);\n            return state.tokenize(stream, state);\n          }\n        }\n      }\n      return \"meta\";\n    };\n  }\n\n  var curState, setStyle;\n  function pass() {\n    for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]);\n  }\n  function cont() {\n    pass.apply(null, arguments);\n    return true;\n  }\n\n  function pushContext(tagName, startOfLine) {\n    var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent);\n    curState.context = {\n      prev: curState.context,\n      tagName: tagName,\n      indent: curState.indented,\n      startOfLine: startOfLine,\n      noIndent: noIndent\n    };\n  }\n  function popContext() {\n    if (curState.context) curState.context = curState.context.prev;\n  }\n\n  function element(type) {\n    if (type == \"openTag\") {\n      curState.tagName = tagName;\n      return cont(attributes, endtag(curState.startOfLine));\n    } else if (type == \"closeTag\") {\n      var err = false;\n      if (curState.context) {\n        if (curState.context.tagName != tagName) {\n          if (Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())) {\n            popContext();\n          }\n          err = !curState.context || curState.context.tagName != tagName;\n        }\n      } else {\n        err = true;\n      }\n      if (err) setStyle = \"error\";\n      return cont(endclosetag(err));\n    }\n    return cont();\n  }\n  function endtag(startOfLine) {\n    return function(type) {\n      var tagName = curState.tagName;\n      curState.tagName = null;\n      if (type == \"selfcloseTag\" ||\n          (type == \"endTag\" && Kludges.autoSelfClosers.hasOwnProperty(tagName.toLowerCase()))) {\n        maybePopContext(tagName.toLowerCase());\n        return cont();\n      }\n      if (type == \"endTag\") {\n        maybePopContext(tagName.toLowerCase());\n        pushContext(tagName, startOfLine);\n        return cont();\n      }\n      return cont();\n    };\n  }\n  function endclosetag(err) {\n    return function(type) {\n      if (err) setStyle = \"error\";\n      if (type == \"endTag\") { popContext(); return cont(); }\n      setStyle = \"error\";\n      return cont(arguments.callee);\n    };\n  }\n  function maybePopContext(nextTagName) {\n    var parentTagName;\n    while (true) {\n      if (!curState.context) {\n        return;\n      }\n      parentTagName = curState.context.tagName.toLowerCase();\n      if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||\n          !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {\n        return;\n      }\n      popContext();\n    }\n  }\n\n  function attributes(type) {\n    if (type == \"word\") {setStyle = \"attribute\"; return cont(attribute, attributes);}\n    if (type == \"endTag\" || type == \"selfcloseTag\") return pass();\n    setStyle = \"error\";\n    return cont(attributes);\n  }\n  function attribute(type) {\n    if (type == \"equals\") return cont(attvalue, attributes);\n    if (!Kludges.allowMissing) setStyle = \"error\";\n    else if (type == \"word\") setStyle = \"attribute\";\n    return (type == \"endTag\" || type == \"selfcloseTag\") ? pass() : cont();\n  }\n  function attvalue(type) {\n    if (type == \"string\") return cont(attvaluemaybe);\n    if (type == \"word\" && Kludges.allowUnquoted) {setStyle = \"string\"; return cont();}\n    setStyle = \"error\";\n    return (type == \"endTag\" || type == \"selfCloseTag\") ? pass() : cont();\n  }\n  function attvaluemaybe(type) {\n    if (type == \"string\") return cont(attvaluemaybe);\n    else return pass();\n  }\n\n  return {\n    startState: function() {\n      return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null};\n    },\n\n    token: function(stream, state) {\n      if (stream.sol()) {\n        state.startOfLine = true;\n        state.indented = stream.indentation();\n      }\n      if (stream.eatSpace()) return null;\n\n      setStyle = type = tagName = null;\n      var style = state.tokenize(stream, state);\n      state.type = type;\n      if ((style || type) && style != \"comment\") {\n        curState = state;\n        while (true) {\n          var comb = state.cc.pop() || element;\n          if (comb(type || style)) break;\n        }\n      }\n      state.startOfLine = false;\n      return setStyle || style;\n    },\n\n    indent: function(state, textAfter, fullLine) {\n      var context = state.context;\n      if ((state.tokenize != inTag && state.tokenize != inText) ||\n          context && context.noIndent)\n        return fullLine ? fullLine.match(/^(\\s*)/)[0].length : 0;\n      if (alignCDATA && /<!\\[CDATA\\[/.test(textAfter)) return 0;\n      if (context && /^<\\//.test(textAfter))\n        context = context.prev;\n      while (context && !context.startOfLine)\n        context = context.prev;\n      if (context) return context.indent + indentUnit;\n      else return 0;\n    },\n\n    electricChars: \"/\",\n\n    configuration: parserConfig.htmlMode ? \"html\" : \"xml\"\n  };\n});\n\nCodeMirror.defineMIME(\"text/xml\", \"xml\");\nCodeMirror.defineMIME(\"application/xml\", \"xml\");\nif (!CodeMirror.mimeModes.hasOwnProperty(\"text/html\"))\n  CodeMirror.defineMIME(\"text/html\", {name: \"xml\", htmlMode: true});\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/ambiance-mobile.css",
    "content": ".cm-s-ambiance.CodeMirror {\n  -webkit-box-shadow: none;\n  -moz-box-shadow: none;\n  -o-box-shadow: none;\n  box-shadow: none;\n}\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/ambiance.css",
    "content": "/* ambiance theme for codemirror */\n\n/* Color scheme */\n\n.cm-s-ambiance .cm-keyword { color: #cda869; }\n.cm-s-ambiance .cm-atom { color: #CF7EA9; }\n.cm-s-ambiance .cm-number { color: #78CF8A; }\n.cm-s-ambiance .cm-def { color: #aac6e3; }\n.cm-s-ambiance .cm-variable { color: #ffb795; }\n.cm-s-ambiance .cm-variable-2 { color: #eed1b3; }\n.cm-s-ambiance .cm-variable-3 { color: #faded3; }\n.cm-s-ambiance .cm-property { color: #eed1b3; }\n.cm-s-ambiance .cm-operator {color: #fa8d6a;}\n.cm-s-ambiance .cm-comment { color: #555; font-style:italic; }\n.cm-s-ambiance .cm-string { color: #8f9d6a; }\n.cm-s-ambiance .cm-string-2 { color: #9d937c; }\n.cm-s-ambiance .cm-meta { color: #D2A8A1; }\n.cm-s-ambiance .cm-error { color: #AF2018; }\n.cm-s-ambiance .cm-qualifier { color: yellow; }\n.cm-s-ambiance .cm-builtin { color: #9999cc; }\n.cm-s-ambiance .cm-bracket { color: #24C2C7; }\n.cm-s-ambiance .cm-tag { color: #fee4ff }\n.cm-s-ambiance .cm-attribute {  color: #9B859D; }\n.cm-s-ambiance .cm-header {color: blue;}\n.cm-s-ambiance .cm-quote { color: #24C2C7; }\n.cm-s-ambiance .cm-hr { color: pink; }\n.cm-s-ambiance .cm-link { color: #F4C20B; }\n.cm-s-ambiance .cm-special { color: #FF9D00; }\n\n.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; }\n.cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; }\n\n.cm-s-ambiance .CodeMirror-selected {\n  background: rgba(255, 255, 255, 0.15);\n}\n.cm-s-ambiance .CodeMirror-focused .CodeMirror-selected {\n  background: rgba(255, 255, 255, 0.10);\n}\n\n/* Editor styling */\n\n.cm-s-ambiance.CodeMirror {\n  line-height: 1.40em;\n  font-family: Monaco, Menlo,\"Andale Mono\",\"lucida console\",\"Courier New\",monospace !important;\n  color: #E6E1DC;\n  background-color: #202020;\n  -webkit-box-shadow: inset 0 0 10px black;\n  -moz-box-shadow: inset 0 0 10px black;\n  -o-box-shadow: inset 0 0 10px black;\n  box-shadow: inset 0 0 10px black;\n}\n\n.cm-s-ambiance .CodeMirror-gutters {\n  background: #3D3D3D;\n  border-right: 1px solid #4D4D4D;\n  box-shadow: 0 10px 20px black;\n}\n\n.cm-s-ambiance .CodeMirror-linenumber {\n  text-shadow: 0px 1px 1px #4d4d4d;\n  color: #222;\n  padding: 0 5px;\n}\n\n.cm-s-ambiance .CodeMirror-lines .CodeMirror-cursor {\n  border-left: 1px solid #7991E8;\n}\n\n.cm-s-ambiance .activeline {\n  background: none repeat scroll 0% 0% rgba(255, 255, 255, 0.031);\n}\n\n.cm-s-ambiance.CodeMirror,\n.cm-s-ambiance .CodeMirror-gutters {\n  background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC\");\n}\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/blackboard.css",
    "content": "/* Port of TextMate's Blackboard theme */\n\n.cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; }\n.cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; }\n.cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; }\n.cm-s-blackboard .CodeMirror-linenumber { color: #888; }\n.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; }\n\n.cm-s-blackboard .cm-keyword { color: #FBDE2D; }\n.cm-s-blackboard .cm-atom { color: #D8FA3C; }\n.cm-s-blackboard .cm-number { color: #D8FA3C; }\n.cm-s-blackboard .cm-def { color: #8DA6CE; }\n.cm-s-blackboard .cm-variable { color: #FF6400; }\n.cm-s-blackboard .cm-operator { color: #FBDE2D;}\n.cm-s-blackboard .cm-comment { color: #AEAEAE; }\n.cm-s-blackboard .cm-string { color: #61CE3C; }\n.cm-s-blackboard .cm-string-2 { color: #61CE3C; }\n.cm-s-blackboard .cm-meta { color: #D8FA3C; }\n.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; }\n.cm-s-blackboard .cm-builtin { color: #8DA6CE; }\n.cm-s-blackboard .cm-tag { color: #8DA6CE; }\n.cm-s-blackboard .cm-attribute { color: #8DA6CE; }\n.cm-s-blackboard .cm-header { color: #FF6400; }\n.cm-s-blackboard .cm-hr { color: #AEAEAE; }\n.cm-s-blackboard .cm-link { color: #8DA6CE; }\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/cobalt.css",
    "content": ".cm-s-cobalt.CodeMirror { background: #002240; color: white; }\n.cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; }\n.cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }\n.cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; }\n.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; }\n\n.cm-s-cobalt span.cm-comment { color: #08f; }\n.cm-s-cobalt span.cm-atom { color: #845dc4; }\n.cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; }\n.cm-s-cobalt span.cm-keyword { color: #ffee80; }\n.cm-s-cobalt span.cm-string { color: #3ad900; }\n.cm-s-cobalt span.cm-meta { color: #ff9d00; }\n.cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; }\n.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; }\n.cm-s-cobalt span.cm-error { color: #9d1e15; }\n.cm-s-cobalt span.cm-bracket { color: #d8d8d8; }\n.cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; }\n.cm-s-cobalt span.cm-link { color: #845dc4; }\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/eclipse.css",
    "content": ".cm-s-eclipse span.cm-meta {color: #FF1717;}\n.cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; }\n.cm-s-eclipse span.cm-atom {color: #219;}\n.cm-s-eclipse span.cm-number {color: #164;}\n.cm-s-eclipse span.cm-def {color: #00f;}\n.cm-s-eclipse span.cm-variable {color: black;}\n.cm-s-eclipse span.cm-variable-2 {color: #0000C0;}\n.cm-s-eclipse span.cm-variable-3 {color: #0000C0;}\n.cm-s-eclipse span.cm-property {color: black;}\n.cm-s-eclipse span.cm-operator {color: black;}\n.cm-s-eclipse span.cm-comment {color: #3F7F5F;}\n.cm-s-eclipse span.cm-string {color: #2A00FF;}\n.cm-s-eclipse span.cm-string-2 {color: #f50;}\n.cm-s-eclipse span.cm-error {color: #f00;}\n.cm-s-eclipse span.cm-qualifier {color: #555;}\n.cm-s-eclipse span.cm-builtin {color: #30a;}\n.cm-s-eclipse span.cm-bracket {color: #cc7;}\n.cm-s-eclipse span.cm-tag {color: #170;}\n.cm-s-eclipse span.cm-attribute {color: #00c;}\n.cm-s-eclipse span.cm-link {color: #219;}\n\n.cm-s-eclipse .CodeMirror-matchingbracket {\n\tborder:1px solid grey;\n\tcolor:black !important;;\n}\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/elegant.css",
    "content": ".cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;}\n.cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;}\n.cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;}\n.cm-s-elegant span.cm-variable {color: black;}\n.cm-s-elegant span.cm-variable-2 {color: #b11;}\n.cm-s-elegant span.cm-qualifier {color: #555;}\n.cm-s-elegant span.cm-keyword {color: #730;}\n.cm-s-elegant span.cm-builtin {color: #30a;}\n.cm-s-elegant span.cm-error {background-color: #fdd;}\n.cm-s-elegant span.cm-link {color: #762;}\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/erlang-dark.css",
    "content": ".cm-s-erlang-dark.CodeMirror { background: #002240; color: white; }\n.cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; }\n.cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }\n.cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; }\n.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; }\n\n.cm-s-erlang-dark span.cm-atom       { color: #845dc4; }\n.cm-s-erlang-dark span.cm-attribute  { color: #ff80e1; }\n.cm-s-erlang-dark span.cm-bracket    { color: #ff9d00; }\n.cm-s-erlang-dark span.cm-builtin    { color: #eeaaaa; }\n.cm-s-erlang-dark span.cm-comment    { color: #7777ff; }\n.cm-s-erlang-dark span.cm-def        { color: #ee77aa; }\n.cm-s-erlang-dark span.cm-error      { color: #9d1e15; }\n.cm-s-erlang-dark span.cm-keyword    { color: #ffee80; }\n.cm-s-erlang-dark span.cm-meta       { color: #50fefe; }\n.cm-s-erlang-dark span.cm-number     { color: #ffd0d0; }\n.cm-s-erlang-dark span.cm-operator   { color: #dd1111; }\n.cm-s-erlang-dark span.cm-string     { color: #3ad900; }\n.cm-s-erlang-dark span.cm-tag        { color: #9effff; }\n.cm-s-erlang-dark span.cm-variable   { color: #50fe50; }\n.cm-s-erlang-dark span.cm-variable-2 { color: #ee00ee; }\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/lesser-dark.css",
    "content": "/*\nhttp://lesscss.org/ dark theme\nPorted to CodeMirror by Peter Kroon\n*/\n.cm-s-lesser-dark {\n  line-height: 1.3em;\n}\n.cm-s-lesser-dark {\n  font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', 'Monaco', Courier, monospace !important;\n}\n\n.cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; }\n.cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/\n.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; }\n.cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/\n\ndiv.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/\n\n.cm-s-lesser-dark .CodeMirror-gutters { background: #262626; border-right:1px solid #aaa; }\n.cm-s-lesser-dark .CodeMirror-linenumber { color: #777; }\n\n.cm-s-lesser-dark span.cm-keyword { color: #599eff; }\n.cm-s-lesser-dark span.cm-atom { color: #C2B470; }\n.cm-s-lesser-dark span.cm-number { color: #B35E4D; }\n.cm-s-lesser-dark span.cm-def {color: white;}\n.cm-s-lesser-dark span.cm-variable { color:#D9BF8C; }\n.cm-s-lesser-dark span.cm-variable-2 { color: #669199; }\n.cm-s-lesser-dark span.cm-variable-3 { color: white; }\n.cm-s-lesser-dark span.cm-property {color: #92A75C;}\n.cm-s-lesser-dark span.cm-operator {color: #92A75C;}\n.cm-s-lesser-dark span.cm-comment { color: #666; }\n.cm-s-lesser-dark span.cm-string { color: #BCD279; }\n.cm-s-lesser-dark span.cm-string-2 {color: #f50;}\n.cm-s-lesser-dark span.cm-meta { color: #738C73; }\n.cm-s-lesser-dark span.cm-error { color: #9d1e15; }\n.cm-s-lesser-dark span.cm-qualifier {color: #555;}\n.cm-s-lesser-dark span.cm-builtin { color: #ff9e59; }\n.cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; }\n.cm-s-lesser-dark span.cm-tag { color: #669199; }\n.cm-s-lesser-dark span.cm-attribute {color: #00c;}\n.cm-s-lesser-dark span.cm-header {color: #a0a;}\n.cm-s-lesser-dark span.cm-quote {color: #090;}\n.cm-s-lesser-dark span.cm-hr {color: #999;}\n.cm-s-lesser-dark span.cm-link {color: #00c;}\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/monokai.css",
    "content": "/* Based on Sublime Text's Monokai theme */\n\n.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;}\n.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}\n.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;}\n.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;}\n.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}\n\n.cm-s-monokai span.cm-comment {color: #75715e;}\n.cm-s-monokai span.cm-atom {color: #ae81ff;}\n.cm-s-monokai span.cm-number {color: #ae81ff;}\n\n.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;}\n.cm-s-monokai span.cm-keyword {color: #f92672;}\n.cm-s-monokai span.cm-string {color: #e6db74;}\n\n.cm-s-monokai span.cm-variable {color: #a6e22e;}\n.cm-s-monokai span.cm-variable-2 {color: #9effff;}\n.cm-s-monokai span.cm-def {color: #fd971f;}\n.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}\n.cm-s-monokai span.cm-bracket {color: #f8f8f2;}\n.cm-s-monokai span.cm-tag {color: #f92672;}\n.cm-s-monokai span.cm-link {color: #ae81ff;}\n\n.cm-s-monokai .CodeMirror-matchingbracket {\n  text-decoration: underline;\n  color: white !important;\n}\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/neat.css",
    "content": ".cm-s-neat span.cm-comment { color: #a86; }\n.cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; }\n.cm-s-neat span.cm-string { color: #a22; }\n.cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; }\n.cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; }\n.cm-s-neat span.cm-variable { color: black; }\n.cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; }\n.cm-s-neat span.cm-meta {color: #555;}\n.cm-s-neat span.cm-link { color: #3a3; }\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/night.css",
    "content": "/* Loosely based on the Midnight Textmate theme */\n\n.cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; }\n.cm-s-night div.CodeMirror-selected { background: #447 !important; }\n.cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }\n.cm-s-night .CodeMirror-linenumber { color: #f8f8f8; }\n.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }\n\n.cm-s-night span.cm-comment { color: #6900a1; }\n.cm-s-night span.cm-atom { color: #845dc4; }\n.cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; }\n.cm-s-night span.cm-keyword { color: #599eff; }\n.cm-s-night span.cm-string { color: #37f14a; }\n.cm-s-night span.cm-meta { color: #7678e2; }\n.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }\n.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }\n.cm-s-night span.cm-error { color: #9d1e15; }\n.cm-s-night span.cm-bracket { color: #8da6ce; }\n.cm-s-night span.cm-comment { color: #6900a1; }\n.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }\n.cm-s-night span.cm-link { color: #845dc4; }\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/rubyblue.css",
    "content": ".cm-s-rubyblue { font:13px/1.4em Trebuchet, Verdana, sans-serif; }\t/* - customized editor font - */\n\n.cm-s-rubyblue.CodeMirror { background: #112435; color: white; }\n.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; }\n.cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; }\n.cm-s-rubyblue .CodeMirror-linenumber { color: white; }\n.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; }\n\n.cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; }\n.cm-s-rubyblue span.cm-atom { color: #F4C20B; }\n.cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; }\n.cm-s-rubyblue span.cm-keyword { color: #F0F; }\n.cm-s-rubyblue span.cm-string { color: #F08047; }\n.cm-s-rubyblue span.cm-meta { color: #F0F; }\n.cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; }\n.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; }\n.cm-s-rubyblue span.cm-error { color: #AF2018; }\n.cm-s-rubyblue span.cm-bracket { color: #F0F; }\n.cm-s-rubyblue span.cm-link { color: #F4C20B; }\n.cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; }\n.cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; }\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/solarized.css",
    "content": "/*\nSolarized theme for code-mirror\nhttp://ethanschoonover.com/solarized\n*/\n\n/*\nSolarized color pallet\nhttp://ethanschoonover.com/solarized/img/solarized-palette.png\n*/\n\n.solarized.base03 { color: #002b36; }\n.solarized.base02 { color: #073642; }\n.solarized.base01 { color: #586e75; }\n.solarized.base00 { color: #657b83; }\n.solarized.base0 { color: #839496; }\n.solarized.base1 { color: #93a1a1; }\n.solarized.base2 { color: #eee8d5; }\n.solarized.base3  { color: #fdf6e3; }\n.solarized.solar-yellow  { color: #b58900; }\n.solarized.solar-orange  { color: #cb4b16; }\n.solarized.solar-red { color: #dc322f; }\n.solarized.solar-magenta { color: #d33682; }\n.solarized.solar-violet  { color: #6c71c4; }\n.solarized.solar-blue { color: #268bd2; }\n.solarized.solar-cyan { color: #2aa198; }\n.solarized.solar-green { color: #859900; }\n\n/* Color scheme for code-mirror */\n\n.cm-s-solarized {\n  line-height: 1.45em;\n  font-family: Menlo,Monaco,\"Andale Mono\",\"lucida console\",\"Courier New\",monospace !important;\n  color-profile: sRGB;\n  rendering-intent: auto;\n}\n.cm-s-solarized.cm-s-dark {\n  color: #839496;\n  background-color:  #002b36;\n  text-shadow: #002b36 0 1px;\n}\n.cm-s-solarized.cm-s-light {\n  background-color: #fdf6e3;\n  color: #657b83;\n  text-shadow: #eee8d5 0 1px;\n}\n\n.cm-s-solarized .CodeMirror-widget {\n  text-shadow: none;\n}\n\n\n.cm-s-solarized .cm-keyword { color: #cb4b16 }\n.cm-s-solarized .cm-atom { color: #d33682; }\n.cm-s-solarized .cm-number { color: #d33682; }\n.cm-s-solarized .cm-def { color: #2aa198; }\n\n.cm-s-solarized .cm-variable { color: #268bd2; }\n.cm-s-solarized .cm-variable-2 { color: #b58900; }\n.cm-s-solarized .cm-variable-3 { color: #6c71c4; }\n\n.cm-s-solarized .cm-property { color: #2aa198; }\n.cm-s-solarized .cm-operator {color: #6c71c4;}\n\n.cm-s-solarized .cm-comment { color: #586e75; font-style:italic; }\n\n.cm-s-solarized .cm-string { color: #859900; }\n.cm-s-solarized .cm-string-2 { color: #b58900; }\n\n.cm-s-solarized .cm-meta { color: #859900; }\n.cm-s-solarized .cm-error,\n.cm-s-solarized .cm-invalidchar {\n  color: #586e75;\n  border-bottom: 1px dotted #dc322f;\n}\n.cm-s-solarized .cm-qualifier { color: #b58900; }\n.cm-s-solarized .cm-builtin { color: #d33682; }\n.cm-s-solarized .cm-bracket { color: #cb4b16; }\n.cm-s-solarized .CodeMirror-matchingbracket { color: #859900; }\n.cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; }\n.cm-s-solarized .cm-tag { color: #93a1a1 }\n.cm-s-solarized .cm-attribute {  color: #2aa198; }\n.cm-s-solarized .cm-header { color: #586e75; }\n.cm-s-solarized .cm-quote { color: #93a1a1; }\n.cm-s-solarized .cm-hr {\n  color: transparent;\n  border-top: 1px solid #586e75;\n  display: block;\n}\n.cm-s-solarized .cm-link { color: #93a1a1; cursor: pointer; }\n.cm-s-solarized .cm-special { color: #6c71c4; }\n.cm-s-solarized .cm-em {\n  color: #999;\n  text-decoration: underline;\n  text-decoration-style: dotted;\n}\n.cm-s-solarized .cm-strong { color: #eee; }\n.cm-s-solarized .cm-tab:before {\n  content: \"➤\";   /*visualize tab character*/\n  color: #586e75;\n}\n\n.cm-s-solarized.cm-s-dark .CodeMirror-focused .CodeMirror-selected {\n  background: #386774;\n  color: inherit;\n}\n\n.cm-s-solarized.cm-s-dark ::selection {\n  background: #386774;\n  color: inherit;\n}\n\n.cm-s-solarized.cm-s-dark .CodeMirror-selected {\n  background: #586e75;\n}\n\n.cm-s-solarized.cm-s-light .CodeMirror-focused .CodeMirror-selected {\n  background: #eee8d5;\n  color: inherit;\n}\n\n.cm-s-solarized.cm-s-light ::selection {\n  background: #eee8d5;\n  color: inherit;\n}\n\n.cm-s-solarized.cm-s-light .CodeMirror-selected {\n  background: #93a1a1;\n}\n\n\n\n/* Editor styling */\n\n\n\n/* Little shadow on the view-port of the buffer view */\n.cm-s-solarized.CodeMirror {\n  -moz-box-shadow: inset 7px 0 12px -6px #000;\n  -webkit-box-shadow: inset 7px 0 12px -6px #000;\n  box-shadow: inset 7px 0 12px -6px #000;\n}\n\n/* Gutter border and some shadow from it  */\n.cm-s-solarized .CodeMirror-gutters {\n  padding: 0 15px 0 10px;\n  box-shadow: 0 10px 20px black;\n  border-right: 1px solid;\n}\n\n/* Gutter colors and line number styling based of color scheme (dark / light) */\n\n/* Dark */\n.cm-s-solarized.cm-s-dark .CodeMirror-gutters {\n  background-color: #073642;\n  border-color: #00232c;\n}\n\n.cm-s-solarized.cm-s-dark .CodeMirror-linenumber {\n  text-shadow: #021014 0 -1px;\n}\n\n/* Light */\n.cm-s-solarized.cm-s-light .CodeMirror-gutters {\n  background-color: #eee8d5;\n  border-color: #eee8d5;\n}\n\n/* Common */\n.cm-s-solarized .CodeMirror-linenumber {\n  color: #586e75;\n}\n\n.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text {\n  color: #586e75;\n}\n\n.cm-s-solarized .CodeMirror-lines {\n  padding-left: 5px;\n}\n\n.cm-s-solarized .CodeMirror-lines .CodeMirror-cursor {\n  border-left: 1px solid #819090;\n}\n\n/*\nActive line. Negative margin compensates left padding of the text in the\nview-port\n*/\n.cm-s-solarized .activeline {\n  margin-left: -20px;\n}\n\n.cm-s-solarized.cm-s-dark .activeline {\n  background: rgba(255, 255, 255, 0.05);\n\n}\n.cm-s-solarized.cm-s-light .activeline {\n  background: rgba(0, 0, 0, 0.05);\n}\n\n/*\nView-port and gutter both get little noise background to give it a real feel.\n*/\n.cm-s-solarized.CodeMirror,\n.cm-s-solarized .CodeMirror-gutters {\n  background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC\");\n}\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/twilight.css",
    "content": ".cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/\n.cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/\n\n.cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; }\n.cm-s-twilight .CodeMirror-linenumber { color: #aaa; }\n.cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white !important; }\n\n.cm-s-twilight .cm-keyword {  color: #f9ee98; } /**/\n.cm-s-twilight .cm-atom { color: #FC0; }\n.cm-s-twilight .cm-number { color:  #ca7841; } /**/\n.cm-s-twilight .cm-def { color: #8DA6CE; }\n.cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/\n.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/\n.cm-s-twilight .cm-operator { color: #cda869; } /**/\n.cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/\n.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/\n.cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/\n.cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/\n.cm-s-twilight .cm-error { border-bottom: 1px solid red; }\n.cm-s-twilight .cm-builtin { color: #cda869; } /*?*/\n.cm-s-twilight .cm-tag { color: #997643; } /**/\n.cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/\n.cm-s-twilight .cm-header { color: #FF6400; }\n.cm-s-twilight .cm-hr { color: #AEAEAE; }\n.cm-s-twilight .cm-link {   color:#ad9361; font-style:italic; text-decoration:none; } /**/\n\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/vibrant-ink.css",
    "content": "/* Taken from the popular Visual Studio Vibrant Ink Schema */\n\n.cm-s-vibrant-ink.CodeMirror { background: black; color: white; }\n.cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; }\n\n.cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }\n.cm-s-vibrant-ink .CodeMirror-linenumber { color: #d0d0d0; }\n.cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; }\n\n.cm-s-vibrant-ink .cm-keyword {  color: #CC7832; }\n.cm-s-vibrant-ink .cm-atom { color: #FC0; }\n.cm-s-vibrant-ink .cm-number { color:  #FFEE98; }\n.cm-s-vibrant-ink .cm-def { color: #8DA6CE; }\n.cm-s-vibrant-ink span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #FFC66D }\n.cm-s-vibrant-ink span.cm-variable-3, .cm-s-cobalt span.cm-def { color: #FFC66D }\n.cm-s-vibrant-ink .cm-operator { color: #888; }\n.cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; }\n.cm-s-vibrant-ink .cm-string { color:  #A5C25C }\n.cm-s-vibrant-ink .cm-string-2 { color: red }\n.cm-s-vibrant-ink .cm-meta { color: #D8FA3C; }\n.cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; }\n.cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; }\n.cm-s-vibrant-ink .cm-tag { color: #8DA6CE; }\n.cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; }\n.cm-s-vibrant-ink .cm-header { color: #FF6400; }\n.cm-s-vibrant-ink .cm-hr { color: #AEAEAE; }\n.cm-s-vibrant-ink .cm-link { color: blue; }\n"
  },
  {
    "path": "extensions/queries/resources/codemirror/theme/xq-dark.css",
    "content": "/*\nCopyright (C) 2011 by MarkLogic Corporation\nAuthor: Mike Brevoort <mike@brevoort.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n.cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; }\n.cm-s-xq-dark span.CodeMirror-selected { background: #a8f !important; }\n.cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }\n.cm-s-xq-dark .CodeMirror-linenumber { color: #f8f8f8; }\n.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; }\n\n.cm-s-xq-dark span.cm-keyword {color: #FFBD40;}\n.cm-s-xq-dark span.cm-atom {color: #6C8CD5;}\n.cm-s-xq-dark span.cm-number {color: #164;}\n.cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;}\n.cm-s-xq-dark span.cm-variable {color: #FFF;}\n.cm-s-xq-dark span.cm-variable-2 {color: #EEE;}\n.cm-s-xq-dark span.cm-variable-3 {color: #DDD;}\n.cm-s-xq-dark span.cm-property {}\n.cm-s-xq-dark span.cm-operator {}\n.cm-s-xq-dark span.cm-comment {color: gray;}\n.cm-s-xq-dark span.cm-string {color: #9FEE00;}\n.cm-s-xq-dark span.cm-meta {color: yellow;}\n.cm-s-xq-dark span.cm-error {color: #f00;}\n.cm-s-xq-dark span.cm-qualifier {color: #FFF700;}\n.cm-s-xq-dark span.cm-builtin {color: #30a;}\n.cm-s-xq-dark span.cm-bracket {color: #cc7;}\n.cm-s-xq-dark span.cm-tag {color: #FFBD40;}\n.cm-s-xq-dark span.cm-attribute {color: #FFF700;}\n"
  },
  {
    "path": "extensions/queries/resources/querieseditor.css",
    "content": "/**\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n.configModules {\n    clear: left;\n}\n\n.width49 {\n    width: 49%;\n}\n.margin {\n    margin: 0.5%;\n}\n.float {\n    float: left;\n}\n"
  },
  {
    "path": "extensions/queries/resources/savepartial.js",
    "content": "/**\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n$(document).ready(function() {\n    $(\"#savequerybutton\").click(function(){\n    var box = $(\"#editortype\");\n    if(box.val() == \"querybuilder\"){\n      $.get(urlBase+\"querybuilder/updatesparql\", {json: $('#hidden_json').val() , limit: $(\"#limit\").val()}, function(query){\n        $.ajax({\n          url: urlBase + \"queries/savequery\",\n          type: \"POST\",\n          data: ({\n          json: $('#hidden_json').val(),\n          name: $('#qname').val(),\n          qdesc: $('#qdesc').val(),\n          \"query\": query,\n          generator: \"qb\",\n          share: $(\"#savequerysharecheckbox\").is(':checked') ? \"true\" : \"false\"\n          }),\n          dataType: \"text\",\n          success: function(msg){\n           //TODO check for status\n           if(msg != \"All OK\")\n            alert(\"Fehler \"+msg);\n           //open(urlBase + \"querybuilding/listquery\");\n          }\n        });\n\n      });\n\n    } else if(box.val() == \"graphicalquerybuilder\"){\n      if (!GQB.view.selectedViewClass) {alert(GQB.translate(\"noPatternSelMsg\"));return;}\n      var modelPattern = GQB.view.selectedViewClass.parentViewPattern.modelPattern;\n      if (!modelPattern) return;  // sollte nicht passieren, ist schwerer Fehler\n      modelPattern.name = $('#qname').val();\n      modelPattern.description= $('#qdesc').val();\n      modelPattern.save();\n\n    } else if(box.val() == \"queryeditor\"){\n      $.ajax({\n          url: urlBase + \"queries/savequery\",\n          type: \"POST\",\n          data: ({\n          json: \"\",\n          name: $('#qname').val(),\n          \"query\": editor.getValue(),\n          generator: \"qe\",\n          //share: $(\"#savequerysharecheckbox\").is(':checked') ? \"true\" : \"false\"\n          share: \"true\"\n          }),\n          dataType: \"text\",\n                error: function(xmlHttpObj, type, error){\n                  alert (\"error\");\n                },\n          success: function(msg){\n           //TODO check for status\n           if (msg != \"All OK\") {\n            alert(\"Fehler \" + msg);\n           } else {\n            $('.innercontent').prepend(\"<p class=\\\"messagebox info\\\" id=\\\"savequerynotification\\\">The Query was saved</p>\");\n            \n            setTimeout(function (){\n              $(\"#savequerynotification\").remove();\n            }, 5000);\n           }\n           //open(urlBase + \"querybuilding/listquery\");\n          }\n        });\n    } else {\n      alert(\"error: dont know which builder this is\");\n    }\n    \n    \n  \n  });\n  $('#qname').innerLabel();\n});"
  },
  {
    "path": "extensions/queries/templates/partials/list_queries_element.phtml",
    "content": "<li class=\"<?php echo $this->odd ? 'odd' : 'even'; ?>\">\n<?php if ($this->instance['type'] == 'uri')\n{\n    $entry = $this->instanceData[$this->instanceUri];\n    $numViews = isset($entry['numViews'][0]['value']) ? $entry['numViews'][0]['value'] : 0;\n    $generator = isset($entry['generator'][0]['value']) ? $entry['generator'][0]['value'] : '';\n?>\n    <div class=\"has-contextmenu-area\" >\n        <h3>\n            <span class=\"name\">\"<?php echo $entry['name'][0]['value']; ?>\"</span>\n            <span class=\"views\">(<?php echo $numViews ?> views)</span>\n        </h3>\n        open with:\n<?php\n    //always show link to queryeditor\n    $QEurl = new OntoWiki_Url(array('controller' => 'queries', 'action'=>'editor'), array());\n    $QEurl->queryUri = $this->instanceUri;\n?>\n        <a class=\"minibutton\" href=\"<?php echo $QEurl; ?>\">Editor</a>\n<?php\n    //if possible show link to original editor\n    if($generator == \"qb\") {\n        $url = new OntoWiki_Url(array('controller' => 'querybuilder', 'action'=>'manage'), array());\n        $url->patterns = $entry[\"json\"][0][\"value\"];\n        ?> <a class=\"minibutton\" href=\"<?php echo $url; ?>\"><?php echo $generator; ?></a> <?php\n    } elseif ($generator == \"gqb\") {\n        $url = new OntoWiki_Url(array('controller' => 'graphicalquerybuilder', 'action'=>'display'), array());\n        $url->open = \"true\";\n        $url->queryuri = $entry[\"query\"][0][\"value\"];\n        ?> <a class=\"minibutton\" href=\"<?php echo $url; ?>\"><?php echo $generator; ?></a> <?php\n    }\n}\n?>\n    </div>\n</li>\n"
  },
  {
    "path": "extensions/queries/templates/partials/list_queries_main.phtml",
    "content": "<?php $odd = true;\nif ($this->instances->hasData()): ?>\n<ol class=\"bullets-none separated\">\n    <?php foreach ($this->instanceInfo as $instance){\n        //fixme\n        $parts = explode(\"/\", $instance['uri']);\n        $name = $parts[count($parts)-1]; //last part of the uri\n            echo $this->partial('partials/list_queries_element.phtml',\n                array(\n                    'instanceUri'  => $instance['uri'],\n                    'instance'     => $instance,\n                    'instanceData' => $this->instanceData,\n                    'instanceInfo' => $this->instanceInfo,\n                    'propertyInfo' => $this->propertyInfo,\n                    'odd'          => $odd\n                )\n             );\n            $odd = !$odd;\n        } ?>\n</ol>\n    <?php else: ?>\n<p class=\"messagebox info\"><?php echo $this->_('No queries found.') ?></p>\n    <?php endif; ?>\n\n\n"
  },
  {
    "path": "extensions/queries/templates/queries/editor.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2013, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki query editor template\n */\n?>\n\n<?php\nif (isset($this->errorFlag) && $this->errorFlag !== false) {\n    return;\n}\n?>\n\n<input id=\"editortype\" type=\"hidden\" value=\"queryeditor\" />\n<div class=\"configMmodules\">\n<div class=\"width49 float margin\">\n<strong><?php echo $this->_('Output Format') ?></strong>\n<?php echo $this->render('sparqloptions.phtml') ?>\n</div>\n<div class=\"width49 float margin\">\n<strong><?php echo $this->_('Query Source') ?></strong>\n<?php echo $this->render('queryeditorfromsetter.phtml') ?>\n</div>\n</div>\n<p class=\"messagebox info\"><?php echo $this->_('Predefined namespaces') ?>:\n<?php $i = 0; ?>\n<?php foreach ($this->prefixes as $prefix => $namespace): ?>\n    <a href=\"<?php echo $namespace ?>\" \n       title=\"<?php echo $namespace ?>\"><?php echo $prefix ?></a><?php if (++$i < count($this->prefixes)) echo ', ' ?>\n<?php endforeach ?>\n</p>\n<p class=\"messagebox info\" id=\"resourceuri-hint\">\n    <?php echo $this->_('You have to specify a projection variable called “?resourceUri” if you want to use the default list') ?>\n</p>\n<fieldset>\n    <div>\n    <textarea id=\"inputfield\" class=\"width99 code-input\" name=\"query\"><?php echo $this->query ?></textarea>\n    </div>\n<?php if ($this->has('error')): ?>\n    <fieldset>\n        <div class=\"messagebox error\"><?php echo nl2br($this->escape($this->error)) ?></div>\n    </fieldset>\n<?php endif; ?>\n\n<?php if (isset($this->data)): ?>\n    <p class=\"messagebox info\">\n        <?php echo sprintf($this->_('Query execution took %1$d ms.'), $this->time) ?>\n    </p>\n    <fieldset>\n        <?php if (is_array($this->data)): ?>\n            <?php \n            if(class_exists(\"QuerybuildingHelper\")){\n                echo $this->partial('partials/resultset.phtml', array('data' => $this->data, 'header' => $this->header, 'caption'=>'Results', 'urlBase' => $this->urlBase));\n            } else {\n                echo $this->partial(\n                    'partials/table.phtml',\n                    array(\n                        'data' => $this->data,\n                        'header' => $this->header,\n                        'tableClass' => 'query-result',\n                        'querylink' => true\n                    )\n                );\n            }\n            ?>\n        <?php else: ?>\n            <pre><?php echo $this->escape($this->data) ?></pre>\n        <?php endif; ?>\n    </fieldset>\n<?php endif; ?>\n</fieldset>\n\n<script type=\"text/javascript\">\n// make sure jQuery is included\nif (typeof jQuery != 'undefined') {\n    function insertModelUri() {\n        editor.setCode(editor.getValue() + '<<?php echo $this->modelUri ?>>');\n    }\n\n    function insertResourceUri() {\n        editor.setCode(editor.getValue()  + '<<?php echo (isset($this->resourceUri) ? $this->resourceUri : \"\") ?>>');\n    }\n}\n</script>\n"
  },
  {
    "path": "extensions/queries/templates/queries/listquery.phtml",
    "content": "click a button to open query"
  },
  {
    "path": "extensions/queries/templates/queries/manage.phtml",
    "content": "<?php\n\n$patterns = json_decode($this->tPattern,true);\n\n// fills the sidewindow space\nif(class_exists(\"QuerybuildingHelper\")){\n$this->placeholder('main.window.innerwindows')->append(\n        $this->partial('partials/window.phtml', array(\n                'headinglevel' => 2,\n                'title'        => $this->_('Save Query'),\n                'content'      => $this->partial('partials/savepartial.phtml'),\n                'cssClasses'   => 'querybuilder',\n                'cssId'        => 'savebox'\n        ))\n);\n}\n?>\n<fieldset>\n<fieldset id=\"debugquery\" style=\"display: none\">\n<legend><?php echo $this->_('Debug Code') ?></legend>\n<textarea style=\"min-height:3em;\" class=\"width99\" id='autocompletionquery' disabled></textarea>\n</fieldset>\n\n<fieldset>\n<legend><?php echo $this->_('Graph Pattern') ?></legend>\n\n<table class=\"separated-vertical\">\n    <tr>\n        <th width=\"20%\"><?php echo $this->_('Subject') ?></th>\n        <th width=\"20%\"><?php echo $this->_('Predicate') ?></th>\n        <th width=\"20%\"><?php echo $this->_('Object') ?></th>\n        <th width=\"20%\"><?php echo $this->_('Options') ?></th>\n    </tr>\n    <?php\n    \tforeach($patterns as $key=>$pattern): \n    \t$in = 'id=\"'.$key.'\"';\n    \t?>\n        <tr <?php echo $in; ?> class=\"triplepattern\">\n            <td><input type=\"text\" class=\"text width25 pattern\" name=\"s\"  value=\"<?php echo  $pattern['s']; ?>\" /></td>\n            <td><input type=\"text\" class=\"text width25 pattern\" name=\"p\"  value=\"<?php echo $pattern['p']; ?>\" /></td>\n            <td><input type=\"text\" class=\"text width25 pattern\" name=\"o\"  value=\"<?php echo $pattern['o']; ?>\" /></td>\n            <td>\n                <img class=\"qb-addtp\" src=\"<?php echo $this->themeUrlBase ?>/images/icon-add.png\" title=\"<?php echo $this->_('Add triple pattern') ?>\" />\n                <img class=\"qb-deltp\" src=\"<?php echo $this->themeUrlBase ?>/images/icon-delete.png\" title=\"<?php echo $this->_('Remove this triple pattern') ?>\" />\n            </td>\n        </tr>\n    <?php endforeach; ?>\n</table>\n</fieldset>\n\n<fieldset id=\"showquery\" style=\"display: none\">\n<legend><?php echo $this->_('SPARQL Code') ?></legend>\n<textarea style=\"min-height:8em;\" class=\"width99\" id='showquerytextarea' readonly></textarea>\n</fieldset>\n\n\n<fieldset >\n<legend><?php echo $this->_('Query Results') ?></legend>\n<form style=\"float:right; margin-right:5em;\">Results:&nbsp;<select id=\"limit\" ><option value=\"10\">10</option><option value=\"50\">50</option><option value=\"100\">100</option></select></form>\n</fieldset>\n\n</fieldset>\n\n\n<?php"
  },
  {
    "path": "extensions/queries/templates/queries/savequery.phtml",
    "content": "<?php // empty template to avoid Zend_Exception on missing templates ?>\n"
  },
  {
    "path": "extensions/queries/templates/queryeditorfromsetter.phtml",
    "content": "<?php\n\n/**\n * OntoWiki query target template\n *\n */\n\n?>\n<div>\n    <p class=\"messagebox info\">Which Model do you want to query?</p>\n    <input type=\"radio\" class=\"radio\" name=\"target\" id=\"target_this\" value=\"this\"\n\t    <?php if ($this->placeholder('sparql.query.target') == 'this'): ?>\n\t        <?php echo ' checked=\"checked\"' ?>\n\t    <?php endif; ?>\n\t/>\n\t<label for=\"target_this\" class=\"checkboxradio\"><?php echo $this->_('this model') ?></label>\n\t<br class=\"clearall\" />\n\t<input type=\"radio\" class=\"radio\" name=\"target\" id=\"target_all\" value=\"all\"\n\t<?php if ($this->placeholder('sparql.query.target') == 'all'): ?>\n        <?php echo ' checked=\"checked\"' ?>\n    <?php endif; ?>\n\t/>\n\t<label for=\"target_all\" class=\"checkboxradio\">all models</label>\n\t<br class=\"clearall\">\n</div>\n"
  },
  {
    "path": "extensions/queries/templates/savequery.phtml",
    "content": "<p class=\"messagebox info\"><?php echo $this->_('If you think your query can be useful for others, please share it.') ?></p>\n<p>\n    <input type=\"text\" class=\"text width98 inner-label\"  id=\"qname\" value=\"<?php echo $this->_('name of query') ?>\" maxlength=\"20\" />\n    </p><p>\n    <input id=\"hidden_query\" type=\"hidden\"  value=\"\"/>\n    <input id=\"hidden_json\" type=\"hidden\" value=\"\"/>\n    <input id=\"savequerysharecheckbox\" type=\"checkbox\"> share with others\n</p>\n<a id = 'savequerybutton' class=\"button submit\"><span><?php echo $this->_('Save Query'); ?></span></a>"
  },
  {
    "path": "extensions/queries/templates/sparqloptions.phtml",
    "content": "<?php\n\n/**\n * OntoWiki sparqloptions template\n */\n\n?>\n<div>\n    <input type=\"radio\" class=\"radio\" name=\"result_format\" id=\"result_format_plain\" value=\"plain\"\n    <?php if ($this->placeholder('sparql.result.format') == 'plain'): ?>\n        <?php echo ' checked=\"checked\"' ?>\n    <?php endif; ?>\n    />\n    <label for=\"result_format_plain\" class=\"checkboxradio\"><?php echo $this->_('Inline List') ?></label>\n    <br class=\"clearall\" />\n    <input type=\"radio\" class=\"radio\" name=\"result_format\" id=\"result_list\" value=\"list\"\n    <?php if ($this->placeholder('sparql.result.format') == 'list'): ?>\n        <?php echo ' checked=\"checked\"' ?>\n    <?php endif; ?>\n    />\n    <label for=\"result_list\" class=\"checkboxradio\"><?php echo $this->_('Default List') ?></label>\n    <br class=\"clearall\">\n    <hr>\n    <input type=\"radio\" class=\"radio\" name=\"result_format\" id=\"result_format_xml\" value=\"xml\"\n    <?php if ($this->placeholder('sparql.result.format') == 'xml'): ?>\n        <?php echo ' checked=\"checked\"' ?>\n    <?php endif; ?>\n    />\n    <label for=\"result_format_xml\" class=\"checkboxradio\"><a href=\"http://www.w3.org/TR/rdf-sparql-XMLres/\">XML</a></label>\n    <br class=\"clearall\">\n    <input type=\"radio\" class=\"radio\" name=\"result_format\" id=\"result_format_json\" value=\"json\"\n    <?php if ($this->placeholder('sparql.result.format') == 'json'): ?>\n        <?php echo ' checked=\"checked\"' ?>\n    <?php endif; ?>\n    />\n    <label for=\"result_format_json\" class=\"checkboxradio\"><a href=\"http://www.w3.org/TR/rdf-sparql-json-res/\">JSON</a></label>\n    <br class=\"clearall\">\n    <input type=\"radio\" class=\"radio\" name=\"result_format\" id=\"result_format_csv\" value=\"csv\"\n    <?php if ($this->placeholder('sparql.result.format') == 'csv'): ?>\n        <?php echo ' checked=\"checked\"' ?>\n    <?php endif; ?>\n    />\n    <label for=\"result_format_csv\" class=\"checkboxradio\"><a href=\"http://www.w3.org/TR/sparql11-results-csv-tsv/\">CSV</a></label>\n    <br class=\"clearall\">\n    <input type=\"checkbox\" class=\"checkbox\" name=\"result_outputfile\" id=\"result_outputfile\" value=\"true\"\n    <?php if ($this->placeholder('sparql.result.file') == 'true'): ?>\n        <?php echo ' checked=\"checked\"' ?>\n    <?php endif; ?>\n    />\n    <label for=\"result_outputfile\" class=\"checkboxradio\"><?php echo $this->_(\"Get as file\") ?></label>\n</div>\n<script type=\"text/javascript\">\n    var result_format_hint = function(){\n        if ($('input[name=result_format]:checked').val() == 'list') {\n            $('#resourceuri-hint').show();\n        } else {\n            $('#resourceuri-hint').hide();\n        }\n    }\n    $(document).ready(result_format_hint);\n    $('input[name=result_format]').change(result_format_hint);\n</script>\n"
  },
  {
    "path": "extensions/resourcecreationuri/ResourcecreationuriPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Plugin.php';\nrequire_once realpath(dirname(__FILE__)) . '/classes/ResourceUriGenerator.php';\n\n/**\n * Plugin that tries to make nice uris if new resources are created.\n *\n * @category   OntoWiki\n * @package    Extensions_Resourcecreationuri\n */\nclass ResourcecreationuriPlugin extends OntoWiki_Plugin\n{\n\n    /**\n     * @var Statements Array for statements to delete\n     */\n    private $_deleteData = array();\n\n    /**\n     * @var Statements Array for statements to insert\n     */\n    private $_insertData = array();\n\n    /**\n     * @var Erfurt_Rdf_Model (used with title helper)\n     */\n    private $_deleteModel = null;\n\n    /**\n     * @var Erfurt_Rdf_Model (used with title helper)\n     */\n    private $_insertModel = null;\n\n    /**\n     * Try to generate nice uri if new resource uri is found\n     *\n     * @param   $event triggered Erfurt_Event\n     *\n     * @return  null\n     */\n    public function onUpdateServiceAction($event)\n    {\n        // set values from event\n        $this->_insertModel = $event->insertModel;\n        $this->_insertData  = $event->insertData;\n        $this->_deleteModel = $event->deleteModel;\n        $this->_deleteData  = $event->deleteData;\n\n        $flag = false;\n\n        // SPARQL/Update can be DELETE only\n        // $_insertModel is null in this case\n        if ($this->_insertModel instanceof Erfurt_Rdf_Model) {\n            $subjectArray = array_keys($this->_insertData);\n            $subjectUri   = current($subjectArray);\n            $pattern      = '/^'\n                // URI Component\n                . addcslashes($this->_insertModel->getBaseUri() . $this->_privateConfig->newResourceUri, './')\n                // MD5 Component\n                . '\\/([A-Z]|[0-9]){32,32}'\n                . '/i';\n\n            $gen = new ResourceUriGenerator($this->_insertModel, $this->_pluginRoot . 'plugin.ini');\n\n            if (count($event->insertData) == 1 && preg_match($pattern, $subjectUri)) {\n                $newUri = $gen->generateUri($subjectUri, ResourceUriGenerator::FORMAT_RDFPHP, $this->_insertData);\n                $temp   = array();\n                foreach ($this->_insertData[$subjectUri] as $p => $o) {\n                    $temp[$newUri][$p] = $o;\n                }\n                $this->_insertData = $temp;\n                $flag             = true;\n            }\n        }\n\n        //writeback on event\n        $event->insertModel = $this->_insertModel;\n        $event->insertData  = $this->_insertData;\n        $event->deleteModel = $this->_deleteModel;\n        $event->deleteData  = $this->_deleteData;\n\n        if ($flag) {\n            $event->changes = array(\n                'original' => $subjectUri,\n                'changed'  => $newUri,\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/resourcecreationuri/classes/ResourceUriGenerator.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n *\n * Enter description here ...\n *\n * @category   OntoWiki\n * @package    Extensions_Resourcecreationuri\n * @author     criess\n *\n */\nclass ResourceUriGenerator\n{\n    /**\n     * @var Array that holds multibyte and special chars in UTF-8 to uri compatible chars.\n     *      All other non-alphanumeric will be deleted\n     */\n    private $_charTable\n        = array(\n            'Ä' => 'Ae',\n            'ä' => 'ae',\n            'Ü' => 'Ue',\n            'ü' => 'ue',\n            'Ö' => 'Oe',\n            'ö' => 'oe',\n            'ß' => 'ss',\n            'ẞ' => 'Ss',\n        );\n\n    private $_whiteSpaceTable\n        = array(\n            ' '     => '_',\n            PHP_EOL => '_',\n            ':'     => '_',\n        );\n\n    /**\n     *\n     * Enter description here ...\n     *\n     * @var array\n     */\n    private $_defaultConfig = array();\n\n    /**\n     *\n     * Enter description here ...\n     *\n     * @var OntoWiki (Application)\n     */\n    private $_owApp = null;\n\n    /**\n     *\n     * Enter description here ...\n     *\n     * @var Zend_Config\n     */\n    private $_config = null;\n\n    /**\n     *\n     * Enter description here ...\n     *\n     * @var Erfurt_Rdf_Model\n     */\n    private $_model = null;\n\n    /**\n     *\n     * Enter description here ...\n     *\n     * @var string\n     */\n    const FORMAT_RDFPHP = 'rdfphp';\n\n    /**\n     *\n     * Enter description here ...\n     *\n     * @var string\n     */\n    const FORMAT_SPARQL = 'sparql';\n\n    /**\n     * constructor\n     *\n     * @param $resourceUri\n     * @param $defaultModel\n     * @param $configPath\n     */\n    public function __construct($defaultModel = null, $configPath = null, $ow = null)\n    {\n        // check for ontowiki application\n        if ($ow === null || !($ow instanceof OntoWiki)) {\n            $this->_owApp = OntoWiki::getInstance();\n        } else {\n            $this->_owApp = $ow;\n        }\n\n        //get config\n        $config        = $this->_owApp->extensionManager->getExtensionConfig(\"resourcecreationuri\");\n        $this->_config = $config->private;\n\n        // check for defaultModel to work on\n        if ($defaultModel === null && $this->_owApp->selectedModel !== null) {\n            $this->_model = $this->_owApp->selectedModel;\n        } else {\n            if ($defaultModel !== null) {\n                $this->_model = $defaultModel;\n            } else {\n                $erroruri = (null === $defaultModel) ? 'null' : (string)$defaultModel;\n                throw new InvalidArgumentException('ResourceUriGenerator can\\'t load model with URI: ' . $erroruri);\n            }\n        }\n    }\n\n    /**\n     * set a new defaultmodel in which the resources should be created\n     *\n     * @param $defaultModel\n     */\n    public function setDefaultModel($defaultModel)\n    {\n        if ($defaultModel instanceof Erfurt_Rdf_Model) {\n            $this->_model = $defaultModel;\n        } else {\n            $this->_model = $this->erfurt->getStore()->getModel((string)$defaultModel);\n        }\n    }\n\n    /**\n     * Function generates nice URIs by certain rules (naming scheme and available resource data)\n     * Two modes are possible: live from store namingly 'sparql', or with memory model in rdfphp\n     * format to use 'rdfphp'.\n     *\n     * @param string $format (see class constants for possible values)\n     * @param array  $data   further data (in rdfphp-mode the insert statements)\n     *\n     * @return string generated 'nice' URI\n     */\n    public function generateUri($resourceUri, $format = self::FORMAT_SPARQL, $data = array())\n    {\n        $titleHelper = new OntoWiki_Model_TitleHelper($this->_model);\n\n        if (isset($this->_config->property->title)) {\n            $titleHelper->prependTitleProperty($this->_config->property->title);\n        }\n\n        // call format specific generation function\n        switch ($format) {\n            case self::FORMAT_SPARQL :\n                $return = $this->generateUriFromSparql($resourceUri, $titleHelper);\n                break;\n            case self::FORMAT_RDFPHP :\n                if (is_array($data) && count($data) > 0) {\n                    $newInstance = $data[$resourceUri];\n                    $return      = $this->generateUriFromRdfphp($resourceUri, $newInstance, $titleHelper);\n                }\n                break;\n        }\n\n        // check if resources with same prefix exist\n        if (($count = $this->countUriPattern($return)) > 0) {\n            $return .= '/' . $count;\n        }\n\n        return $return;\n    }\n\n    /**\n     *\n     * Enter description here ...\n     *\n     * @param   $uri         string to convert to nice uri\n     * @param   $titleHelper TitleHelper instance to use to get titles for URIs\n     */\n    private function generateUriFromSparql($uri, $titleHelper)\n    {\n        $schema     = $this->loadNamingSchema($uri);\n        $properties = array();\n\n        foreach ($schema as $element) {\n            if (is_string($this->_config->property->$element)) {\n                $properties[$this->_config->property->$element] = array('element' => $element, 'rank' => '1');\n            } elseif (is_array($this->_config->property->$element->toArray())) {\n                $countDeep = 0;\n                foreach ($this->_config->property->$element->toArray() as $elementDeep) {\n                    $properties[(string)$elementDeep] = array(\n                        'element' => $element, 'rank' => $countDeep++\n                    );\n                }\n            }\n        }\n\n        $query = new Erfurt_Sparql_Query2();\n        $sRef  = new Erfurt_Sparql_Query2_IriRef($uri);\n        $pVar  = new Erfurt_Sparql_Query2_Var('p');\n        $oVar  = new Erfurt_Sparql_Query2_Var('o');\n\n        $query->addProjectionVar($pVar);\n        $query->addProjectionVar($oVar);\n        $query->addTriple($sRef, $pVar, $oVar);\n        $query->addFrom((string)$this->_model);\n        $query->setLimit(100);\n        $query->setDistinct(true);\n\n        $container = new Erfurt_Sparql_Query2_ConditionalOrExpression();\n        foreach ($properties as $filterProp => $element) {\n            $sameTerm = new Erfurt_Sparql_Query2_sameTerm($pVar, new Erfurt_Sparql_Query2_IriRef($filterProp));\n            $container->addElement($sameTerm);\n        }\n\n        $query->addFilter($container);\n\n        $result = $this->_owApp->erfurt->getStore()->sparqlQuery(\n            $query, array('withImports' => true)\n        );\n\n        $replacements = array();\n\n        foreach ($result as $row) {\n            if (array_key_exists($row['p'], $properties)) {\n                $titleHelper->addResource($row['p']);\n                if (Erfurt_Uri::check($row['o'])) {\n                    $titleHelper->addResource($row['o']);\n                }\n                if (array_key_exists($properties[$row['p']]['element'], $replacements)) {\n                    $newRank = (int)$properties[$row['p']]['rank'];\n                    $minRank = $replacements[$properties[$row['p']]['element']]['rank'];\n                    if ($newRank < $minRank) {\n                        $replacements[$properties[$row['p']]['element']] = array(\n                            'rank'  => $newRank,\n                            'value' => $row['o'],\n                            'key'   => $row['p']\n                        );\n                    }\n                } else {\n                    $replacements[$properties[$row['p']]['element']] = array(\n                        'rank'  => $properties[$row['p']]['rank'],\n                        'value' => $row['o'],\n                        'key'   => $row['p']\n                    );\n                }\n            }\n        }\n\n        $localName = '';\n\n        foreach ($schema as $element) {\n            if (array_key_exists($element, $replacements)) {\n                if (Erfurt_Uri::check($replacements[$element]['value'])) {\n                    $val = $titleHelper->getTitle($replacements[$element]['value']);\n                } else {\n                    $val = $replacements[$element]['value'];\n                }\n                $val = $this->convertChars($val);\n\n                $key = $this->convertChars($titleHelper->getTitle($replacements[$element]['key']));\n\n                $localName .= $key . '/' . $val . '/';\n            }\n        }\n\n        // no meaningful localname created falback to old uri (TODO or md5 a new one?)\n        if ($localName === '') {\n            return $uri;\n        }\n\n        $base = '';\n\n        if ($this->_model !== null && $this->_model->getBaseIri() !== '') {\n            $base = $this->_model->getBaseIri();\n            if ($base[strlen($base) - 1] !== '#' && $base[strlen($base) - 1] !== '/') {\n                $base .= '/';\n            }\n        } else {\n            $count = 0;\n            foreach (explode('/', $uri) as $element) {\n                if ($count > 2) {\n                    break;\n                } else {\n                    $count++;\n                    $base .= $element . '/';\n                }\n            }\n        }\n\n        return $base . $localName;\n\n    }\n\n    /**\n     * Nice uri building method\n     *\n     * @param   $uri         string to convert to nice uri\n     * @param   $newInstance array with properties of the new Resource\n     * @param   $titleHelper TitleHelper instance to use to get titles for URIs\n     *\n     * @return  string nice uri\n     */\n    private function generateUriFromRdfphp($uri, $newInstance, $titleHelper)\n    {\n        // prepare TitleHelper by adding all possible resources\n        foreach ($newInstance as $prop => $object) {\n            $titleHelper->addResource($prop);\n            foreach ($object as $value) {\n                if ($value['type'] === 'uri') {\n                    $titleHelper->addResource($value['value']);\n                }\n            }\n        }\n\n        $nameParts = $this->loadNamingSchema($newInstance);\n        $uriParts  = array();\n\n        foreach ($nameParts as $part) {\n            if (is_string($this->_config->property->$part)) {\n                $partProperties = array($this->_config->property->$part);\n            } else {\n                if (is_array($this->_config->property->$part->toArray())) {\n                    $partProperties = $this->_config->property->$part->toArray();\n                } else {\n                    // No propeties for the given part. Create empty array for the loop\n                    $partProperties = array();\n                }\n            }\n\n            foreach ($partProperties as $property) {\n                if (array_key_exists($property, $newInstance) && $value = current($newInstance[$property])) {\n                    $uriParts[$part] = $this->_getTitle($value, $titleHelper);\n                    // on first value exit foreach\n                    break;\n                }\n            }\n        }\n\n        $baseUri              = $this->_model->getBaseUri();\n        $baseUriLastCharacter = $baseUri[strlen($baseUri) - 1];\n        if (($baseUriLastCharacter == '/') || ($baseUriLastCharacter == '#')) {\n            $createdUri = $baseUri . implode('/', $uriParts);\n        } else {\n            // avoid ugly glued uris without separator\n            $createdUri = $baseUri . '/' . implode('/', $uriParts);\n        }\n\n        return $createdUri;\n    }\n\n    /**\n     * Returns a human readable Title for a resource\n     *\n     * @param $resource    Array in the object style ('value' and 'type')\n     * @param $titleHelper TitleHelper instance to get a title\n     */\n    private function _getTitle($resource, $titleHelper = null)\n    {\n        if ($resource['type'] === 'uri') {\n            // check if a resourcecreation specific title property is set\n            /*\n             * The following if-block is called if a custom property is defined to circumvent the\n             * TitleHelper because of https://github.com/AKSW/OntoWiki/issues/162. This might be\n             * superfluous if the TitleHelper is working correctly, but it works of now and can be\n             * removed if correctnes of TitleHelper is proven.\n             */\n            if (isset($this->_config->property->title)) {\n                $property = $this->_config->property->title;\n\n                $query = 'SELECT ?title' . PHP_EOL;\n                $query .= 'WHERE {' . PHP_EOL;\n                $query .= '  <' . $resource['value'] . '> <' . $property . '> ?title .' . PHP_EOL;\n                $query .= '}' . PHP_EOL;\n\n                $result = $this->_model->sparqlQuery($query);\n\n                if (count($result) > 0) {\n                    return $result[0]['title'];\n                }\n            }\n\n            // return TitleHelper value\n            return $this->convertChars($titleHelper->getTitle($resource['value']));\n        } else {\n            // return literal value\n            return $this->convertChars($resource['value']);\n        }\n    }\n\n    /**\n     * Load Naming Scheme from Model or Ini\n     *\n     * @param $resource String|Array eigther the resource URI or an array with its properties\n     *\n     * @return Array\n     */\n    private function loadNamingSchema($resource)\n    {\n        if (isset($this->_config->namingSchemeProperty)) {\n            $schemeProperty = $this->_config->namingSchemeProperty;\n\n            // set the query result as empty array so we can be sure its an array\n            $result = array();\n\n            if (is_string($resource)) {\n                $resourceUri = $resource;\n                $query       = 'SELECT ?scheme' . PHP_EOL;\n                $query .= 'WHERE {' . PHP_EOL;\n                $query .= '  <' . $resourceUri . '> a ?type .' . PHP_EOL;\n                $query .= '  ?type <' . $schemeProperty . '> ?scheme .' . PHP_EOL;\n                $query .= '}' . PHP_EOL;\n\n                $result = $this->_model->sparqlQuery($query);\n\n            } else {\n                if (is_array($resource)) {\n                    $resourceProps = $resource;\n\n                    $types = $resourceProps[$this->_config->property->type];\n\n                    foreach ($types as $type) {\n                        if ($type['type'] == 'uri') {\n                            $query = 'SELECT ?scheme' . PHP_EOL;\n                            $query .= 'WHERE {' . PHP_EOL;\n                            $query .= '  <' . $type['value'] . '> <' . $schemeProperty . '> ?scheme .' . PHP_EOL;\n                            $query .= '}' . PHP_EOL;\n\n                            $result = $this->_model->sparqlQuery($query);\n                            if (count($result) > 0) {\n                                // break with the first type which has a sheme defined\n                                break;\n                            }\n                        }\n                    }\n                }\n            }\n\n            if (count($result) > 0) {\n                $scheme = $result[0]['scheme'];\n\n                return explode('/', $scheme);\n            }\n        }\n\n        return explode('/', $this->_config->defaultNamingScheme);\n    }\n\n    /**\n     * Method to convert chars in a string to uri compatible\n     *\n     * @param $str any string\n     *\n     * @return string with some characters replaced or deleted\n     */\n    private function convertChars($str)\n    {\n        // replace defined special chars\n        foreach ($this->_charTable as $key => $value) {\n            $str = str_replace($key, $value, $str);\n        }\n\n        // replace defined whitespaces\n        if (isset($this->_config->whiteSpaceMode)) {\n            $mode = $this->_config->whiteSpaceMode;\n        } else {\n            $mode = false;\n        }\n\n        if ($mode == 'underscore') {\n            foreach ($this->_whiteSpaceTable as $key => $value) {\n                $str = str_replace($key, '_', $str);\n            }\n        } else {\n            if ($mode == 'CamelCaps' || $mode == 'CamelCase') {\n                foreach ($this->_whiteSpaceTable as $key => $value) {\n                    // replace all whitespace with a simple space\n                    $str = str_replace($key, ' ', $str);\n                    // make all word uppercase\n                    $str = ucwords($str);\n                    // remove all spaces\n                    $str = str_replace(' ', '', $str);\n                }\n            } else {\n                foreach ($this->_whiteSpaceTable as $key => $value) {\n                    $str = str_replace($key, $value, $str);\n                }\n            }\n        }\n\n        // replace other special chars\n        $str = preg_replace('/[^a-z0-9_]+/i', '', $str);\n\n        return $str;\n    }\n\n    /**\n     * Method that counts already existing distinct datasets for given uri\n     *\n     * @param $uri uri string\n     *\n     * @return int distinct existing datasets\n     */\n    private function countUriPattern($uri)\n    {\n        $query = new Erfurt_Sparql_Query2();\n        $query->setDistinct(true);\n\n        $unions = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();\n\n        $subjectVar = new Erfurt_Sparql_Query2_Var('s');\n        $query->addProjectionVar($subjectVar);\n\n        // create six temporary vars (not selected in query)\n        $tempVars = array();\n        for ($i = 0; $i < 6; $i++) {\n            $tempVars[] = new Erfurt_Sparql_Query2_Var('var' . $i);\n        }\n\n        $singlePattern = new Erfurt_Sparql_Query2_GroupGraphPattern();\n        $singlePattern->addTriple($subjectVar, $tempVars[0], $tempVars[1]);\n        $unions->addElement($singlePattern);\n\n        $singlePattern = new Erfurt_Sparql_Query2_GroupGraphPattern();\n        $singlePattern->addTriple($tempVars[2], $subjectVar, $tempVars[3]);\n        $unions->addElement($singlePattern);\n\n        $singlePattern = new Erfurt_Sparql_Query2_GroupGraphPattern();\n        $singlePattern->addTriple($tempVars[4], $tempVars[5], $subjectVar);\n        $unions->addElement($singlePattern);\n\n        $query->getWhere()->addElement($unions);\n\n        $filter = new Erfurt_Sparql_Query2_ConditionalOrExpression();\n\n        $filter->addElement(\n            new Erfurt_Sparql_Query2_Regex(\n                $subjectVar,\n                new Erfurt_Sparql_Query2_RDFLiteral('^' . $uri),\n                new Erfurt_Sparql_Query2_RDFLiteral('i')\n            )\n        );\n\n        $query->addFilter($filter);\n\n        $result = $this->_owApp->erfurt->getStore()->countWhereMatches(\n            $this->_model->getModelIri(),\n            $query->getWhere(),\n            's',\n            true\n        );\n\n        return $result;\n    }\n}\n"
  },
  {
    "path": "extensions/resourcecreationuri/default.ini",
    "content": "enabled         = true\nname            = \"Custom Resource URI Creation\"\ndescription     = \"plugin to create nice URIs on instance creation via RDFauthor/updateService\"\nauthor          = \"Christoph Rieß\"\n; url           = \n\n[events]\n1 = onUpdateServiceAction\n;2 = onRouteStartup\n\n[private]\n;; load naming schema from Model\nfromModel               = true\n\n;; renaming schema property\nnamingSchemeProperty    = \"http://ns.ontowiki.net/SysOnt/instanceNamingScheme\"\n\n;; URIs to rewite (+baseUri +md5)\nnewResourceUri          = \"NewResource\"\n\n;; scheme to configure new uri (+baseUri)\ndefaultNamingScheme     = \"type/label\"\n\n;; type property\nproperty.type           = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\"\n\n;; label property\n;; these are more important than rdfs:label\nproperty.label.skosPlabel  = \"http://www.w3.org/2004/02/skos/core#prefLabel\"\nproperty.label.dcTitle     = \"http://purl.org/dc/elements/1.1/title\"\nproperty.label.dcTitle2    = \"http://purl.org/dc/terms/title\"\nproperty.label.swrcTitle   = \"http://swrc.ontoware.org/ontology#title\"\nproperty.label.foafName    = \"http://xmlns.com/foaf/0.1/name\"\nproperty.label.siocName    = \"http://rdfs.org/sioc/ns#name\"\nproperty.label.tagName     = \"http://www.holygoat.co.uk/owl/redwood/0.1/tags/name\"\nproperty.label.lgeodName   = \"http://linkedgeodata.org/vocabulary#name\"\nproperty.label.geoName     = \"http://www.geonames.org/ontology#name\"\n\n;; standard rdfs:label\nproperty.label.rdfsLabel   = \"http://www.w3.org/2000/01/rdf-schema#label\"\n\n;; these are less important than rdfs:label\nproperty.label.accountName = \"http://xmlns.com/foaf/0.1/accountName\"\nproperty.label.foafNick    = \"http://xmlns.com/foaf/0.1/nick\"\nproperty.label.foafSurname = \"http://xmlns.com/foaf/0.1/surname\"\nproperty.label.skosAlabel  = \"http://www.w3.org/2004/02/skos/core#altLabel\"\n"
  },
  {
    "path": "extensions/resourcecreationuri/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/resourcecreationuri/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :resourcecreationuri .\n:resourcecreationuri a doap:Project ;\n  doap:name \"resourcecreationuri\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/resourcecreationuri/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Custom Resource URI Creation\" ;\n  doap:description \"plugin to create nice URIs on instance creation via RDFauthor/updateService\" ;\n  owconfig:authorLabel \"Christoph Rieß\" ;\n  owconfig:pluginEvent event:onUpdateServiceAction ;\n  :fromModel \"true\"^^xsd:boolean ;\n  :namingSchemeProperty <http://ns.ontowiki.net/SysOnt/instanceNamingScheme> ;\n  :newResourceUri \"NewResource\" ;\n  :whiteSpaceMode \"underscore\" ;\n  :defaultNamingScheme \"type/label\" ;\n  owconfig:config [\n    a owconfig:Config;\n    owconfig:id \"property\";\n    :title <http://ns.ontowiki.net/SysOnt/creationLabel> ;\n    :type <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ;\n    :label (\n        <http://ns.ontowiki.net/SysOnt/creationLabel>\n        <http://www.w3.org/2004/02/skos/core#prefLabel>\n        <http://purl.org/dc/elements/1.1/title>\n        <http://purl.org/dc/terms/title>\n        <http://swrc.ontoware.org/ontology#title>\n        <http://xmlns.com/foaf/0.1/name>\n        <http://rdfs.org/sioc/ns#name>\n        <http://www.holygoat.co.uk/owl/redwood/0.1/tags/name>\n        <http://linkedgeodata.org/vocabulary#name>\n        <http://www.geonames.org/ontology#name>\n        <http://www.w3.org/2000/01/rdf-schema#label>\n        <http://xmlns.com/foaf/0.1/accountName>\n        <http://xmlns.com/foaf/0.1/nick>\n        <http://xmlns.com/foaf/0.1/surname>\n        <http://www.w3.org/2004/02/skos/core#altLabel>\n    )\n] .\n:resourcecreationuri doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/resourcemodules/LinkinghereModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module – linkinhere\n *\n * Add instance properties to the list view\n *\n * @category   OntoWiki\n * @package    Extensions_Resourcemodule\n * @author     Norman Heino <norman.heino@gmail.com>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass LinkinghereModule extends OntoWiki_Module\n{\n    private $_predicates = null;\n\n    /**\n     * Constructor\n     */\n    public function init()\n    {\n        $query = new Erfurt_Sparql_SimpleQuery();\n\n        $query->setSelectClause('SELECT DISTINCT ?subject ?uri')\n            ->setWherePart(\n                'WHERE {\n                    ?subject ?uri <' . (string)$this->_owApp->selectedResource . '> .\n                }'\n            )->setLimit(6);\n\n        $result           = $this->_owApp->selectedModel->sparqlQuery($query, array('result_format' => 'extended'));\n        $_predicatesResult = array();\n        if (isset($result['results']['bindings'])) {\n            foreach ($result['results']['bindings'] as $row) {\n                if ($row['subject']['type'] === 'uri') {\n                    $_predicatesResult[] = array(\n                        'uri' => $row['uri']['value']\n                    );\n                }\n            }\n        }\n        $this->_predicates = $_predicatesResult;\n\n        // I removed the isURI(?subject) here as well as the limit, since the query is way faster\n        // without filter! We kick out bnodes manually!\n    }\n\n    public function getTitle()\n    {\n        return \"Instances linking here\";\n    }\n\n    public function shouldShow()\n    {\n        // show only if there are predicates\n        if ($this->_predicates) {\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    public function getContents()\n    {\n        $titleHelper = new OntoWiki_Model_TitleHelper($this->_owApp->selectedModel);\n\n        $query = new Erfurt_Sparql_SimpleQuery();\n\n        $results = false;\n\n        $_predicates = $this->_predicates;\n        $properties = array();\n        $instances  = array();\n        $url        = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n\n        $titleHelper->addResources($_predicates, 'uri');\n\n        foreach ($_predicates as $predicate) {\n            $predicateUri = $predicate['uri'];\n\n            $url->setParam('r', $predicateUri, true); // create properties url for the relation\n            $properties[$predicateUri]['uri']   = $predicateUri;\n            $properties[$predicateUri]['url']   = (string)$url;\n            $properties[$predicateUri]['title'] = $titleHelper->getTitle($predicateUri, $this->_lang);\n\n            $query->resetInstance()\n                ->setSelectClause('SELECT DISTINCT ?uri')\n                ->setWherePart(\n                    'WHERE {\n                        ?uri <' . $predicateUri . '> <' . (string)$this->_owApp->selectedResource . '> .\n                        FILTER (isURI(?uri))\n                    }'\n                )\n                ->setLimit(OW_SHOW_MAX + 1);\n\n            if ($subjects = $this->_owApp->selectedModel->sparqlQuery($query)) {\n                $results = true;\n\n                // has_more is used for the dots\n                if (count($subjects) > OW_SHOW_MAX) {\n                    $properties[$predicateUri]['has_more'] = true;\n                    $subjects                              = array_splice($subjects, 0, OW_SHOW_MAX);\n                } else {\n                    $properties[$predicateUri]['has_more'] = false;\n                }\n\n                $subjectTitleHelper = new OntoWiki_Model_TitleHelper($this->_owApp->selectedModel);\n                $subjectTitleHelper->addResources($subjects, 'uri');\n\n                foreach ($subjects as $subject) {\n                    $subjectUri       = $subject['uri'];\n                    $subject['title'] = $subjectTitleHelper->getTitle($subjectUri, $this->_lang);\n\n                    // set URL\n                    $url->setParam('r', $subjectUri, true);\n                    $subject['url'] = (string)$url;\n\n                    if (array_key_exists($predicateUri, $instances)) {\n                        if (!array_key_exists($subjectUri, $instances[$predicateUri])) {\n                            $instances[$predicateUri][$subjectUri] = $subject;\n                        }\n                    } else {\n                        $instances[$predicateUri] = array(\n                            $subjectUri => $subject\n                        );\n                    }\n                }\n            }\n        }\n\n        $this->view->resource   = $this->_owApp->selectedResource;\n        $this->view->properties = $properties;\n        $this->view->instances  = $instances;\n\n        if (!$results) {\n            $this->view->message = 'No matches.';\n        }\n\n        return $this->render('linkinghere');\n    }\n\n    public function getStateId()\n    {\n        $id = $this->_owApp->selectedModel->getModelIri()\n            . $this->_owApp->selectedResource;\n\n        return $id;\n    }\n}\n"
  },
  {
    "path": "extensions/resourcemodules/SimilarinstancesModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki module – similarinstances\n *\n * Add instance properties to the list view\n *\n * @category   OntoWiki\n * @package    Extensions_Resourcemodule\n * @author     Norman Heino <norman.heino@gmail.com>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass SimilarinstancesModule extends OntoWiki_Module\n{\n\n    public function getTitle()\n    {\n        return \"Similar Instances\";\n    }\n\n    public function shouldShow()\n    {\n        if ($this->_privateConfig->show->similarinstances == true) {\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    public function getContents()\n    {\n        $query = new Erfurt_Sparql_SimpleQuery();\n\n        $results  = false;\n        $similars = array();\n        $typesArr = array();\n        $types    = $this->_getTypes();\n        $url      = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n        $listUrl  = new OntoWiki_Url(array('route' => 'instances'), array());\n\n        $titleHelper = new OntoWiki_Model_TitleHelper($this->_owApp->selectedModel);\n        $titleHelper->addResources($types);\n\n        foreach ($types as $typeUri) {\n            if (!array_key_exists($typeUri, $typesArr)) {\n                $typesArr[$typeUri] = $typeUri;\n            }\n\n            $query->resetInstance()\n                ->setSelectClause('SELECT DISTINCT ?uri')\n                ->setWherePart(\n                    'WHERE {\n                        ?uri a <' . $typeUri . '> .\n                        FILTER (!sameTerm(?uri, <' . (string)$this->_owApp->selectedResource . '>))\n                        FILTER (isURI(?uri))\n                    }'\n                )\n                ->setLimit(OW_SHOW_MAX + 1);\n\n            if ($instances = $this->_owApp->selectedModel->sparqlQuery($query)) {\n                $results = true;\n                $url->setParam('r', $typeUri, true); // create properties url for the class\n                $typesArr[$typeUri] = array(\n                    'uri'      => $typeUri,\n                    'url'      => (string)$url,\n                    'title'    => $titleHelper->getTitle($typeUri, $this->_lang),\n                    'has_more' => false\n                );\n\n                // has_more is used for the dots\n                if (count($instances) > OW_SHOW_MAX) {\n                    $typesArr[$typeUri]['has_more'] = true;\n                    $instances                      = array_splice($instances, 0, OW_SHOW_MAX);\n                }\n\n                $instTitleHelper = new OntoWiki_Model_TitleHelper($this->_owApp->selectedModel);\n                $instTitleHelper->addResources($instances, 'uri');\n\n                $conf['filter'][0] = array(\n                    'mode'      => 'rdfsclass',\n                    'rdfsclass' => $typeUri,\n                    'action'    => 'add'\n                );\n\n                // the list url is used for the context menu link\n                $listUrl->setParam('instancesconfig', json_encode($conf), true);\n                $listUrl->setParam('init', true, true);\n                $typesArr[$typeUri]['listUrl'] = (string)$listUrl;\n\n                foreach ($instances as $row) {\n                    $instanceUri = $row['uri'];\n                    // set URL\n                    $url->setParam('r', $instanceUri, true);\n\n                    if (!array_key_exists($typeUri, $similars)) {\n                        $similars[$typeUri] = array();\n                    }\n\n                    // add instance\n                    $similars[$typeUri][$instanceUri] = array(\n                        'uri'   => $instanceUri,\n                        'title' => $instTitleHelper->getTitle($instanceUri, $this->_lang),\n                        'url'   => (string)$url,\n                    );\n                }\n            }\n        }\n\n        $this->view->types    = $typesArr;\n        $this->view->similars = $similars;\n\n        if (!$results) {\n            $this->view->message = 'No matches.';\n        }\n\n        return $this->render('similarinstances');\n    }\n\n    public function getStateId()\n    {\n        $id = $this->_owApp->selectedModel\n            . $this->_owApp->selectedResource;\n\n        return $id;\n    }\n\n    private function _getTypes()\n    {\n        $typesInferred = array();\n\n        $query = new Erfurt_Sparql_SimpleQuery();\n\n        $query->setSelectClause('SELECT DISTINCT ?uri')\n            ->setWherePart(\n                'WHERE {\n                    <' . (string)$this->_owApp->selectedResource . '> a ?uri.\n                    ?similar a ?uri.\n                    FILTER isUri(?uri)\n                }'\n            );\n\n        if ($result = $this->_owApp->selectedModel->sparqlQuery($query)) {\n            $types = array();\n            foreach ($result as $row) {\n                array_push($types, $row['uri']);\n            }\n\n            $typesInferred = $this->_store->getTransitiveClosure(\n                (string)$this->_owApp->selectedModel,\n                EF_RDFS_SUBCLASSOF,\n                $types,\n                false\n            );\n        }\n\n        return array_keys($typesInferred);\n    }\n}\n"
  },
  {
    "path": "extensions/resourcemodules/UsageModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * OntoWiki usage module\n *\n * Adds the \"Usage as Property\" box to the properties context\n *\n * @category   OntoWiki\n * @package    Extensions_Resourcemodule\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author     Norman Heino <norman.heino@gmail.com>\n */\nclass UsageModule extends OntoWiki_Module\n{\n    /** @var array */\n    protected $_subjects = null;\n\n    /** @var OntoWiki_Model */\n    protected $_model = null;\n\n    /** @var array */\n    protected $_objects = null;\n\n    protected $_subjectQuery = null;\n    protected $_objectQuery = null;\n\n    /**\n     * Constructor\n     */\n    public function init()\n    {\n    }\n\n    private function _initQuery()\n    {\n        // instances (subjects)\n        $this->_subjectQuery = new Erfurt_Sparql_SimpleQuery();\n        $this->_subjectQuery->setSelectClause('SELECT DISTINCT ?resourceUri')\n            ->setWherePart(\n                'WHERE { ?resourceUri <' . (string)$this->_owApp->selectedResource . '> ?object . ' .\n                'FILTER (isURI(?resourceUri)) }'\n            )\n            ->setLimit(OW_SHOW_MAX);\n        $this->_subjects = $this->_owApp->selectedModel->sparqlQuery($this->_subjectQuery);\n\n        // objects\n        $this->_objectQuery = new Erfurt_Sparql_SimpleQuery();\n        $this->_objectQuery->setSelectClause('SELECT DISTINCT ?resourceUri')\n            ->setWherePart(\n                'WHERE { ?subject <' . (string)$this->_owApp->selectedResource . '> ?resourceUri . ' .\n                'FILTER (isURI(?resourceUri)) }'\n            )\n            ->setLimit(OW_SHOW_MAX);\n        $this->_objects = $this->_owApp->selectedModel->sparqlQuery($this->_objectQuery);\n    }\n\n    public function shouldShow()\n    {\n        if ($this->_privateConfig->show->usage == true) {\n            $this->_initQuery();\n            if (!empty($this->_subjects) || !empty($this->_objects)) {\n                return true;\n            } else {\n                return false;\n            }\n        } else {\n            return false;\n        }\n    }\n\n    public function getTitle()\n    {\n        $title = $this->view->_('Usage as property') . ' ('\n            . count($this->_subjects) . '/'\n            . count($this->_objects) . ')';\n\n        return $title;\n    }\n\n\n    public function getContents()\n    {\n        $url = new OntoWiki_Url(array('route' => 'properties'));\n\n        if (!empty($this->_subjects)) {\n            $instances = array();\n\n            $instancesTitleHelper = new OntoWiki_Model_TitleHelper($this->_owApp->selectedModel);\n            $instancesTitleHelper->addResources($this->_subjects, 'resourceUri');\n\n            foreach ($this->_subjects as $instance) {\n                $instanceUri = $instance['resourceUri'];\n\n                if (!array_key_exists($instanceUri, $instances)) {\n                    // URL\n                    $url->setParam('r', $instanceUri, true);\n\n                    $instances[$instanceUri] = array(\n                        'uri'   => $instanceUri,\n                        'title' => $instancesTitleHelper->getTitle($instanceUri, $this->_lang),\n                        'url'   => (string)$url\n                    );\n                }\n            }\n            $this->view->instances = $instances;\n        }\n\n        if (!empty($this->_objects)) {\n            $objects = array();\n\n            $objectTitleHelper = new OntoWiki_Model_TitleHelper($this->_owApp->selectedModel);\n            $objectTitleHelper->addResources($this->_objects, 'resourceUri');\n\n            foreach ($this->_objects as $object) {\n                $objectUri = $object['resourceUri'];\n\n                if (!array_key_exists($objectUri, $objects)) {\n                    // URL\n                    $url->setParam('r', $objectUri, true);\n\n                    $objects[$objectUri] = array(\n                        'uri'   => $objectUri,\n                        'title' => $objectTitleHelper->getTitle($objectUri, $this->_lang),\n                        'url'   => (string)$url\n                    );\n                }\n            }\n            $this->view->objects = $objects;\n        }\n        $url = new OntoWiki_Url(array('controller' => 'resource', 'action' => 'instances'));\n        $url->setParam(\n            'instancesconfig', json_encode(\n                array('filter' => array(array('id'    => 'propertyUsage', 'action' => 'add', 'mode' => 'query',\n                                              'query' => (string)$this->_subjectQuery)))\n            )\n        );\n        $url->setParam('init', true);\n        $this->view->subjectListLink = (string)$url;\n        $url->setParam(\n            'instancesconfig', json_encode(\n                array('filter' => array(array('id'    => 'propertyUsage', 'action' => 'add', 'mode' => 'query',\n                                              'query' => (string)$this->_objectQuery)))\n            )\n        );\n        $this->view->objectListLink = (string)$url;\n\n        if (empty($this->_subjects) && empty($this->_objects)) {\n            $this->view->message = 'No matches.';\n        }\n\n        // render data into template\n        return $this->render('usage');\n    }\n\n    public function getStateId()\n    {\n        $id = $this->_owApp->selectedModel\n            . $this->_owApp->selectedResource;\n\n        return $id;\n    }\n}\n"
  },
  {
    "path": "extensions/resourcemodules/default.ini",
    "content": "enabled    = true\nname      = \"Resource Modules\"\ncaching    = true\ndescription = \"Modules showed in the single resource view (Linking Here, Similar Instances, Predicates, Usage as Property)\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\nmodules.linkinghere.priority   = 20\nmodules.linkinghere.name   = \"Linking Here\"\nmodules.linkinghere.contexts.0 = \"main.window.properties\"\nmodules.linkinghere.contexts.1 = \"main.window.modelinfo\"\n\nmodules.similarinstances.priority   = 10\nmodules.similarinstances.name   = \"Similar Instances\"\nmodules.similarinstances.contexts.0 = \"main.window.properties\"\n\nmodules.usage.priority   = 30\nmodules.usage.title      = Usage as Property\nmodules.usage.contexts.0 = \"main.window.properties\"\n\n[private]\nshow.similarinstances = false\nshow.usage = true\n\n"
  },
  {
    "path": "extensions/resourcemodules/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/resourcemodules/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :resourcemodules .\n:resourcemodules a doap:Project ;\n  doap:name \"resourcemodules\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/resourcemodules/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Resource Modules\" ;\n  doap:description \"Modules showed in the single resource view (Linking Here, Similar Instances, Predicates, Usage as Property)\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:hasModule :Default .\n:Default a owconfig:Module ;\n  rdfs:label \"Default\" ;\n  owconfig:caching \"true\"^^xsd:boolean .\n\n:resourcemodules owconfig:hasModule :Linkinghere .\n:Linkinghere a owconfig:Module ;\n  rdfs:label \"Linkinghere\" ;\n  owconfig:priority \"20\" ;\n  rdfs:label \"Linking Here\" ;\n  owconfig:context \"extension.resourcemodules.linkinghere\" ;\n  owconfig:context \"main.window.properties\" ;\n  owconfig:context \"main.window.modelinfo\" .\n\n:resourcemodules owconfig:hasModule :Similarinstances .\n:Similarinstances a owconfig:Module ;\n  rdfs:label \"Similarinstances\" ;\n  owconfig:priority \"10\" ;\n  rdfs:label \"Similar Instances\" ;\n  owconfig:context \"extension.resourcemodules.similarinstances\" ;\n  owconfig:context \"main.window.properties\" .\n\n:resourcemodules owconfig:hasModule :Usage .\n:Usage a owconfig:Module ;\n  owconfig:priority \"30\" ;\n  rdfs:label \"Usage as Property\" ;\n  owconfig:context \"extension.resourcemodules.usage\" ;\n  owconfig:context \"main.window.properties\" .\n\n:resourcemodules owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"show\";\n      :similarinstances \"false\"^^xsd:boolean ;\n      :usage \"true\"^^xsd:boolean\n] .\n\n:resourcemodules doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n\n"
  },
  {
    "path": "extensions/resourcemodules/linkinghere.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki linkinghere module template\n * TODO: use rev (with curie'd property) and resource instead of only about?\n *\n */\nfunction buildFilterExp($res, $pred, $label){\n    $allfilter = array(\n        'filter' => array(\n            array (\n                'action' => 'add',\n                'mode' => 'box',\n                'id' => 'linkinghere',\n                'property' => $pred,\n                'isInverse' => false,\n                'propertyLabel' => $label,\n                'filter' => 'equals',\n                'value1' => $res,\n                'value2' => null,\n                'valuetype' => 'uri',\n                'literaltype' => null,\n                'hidden' => false\n            )\n        )\n    );\n    return urlencode(json_encode($allfilter));\n}\n?>\n<?php if (!empty($this->instances)): ?>\n\t<ul class=\"bullets-none separated\">\n\t    <?php foreach ($this->instances as $property => $instances): ?>\n        <?php $relation = $this->properties[$property] ?>\n\t        <li class=\"has-contextmenu-area\">\n                <strong>\n                    <a class=\"hasMenu\"\n                       about=\"<?php echo $relation['uri'] ?>\"\n                       href=\"<?php echo $relation['url'] ?>\"><?php echo $relation['title'] ?></a><sup>-1</sup>\n               </strong>\n\t            <ul class=\"inline separated\"  style=\"padding-left: 0.5em;\">\n\t                <?php $i = 0; ?>\n\t                <?php foreach ($instances as $instance): ?>\n\t                    <?php if ((++$i == count($instances)) && ($relation['has_more'] == false)): ?>\n\t                        <li class=\"last-child\"><a class=\"hasMenu\" about=\"<?php echo $instance['uri'] ?>\" href=\"<?php echo $instance['url'] ?>\"><?php echo $instance['title'] ?></a></li>\n\t                    <?php else: ?>\n\t                        <li><a class=\"hasMenu\" about=\"<?php echo $instance['uri'] ?>\" href=\"<?php echo $instance['url'] ?>\"><?php echo $instance['title'] ?></a></li>\n\t                    <?php endif; ?>\n                        <?php endforeach; ?>\n                    <?php if ($relation['has_more'] == true): ?>\n                            <li>&hellip;</li>\n                    <?php endif; ?>\n\t            </ul>\n                  <div class=\"contextmenu\">\n                    <a class=\"item\"\n                       href=\"<?php echo $this->urlBase; ?>list/?init&instancesconfig=<?php echo buildFilterExp((string)$this->resource, $property, $this->properties[$property]); ?>\">\n                        <span class=\"icon icon-list\" title=\"Show as List\">\n                            <span>Show as List</span>\n                        </span>\n                    </a>\n                  </div>\n\t        </li>\n\t    <?php endforeach; ?>\n\t</ul>\n<?php else: ?>\n\t<p class=\"messagebox info\"><?php echo $this->_($this->message) ?></p>\n<?php endif; ?>\n"
  },
  {
    "path": "extensions/resourcemodules/similarinstances.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki similarinstances module template\n */\n\n?>\n<?php if (!empty($this->similars)): ?>\n\t<ul class=\"bullets-none separated\">\n\t    <?php foreach ($this->similars as $type => $instances): ?>\n            <?php $class = $this->types[$type] ?>\n\t        <li class=\"has-contextmenu-area\">\n                <strong>\n                    <a class=\"hasMenu\"\n                       about=\"<?php echo $class['uri'] ?>\"\n                       href=\"<?php echo $class['url'] ?>\"><?php echo $class['title'] ?></a>\n                </strong>\n\t            <ul class=\"inline separated\" style=\"padding-left: 0.5em;\">\n\t                <?php $i = 0; ?>\n\t                <?php foreach ($instances as $instance): ?>\n\t                    <?php if ((++$i == count($instances)) && ($class['has_more'] == false) ): ?>\n\t                        <li class=\"last-child\"><a class=\"hasMenu\" about=\"<?php echo $instance['uri'] ?>\" href=\"<?php echo $instance['url'] ?>\"><?php echo $instance['title'] ?></a></li>\n\t                    <?php else: ?>\n\t                        <li><a class=\"hasMenu\" about=\"<?php echo $instance['uri'] ?>\" href=\"<?php echo $instance['url'] ?>\"><?php echo $instance['title'] ?></a></li>\n\t                    <?php endif; ?>\n                    <?php endforeach; ?>\n                    <?php if ($class['has_more'] == true): ?>\n                            <li>&hellip;</li>\n                    <?php endif; ?>\n\t            </ul>\n                    <div class=\"contextmenu\">\n                        <a class=\"item\"\n                           href=\"<?php echo $class['listUrl'] ?>\">\n                            <span class=\"icon icon-list\" title=\"Show as List\">\n                                <span>Show as List</span>\n                            </span>\n                        </a>\n                    </div>\n\t        </li>\n\t    <?php endforeach; ?>\n\t</ul>\n<?php else: ?>\n\t<p class=\"messagebox info\"><?php echo $this->_($this->message) ?></p>\n<?php endif; ?>\n"
  },
  {
    "path": "extensions/resourcemodules/usage.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki usage module template\n *\n * @version $Id: usage.phtml 3392 2009-06-26 12:41:00Z sebastian.dietzold $\n */\n\n?>\n<?php if (!empty($this->instances) or !empty($this->objects)): ?>\n    <ul class=\"bullets-none separated\">\n        <?php if (!empty($this->instances)): ?>\n            <li class=\"has-contextmenu-area\">\n                <div class=\"contextmenu\">\n                    <a class=\"item\"\n                       href=\"<?php echo $this->subjectListLink ?>\">\n                            <span class=\"icon icon-list\" title=\"Show as List\">\n                                    <span>Show as List</span>\n                            </span>\n                    </a>\n                </div>\n                <?php echo $this->_('Subjects') ?>\n            \t<ul class=\"inline separated\">\n                    \n            \t    <?php $i = 0; ?>\n            \t    <?php foreach ($this->instances as $instance): ?>\n            \t        <?php if (++$i == count($this->instances)): ?>\n            \t            <li class=\"last-child\"><a class=\"hasMenu\" about=\"<?php echo $instance['uri'] ?>\" href=\"<?php echo $instance['url'] ?>\"><?php echo $instance['title'] ?></a></li>\n            \t        <?php else: ?>\n            \t            <li><a class=\"hasMenu\" about=\"<?php echo $instance['uri'] ?>\" href=\"<?php echo $instance['url'] ?>\"><?php echo $instance['title'] ?></a></li>\n            \t        <?php endif; ?>\n            \t    <?php endforeach; ?>\n            \t</ul>\n        \t</li>\n    \t<?php endif; ?>\n    \t<?php if (!empty($this->objects)): ?>\n        \t<li class=\"has-contextmenu-area\">\n        \t    <div class=\"contextmenu\">\n                        <a class=\"item\"\n                           href=\"<?php echo $this->objectListLink ?>\">\n                                <span class=\"icon icon-list\" title=\"Show as List\">\n                                        <span>Show as List</span>\n                                </span>\n                        </a>\n                    </div>\n                <?php echo $this->_('Objects') ?>\n            \t<ul class=\"inline separated\">\n                    <div class=\"contextmenu\">\n                        <a class=\"item\"\n                           href=\"<?php echo $this->subjectListLink ?>\">\n                                <span class=\"icon icon-list\" title=\"Show as List\">\n                                        <span>Show as List</span>\n                                </span>\n                        </a>\n                    </div>\n            \t    <?php $i = 0; ?>\n            \t    <?php foreach ($this->objects as $object): ?>\n            \t        <?php if (++$i == count($this->objects)): ?>\n            \t            <li class=\"last-child\"><a class=\"hasMenu\" about=\"<?php echo $object['uri'] ?>\" href=\"<?php echo $object['url'] ?>\"><?php echo $object['title'] ?></a></li>\n            \t        <?php else: ?>\n            \t            <li><a class=\"hasMenu\" about=\"<?php echo $object['uri'] ?>\" href=\"<?php echo $object['url'] ?>\"><?php echo $object['title'] ?></a></li>\n            \t        <?php endif; ?>\n            \t    <?php endforeach; ?>\n            \t</ul>\n            </li>\n        <?php endif; ?>\n    </ul>\n<?php else: ?>\n\t<p class=\"messagebox info\"><?php echo $this->_($this->message) ?></p>\n<?php endif; ?>\n"
  },
  {
    "path": "extensions/savedqueries/SavedqueriesController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Mass Geocoding of Ressources via attributes (parameter r)\n *\n *\n * @category   OntoWiki\n * @package    Extensions_Savedqueries\n * @author     Michael Martin <martin@informatik.uni-leipzig.de>\n * @author     Sebastian Dietzold <dietzold@informatik.uni-leipzig.de>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass SavedqueriesController extends OntoWiki_Controller_Component\n{\n    private $_model = null;\n    private $_translate = null;\n\n    // ------------------------------------------------------------------------\n    // --- Component initialization -------------------------------------------\n    // ------------------------------------------------------------------------\n    public function init()\n    {\n        parent::init();\n        // m is automatically used and selected\n        if ((!isset($this->_request->m)) && (!$this->_owApp->selectedModel)) {\n            throw new OntoWiki_Exception('No model pre-selected and missing parameter m (model)!');\n        } else {\n            $this->_model = $this->_owApp->selectedModel;\n        }\n\n        // disable tabs\n        OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n        // get translation object\n        $this->_translate = $this->_owApp->translate;\n\n        $this->queryString = $this->_request->getParam('query', '');\n        $this->queryLabel  = $this->_request->getParam('label', '');\n\n        //set title of main window ...\n        $this->view->placeholder('main.window.title')->set($this->queryLabel);\n    }\n\n    /**\n     * initialization of the geocoder Action\n     *\n     * @access private\n     *\n     */\n    public function initAction()\n    {\n        // create a new button on the toolbar\n        try {\n            $queryResult = $this->_getQueryResult($this->queryString);\n        } catch (Exception $e){\n            $queryResult = array(\n                array(\n                    \"error\" => \"This Query contains errors and should be corrected in the Query Editor\",\n                    ),\n                );\n        }\n        $header = array();\n        try {\n            if (is_array($queryResult) && isset($queryResult[0]) && is_array($queryResult[0])) {\n                $header = array_keys($queryResult[0]);\n            } else {\n                if (is_bool($queryResult)) {\n                    $queryResult = $queryResult ? 'yes' : 'no';\n                } else {\n                    if (is_int($queryResult)) {\n                        $queryResult = (string)$queryResult;\n                    } else {\n                        if (is_string($queryResult)) {\n                            $queryResult = $queryResult;\n                        } else {\n                            $queryResult = 'no result';\n                        }\n                    }\n                }\n            }\n        } catch (Exception $e) {\n            $this->view->error = $e->getMessage();\n            $header            = '';\n            $queryResult       = '';\n        }\n\n        $this->view->queryResult = $queryResult;\n        $this->view->header      = $header;\n    }\n\n    private function _getQueryResult($queryString)\n    {\n        $elements = $this->_model->sparqlQuery($queryString);\n\n        return $elements;\n    }\n}\n"
  },
  {
    "path": "extensions/savedqueries/SavedqueriesModule.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * @category   OntoWiki\n * @package    Extensions_Savedqueries\n */\nclass SavedqueriesModule extends OntoWiki_Module\n{\n    const SERVICE_URL = 'savedQueries';\n\n    public function getTitle()\n    {\n        return (string)$this->_privateConfig->title;\n    }\n\n    /**\n     * Returns the content for the model list.\n     */\n    public function getContents()\n    {\n        $storeGraph = $this->_owApp->selectedModel;\n        if (!$storeGraph) {\n            return \"\";\n        }\n        $query\n            = \"SELECT * WHERE {\n                ?query a <\" . $this->_privateConfig->queryClass . \"> .\n                ?query <\" . $this->_privateConfig->queryLabel . \"> ?label .\n                ?query <\" . $this->_privateConfig->queryId . \"> ?id .\n                ?query <\" . $this->_privateConfig->queryCode . \"> ?code.\n                OPTIONAL { ?query <\" . $this->_privateConfig->queryDesc . \"> ?description . }\n        }\";\n\n        $elements = $storeGraph->sparqlQuery($query);\n        $queries  = array();\n        foreach ($elements as $element) {\n            $query                = array();\n            $query['label']       = $element['label'];\n            $query['link']        = $this->_config->urlBase . \"savedqueries/init?&query=\" .\n                (urlencode($element['code'])) . \"&label=\" . (urlencode($query['label'])); //Link noch bauen\n            $query['description'] = $element['description']; //Link noch bauen\n            $queries[]            = $query;\n        }\n        $this->view->queries = $queries;\n        $content             = $this->render('savedqueries');\n\n        return $content;\n    }\n\n    public function getStateId()\n    {\n        $session = OntoWiki::getInstance()->session;\n\n        $id = $this->_owApp->selectedModel->getModelIri()\n            . $this->_owApp->selectedClass\n            . print_r($session->hierarchyOpen, true);\n\n        return $id;\n    }\n\n    public function shouldShow()\n    {\n        if ($this->_owApp->selectedModel) {\n            return true;\n        }\n\n        return false;\n    }\n\n    public function allowCaching()\n    {\n        // no caching\n        // return false;\n        return true;\n    }\n\n}\n\n\n"
  },
  {
    "path": "extensions/savedqueries/default.ini",
    "content": ";;\r\n; Basic component configuration\r\n;;\r\nenabled    = false\r\naction     = init\r\nname       = \"Saved Queries\"\r\ntemplates  = \"templates\"\r\nlanguages  = \"languages/\"\r\n\r\ndescription = \"display saved queries in a module, and execute them\"\r\nauthor      = \"AKSW\"\r\nauthorUrl   = \"http://aksw.org\"\r\n\r\npriority   = 30\r\ncontexts[] = \"main.sidewindows\"\r\nclasses    = \"has-contextmenus-block\"\r\n;;\r\n; Component's private configuration\r\n; Anything set below will be available within the component ($this->_privateConfig->key)\r\n;;\r\n[private]\r\n\r\ntitle       = \"saved Queries\";\r\n\r\nqueryClass = \"http://ns.ontowiki.net/SysOnt/SparqlQuery\"\r\nqueryLabel = \"http://purl.org/dc/elements/1.1/title\"\r\nqueryId    = \"http://rdfs.org/sioc/ns#id\"\r\nqueryDesc  = \"http://purl.org/dc/elements/1.1/description\"\r\nqueryCode  = \"http://ns.ontowiki.net/SysOnt/sparql_code\"\r\n"
  },
  {
    "path": "extensions/savedqueries/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/savedqueries/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :savedqueries .\n:savedqueries a doap:Project ;\n  doap:name \"savedqueries\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/savedqueries/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  owconfig:defaultAction \"init\" ;\n  rdfs:label \"Saved Queries\" ;\n  owconfig:templates \"templates\" ;\n  owconfig:languages \"languages/\" ;\n  doap:description \"display saved queries in a module, and execute them\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:class \"has-contextmenus-block\" ;\n  owconfig:hasModule :Default .\n:Default a owconfig:Module ;\n  rdfs:label \"Default\" ;\n  owconfig:priority \"30\" ;\n  owconfig:context \"main.sidewindows\" .\n:savedqueries :title \"saved Queries\" ;\n  :queryClass <http://ns.ontowiki.net/SysOnt/SparqlQuery> ;\n  :queryLabel <http://purl.org/dc/elements/1.1/title> ;\n  :queryId <http://rdfs.org/sioc/ns#id> ;\n  :queryDesc <http://purl.org/dc/elements/1.1/description> ;\n  :queryCode <http://ns.ontowiki.net/SysOnt/sparql_code> ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/savedqueries/savedqueries.phtml",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki savedQueries module template\n *\n * @author Michael Martin\n */\n\n?>\n<?php if (!empty($this->queries)): ?>\n\t<ul class=\"bullets-none separated hierarchy\">\n\t\t<?php foreach ($this->queries as $query): ?>\n\t\t\t<li>\n\t\t\t    <a class=\"Class ?>\" href=\"<?php echo $query['link'] ?>\" alt=\"<?php echo $query['description'] ?>\">\n\t\t\t\t\t<?php echo $query['label'] ?>\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t<?php endforeach; ?>\n\t</ul>\n<?php else: ?>\n    <p>No Queries found. Please use queryBuilding extension to create and store queries for this model.</p>\n<?php endif; ?>\n"
  },
  {
    "path": "extensions/savedqueries/templates/savedqueries/init.phtml",
    "content": "<?php if (isset($this->queryResult)): ?>\n    <fieldset>\n        <?php if (is_array($this->queryResult)): ?>\n            <?php \n               \techo $this->partial('partials/resultset.phtml', array('data' => $this->queryResult, 'urlBase' => $this->urlBase, 'header' => $this->header, 'caption'=>'')); \n            ?>\n        <?php else: ?>\n            <pre><?php echo $this->escape($this->queryResult) ?></pre>\n        <?php endif; ?>\n    </fieldset>\n<?php endif; ?>\n</fieldset>\n\n<script type=\"text/javascript\">\n// make sure jQuery is included\nif (typeof jQuery != 'undefined') {\n    var queryInput = $('.code-input[name=query]');\n\n    function insertModelUri() {\n        queryInput.val(queryInput.val() + '<<?php echo $this->modelUri ?>>');\n    }\n\n    function insertResourceUri() {\n        queryInput.val(queryInput.val() + '<<?php echo $this->resourceUri ?>>');\n    }\n}\n</script>\n"
  },
  {
    "path": "extensions/selectlanguage/SelectlanguagePlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Plugin.php';\n\n/**\n * @category   OntoWiki\n * @package    Extensions_Selectlanguage\n */\nclass SelectlanguagePlugin extends OntoWiki_Plugin\n{\n    protected $_config = null;\n    protected $_supportedLanguages = null;\n    public $owApp;\n\n    public function init()\n    {\n        $this->_config             = $this->_privateConfig;\n        $this->_supportedLanguages = $this->_config->languages->toArray();\n        $this->owApp               = OntoWiki::getInstance();\n    }\n\n    public function onBeforeInitController()\n    {\n        // Translation hack in order to enable the plugin to translate...\n        $translate = $this->owApp->translate;\n        $translate->addTranslation(\n            $this->_pluginRoot . 'languages',\n            null,\n            array('scan' => Zend_Translate::LOCALE_FILENAME)\n        );\n        $locale = $this->owApp->getConfig()->languages->locale;\n        $translate->setLocale($locale);\n\n        $appMenu      = OntoWiki_Menu_Registry::getInstance()->getMenu('application');\n        $extrasMenu   = $appMenu->getSubMenu('Extras');\n        $lanMenuEntry = $translate->_('Select Language', $this->owApp->config->languages->locale);\n        $lanMenue     = new OntoWiki_Menu();\n\n        $request    = new OntoWiki_Request();\n        $getRequest = $request->getRequestUri();\n        foreach ($this->_supportedLanguages as $key => $value) {\n            $getRequest = str_replace(\"&lang=\" . $key, \"\", $getRequest);\n            $getRequest = str_replace(\"?lang=\" . $key, \"\", $getRequest);\n        }\n        foreach ($this->_supportedLanguages as $key => $value) {\n            $url = $getRequest . ((strpos($getRequest, \"?\")) ? \"&\" : \"?\") . \"lang=\" . $key;\n            $lanMenue->appendEntry(\n                $translate->_($value, $this->owApp->config->languages->locale),\n                $url\n            );\n        }\n        $extrasMenu->setEntry($lanMenuEntry, $lanMenue);\n    }\n\n    public function onPostBootstrap($event)\n    {\n        $request           = new OntoWiki_Request();\n        $requestedLanguage = $request->getParam(\"lang\");\n        $selectedLanguage  = \"\";\n\n        if (!empty($requestedLanguage)) {\n            $selectedLanguage             = $requestedLanguage;\n            $_SESSION['selectedLanguage'] = $requestedLanguage;\n        } else {\n            if (!empty($_SESSION['selectedLanguage'])) {\n                $selectedLanguage = $_SESSION['selectedLanguage'];\n            }\n        }\n\n        //writing the selected Language back into configuration\n        if (!empty($selectedLanguage)) {\n\n            //Set Selected Language in the internal config object\n            $this->owApp->config->languages->locale = $selectedLanguage;\n            //Set the Selected Language in the language Variable of the OntoWiki Object\n            $this->owApp->language = $selectedLanguage;\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/selectlanguage/default.ini",
    "content": "enabled     = true\nname        = Select Language\ndescription = \"This plugin is used for switching to a specific language\"\nauthor      = \"Michael Martin\"\n\n[events]\n;1 = onAfterConfigurationInitialized\n1 = onPostBootstrap\n2 = onBeforeInitController\n[private]\nlanguages.en = \"english (en)\"\nlanguages.de = \"deutsch (de)\"\nlanguages.hu = \"magyar (hu)\"\nlanguages.zh = \"汉语 (zh)\"\nlanguages.ru = \"русский язык (ru)\"\n;languages.nl = dutch\n"
  },
  {
    "path": "extensions/selectlanguage/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/selectlanguage/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :selectlanguage .\n:selectlanguage a doap:Project ;\n  doap:name \"selectlanguage\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/selectlanguage/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Select Language\" ;\n  doap:description \"This plugin is used for switching to a specific language\" ;\n  owconfig:authorLabel \"Michael Martin\" ;\n  owconfig:pluginEvent event:onPostBootstrap ;\n  owconfig:pluginEvent event:onBeforeInitController ;\n  owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"languages\";\n      :en \"English (en)\" ;\n      :de \"Deutsch (de)\" ;\n      :fr \"Français (fr)\" ;\n      :hu \"Magyar (hu)\" ;\n      :zh \"汉语 (zh)\" ;\n      :ru \"русский язык (ru)\"\n] .\n:selectlanguage doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/selectlanguage/languages/selectlanguage-de.csv",
    "content": "select language; Sprache auswählen"
  },
  {
    "path": "extensions/semanticsitemap/SemanticsitemapController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Semantic Sitemap plug-in controller\n *\n * @category   OntoWiki\n * @package    Extensions_Semanticsitemap\n * @author     Sebastian Dietzold <sebastian@dietzold.de>\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass SemanticsitemapController extends OntoWiki_Controller_Component\n{\n    protected $_store = null;\n    protected $_models = null;\n\n\n    /**\n     * inits the controller (e.g. for getting the config)\n     *\n     * @return void\n     */\n    public function init()\n    {\n        parent::init();\n\n        // Disable layout (we want only output xml)\n        $this->_helper->layout->disableLayout();\n\n        // get the default store from the registry\n        $this->_store = Erfurt_App::getInstance()->getStore();\n\n        // fetch the modellist from the store\n        $this->_models = $this->_store->getAvailableModels();\n\n        // todo: where to set the content type? currently we get a Quirks mode :-(\n        $this->_response->setRawHeader('Content-Type: application/xml');\n    }\n\n\n    /**\n     * Generates a semantic sitemap according to Cyganiak et.al. (ESWC2008)\n     *\n     * @return void\n     */\n    public function sitemapAction()\n    {\n        $owApp = OntoWiki::getInstance();\n        // these dataset items are used by the template\n        $datasets = array();\n        foreach ($this->_models as $modelUri => $model) {\n            $dataDump = $owApp->config->urlBase . 'model/export?output=xml&amp;m=' . urlencode($modelUri);\n            $datasets[] = array(\n                'datasetURI'             => $modelUri,\n                'datasetLabel'           => $this->_store->getModel($modelUri)->getTitle(),\n                'sparqlEndpoint'         => $owApp->config->urlBase . 'service/sparql',\n                'sparqlGraphName'        => $modelUri,\n                'sparqlEndpointLocation' => $owApp->config->urlBase . 'service/sparql',\n                'dataDump'               => $dataDump\n            );\n        }\n\n        // assign view var(s)\n        $this->view->datasets = $datasets;\n        $this->view->appname  = OntoWiki::APPLICATION_NAME;\n        $this->view->version  = OntoWiki_Version::VERSION;\n    }\n\n}\n"
  },
  {
    "path": "extensions/semanticsitemap/default.ini",
    "content": "enabled = false\naction = \"sitemap.xml\"\ntemplates = \"templates/\"\nlanguages = \"languages/\"\nname       = \"Semantic Site Map\"\ndescription = \"represent the content of ontowiki as a semantic sitemap.\"\nauthor      = \"AKSW\"\nauthorUrl   = \"http://aksw.org\"\n\n[events]\n1 = onRouteStartup\n\n[private]\n;auth.agentId  = \"https://localhost/ow_da/auth/agent\"\n"
  },
  {
    "path": "extensions/semanticsitemap/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/semanticsitemap/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :semanticsitemap .\n:semanticsitemap a doap:Project ;\n  doap:name \"semanticsitemap\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/semanticsitemap/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  owconfig:defaultAction \"sitemap.xml\" ;\n  owconfig:templates \"templates/\" ;\n  owconfig:languages \"languages/\" ;\n  rdfs:label \"Semantic Site Map\" ;\n  doap:description \"represent the content of ontowiki as a semantic sitemap.\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:pluginEvent event:onRouteStartup ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/semanticsitemap/semanticsitemap.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Plugin.php';\n\n/**\n * @category   OntoWiki\n * @package    Extensions_Semanticsitemap\n */\nclass SemanticsitemapPlugin extends OntoWiki_Plugin\n{\n\n    public function onRouteStartup()\n    {\n        // get current route info\n        $front  = Zend_Controller_Front::getInstance();\n        $router = $front->getRouter();\n\n        // we must set a new route so that the navigation class knows,\n        $route = new Zend_Controller_Router_Route(\n            'sitemap.xml', // hijack 'sitemap.xml' shortcut\n            array(\n                 'controller' => 'semanticsitemap', // map to 'semanticsitemap' controller and\n                 'action'     => 'sitemap' // 'sitemap' action\n            )\n        );\n\n        // add the new route\n        $router->addRoute('showsitemap', $route);\n    }\n}\n\n"
  },
  {
    "path": "extensions/semanticsitemap/templates/semanticsitemap/sitemap.phtml",
    "content": "<?php\r\n/**\r\n * Semantic Sitemap default template\r\n *\r\n * @author Sebastian Dietzold <sebastian@dietzold.de>\r\n * @copyright  Copyright (c) 2008, {@link http://aksw.org AKSW}\r\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\r\n * @version $Id: $\r\n */\r\n\r\n// to avoid problems with these nasty short open tags ...\r\necho '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'. PHP_EOL;\r\n?>\r\n<!-- Semantic Sitemap generated by <?php echo $this->appname ?> <?php echo $this->version ?> -->\r\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\r\n\txmlns:sc=\"http://sw.deri.org/2007/07/sitemapextension\">\r\n<?php foreach ($this->datasets as $dataset): ?>\r\n\t<sc:dataset>\r\n\t\t<sc:datasetURI><?php echo $dataset['datasetURI'] ?></sc:datasetURI>\r\n\t\t<sc:datasetLabel><?php echo $dataset['datasetLabel'] ?></sc:datasetLabel>\r\n\t\t<sc:sparqlEndpoint><?php echo $dataset['sparqlEndpoint'] ?></sc:sparqlEndpoint>\r\n\t\t<sc:sparqlGraphName><?php echo $dataset['sparqlGraphName'] ?></sc:sparqlGraphName>\r\n\t\t<sc:sparqlEndpointLocation><?php echo $dataset['sparqlEndpointLocation'] ?></sc:sparqlEndpointLocation>\r\n\t\t<sc:dataDump><?php echo $dataset['dataDump'] ?></sc:dataDump>\r\n\t</sc:dataset>\r\n<?php endforeach; ?>\r\n</urlset>\r\n"
  },
  {
    "path": "extensions/sendmail/SendmailPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Plugin.php';\nrequire_once 'Zend/Mail.php';\n\n/**\n * This class includes a plugin to send mails via an event from different places\n * within ontowiki.\n *\n * Long description for class (if any) ...\n *\n * @category   OntoWiki\n * @package    Extensions_Sendmail\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @author     Christian Maier <christianmaier83@gmail.com>\n * @author     Michael Niederstätter <michael.niederstaetter@gmail.com>\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass SendmailPlugin extends OntoWiki_Plugin\n{\n    private $_transport = null;\n\n    public function init()\n    {\n        $smtpServer = $this->_privateConfig->smtp->server;\n\n        $config = $this->_privateConfig->smtp->config->toArray();\n\n        $this->_transport = new Zend_Mail_Transport_Smtp($smtpServer, $config = null);\n    }\n\n    public function onEmailsend($event)\n    {\n        if (isset($event->receiver)) {\n            foreach ($event->receiver as $receiver) {\n\n                $mail = new Zend_Mail();\n                $mail->setDefaultTransport($this->_transport);\n\n                $mail->addTo($receiver);\n\n                $mail->setFrom($event->sender);\n                $mail->setSubject($event->subject);\n\n                if ($event->type == 'text') {\n                    $mail->setBodyText($event->content);\n                } elseif ($event->type == 'html') {\n                    $mail->setBodyHtml($event->content);\n                }\n\n                $mail->send($this->_transport);\n            }\n\n            return true;\n\n        } else {\n            return false;\n        }\n    }\n}\n\n"
  },
  {
    "path": "extensions/sendmail/default.ini",
    "content": "enabled     = false\nname        = Sendmail\ndescription = \"A plug-in that sends mails via a mailserver using zend_mail\"\nauthor      = \"Maier Christian, Niederstätter Michael\"\n; url         = \n\n[events]\n1 = onEmailsend\n\n\n[private]\nsmtp.server = \"yourmailserver.com\";\n\n;smtp.config.auth = \"login\";\n;smtp.config.username = \"un\";\n;smtp.config.password = \"pwd\";\n;further options if needed...\n;\n\n\n"
  },
  {
    "path": "extensions/sendmail/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/sendmail/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :sendmail .\n:sendmail a doap:Project ;\n  doap:name \"sendmail\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/sendmail/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  rdfs:label \"Sendmail\" ;\n  doap:description \"A plug-in that sends mails via a mailserver using zend_mail\" ;\n  owconfig:authorLabel \"Maier Christian, Niederstätter Michael\" ;\n  owconfig:pluginEvent event:onEmailsend ;\n  owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"smtp\";\n      :server \"yourmailserver.com\"\n] ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/sindice/SindicePlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nrequire_once 'OntoWiki/Plugin.php';\n\n/**\n * Plugin for the Sindice search service. This plugin is used by the datagathering component search service.\n *\n * @category   OntoWiki\n * @package    Extensions_Sindice\n * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n * @author     Philipp Frischmuth <pfrischmuth@googlemail.com>\n */\nclass SindicePlugin extends OntoWiki_Plugin\n{\n    public function onDatagatheringComponentSearch($event)\n    {\n        $baseUri = 'http://api.sindice.com/v2/search?qt=term&page=1&q=';\n        $searchUri = $baseUri . implode('+', $event->termsArray);\n\n        $client = Erfurt_App::getInstance()->getHttpClient(\n            $searchUri, array(\n                             'maxredirects' => 2,\n                             'timeout'      => 10\n                        )\n        );\n        $client->setHeaders('Accept', 'application/json');\n        $response = $client->request();\n\n        $sindiceResult = json_decode($response->getBody(), true);\n        $result        = array();\n\n        // unfortunatly json_last_error is PHP >= 5.3.0, so this is not perfect\n        // and someday we should us ---> if (json_last_error() == JSON_ERROR_NONE) {\n        if ($sindiceResult != null) {\n            // TODO Keep order of original sindice result!!!\n            foreach ($sindiceResult['entries'] as $row) {\n                $title = implode(' - ', $row['title']);\n                $uri   = $row['link'];\n\n                $result[$uri]\n                    = str_replace('|', '&Iota;', $title) . '|' . $uri . '|' . $event->translate->_('Sindice Search');\n            }\n        }\n\n        return $result;\n    }\n}\n"
  },
  {
    "path": "extensions/sindice/default.ini",
    "content": "enabled = false\nname       = \"Sindice\"\ndescription= \"provides results from sindice via datagathering search\"\nauthor     = \"AKSW\"\nauthorUrl  = \"http://aksw.org\"\n\n\n[events]\n1 = onDatagatheringComponentSearch\n\n"
  },
  {
    "path": "extensions/sindice/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/sindice/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :sindice .\n:sindice a doap:Project ;\n  doap:name \"sindice\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/sindice/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  rdfs:label \"Sindice\" ;\n  doap:description \"provides results from sindice via datagathering search\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  owconfig:pluginEvent event:onDatagatheringComponentSearch ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/sortproperties/SortpropertiesPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Plugin to reorder properties data on PropertiesAction.\n *\n * @category   OntoWiki\n * @package    Extensions_Sortproperties\n */\nclass SortpropertiesPlugin extends OntoWiki_Plugin\n{\n    public function onPropertiesActionData($event)\n    {\n        if ($this->_privateConfig->sort->property) {\n\n            $store  = Erfurt_App::getInstance()->getStore();\n            $config = Erfurt_App::getInstance()->getConfig();\n\n            $data = $event->predicates;\n\n            foreach ($data as $graphUri => $predicates) {\n                $query = new Erfurt_Sparql_SimpleQuery();\n                $query->setSelectClause('SELECT DISTINCT *')\n                    ->addFrom((string)$graphUri)\n                    ->setWherePart('WHERE { ?p <' . $this->_privateConfig->sort->property . '> ?o . }');\n\n                $result = $store->sparqlQuery($query);\n\n                if (!empty($result)) {\n\n                    $order = array();\n\n                    foreach ($result as $v) {\n                        $order[$v['p']] = $v['o'];\n                    }\n\n                    $predicateOrder = array();\n\n                    foreach (array_keys($predicates) as $predicate) {\n                        if (array_key_exists($predicate, $order)) {\n                            $predicateOrder[] = (int)$order[$predicate];\n                        } else {\n                            $predicateOrder[] = 0;\n                        }\n                    }\n\n                    array_multisort($predicateOrder, SORT_DESC, SORT_NUMERIC, $predicates);\n                    $data[$graphUri] = $predicates;\n\n                }\n\n            }\n\n            $event->predicates = $data;\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/sortproperties/default.ini",
    "content": "enabled     = false\nname        = Sortproperties\n\n[events]\n1 = onPropertiesActionData\n\n[private]\nsort.method     = \"rdf\"\nsort.property   = \"http://ns.ontowiki.net/SysBase/order\"\n"
  },
  {
    "path": "extensions/sortproperties/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/sortproperties/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :sortproperties .\n:sortproperties a doap:Project ;\n  doap:name \"sortproperties\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/sortproperties/raw/master/doap.n3#> ;\n  owconfig:enabled \"false\"^^xsd:boolean ;\n  rdfs:label \"Sortproperties\" ;\n  owconfig:pluginEvent event:onPropertiesActionData ;\n  owconfig:config [\n      a owconfig:Config;\n      owconfig:id \"sort\";\n      :method \"rdf\" ;\n      :property <http://ns.ontowiki.net/SysBase/order>\n] ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/source/SourceController.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * @category   OntoWiki\n * @package    Extensions_Source\n */\nclass SourceController extends OntoWiki_Controller_Component\n{\n    public function editAction()\n    {\n        $store       = $this->_owApp->erfurt->getStore();\n        $resource    = $this->_owApp->selectedResource;\n        $translate   = $this->_owApp->translate;\n        $allowSaving = false;\n        $showList    = false;\n\n        // window title\n        if (!$resource) {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message(\"No resource selected\", OntoWiki_Message::WARNING)\n            );\n            $title = 'RDF Source';\n        } else {\n            if ($resource->getTitle()) {\n                $title = $resource->getTitle();\n            } else {\n                $title = OntoWiki_Utils::contractNamespace($resource->getIri());\n            }\n        }\n        $windowTitle = sprintf(\n            $translate->_('Source of Statements about %1$s') .\n            ' (' . $translate->_('without imported statements') . ')',\n            $title\n        );\n        $this->view->placeholder('main.window.title')->set($windowTitle);\n\n        // check for N3 capability\n        if (array_key_exists('ttl', $store->getSupportedImportFormats())) {\n            $allowSaving = true;\n        } else {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message(\"Store adapter cannot handle TTL.\", OntoWiki_Message::WARNING)\n            );\n        }\n\n        if (!$this->_owApp->selectedModel || !$this->_owApp->selectedModel->isEditable()) {\n            $allowSaving = false;\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message(\n                    'No model selected or no permissions to edit this model.',\n                    OntoWiki_Message::WARNING\n                )\n            );\n        }\n\n        if ($this->_owApp->lastRoute === 'instances') {\n            $allowSaving = false;\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message(\"Modifications of a list currently not supported.\", OntoWiki_Message::WARNING)\n            );\n            $showList = true;\n        }\n\n        // do not show edit stuff if model is not writeable\n        if ($this->_owApp->erfurt->getAc()->isModelAllowed('edit', $this->_owApp->selectedModel)) {\n            $allowSaving = true;\n        } else {\n            $allowSaving = false;\n        }\n\n        if ($allowSaving) {\n            // toolbar\n            $toolbar = $this->_owApp->toolbar;\n            $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Save Source', 'id' => 'savesource'));\n            $this->view->placeholder('main.window.toolbar')->set($toolbar);\n        } else {\n            $this->_owApp->appendMessage(\n                new OntoWiki_Message(\"Saving has been disabled.\", OntoWiki_Message::WARNING)\n            );\n        }\n\n        // form\n        $this->view->formActionUrl = $this->_config->urlBase . 'model/update';\n        $this->view->formEncoding  = 'multipart/form-data';\n        $this->view->formClass     = 'simple-input input-justify-left';\n        $this->view->formMethod    = 'post';\n        $this->view->formName      = 'savesource';\n        $this->view->readonly      = $allowSaving ? '' : 'readonly=\"readonly\"';\n        $this->view->graphUri      = (string)$this->_owApp->selectedModel;\n\n        // construct N3\n        $exporter = Erfurt_Syntax_RdfSerializer::rdfSerializerWithFormat('ttl');\n        if (!$showList) {\n            $source = $exporter->serializeResourceToString(\n                (string)$this->_owApp->selectedResource,\n                (string)$this->_owApp->selectedModel\n            );\n        } else {\n            $listHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('List');\n            $listName   = \"instances\";\n            if ($listHelper->listExists($listName)) {\n                $list = $listHelper->getList($listName);\n            } else {\n                $this->_owApp->appendMessage(\n                    new OntoWiki_Message(\n                        'something went wrong with the list of instances you want to rdf-view',\n                        OntoWiki_Message::ERROR\n                    )\n                );\n            }\n            $source = $exporter->serializeQueryResultToString(\n                clone $list->getResourceQuery(),\n                (string)$this->_owApp->selectedModel\n            );\n        }\n\n        $this->view->source = $source;\n\n        $url = new OntoWiki_Url(array('route' => 'properties'), array());\n        $url->setParam('r', (string)$resource, true);\n        $this->view->redirectUri = urlencode((string)$url);\n    }\n}\n"
  },
  {
    "path": "extensions/source/SourceHelper.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * Helper class for the Source component.\n *\n * - register the tab for all navigations\n *\n * @category  OntoWiki\n * @package   Extensions_Source\n * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\nclass SourceHelper extends OntoWiki_Component_Helper\n{\n    public function init()\n    {\n        OntoWiki::getInstance()->getNavigation()->register(\n            'source', array(\n                           'controller' => 'source', // source controller\n                           'action'     => 'edit', // ecit action\n                           'name'       => 'Source',\n                           'priority'   => 60)\n        );\n    }\n}\n"
  },
  {
    "path": "extensions/source/default.ini",
    "content": ";;\n; Basic component configuration\n;;\nenabled    = true\nname       = \"Source\"\ndescription= \"a tab for the list and resource view which displays the N3 source and allows source based editing\"\nauthor     = \"AKSW\"\nauthorUrl  = \"http://aksw.org\"\n\nnavigation = yes\nposition   = 100\ntemplates  = \"templates\"\naction     = \"edit\"\n\n[private]\n"
  },
  {
    "path": "extensions/source/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/source/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :source .\n:source a doap:Project ;\n  doap:name \"source\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/source/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Source\" ;\n  doap:description \"a tab for the list and resource view which displays the N3 source and allows source based editing\" ;\n  owconfig:authorLabel \"AKSW\" ;\n  doap:maintainer <http://aksw.org> ;\n  :navigation \"true\"^^xsd:boolean ;\n  :position \"100\" ;\n  owconfig:templates \"templates\" ;\n  owconfig:defaultAction \"edit\" ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "extensions/source/templates/source/edit.phtml",
    "content": "<?php if ($this->has('redirectUri')): ?>\n    <input type=\"hidden\" name=\"redirect-uri\" value=\"<?php echo $this->redirectUri ?>\"/>\n<?php endif; ?>\n<input type=\"hidden\" name=\"named-graph-uri\" value=\"<?php echo $this->graphUri ?>\"/>\n<textarea style=\"display:none\" name=\"original-graph\"><?php echo $this->source ?></textarea>\n<input type=\"hidden\" name=\"original-format\" value=\"nt\"/>\n<textarea name=\"modified-graph\" cols=\"80\" rows=\"25\" class=\"width100 code-input\" <?php echo $this->readonly ?>><?php echo $this->source ?></textarea>\n<input type=\"hidden\" name=\"modified-format\" value=\"nt\"/>\n"
  },
  {
    "path": "extensions/source/tests/SourceControllerTest.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2006-2013, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nclass SourceControllerTest extends OntoWiki_Test_ControllerTestCase\n{\n    public function setUp()\n    {\n        $this->_extensionName = 'source';\n\n        $this->setUpExtensionUnitTest();\n    }\n\n    public function testDispatching()\n    {\n        $this->_storeAdapter->createModel('http://localhost/OntoWiki/Config/');\n        $this->_ac->setUserModelRight('http://localhost/OntoWiki/Config/', 'view', 'grant');\n        $this->_ac->setUserModelRight('http://localhost/OntoWiki/Config/', 'edit', 'grant');\n\n        $this->request->setParam('m', 'http://localhost/OntoWiki/Config/');\n        $this->dispatch('/source/edit');\n\n        $this->assertController('source');\n        $this->assertAction('edit');\n        @$this->assertResponseCode(200);\n    }\n}\n"
  },
  {
    "path": "extensions/themes/.htaccess",
    "content": "#\n# OntoWiki requires Apache's rewrite engine to work\n#\n<IfModule mod_rewrite.c>\n\tRewriteEngine Off\n\tRewriteRule !\\.(js|ico|gif|jpg|png|css|php)$ index.php\n#\n# Set RewriteBase only if your OntoWiki folder is not \n# located in your web server's root dir.\n#\n#\tRewriteBase /path/to/ontowiki\n\n</IfModule>\n"
  },
  {
    "path": "extensions/themes/darkorange/install.txt",
    "content": "The OntoWiki \"Dark Orange\" Stylesheet is an add-on top of the default\nSilverblue theme styles.\n\n## Activation\n\nAdd to you config.ini:\n\n    themes.styles.darkorange = \"darkorange\"\n"
  },
  {
    "path": "extensions/themes/darkorange/styles/default.css",
    "content": "/**\n *\n * OntoWiki Extra Styles\n * DARK ORANGE\n *\n * @depends   OntoWiki Silverblue Theme\n * @author    http://michael.haschke.biz/\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n *\n *************************************************************************/\n\n/* -- 1. Windows ------------------------------------------------------- */\n\ndiv.window .title\n{\n    background-color: #444;\n}\n\n/* -- 2. Upper Control Panel ------------------------------------------- */\n\n#application\n{\n    background-color: #444;\n}\n\n#application ul.clickMenu > li.main\n{\n    color: #eee;\n}\n\n#application ul.clickMenu > li.main.hover\n{\n    background-color: orange;\n    color: #fff;\n}\n\n#application ul.clickMenu > li.main li,\n#application ul.clickMenu > li.main a\n{\n    color: #333;\n}\n\n#application ul.clickMenu li.hover > a\n{\n    color: #fff;\n}\n\n#application #searchtext-input\n{\n    border-color: #222;\n}\n\n/* -- 3. Dropdown Menus ------------------------------------------------ */\n\nul.clickMenu li.hover\n{\n    background-color: orange;\n    /* color: #fff; */\n}\n\nul.clickMenu li.hover > a:hover\n{\n    /* color: #fff; */\n}\n\nul.clickMenu li > a\n{\n    color: #333;\n}\n\nul.clickMenu li.hover > a:focus,\nul.clickMenu li.hover > a:hover\n{\n    color: #000;\n}\n\n/* -- 4. Links ------------------------------------------------------------\n\n   - #DC3B00 is adjusted #ff4500 (orangered) on white for some more contrast\n\n*/\n\na {\n    color: #DC3B00;\n}\n\na:focus, a:hover {\n    color: #DC3B00;\n}\n\na img.boxed { border-color: #DC3B00; }\n\na:focus img.boxed, a:hover img.boxed { border-color: #DC3B00; }\n\n/* -- 5. Blocklinks ---------------------------------------------------- */\n\n.has-contextmenus-block a.Resource:focus,\n.has-contextmenus-block a.Resource:hover\n{\n    background-color: #FFFBE6;\n}\n\n.marked, tr.list-selected td, .selected, tr.marked td\n{\n    background-color: #FFF4C9 !important;\n    border-color: #eee3b8 !important;\n}\n\n/* -- 6. Input fields -------------------------------------------------- */\n\ninput.text:hover, input.password:hover, textarea:hover\n{\n    background: #FFFBE6;\n}\n\ninput.text:focus, input.password:focus, textarea:focus\n{\n    box-shadow: 0px 0px 0.35em orange inset;\n}\n\n/* -- 7. Tabs ---------------------------------------------------------- */\n\ndiv.window .tabs li a:focus,\ndiv.window .tabs li a:hover\n{\n    background-color: #FFFBE6;\n}\n\ndiv.window .tabs li.active a\n{\n    background-image: -webkit-linear-gradient(top, orange 0%, orange 2px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0) 100%);\n    background-image: -moz-linear-gradient(top, orange 0%, orange 2px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0) 100%);\n    background-image: -ms-linear-gradient(top, orange 0%, orange 2px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0) 100%);\n    background-image: -o-linear-gradient(top, orange 0%, orange 2px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0) 100%);\n    background-image: linear-gradient(top, orange 0%, orange 2px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0) 100%);\n}\n\n/* -- 8. Buttons ------------------------------------------------------- */\n\na.formbutton:focus,\nbutton:focus, input.formbutton:focus,\ndiv.window .content a.button:focus,\ninput.button:focus, input.submit:focus, input.reset:focus,\nul.minibutton li a:focus, li.minibutton a:focus, a.minibutton:focus,\n.ui-state-default.ui-button:focus,\na.formbutton:hover,\nbutton:hover, input.formbutton:hover,\ndiv.window .content a.button:hover,\ninput.button:hover, input.submit:hover, input.reset:hover,\nul.minibutton li a:hover, li.minibutton a:hover, a.minibutton:hover,\n.ui-state-default.ui-button:hover\n{\n    background-color: #FFFBE6;\n    box-shadow: 0 0 2px orange;\n}\n\na.active,\na.formbutton:active,\nbutton:active, input.formbutton:active,\ndiv.window .content a.button:active,\ninput.button:active, input.submit:active, input.reset:active,\nul.minibutton li a:active, li.minibutton a:active, a.minibutton:active,\n.ui-state-default.ui-button:active\n{\n    background-color: #FFFBE6;\n}\n\n/* -- 8. Contextmenu ------------------------------------------------------\n*/\n\n.contextmenu ul a:hover,\n.contextmenu ol a:hover,\n.contextmenu ul span:hover,\n.contextmenu ol span:hover\n{\n    background-color: orange;\n    border-color: orange;\n}\n"
  },
  {
    "path": "extensions/themes/silverblue/sandbox/detailview.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n        \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\n<head>\n<title>OntoWiki — Instances of Person</title>    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"OntoWiki — Collaborative Knowledge Engineering\" />\n<script type=\"text/javascript\">\nvar urlBase = \"http://localhost/ow/trunk/\";\nvar themeUrlBase = \"http://localhost/ow/trunk/extensions/themes/silverblue/\";\nvar _OWSESSION = \"ONTOWIKItrunk\";\nvar widgetBase = \"http://localhost/ow/trunk/libraries/RDFauthor/\";\nvar defaultGraph = \"http://sebastian.dietzold.de/rdf/foaf.rdf\";\nvar defaultResource = \"http://xmlns.com/foaf/0.1/Person\";\n</script>\n\n    <!-- jQuery -->\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery-1.9.1.js\"></script>\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery-ui-1.8.22.js\"></script>\n\n    <!-- included js libraries -->\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.json.js\"></script>\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.livequery.js\"></script>\n\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.clickmenu.js\"></script>\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.simplemodal.js\"></script>\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.tablesorter.js\"></script>\n\n    <!-- ontowiki js -->\n    <script type=\"text/javascript\" src=\"./../themes/silverblue/scripts/jquery.ontowiki.js\"></script>\n    <script type=\"text/javascript\" src=\"./../themes/silverblue/scripts/main.js\"></script>\n\n    <!-- dynamic js -->\n\n<script type=\"text/javascript\">\n    //<![CDATA[\nvar classUri = \"foaf:Person\";    //]]>\n</script>\n\n    <!-- ontowiki stylesheets -->\n\n    <link rel=\"stylesheet\" href=\"./../styles/default.css\" type=\"text/css\" media=\"screen\" />\n    <link rel=\"stylesheet\" href=\"./../styles/clickmenu.css\" type=\"text/css\" media=\"screen\" />\n    <link rel=\"stylesheet\" href=\"./../styles/jquery-ui.css\" type=\"text/css\" media=\"screen\" />\n\n    <!-- IE conditional stylesheets -->\n    <!--[if lte IE 6]><link rel=\"stylesheet\" media=\"screen\" href=\"http://localhost/ow/trunk/extensions/themes/silverblue/styles/default.ie6.css\" /><![endif]-->\n    <!--[if lte IE 6]><link rel=\"stylesheet\" media=\"screen\" href=\"http://localhost/ow/trunk/extensions/themes/silverblue/styles/clickmenu.msie.css\" /><![endif]-->\n    <!--[if IE 7]><link rel=\"stylesheet\" media=\"screen\" href=\"http://localhost/ow/trunk/extensions/themes/silverblue/styles/default.ie7.css\" /><![endif]-->\n\n    <!-- dynamic styles -->\n    </head>\n\n\n\n</head>\n    <body class=\"javascript-off\">\n\n\n\n    <script type=\"text/javascript\">\n        // get body element\n        var body = document.body;\n        var bodyClass = body.className;\n        // set javascript = on\n        bodyClass = bodyClass.replace(/javascript-off/g, \"javascript-on\");\n        // process changes\n        body.setAttribute(\"class\", bodyClass, 0);\n    </script>\n\n    <script type=\"text/javascript\">\n    //<![CDATA[\n/* from modules/navigation/ */\nvar navigationConfigString = '{\"default\":\"classes\",\"config\":{\"skos\":{\"name\":\"SKOS\",\"hierarchyTypes\":[\"http:\\/\\/www.w3.org\\/2004\\/02\\/skos\\/core#Concept\",\"http:\\/\\/www.w3.org\\/2004\\/02\\/skos\\/core#Collection\"],\"hierarchyRelations\":{\"in\":[\"http:\\/\\/www.w3.org\\/2004\\/02\\/skos\\/core#broader\"],\"out\":[\"http:\\/\\/www.w3.org\\/2004\\/02\\/skos\\/core#narrower\"]}},\"classes\":{\"name\":\"Classes\",\"hierarchyTypes\":[\"http:\\/\\/www.w3.org\\/2000\\/01\\/rdf-schema#Class\",\"http:\\/\\/www.w3.org\\/2002\\/07\\/owl#Class\"],\"hierarchyRelations\":{\"in\":[\"http:\\/\\/www.w3.org\\/2000\\/01\\/rdf-schema#subClassOf\"]},\"instanceRelation\":{\"out\":[\"http:\\/\\/www.w3.org\\/1999\\/02\\/22-rdf-syntax-ns#type\"]},\"hiddenNS\":[\"http:\\/\\/www.w3.org\\/1999\\/02\\/22-rdf-syntax-ns#\",\"http:\\/\\/www.w3.org\\/2000\\/01\\/rdf-schema#\",\"http:\\/\\/www.w3.org\\/2002\\/07\\/owl#\"],\"hiddenRelation\":[\"http:\\/\\/ns.ontowiki.net\\/SysOnt\\/hidden\"]}}}'\nvar navigationConfig = $.evalJSON(navigationConfigString);\n    //]]>\n</script>\n    <div class=\"section-mainwindows\">\n        <div class=\"window tabbed windowbuttonscount-right-1 has-menu\">\n                        <h1 class=\"title\">Properties of Michael Haschke</h1>\n            <div class=\"slidehelper\">\n                                    <div id=\"pre_tabs_content\">\n                        <div style=\"padding: 10px 20px 10px 30px; display: none;\" id=\"location_bar_container\" class=\"cmDiv\">\n                    <input id=\"location_bar_input\" class=\"text width75\" value=\"http://eye48.com/foaf.rdf#me\" name=\"l\" type=\"text\">\n                    <a id=\"location_open\" class=\"minibutton\" style=\"float: none;\">View Resource</a>\n                 </div>                    </div>\n                                    <ol class=\"tabs\">\n                    <li id=\"index\" class=\"active\">\n                <a href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Feye48.com%2Ffoaf.rdf%23me\">Properties</a>\n            </li>\n                    <li id=\"history\" class=\"\">\n                <a href=\"http://localhost/ow/trunk/history/list/?r=http%3A%2F%2Feye48.com%2Ffoaf.rdf%23me\">History</a>\n            </li>\n                    <li id=\"community\" class=\"\">\n                <a href=\"http://localhost/ow/trunk/community/list/?r=http%3A%2F%2Feye48.com%2Ffoaf.rdf%23me\">Community</a>\n            </li>\n                    <li id=\"source\" class=\"\">\n                <a href=\"http://localhost/ow/trunk/source/edit/?r=http%3A%2F%2Feye48.com%2Ffoaf.rdf%23me\">Source</a>\n            </li>\n            </ol>\n\n                                    <div class=\"content has-innerwindows active-tab-content\">\n\n                                                    <div class=\"messagebox\"><div class=\"toolbar\"><a class=\"button edit-enable\"><img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/icon-edit.png\"><span>&nbsp;Edit Properties</span></a><a class=\"button\" href=\"javascript:createInstanceFromURI('http://eye48.com/foaf.rdf#me');\"><img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/icon-editadd.png\"><span>&nbsp;Clone Resource</span></a><a class=\"button separator\"></a><a class=\"button\" href=\"http://localhost/ow/trunk/resource/delete/?r=http%3A%2F%2Feye48.com%2Ffoaf.rdf%23me\"><img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/icon-delete.png\"><span>&nbsp;Delete Resource</span></a></div></div>\n\n                        <div class=\"innercontent\">\n\n                            <span about=\"http://eye48.com/foaf.rdf#me\" style=\"display: none;\" class=\"about_span Resource\"></span>\n<table class=\"separated-vertical rdfa Resource\" about=\"http://eye48.com/foaf.rdf#me\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" xmlns:ns0=\"http://webns.net/mvcb/\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\" xmlns:__default=\"http://sebastian.dietzold.de/rdf/foaf.rdf\">\n\n                                        <tbody update:from=\"http://sebastian.dietzold.de/rdf/foaf.rdf\" id=\"table-group-1\">\n                                            <tr>\n                <td width=\"25%\">\n                    <a class=\"hasMenu Resource\" about=\"http://www.w3.org/2000/01/rdf-schema#seeAlso\" href=\"http://localhost/ow/trunk/view/r/rdfs%3AseeAlso\">seeAlso<span class=\"toggle\" title=\"Menu\"></span></a>\n                </td>\n                                                    <td>\n                                                                        <span class=\"icon-button expand\"></span><a rel=\"rdfs:seeAlso\" class=\"expandable hasMenu Resource\" resource=\"http://eye48.com/foaf.rdf\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Feye48.com%2Ffoaf.rdf\"><span class=\"toggle\" title=\"Menu\"></span></a><a resource=\"http://eye48.com/foaf.rdf\" class=\"hasMenu Resource\" href=\"http://eye48.com/foaf.rdf\">http://eye48.com/foaf.rdf<span class=\"toggle\" title=\"Menu\"></span></a>\n                                                            </td>\n                            </tr>\n                                <tr>\n                <td width=\"25%\">\n                    <a class=\"hasMenu Resource\" about=\"http://xmlns.com/foaf/0.1/depiction\" href=\"http://localhost/ow/trunk/view/r/foaf%3Adepiction\">depiction<span class=\"toggle\" title=\"Menu\"></span></a>\n                </td>\n                                                    <td>\n                                                                        <span class=\"icon-button expand\"></span><a rel=\"foaf:depiction\" class=\"expandable hasMenu Resource\" resource=\"http://sebastian.dietzold.de/pics/people/haschek.jpg\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fpics%2Fpeople%2Fhaschek.jpg\"><img class=\"object\" src=\"http://sebastian.dietzold.de/pics/people/haschek.jpg\" alt=\"image of http://sebastian.dietzold.de/pics/people/haschek.jpg\"><span class=\"toggle\" title=\"Menu\"></span></a>\n                                                            </td>\n                            </tr>\n                                <tr>\n                <td width=\"25%\">\n                    <a class=\"hasMenu Resource\" about=\"http://xmlns.com/foaf/0.1/knows\" href=\"http://localhost/ow/trunk/view/r/foaf%3Aknows\">knows<span class=\"toggle\" title=\"Menu\"></span></a>\n                </td>\n                                <td><div class=\"has-contextmenu-area\">\n                    <ul class=\"bullets-none\">\n                                                                                    <li>\n                                    <span class=\"icon-button expand\"></span><a resource=\"http://sebastian.dietzold.de/terms/Nudge\" rel=\"foaf:knows\" class=\"expandable hasMenu Resource\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2FNudge\">Mathias Lieber<span class=\"toggle\" title=\"Menu\"></span></a>\n                                </li>\n                                                                                                                <li>\n                                    <span class=\"icon-button expand\"></span><a resource=\"http://sebastian.dietzold.de/terms/Seppl\" rel=\"foaf:knows\" class=\"expandable hasMenu Resource\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2FSeppl\">Sebastian Uhlig<span class=\"toggle\" title=\"Menu\"></span></a>\n                                </li>\n                                                                                                                <li>\n                                    <span class=\"icon-button expand\"></span><a resource=\"http://sebastian.dietzold.de/terms/me\" rel=\"foaf:knows\" class=\"expandable hasMenu Resource\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2Fme\">Sebastian Dietzold<span class=\"toggle\" title=\"Menu\"></span></a>\n                                </li>\n                                                                                                </ul>\n                    <div class=\"contextmenu\">\n                        <a class=\"item\"><span class=\"icon icon-edit\" title=\"Editieren\"><span>Editieren</span></span></a>\n                    </div>\n                </div></td>\n                            </tr>\n                                <tr>\n                <td width=\"25%\">\n                    <a class=\"hasMenu Resource\" about=\"http://xmlns.com/foaf/0.1/mbox_sha1sum\" href=\"http://localhost/ow/trunk/view/r/foaf%3Ambox_sha1sum\">sha1sum of a personal mailbox URI name<span class=\"toggle\" title=\"Menu\"></span></a>\n                </td>\n                                                    <td>\n                                            <span property=\"foaf:mbox_sha1sum\" content=\"b46e0640d19dcc6ac3d4c0da17c4e65152c0ad37\">b46e0640d19dcc6ac3d4c0da17c4e65152c0ad37</span>\n                                    </td>\n                            </tr>\n                                <tr>\n                <td width=\"25%\">\n                    <a class=\"hasMenu Resource\" about=\"http://xmlns.com/foaf/0.1/name\" href=\"http://localhost/ow/trunk/view/r/foaf%3Aname\">name<span class=\"toggle\" title=\"Menu\"></span></a>\n                </td>\n                                                    <td>\n                                            <span property=\"foaf:name\" content=\"Michael Haschke\">Michael Haschke</span>\n                                    </td>\n                            </tr>\n                                <tr>\n                <td width=\"25%\">\n                    <a class=\"hasMenu Resource\" about=\"http://xmlns.com/foaf/0.1/nick\" href=\"http://localhost/ow/trunk/view/r/foaf%3Anick\">nickname<span class=\"toggle\" title=\"Menu\"></span></a>\n                </td>\n                                                    <td>\n                                            <span property=\"foaf:nick\" content=\"Haschek\">Haschek</span>\n                                    </td>\n                            </tr>\n                                <tr>\n                <td width=\"25%\">\n                    <a class=\"hasMenu Resource\" about=\"http://xmlns.com/foaf/0.1/weblog\" href=\"http://localhost/ow/trunk/view/r/foaf%3Aweblog\">weblog<span class=\"toggle\" title=\"Menu\"></span></a>\n                </td>\n                                                    <td>\n                                                                        <span class=\"icon-button expand\"></span><a rel=\"foaf:weblog\" class=\"expandable hasMenu Resource\" resource=\"http://haschek.eye48.com/\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fhaschek.eye48.com%2F\"><span class=\"toggle\" title=\"Menu\"></span></a><a resource=\"http://haschek.eye48.com/\" class=\"hasMenu Resource\" href=\"http://haschek.eye48.com/\">http://haschek.eye48.com/<span class=\"toggle\" title=\"Menu\"></span></a>\n                                                            </td>\n                            </tr>\n            </tbody>\n        </table>\n                        </div><!-- .innercontent -->\n\n                                                <div class=\"innerwindows\">\n                            <div class=\"window windowbuttonscount-right-1\" id=\"tagging\">\n\n            <h1 class=\"title\">Tagging</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n\n<p><input autocomplete=\"off\" class=\"text width98 inner-label ac_input\" id=\"tagging-input\" name=\"tagging-input\" value=\"\" type=\"text\"></p>\n<div class=\"Resource\" id=\"tagging-content\" about=\"http://eye48.com/foaf.rdf#me\"><ol class=\"bullets-none horizontal\">\n</ol>\n\n            <span class=\"messagebox info\">No tags yet.</span>\n    </div>                </div><!-- .window .content -->\n\n\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n<div class=\"window windowbuttonscount-right-1\" id=\"similarinstances\">\n\n            <h1 class=\"title\">Similar Instances</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n                                        \t<ul class=\"bullets-none separated-vertical\">\n\t    \t        <li>Person:\n\t            <ul class=\"bullets-none separated-horizontal\">\n\t                \t                \t                    \t                        <li><a class=\"hasMenu Resource\" about=\"http://sebastian.dietzold.de/terms/Joerg\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2FJoerg\">Jörg Linke<span class=\"toggle\" title=\"Menu\"></span></a></li>\n\t                                        \t                    \t                        <li><a class=\"hasMenu Resource\" about=\"http://sebastian.dietzold.de/terms/Nici\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2FNici\">Nicole Lieber<span class=\"toggle\" title=\"Menu\"></span></a></li>\n\t                                        \t                    \t                        <li><a class=\"hasMenu Resource\" about=\"http://sebastian.dietzold.de/terms/Dominik\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2FDominik\">Dominik Wolf<span class=\"toggle\" title=\"Menu\"></span></a></li>\n\t                                        \t                    \t                        <li><a class=\"hasMenu Resource\" about=\"http://sebastian.dietzold.de/terms/Nudge\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2FNudge\">Mathias Lieber<span class=\"toggle\" title=\"Menu\"></span></a></li>\n\t                                        \t                    \t                        <li class=\"last-child\"><a class=\"hasMenu Resource\" about=\"http://sebastian.dietzold.de/terms/Roland\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2FRoland\">Roland Mücke<span class=\"toggle\" title=\"Menu\"></span></a></li>\n\t                                                                \t                <li class=\"last-child\">\n    \t                    <a href=\"http://localhost/ow/trunk/list/r/foaf%3APerson\">[more]</a>\n    \t                </li>\n    \t            \t            </ul>\n\t        </li>\n\t    \t</ul>\n                </div><!-- .window .content -->\n\n\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n<div class=\"window windowbuttonscount-right-1\" id=\"linkinghere\">\n\n            <h1 class=\"title\">Instances Linking Here</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n                                        \t<ul class=\"bullets-none separated-vertical\">\n\t    \t        <li>member<sup>-1</sup>\n\t            <ul class=\"bullets-none separated-horizontal\">\n\t                \t                \t                    \t                        <li class=\"last-child\"><a class=\"hasMenu Resource\" about=\"http://musicbrainz.org/mm-2.1/artist/53c809d4-5ada-4463-95ae-e3cb95488e94\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fmusicbrainz.org%2Fmm-2.1%2Fartist%2F53c809d4-5ada-4463-95ae-e3cb95488e94\">Farmer's Boulevard<span class=\"toggle\" title=\"Menu\"></span></a></li>\n\t                                        \t            </ul>\n\t        </li>\n\t    \t        <li>close friend of<sup>-1</sup>\n\t            <ul class=\"bullets-none separated-horizontal\">\n\t                \t                \t                    \t                        <li class=\"last-child\"><a class=\"hasMenu Resource\" about=\"http://sebastian.dietzold.de/terms/me\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2Fme\">Sebastian Dietzold<span class=\"toggle\" title=\"Menu\"></span></a></li>\n\t                                        \t            </ul>\n\t        </li>\n\t    \t        <li>maker<sup>-1</sup>\n\t            <ul class=\"bullets-none separated-horizontal\">\n\t                \t                \t                    \t                        <li><a class=\"hasMenu Resource\" about=\"http://sebastian.dietzold.de/terms/project.sxhc\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2Fproject.sxhc\">sxhc.de<span class=\"toggle\" title=\"Menu\"></span></a></li>\n\t                                        \t                    \t                        <li class=\"last-child\"><a class=\"hasMenu Resource\" about=\"http://weltweit24maerz.de/doap.rdf#this\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fweltweit24maerz.de%2Fdoap.rdf%23this\">Weltweit 24.März<span class=\"toggle\" title=\"Menu\"></span></a></li>\n\t                                        \t            </ul>\n\t        </li>\n\t    \t</ul>\n                </div><!-- .window .content -->\n\n\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n                        </div><!-- .innerwindows -->\n\n                    </div><!-- .content .has-innerwindows -->\n\n                                    <div class=\"cmDiv\"><ul class=\"menu clickMenu\">\n                                    <li class=\"main\">Resource            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li>\n                                                            <a class=\"location_bar show\">\n                                Show/Hide Location Bar                            </a>\n                        </li>\n                                                                                <!-- TODO: this is invalid XHTML -->\n                        <hr class=\"menusep\">\n                                                                                <li><a href=\"http://localhost/ow/trunk/resource/export/f/rdfxml?r=http%3A%2F%2Feye48.com%2Ffoaf.rdf%23me\">Export Resource as RDF/XML</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/resource/export/f/turtle?r=http%3A%2F%2Feye48.com%2Ffoaf.rdf%23me\">Export Resource as Turtle</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/resource/export/f/rdfjson?r=http%3A%2F%2Feye48.com%2Ffoaf.rdf%23me\">Export Resource as RDF/JSON (Talis)</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/resource/export/f/rdfn3?r=http%3A%2F%2Feye48.com%2Ffoaf.rdf%23me\">Export Resource as Notation 3</a></li>\n                                                                                <!-- TODO: this is invalid XHTML -->\n                        <hr class=\"menusep\">\n                                                                                <li>\n                                                            <a about=\"http://eye48.com/foaf.rdf#me\" class=\"fetch_data_button wrapper_linkeddata Resource\">\n                                Import Data with Linked Data Wrapper                            </a>\n                        </li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/datagathering/config?uri=http%3A%2F%2Feye48.com%2Ffoaf.rdf%23me&amp;wrapper=linkeddata\">Configure Sync with Linked Data Wrapper</a></li>\n                                                </ul></div>\n        </li>\n                        </ul><div style=\"clear: both; visibility: hidden;\"></div></div>\n\n                            </div><!-- .slidehelper -->\n        <div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n    </div><!-- .section-mainwindows -->\n\n    <div class=\"section-sidewindows\">\n        <div class=\"window windowbuttonscount-right-1 has-menu\" id=\"application\">\n\n            <h1 class=\"title\">OntoWiki (Admin)</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n\n<form name=\"search\" method=\"get\" action=\"http://localhost/ow/trunk/resource/instances/\">\n\t\t<p class=\"width98\">\n\t\t<label class=\"display-block onlyAural\" for=\"searchtext-input\">Search for Resources</label>\n\t\t<input class=\"text width99 inner-label\" id=\"searchtext-input\" name=\"s\" value=\"\" type=\"text\">\n\t</p>\n\t\t<p>\n\t\t<!--label class=\"display-block\">\n\t\t    \t\t\t<input class=\"checkbox\" type=\"checkbox\" name=\"allModels\" id=\"allModels\" />\n\t\t\tSearch all Knowledge Bases\t\t</label-->\n\t\t\t\t<!--a class=\"button submit\">Submit</a-->\n\t</p>\n</form>\n                </div><!-- .window .content -->\n\n                    <div class=\"cmDiv\"><ul class=\"menu clickMenu\">\n                                        <li class=\"main\">User            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"http://localhost/ow/trunk/application/register\">Register New User</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/application/preferences\">Preferences</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/application/logout\">Logout</a></li>\n                                                </ul></div>\n        </li>\n                                <li class=\"main\">Extras            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"http://localhost/ow/trunk/querybuilding/editor\">SPARQL Query Editor</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/index/news\">News</a></li>\n                                                </ul></div>\n        </li>\n                                <li class=\"main\">Help            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"http://ontowiki.net/Projects/OntoWiki/Help\">Documentation</a></li>\n                                                                                <li><a href=\"http://code.google.com/p/ontowiki/issues/entry\">Bug Report</a></li>\n                                                                                <li><a href=\"http://ontowiki.net/Projects/OntoWiki/ChangeLog#0.9.5\">Version Info</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/application/about\">About</a></li>\n                                                </ul></div>\n        </li>\n                                <li class=\"main\">Debug            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"http://localhost/ow/trunk/debug/clearmodulecache\">Clear Module Cache</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/debug/cleartranslationcache\">Clear Translation Cache</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/debug/clearquerycache\">Clear Query Cache</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/debug/destroysession\">Destroy Session</a></li>\n                                                </ul></div>\n        </li>\n                    </ul><div style=\"clear: both; visibility: hidden;\"></div></div>\n\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n<div class=\"window has-contextmenus-block windowbuttonscount-right-1 windowbuttonscount-left-1\" id=\"modellist\">\n\n            <h1 class=\"title\">Knowledge Bases</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n                                            <ol class=\"bullets-none separated-vertical\">\n    \t    \t\t<li>\n    \t\t\t<a class=\"Model Resource\" href=\"http://localhost/ow/trunk/model/select/?m=http%3A%2F%2Flocalhost%2FOntoWiki%2FConfig%2F\" about=\"http://localhost/OntoWiki/Config/\">\n    \t\t\t\tOntoWiki System Configuration    \t\t\t<span class=\"button\"></span></a>\n    \t\t</li>\n    \t    \t\t<li>\n    \t\t\t<a class=\"Model selected Resource\" href=\"http://localhost/ow/trunk/model/select/?m=http%3A%2F%2Fsebastian.dietzold.de%2Frdf%2Ffoaf.rdf\" about=\"http://sebastian.dietzold.de/rdf/foaf.rdf\">\n    \t\t\t\tSeebis FOAF Profile    \t\t\t<span class=\"button\"></span></a>\n    \t\t</li>\n    \t    </ol>\n                </div><!-- .window .content -->\n\n\n                    <div class=\"contextmenu\">\n                <ul>\n                        <li><a href=\"http://localhost/ow/trunk/model/create\">Create Knowledge Base</a></li>\n                                </ul>\n                <hr>\n            <ul>\n                                <li>\n                                    <a class=\"modellist_hidden_button show\">\n                   Show Hidden Knowledge Bases                </a>\n            </li>\n            </ul>\n            </div>\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"><span class=\"button button-contextmenu\"></span></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n<div class=\"window has-contextmenus-block windowbuttonscount-right-1\" id=\"hierarchy\">\n\n            <h1 class=\"title\">Classes</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n                                        <!--form name=\"search\" method=\"get\" action=\"\">\n\t<p class=\"width98\">\n\t\t<label class=\"display-block\" for=\"hierarchy-input\">Type to search ...</label>\n\t\t<input class=\"inner-label text width100 live-search\" type=\"text\" id=\"hierarchy-input\" name=\"q\"/>\n\t</p>\n</form-->\n\t<ul class=\"bullets-none separated-vertical hierarchy\">\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/?r=http%3A%2F%2Fpurl.org%2Frss%2F1.0%2Fchannel\" about=\"http://purl.org/rss/1.0/channel\">\n\t\t\t\t\tchannel\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/?r=http%3A%2F%2Fwww.w3.org%2F2002%2F12%2Fcal%2Fical%23Vcalendar\" about=\"http://www.w3.org/2002/12/cal/ical#Vcalendar\">\n\t\t\t\t\tVcalendar\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AGroup\" about=\"http://xmlns.com/foaf/0.1/Group\">\n\t\t\t\t\tGroup\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AOnlineAccount\" about=\"http://xmlns.com/foaf/0.1/OnlineAccount\">\n\t\t\t\t\tOnline Account\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AOrganization\" about=\"http://xmlns.com/foaf/0.1/Organization\">\n\t\t\t\t\tOrganization\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3APerson\" about=\"http://xmlns.com/foaf/0.1/Person\">\n\t\t\t\t\tPerson\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3APersonalProfileDocument\" about=\"http://xmlns.com/foaf/0.1/PersonalProfileDocument\">\n\t\t\t\t\tPersonalProfileDocument\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AProject\" about=\"http://xmlns.com/foaf/0.1/Project\">\n\t\t\t\t\tProject\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t</ul>\n                </div><!-- .window .content -->\n\n\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n<div class=\"window has-contextmenus-block windowbuttonscount-right-1 has-menu\" id=\"navigation\">\n\n            <h1 class=\"title\">Navigation</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n\n<p><input class=\"text width98 inner-label\" id=\"navigation-input\" name=\"navigation-input\" value=\"\" type=\"text\"></p>\n<p style=\"overflow: hidden; margin-left: 0px;\" id=\"navigation-content\" class=\"\">\n    <ol class=\"bullets-none separated-vertical\">\n            <li class=\"even\">\n            <a class=\"navigation Resource\" about=\"http://purl.org/rss/1.0/channel\">channel<span class=\"button\"></span></a>\n        </li>\n            <li class=\"odd\">\n            <a class=\"navigation Resource\" about=\"http://www.w3.org/2002/12/cal/ical#Vcalendar\">ical#Vcalendar<span class=\"button\"></span></a>\n        </li>\n            <li class=\"even\">\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/Group\">Group<span class=\"button\"></span></a>\n        </li>\n            <li class=\"odd\">\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/OnlineAccount\">OnlineAccount<span class=\"button\"></span></a>\n        </li>\n            <li class=\"even\">\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/Organization\">Organization<span class=\"button\"></span></a>\n        </li>\n            <li class=\"odd\">\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/Person\">Person<span class=\"button\"></span></a>\n        </li>\n            <li class=\"even\">\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/PersonalProfileDocument\">PersonalProfileDocument<span class=\"button\"></span></a>\n        </li>\n            <li class=\"odd\">\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/Project\">Project<span class=\"button\"></span></a>\n        </li>\n        </ol>\n\n<pre></pre></p>\n                </div><!-- .window .content -->\n\n                    <div class=\"cmDiv\"><ul class=\"menu clickMenu\">\n                                        <li class=\"main\">Type            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"javascript:navigationEvent('setType', 'skos')\">SKOS</a></li>\n                                                                                <li><a href=\"javascript:navigationEvent('setType', 'classes')\">Classes</a></li>\n                                                </ul></div>\n        </li>\n                                <li class=\"main\">View            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"javascript:navigationEvent('reset')\">Reset Navigation</a></li>\n                                                                                            <li>Number of entries            <img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/submenu-indicator.png\" class=\"liArrow\"><div style=\"position: absolute;\" class=\"outerbox\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"javascript:navigationEvent('setCount', 10)\">10</a></li>\n                                                                                <li><a href=\"javascript:navigationEvent('setCount', 20)\">20</a></li>\n                                                                                <li><a href=\"javascript:navigationEvent('setCount', 30)\">30</a></li>\n                                                                                <li><a href=\"javascript:navigationEvent('setCount', 'all')\">all</a></li>\n                                                </ul></div>\n        </li>\n                                                                                                <li>Sort            <img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/submenu-indicator.png\" class=\"liArrow\"><div style=\"position: absolute;\" class=\"outerbox\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"javascript:navigationEvent('setSort', 'name')\">by name</a></li>\n                                                                                <li><a href=\"javascript:navigationEvent('setSort', 'frequency')\">by frequency</a></li>\n                                                </ul></div>\n        </li>\n                                                    </ul></div>\n        </li>\n                    </ul><div style=\"clear: both; visibility: hidden;\"></div></div>\n\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n    <span style=\"cursor: ew-resize; position: absolute; height: 831px;\" class=\"resizer-horizontal ui-draggable\"></span></div><!-- .section-sidewindows -->\n        <!-- Rendered in 1557 ms using 27 SPARQL queries. -->\n<div class=\"contextmenu-enhanced\"></div>\n\n<div class=\"overlay\"></div>\n<div id=\"ziel\" class=\"versatile shadowed centered\">\n        <div class=\"window has-contextmenus-block windowbuttonscount-right-1\">\n\n                    <h1 class=\"title\">Classes</h1>\n\n            <div class=\"slidehelper\">\n\n\n                                            <div class=\"content\">\n\t        <ul class=\"bullets-none separated-vertical hierarchy\">\n\n\t\t\t\t\t        <li>\n\t\t\t            \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/?r=http%3A%2F%2Fpurl.org%2Frss%2F1.0%2Fchannel\" about=\"http://purl.org/rss/1.0/channel\">\n\t\t\t\t\t        channel\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t        </li>\n\t\t\t\t\t        <li>\n\t\t\t            \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/?r=http%3A%2F%2Fwww.w3.org%2F2002%2F12%2Fcal%2Fical%23Vcalendar\" about=\"http://www.w3.org/2002/12/cal/ical#Vcalendar\">\n\t\t\t\t\t        Vcalendar\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t        </li>\n\n\t\t\t\t\t        <li>\n\t\t\t            \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AGroup\" about=\"http://xmlns.com/foaf/0.1/Group\">\n\t\t\t\t\t        Group\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t        </li>\n\t\t\t\t\t        <li>\n\t\t\t            \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AOnlineAccount\" about=\"http://xmlns.com/foaf/0.1/OnlineAccount\">\n\t\t\t\t\t        Online Account\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t        </li>\n\n\t\t\t\t\t        <li>\n\t\t\t            \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AOrganization\" about=\"http://xmlns.com/foaf/0.1/Organization\">\n\t\t\t\t\t        Organization\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t        </li>\n\t\t\t\t\t        <li>\n\t\t\t            \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3APerson\" about=\"http://xmlns.com/foaf/0.1/Person\">\n\t\t\t\t\t        Person\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t        </li>\n\n\t\t\t\t\t        <li>\n\t\t\t            \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3APersonalProfileDocument\" about=\"http://xmlns.com/foaf/0.1/PersonalProfileDocument\">\n\t\t\t\t\t        PersonalProfileDocument\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t        </li>\n\t\t\t\t\t        <li>\n\t\t\t            \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AProject\" about=\"http://xmlns.com/foaf/0.1/Project\">\n\t\t\t\t\t        Project\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t        </li>\n\n\t\t\t        </ul>\n                        </div><!-- .window .content -->\n\n\n\n            </div><!-- .slidehelper -->\n\n        <div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div>\n</div>\n\n    </body>\n</html>\n\n"
  },
  {
    "path": "extensions/themes/silverblue/sandbox/filter.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n        \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\n<head>\n<title>OntoWiki sandbox : Form examples</title>\n<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n\n<!-- ontowiki stylesheets -->\n<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"./../styles/old.css\" />\n<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"./../styles/default.css\" />\n<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"./../styles/default.dev.css\" />\n<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"./../styles/clickmenu.css\" />\n\n<!-- IE conditional stylesheets -->\n<!--[if IE 7]>\n    <link rel=\"stylesheet\" media=\"screen\" href=\"./../styles/default.ie7.css\" />\n<![endif]-->\n<!--[if lte IE 6]>\n    <link rel=\"stylesheet\" media=\"screen\" href=\"./../styles/default.ie6.css\" />\n    <link rel=\"stylesheet\" media=\"screen\" href=\"./../styles/clickmenu.msie.css\" />\n<![endif]-->\n\n</head>\n\n<body xmlns:owl=\"http://www.w3.org/2002/07/owl/\" xmlns:SysOnt=\"http://ns.ontowiki.net/SysOnt/\" class=\"javascript-off\">\n\n<div class=\"section-mainwindows\"><!-- Section 1 -->\n\n<div class=\"window\">\n    <h1 class=\"title\">Filter GUI</h1>\n\t\t<div class=\"content has-innerwindows\">\n\t    <div class=\"innercontent\">\n\t\t\t\t<div class=\"messagebox info\">Dies sind Tests für innerwindow form elemente</div>\n\t\t\t</div>\n\t    <div class=\"innerwindows\">\n\t\t\t\t<div class=\"window\">\n\t\t\t\t\t<h2 class=\"title\">Textfield</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\tIn diesem form sollten die inhalte möglichst so groß wie das innerwindow sein und umbrechen.\n\t\t\t\t\t\tDas textarea sollte nur drei zeilen hoch sein.\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n</div>\n\n</div><!-- Section 1 -->\n\n<div class=\"section-sidewindows\"><!-- Section 2 -->\n\n    <div class=\"window\">\n        <h1 class=\"title\">Sandboxes</h1>\n        <div class=\"content\">\n            <ol class=\"bullets-none separated-vertical has-contextmenus-block\">\n                <li><a href=\"forms.html\">Form Examples</a></li>\n                <li><a href=\"tables.html\">Table Examples</a></li>\n                <li><a href=\"filter.html\" class=\"selected\">Filter GUI</a></li>\n            </ol>\n        </div>\n    </div>\n\n\n</div><!-- Section 2 -->\n\n</body>\n</html>\n\n"
  },
  {
    "path": "extensions/themes/silverblue/sandbox/forms.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n        \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\n<head>\n<title>OntoWiki sandbox : Form examples</title>\n<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n\n<!-- ontowiki stylesheets -->\n<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"./../styles/old.css\" />\n<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"./../styles/default.css\" />\n<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"./../styles/default.dev.css\" />\n<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"./../styles/clickmenu.css\" />\n\n<!-- IE conditional stylesheets -->\n<!--[if IE 7]>\n    <link rel=\"stylesheet\" media=\"screen\" href=\"./../styles/default.ie7.css\" />\n<![endif]-->\n<!--[if lte IE 6]>\n    <link rel=\"stylesheet\" media=\"screen\" href=\"./../styles/default.ie6.css\" />\n    <link rel=\"stylesheet\" media=\"screen\" href=\"./../styles/clickmenu.msie.css\" />\n<![endif]-->\n\n</head>\n\n<body xmlns:owl=\"http://www.w3.org/2002/07/owl/\" xmlns:SysOnt=\"http://ns.ontowiki.net/SysOnt/\" class=\"javascript-off\">\n\n<div class=\"section-mainwindows\"><!-- Section 1 -->\n\n<div class=\"window\">\n    <h1 class=\"title\">Form Examples</h1>\n    <div class=\"content\">\n    <form action=\"#\" method=\"post\">\n    <fieldset><legend>Registration 1</legend>\n        <div class=\"row-input input-justify-left\">\n            <label for=\"f1v\">Vorname</label> <input disabled type=\"text\" class=\"text disabled\" name=\"f1v\" id=\"f1v\" value=\"111\" /><br class=\"clearall\" />\n        </div>\n        <div class=\"row-input input-justify-left\">\n            <label for=\"f1n\">Nachname</label> <input disabled type=\"text\" class=\"text disabled\" name=\"f1n\" id=\"f1n\" value=\"222\" /><br class=\"clearall\" />\n        </div>\n        <div class=\"row-input input-justify-left\">\n            <label for=\"f1e\">Email-Adresse</label> <input type=\"text\" class=\"text\" name=\"f1e\" id=\"f1e\" /><br class=\"clearall\" />\n        </div>\n        <div class=\"row-input input-justify-left\">\n            <label for=\"f1p1\">Neues Passwort</label> <input type=\"password\" class=\"password\" name=\"f1p1\" id=\"f1p1\" /><br class=\"clearall\" />\n        </div>\n        <div class=\"row-input input-justify-left\">\n            <label for=\"f1p2\">Passwort Wiederholung</label> <input type=\"password\" class=\"password\" name=\"f1p2\" id=\"f1p2\" /><br class=\"clearall\" />\n        </div>\n        <div class=\"row-input input-justify-left\">\n            <input type=\"checkbox\" class=\"checkbox\" name=\"f1agb\" id=\"f1agb\" /><label for=\"f1agb\" class=\"checkboxradio\">Ich stimme den Nutzungsbedingungen zu!</label><br class=\"clearall\" />\n        </div>\n        <div class=\"row-input input-justify-left\">\n            <input type=\"radio\" class=\"radio\" name=\"f1ttt\" id=\"f1ttt\" /><label for=\"f1ttt\" class=\"checkboxradio\">nur ein Test</label><br class=\"clearall\" />\n        </div>\n        <div class=\"actionbuttons\">\n            <button type=\"submit\">Register now!</button>\n        </div>\n    </fieldset>\n    </form>\n\n    <form action=\"#\" method=\"post\" class=\"row-input input-justify-left\">\n    <fieldset><legend>Registration 2</legend>\n        <div class=\"width50 float-left\">\n            <label for=\"f2v\">Vorname</label> <input type=\"text\" class=\"text\" name=\"f2v\" id=\"f2v\" /><br class=\"clearall\" />\n        </div>\n        <div class=\"width50 float-right\">\n            <label for=\"f2n\">Nachname</label> <input type=\"text\" class=\"text\" name=\"f2n\" id=\"f2n\" /><br class=\"clearall\" />\n        </div><br class=\"clearall\" />\n        <div class=\"width50 float-left\">\n            <label for=\"f2p1\">Neues Passwort</label> <input type=\"password\" class=\"password\" name=\"f2p1\" id=\"f2p1\" /><br class=\"clearall\" />\n        </div>\n        <div class=\"width50 float-right\">\n            <label for=\"f2p2\">Passwort Wiederholung</label> <input type=\"password\" class=\"password\" name=\"f2p2\" id=\"f2p2\" /><br class=\"clearall\" />\n        </div><br class=\"clearall\" />\n        <div class=\"width50 float-left\">\n            <label for=\"f2e\">Email-Adresse</label> <input type=\"text\" class=\"text\" name=\"f2e\" id=\"f2e\" /><br class=\"clearall\" />\n        </div>\n        <div class=\"width50 float-right\">\n            <input type=\"checkbox\" class=\"checkbox\" name=\"f2agb\" id=\"f2agb\" /><label for=\"f2agb\" class=\"checkboxradio\">Ich stimme den Nutzungsbedingungen zu!</label><br class=\"clearall\" />\n        </div><br class=\"clearall\" />\n        <div class=\"width50 clearall\"><div class=\"actionbuttons\">\n            <button type=\"submit\">Register now!</button>\n        </div></div>\n    </fieldset>\n    </form>\n\n    <form action=\"#\" method=\"post\" class=\"row-input input-justify-left\">\n    <fieldset><legend>Comment</legend>\n        <div>\n            <label for=\"f3v\">Your Name</label> <input type=\"text\" class=\"text\" name=\"f3v\" id=\"f3v\" /><br class=\"clearall\" />\n        </div>\n        <div>\n            <label for=\"f3n\">Your Email-Address</label> <input type=\"text\" class=\"text\" name=\"f3n\" id=\"f3n\" /><br class=\"clearall\" />\n        </div>\n        <div>\n            <label for=\"f3e\">Your Website</label> <input type=\"text\" class=\"text\" name=\"f3e\" id=\"f3e\" /><br class=\"clearall\" />\n        </div>\n        <div>\n            <input type=\"radio\" class=\"radio\" name=\"f3d\" id=\"f3d1\" /><label for=\"f3d1\" class=\"checkboxradio\">Ich finde dich dufte.</label><br class=\"clearall\" />\n            <input type=\"radio\" class=\"radio\" name=\"f3d\" id=\"f3d2\" /><label for=\"f3d2\" class=\"checkboxradio\">Ich finde dich doof.</label><br class=\"clearall\" />\n        </div>\n        <div>\n            <label for=\"f3d3\">Am duftesten finde ich</label>\n            <select name=\"f3d3\" id=\"f3d3\" size=\"1\">\n                <option>Heino</option>\n                <option>Michael Jackson</option>\n                <option>Tom Waits</option>\n                <option>Nina Hagen</option>\n                <option>Marianne Rosenberg</option>\n                <option>Heino</option>\n                <option>Michael Jackson</option>\n                <option>Tom Waits</option>\n                <option>Nina Hagen</option>\n                <option>Marianne Rosenberg</option>\n            </select>\n            <br class=\"clearall\" />\n        </div>\n        <div>\n            <label for=\"f3c1\">Your Comment</label> <textarea name=\"f3c1\" id=\"f3c1\" cols=\"40\" rows=\"15\"></textarea><br class=\"clearall\" />\n        </div>\n        <div class=\"actionbuttons\">\n            <button type=\"submit\">Send!</button>\n        </div>\n    </fieldset>\n    </form>\n    </div>\n</div>\n\n<div class=\"window\">\n    <h1 class=\"title\">Form Test Stuff</h1>\n    <div class=\"content\">\n        <form action=\"#\" method=\"post\">\n        <fieldset><legend>Uberformtest mit Gruppierungen</legend>\n            <fieldset><legend>Textinput</legend>\n              <label for=\"t1\">Vorname</label> <input id=\"t1\" name=\"vorname\" type=\"text\" class=\"text\"/><br/>\n              <label for=\"t2\">Zuname</label> <input id=\"t2\" name=\"zuname\" type=\"text\" class=\"text\"/><br/>\n              <br />\n              <label>Vorname <input name=\"vorname\" type=\"text\" class=\"text\"/></label><br/>\n              <label>Zuname <input name=\"zuname\" type=\"text\" class=\"text\"/></label><br/>\n              <br />\n              <label for=\"p1\">Vorname</label> <input id=\"p1\" name=\"vorname\" type=\"password\" class=\"password\"/><br/>\n              <label>Passwort <input name=\"vorname\" type=\"password\" class=\"password\" /></label><br/>\n\n                <fieldset><legend><label for=\"ta\">Textarea</label></legend>\n                    <textarea name=\"user_eingabe\" id=\"ta\" cols=\"40\" rows=\"15\"></textarea>\n                </fieldset>\n\n            </fieldset>\n\n            <fieldset><legend><a href=\"http://de.selfhtml.org/html/formulare/auswahl.htm#checkboxen\">Checkbox</a></legend>\n                <input type=\"checkbox\" name=\"zutat\" id=\"c1\" value=\"salami\" class=\"checkbox\" /> <label for=\"c1\">Salami</label><br/>\n                <input type=\"checkbox\" name=\"zutat\" id=\"c2\" value=\"pilze\" class=\"checkbox\" /> <label for=\"c2\">Pilze</label><br/>\n                <input type=\"checkbox\" name=\"zutat\" id=\"c3\" value=\"sardellen\" class=\"checkbox\" /> <label for=\"c3\">Sardellen</label><br/>\n                <br />\n                <label><input type=\"checkbox\" name=\"zutat\" value=\"salami\" class=\"checkbox\" /> Salami</label><br/>\n                <label><input type=\"checkbox\" name=\"zutat\" value=\"pilze\" class=\"checkbox\" /> Pilze</label><br/>\n                <label><input type=\"checkbox\" name=\"zutat\" value=\"sardellen\" class=\"checkbox\" /> Sardellen</label><br/>\n            </fieldset>\n\n            <fieldset><legend><a href=\"http://de.selfhtml.org/html/formulare/auswahl.htm#radiobuttons\">Radio-Button</a></legend>\n                <input type=\"radio\" name=\"zutat1\" id=\"r1\" value=\"salami\" class=\"radio\" /> <label for=\"r1\">Salami</label><br/>\n                <input type=\"radio\" name=\"zutat1\" id=\"r2\" value=\"pilze\" class=\"radio\" /> <label for=\"r2\">Pilze</label><br/>\n                <input type=\"radio\" name=\"zutat1\" id=\"r3\" value=\"sardellen\" class=\"radio\" /> <label for=\"r3\">Sardellen</label><br/>\n                <br />\n                <label><input type=\"radio\" name=\"zutat2\" value=\"salami\" class=\"radio\" /> Salami</label><br/>\n                <label><input type=\"radio\" name=\"zutat2\" value=\"pilze\" class=\"radio\" /> Pilze</label><br/>\n                <label><input type=\"radio\" name=\"zutat2\" value=\"sardellen\" class=\"radio\" /> Sardellen</label><br/>\n            </fieldset>\n\n            <fieldset><legend><a href=\"http://de.selfhtml.org/html/formulare/auswahl.htm#listen\">Selects</a></legend>\n                <label for=\"s1\">Auswahl</label> <select id=\"s1\" name=\"Namen\" size=\"10\" class=\"bigsize\">\n                  <optgroup label=\"Namen mit A\">\n                    <option label=\"Anna\">Anna</option>\n                    <option label=\"Achim\">Achim</option>\n                    <option label=\"August\">August</option>\n                  </optgroup>\n                  <optgroup label=\"Namen mit B\">\n                    <option label=\"Berta\">Berta</option>\n                    <option label=\"Barbara\">Barbara</option>\n                    <option label=\"Bernhard\">Bernhard</option>\n                  </optgroup>\n                  <optgroup label=\"Namen mit C\">\n                    <option label=\"Caesar\">Caesar</option>\n                    <option label=\"Christiane\">Christiane</option>\n                    <option label=\"Christian\">Christian</option>\n                  </optgroup>\n                </select>\n                <br /><br />\n                <label for=\"s2\">Auswahl</label> <select id=\"s2\" name=\"Namen2\" size=\"1\">\n                  <optgroup label=\"Namen mit A\">\n                    <option label=\"Anna\">Anna</option>\n                    <option label=\"Achim\">Achim</option>\n                    <option label=\"August\">August</option>\n                  </optgroup>\n                  <optgroup label=\"Namen mit B\">\n                    <option label=\"Berta\">Berta</option>\n                    <option label=\"Barbara\">Barbara</option>\n                    <option label=\"Bernhard\">Bernhard</option>\n                  </optgroup>\n                  <optgroup label=\"Namen mit C\">\n                    <option label=\"Caesar\">Caesar</option>\n                    <option label=\"Christiane\">Christiane</option>\n                    <option label=\"Christian\">Christian</option>\n                  </optgroup>\n                </select>\n                <br /><br />\n                <select name=\"top5\" size=\"10\" multiple=\"multiple\" class=\"bigsize multiple\">\n                    <option>Heino</option>\n                    <option>Michael Jackson</option>\n                    <option>Tom Waits</option>\n                    <option>Nina Hagen</option>\n                    <option>Marianne Rosenberg</option>\n                    <option>Heino</option>\n                    <option>Michael Jackson</option>\n                    <option>Tom Waits</option>\n                    <option>Nina Hagen</option>\n                    <option>Marianne Rosenberg</option>\n                </select>\n                <br /><br />\n                <select name=\"top5\" size=\"1\">\n                    <option>Heino</option>\n                    <option>Michael Jackson</option>\n                    <option>Tom Waits</option>\n                    <option>Nina Hagen</option>\n                    <option>Marianne Rosenberg</option>\n                    <option>Heino</option>\n                    <option>Michael Jackson</option>\n                    <option>Tom Waits</option>\n                    <option>Nina Hagen</option>\n                    <option>Marianne Rosenberg</option>\n                </select>\n            </fieldset>\n\n            <fieldset><legend>Button-Test</legend>\n                <p>input type=submit | input type=reset | input.formbutton | input.button | button | a.formbutton | a.button</p>\n                <input type=\"submit\" class=\"submit\" value=\"Button 1\" />\n                <input type=\"reset\" class=\"reset\" value=\"Button 2\" />\n                <input class=\"formbutton\" type=\"submit\" value=\"Button 3\" />\n                <input class=\"button\" type=\"submit\" value=\"Button 4\" />\n                <button type=\"submit\"><img src=\"./../../images/icon-edit.png\" alt=\"\" /> Button 5</button>\n                <a href=\"#\" class=\"formbutton\">Button 6</a>\n                <a href=\"#\" class=\"button\"><img src=\"./../../images/icon-delete.png\" alt=\"\" /> Button 7</a>\n            </fieldset>\n        </fieldset>\n        </form>\n    </div>\n</div>\n\n<div class=\"window\">\n    <h1 class=\"title\">Form Innerwindow Test Stuff</h1>\n\t\t<div class=\"content has-innerwindows\">\n\t    <div class=\"innercontent\">\n\t\t\t\t<div class=\"messagebox info\">Dies sind Tests für innerwindow form elemente</div>\n\t\t\t</div>\n\t    <div class=\"innerwindows\">\n\t\t\t\t<div class=\"window\">\n\t\t\t\t\t<h2 class=\"title\">Textfield</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\tIn diesem form sollten die inhalte möglichst so groß wie das innerwindow sein und umbrechen.\n\t\t\t\t\t\tDas textarea sollte nur drei zeilen hoch sein.\n\t\t\t\t\t\t<form>\n\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\t<textarea class=\"width95 height-3lines\">Ein normales textarea</textarea>\n\t\t\t\t\t\t\t\t<input class=\"button\" value=\"Hit me\" />\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n</div>\n\n</div><!-- Section 1 -->\n\n<div class=\"section-sidewindows\"><!-- Section 2 -->\n\n    <div class=\"window\">\n        <h1 class=\"title\">Sandboxes</h1>\n        <div class=\"content\">\n            <ol class=\"bullets-none separated-vertical has-contextmenus-block\">\n                <li><a href=\"forms.html\" class=\"selected\">Form Examples</a></li>\n                <li><a href=\"tables.html\">Table Examples</a></li>\n                <li><a href=\"filter.html\">Filter GUI</a></li>\n            </ol>\n        </div>\n    </div>\n\n<div id=\"contexttest\" class=\"window has-contextmenus-block\">\n<h1 class=\"title\">Context Menu Test</h1>\n\t<div class=\"content\">\n\t<ol class=\"bullets-none separated-vertical\">\n\t\t<li><a href=\"http://localhost/OntoWiki/model/select/?m=http%3A%2F%2Fns.ontowiki.net%2Fplugins%2Fsocializr%2F\" class=\"Model\" about=\"http://ns.ontowiki.net/plugins/socializr/\">Socializr Namespace<span class=\"button\" /></a></li>\n\t\t<li><a href=\"http://localhost/OntoWiki/model/select/?m=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F\" class=\"Model\" about=\"http://xmlns.com/foaf/0.1/\">Friend of a Friend (FOAF) vocabulary<span class=\"button\" /></a></li>\n\t</ol>\n</div> <!-- window content -->\n</div>\n\n<div id=\"tagtest\" class=\"window\">\n<h1 class=\"title\">Tag Cloud Test</h1>\n\t<div class=\"content\">\n<script type=\"text/javascript\">//<!--\n\t\t\tvar tagParams = {\n\t\t\t\ttagProperty:   'http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedWithTag',\n\t\t\t\tlabelProperty: 'http://www.holygoat.co.uk/owl/redwood/0.1/tags/name'\n\t\t\t};\n\t\t//--></script>\n<ol class=\"bullets-none inline\">\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Team\" style=\"font-size: 125%; opacity: 1;\" title=\"9\">Team<span class=\"onlyAural\">(9)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Spass\" style=\"font-size: 117%; opacity: 0.952767;\" title=\"7\">Spaß<span class=\"onlyAural\">(7)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Apfelkuchen\" style=\"font-size: 113%; opacity: 0.926599;\" title=\"6\">Apfelkuchen<span class=\"onlyAural\">(6)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Cheesburger\" style=\"font-size: 108%; opacity: 0.898142;\" title=\"5\">Cheesburger<span class=\"onlyAural\">(5)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Computer\" style=\"font-size: 108%; opacity: 0.898142;\" title=\"5\">Computer<span class=\"onlyAural\">(5)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Hammburger\" style=\"font-size: 108%; opacity: 0.898142;\" title=\"5\">Hammburger<span class=\"onlyAural\">(5)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Lisa\" style=\"font-size: 108%; opacity: 0.898142;\" title=\"5\">Lisa<span class=\"onlyAural\">(5)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Service\" style=\"font-size: 108%; opacity: 0.898142;\" title=\"5\">Service<span class=\"onlyAural\">(5)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Tiger\" style=\"font-size: 108%; opacity: 0.898142;\" title=\"5\">Tiger<span class=\"onlyAural\">(5)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Google\" style=\"font-size: 103%; opacity: 0.866667;\" title=\"4\">Google<span class=\"onlyAural\">(4)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Sonne\" style=\"font-size: 103%; opacity: 0.866667;\" title=\"4\">Sonne<span class=\"onlyAural\">(4)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Stadt\" style=\"font-size: 103%; opacity: 0.866667;\" title=\"4\">Stadt<span class=\"onlyAural\">(4)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/laeuft\" style=\"font-size: 103%; opacity: 0.866667;\" title=\"4\">läuft<span class=\"onlyAural\">(4)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Baerchen\" style=\"font-size: 97%; opacity: 0.83094;\" title=\"3\">Bärchen<span class=\"onlyAural\">(3)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Feuer\" style=\"font-size: 97%; opacity: 0.83094;\" title=\"3\">Feuer<span class=\"onlyAural\">(3)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Frage\" style=\"font-size: 97%; opacity: 0.83094;\" title=\"3\">Frage<span class=\"onlyAural\">(3)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Fussball\" style=\"font-size: 97%; opacity: 0.83094;\" title=\"3\">Fußball<span class=\"onlyAural\">(3)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Internet\" style=\"font-size: 97%; opacity: 0.83094;\" title=\"3\">Internet<span class=\"onlyAural\">(3)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Markus\" style=\"font-size: 97%; opacity: 0.83094;\" title=\"3\">Markus<span class=\"onlyAural\">(3)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Monitor\" style=\"font-size: 97%; opacity: 0.83094;\" title=\"3\">Monitor<span class=\"onlyAural\">(3)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Mord\" style=\"font-size: 97%; opacity: 0.83094;\" title=\"3\">Mord<span class=\"onlyAural\">(3)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Papst\" style=\"font-size: 97%; opacity: 0.83094;\" title=\"3\">Papst<span class=\"onlyAural\">(3)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Sport\" style=\"font-size: 97%; opacity: 0.83094;\" title=\"3\">Sport<span class=\"onlyAural\">(3)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/spielt\" style=\"font-size: 97%; opacity: 0.83094;\" title=\"3\">spielt<span class=\"onlyAural\">(3)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/verunglueckt\" style=\"font-size: 97%; opacity: 0.83094;\" title=\"3\">verunglückt<span class=\"onlyAural\">(3)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/weil\" style=\"font-size: 97%; opacity: 0.83094;\" title=\"3\">weil<span class=\"onlyAural\">(3)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Abends\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Abends<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Bundestag\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Bundestag<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Bundeswehr\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Bundeswehr<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Chat\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Chat<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Fruehling\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Frühling<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Herbst\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Herbst<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Jochen\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Jochen<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Monster\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Monster<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Nicht\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Nicht<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Regen\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Regen<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Sommer\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Sommer<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Tod\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Tod<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Und\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Und<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Winter\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Winter<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Zivildienst\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">Zivildienst<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/haben\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">haben<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/isst\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">isst<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/schnarchen\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">schnarchen<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/toedlich\" style=\"font-size: 90%; opacity: 0.788562;\" title=\"2\">tödlich<span class=\"onlyAural\">(2)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Bilderbuch\" style=\"font-size: 81%; opacity: 0.733333;\" title=\"1\">Bilderbuch<span class=\"onlyAural\">(1)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Darum\" style=\"font-size: 81%; opacity: 0.733333;\" title=\"1\">Darum<span class=\"onlyAural\">(1)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Das\" style=\"font-size: 81%; opacity: 0.733333;\" title=\"1\">Das<span class=\"onlyAural\">(1)</span></a></li>\n<li><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Der\" style=\"font-size: 81%; opacity: 0.733333;\" title=\"1\">Der<span class=\"onlyAural\">(1)</span></a></li>\n<li class=\"last-child\"><a class=\"tag javascript-on\" about=\"http://testdb.softwiki.de/Tags/Doch\" style=\"font-size: 81%; opacity: 0.733333;\" title=\"1\">Doch<span class=\"onlyAural\">(1)</span></a></li>\n</ol>\n\t</div> <!-- window content -->\n</div>\n\n</div><!-- Section 2 -->\n\n</body>\n</html>\n\n"
  },
  {
    "path": "extensions/themes/silverblue/sandbox/listview.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n        \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\n<head>\n<title>OntoWiki — Instances of Person</title>    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"OntoWiki — Collaborative Knowledge Engineering\" />\n<script type=\"text/javascript\">\nvar urlBase = \"http://localhost/ow/trunk/\";\nvar themeUrlBase = \"http://localhost/ow/trunk/extensions/themes/silverblue/\";\nvar _OWSESSION = \"ONTOWIKItrunk\";\nvar widgetBase = \"http://localhost/ow/trunk/libraries/RDFauthor/\";\nvar defaultGraph = \"http://sebastian.dietzold.de/rdf/foaf.rdf\";\nvar defaultResource = \"http://xmlns.com/foaf/0.1/Person\";\n</script>\n\n    <!-- jQuery -->\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery-1.9.1.js\"></script>\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery-ui-1.8.22.js\"></script>\n\n    <!-- included js libraries -->\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.json.js\"></script>\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.livequery.js\"></script>\n\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.clickmenu.js\"></script>\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.simplemodal.js\"></script>\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.tablesorter.js\"></script>\n\n    <!-- ontowiki js -->\n    <script type=\"text/javascript\" src=\"./../themes/silverblue/scripts/jquery.ontowiki.js\"></script>\n    <script type=\"text/javascript\" src=\"./../themes/silverblue/scripts/main.js\"></script>\n\n    <!-- dynamic js -->\n\n<script type=\"text/javascript\">\n    //<![CDATA[\nvar classUri = \"foaf:Person\";    //]]>\n</script>\n\n    <!-- ontowiki stylesheets -->\n\n    <link rel=\"stylesheet\" href=\"./../styles/default.css\" type=\"text/css\" media=\"screen\" />\n    <link rel=\"stylesheet\" href=\"./../styles/clickmenu.css\" type=\"text/css\" media=\"screen\" />\n    <link rel=\"stylesheet\" href=\"./../styles/jquery-ui.css\" type=\"text/css\" media=\"screen\" />\n\n    <!-- IE conditional stylesheets -->\n    <!--[if lte IE 6]><link rel=\"stylesheet\" media=\"screen\" href=\"http://localhost/ow/trunk/extensions/themes/silverblue/styles/default.ie6.css\" /><![endif]-->\n    <!--[if lte IE 6]><link rel=\"stylesheet\" media=\"screen\" href=\"http://localhost/ow/trunk/extensions/themes/silverblue/styles/clickmenu.msie.css\" /><![endif]-->\n    <!--[if IE 7]><link rel=\"stylesheet\" media=\"screen\" href=\"http://localhost/ow/trunk/extensions/themes/silverblue/styles/default.ie7.css\" /><![endif]-->\n\n    <!-- dynamic styles -->\n    </head>\n\n\n\n</head>\n    <body class=\"javascript-off\">\n\n\n    <script type=\"text/javascript\">\n        // get body element\n        var body = document.body;\n        var bodyClass = body.className;\n        // set javascript = on\n        bodyClass = bodyClass.replace(/javascript-off/g, \"javascript-on\");\n        // process changes\n        body.setAttribute(\"class\", bodyClass, 0);\n    </script>\n\n    <script type=\"text/javascript\">\n    //<![CDATA[\n/* from modules/navigation/ */\nvar navigationConfigString = '{\"default\":\"classes\",\"config\":{\"skos\":{\"name\":\"SKOS\",\"hierarchyTypes\":[\"http:\\/\\/www.w3.org\\/2004\\/02\\/skos\\/core#Concept\",\"http:\\/\\/www.w3.org\\/2004\\/02\\/skos\\/core#Collection\"],\"hierarchyRelations\":{\"in\":[\"http:\\/\\/www.w3.org\\/2004\\/02\\/skos\\/core#broader\"],\"out\":[\"http:\\/\\/www.w3.org\\/2004\\/02\\/skos\\/core#narrower\"]}},\"classes\":{\"name\":\"Classes\",\"hierarchyTypes\":[\"http:\\/\\/www.w3.org\\/2000\\/01\\/rdf-schema#Class\",\"http:\\/\\/www.w3.org\\/2002\\/07\\/owl#Class\"],\"hierarchyRelations\":{\"in\":[\"http:\\/\\/www.w3.org\\/2000\\/01\\/rdf-schema#subClassOf\"]},\"instanceRelation\":{\"out\":[\"http:\\/\\/www.w3.org\\/1999\\/02\\/22-rdf-syntax-ns#type\"]},\"hiddenNS\":[\"http:\\/\\/www.w3.org\\/1999\\/02\\/22-rdf-syntax-ns#\",\"http:\\/\\/www.w3.org\\/2000\\/01\\/rdf-schema#\",\"http:\\/\\/www.w3.org\\/2002\\/07\\/owl#\"],\"hiddenRelation\":[\"http:\\/\\/ns.ontowiki.net\\/SysOnt\\/hidden\"]}}}'\nvar navigationConfig = $.evalJSON(navigationConfigString);\n    //]]>\n</script>\n    <div class=\"section-mainwindows\">\n        <div class=\"window tabbed windowbuttonscount-right-1\">\n                        <h1 class=\"title\">Instances of Person</h1>\n            <div class=\"slidehelper\">\n                                    <ol class=\"tabs\">\n                    <li id=\"index\" class=\"active\">\n                <a href=\"http://localhost/ow/trunk/list/r/foaf%3APerson\">Instances</a>\n            </li>\n                    <li id=\"history\" class=\"\">\n                <a href=\"http://localhost/ow/trunk/history/list/r/foaf%3APerson\">History</a>\n            </li>\n                    <li id=\"community\" class=\"\">\n                <a href=\"http://localhost/ow/trunk/community/list/r/foaf%3APerson\">Community</a>\n            </li>\n                    <li id=\"source\" class=\"\">\n                <a href=\"http://localhost/ow/trunk/source/edit/r/foaf%3APerson\">Source</a>\n            </li>\n            </ol>\n\n                                    <div class=\"content has-innerwindows active-tab-content\">\n                                                    <form action=\"http://localhost/ow/trunk/resource/delete\" method=\"post\" name=\"instancelist\" enctype=\"multipart/form-data\">\n                                                                        <input name=\"redirect\" value=\"http://localhost/ow/trunk/list/r/foaf%3APerson\" type=\"hidden\">\n\n                                                    <div class=\"messagebox\"><div class=\"toolbar\"><a href=\"uitestow.html\" class=\"button edit\"><span>jQuery UI Testpage</span></a><a class=\"button edit\"><img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/icon-save2.png\"><span>&nbsp;Save Changes</span></a><a class=\"button edit\"><img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/icon-cancel.png\"><span>&nbsp;Cancel</span></a><a class=\"button separator\"></a><a class=\"button init-resource\"><img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/icon-editadd.png\"><span>&nbsp;Add Instance</span></a><a class=\"button separator\"></a><a class=\"button submit\"><img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/icon-delete.png\"><span>&nbsp;Delete Selected</span></a></div></div>\n\n                        <div class=\"innercontent\">\n\n\n    <table class=\"separated-vertical\">\n                    <tbody><tr>\n                <th></th><th></th><th></th>\n                                    <th><a href=\"http://localhost/ow/trunk/view/r/foaf%3Amember\">member</a><sup>-1</sup></th>\n                                    <th><a href=\"http://localhost/ow/trunk/view/r/foaf%3Anick\">nickname</a></th>\n                                    <th><a href=\"http://localhost/ow/trunk/view/r/foaf%3Adepiction\">depiction</a></th>\n                            </tr>\n                                    <tr class=\"odd\">\n                <td class=\"selector\">\n                    <input id=\"selector-1\" name=\"r[]\" value=\"http://jens-lehmann.org/foaf.rdf#i\" type=\"checkbox\">\n                </td>\n                <td class=\"enumeration\"><label for=\"selector-1\">1.</label></td>\n                <td>\n                    <span class=\"icon-button expand\"></span><a class=\"hasMenu expandable Resource\" about=\"http://jens-lehmann.org/foaf.rdf#i\" typeof=\"http://xmlns.com/foaf/0.1/Person\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fjens-lehmann.org%2Ffoaf.rdf%23i\">\n                        Jens Lehmann                    <span class=\"toggle\" title=\"Menu\"></span></a><br>\n                                                                        foaf:Person                                                            </td>\n                                    <td>\n                                                                                                                        <a href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2Fgroup.aksw\">\n                                        AKSW                                    </a>\n                                                                                                        </td>\n                                    <td>\n                                                                                                                                                                                                                                </td>\n                                    <td>\n                                                                                                                                                                                                                                </td>\n                            </tr>\n                    <tr class=\"even\">\n                <td class=\"selector\">\n                    <input id=\"selector-2\" name=\"r[]\" value=\"http://philipp.frischmuth24.de#philippFrischmuth\" type=\"checkbox\">\n                </td>\n                <td class=\"enumeration\"><label for=\"selector-2\">2.</label></td>\n                <td>\n                    <span class=\"icon-button expand\"></span><a class=\"hasMenu expandable Resource\" about=\"http://philipp.frischmuth24.de#philippFrischmuth\" typeof=\"http://xmlns.com/foaf/0.1/Person\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fphilipp.frischmuth24.de%23philippFrischmuth\">\n                        Philipp Frischmuth                    <span class=\"toggle\" title=\"Menu\"></span></a><br>\n                                                                        foaf:Person                                                            </td>\n                                    <td>\n                                                                                                                        <a href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2Fgroup.aksw\">\n                                        AKSW                                    </a>\n                                                                                                        </td>\n                                    <td>\n                                                                                                                                                                                                                                </td>\n                                    <td>\n                                                                                                                                                                                                                                </td>\n                            </tr>\n                    <tr class=\"odd\">\n                <td class=\"selector\">\n                    <input id=\"selector-3\" name=\"r[]\" value=\"http://sebastian.dietzold.de/terms/me\" type=\"checkbox\">\n                </td>\n                <td class=\"enumeration\"><label for=\"selector-3\">3.</label></td>\n                <td>\n                    <span class=\"icon-button expand\"></span><a class=\"hasMenu expandable Resource\" about=\"http://sebastian.dietzold.de/terms/me\" typeof=\"http://xmlns.com/foaf/0.1/Person\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2Fme\">\n                        me                    <span class=\"toggle\" title=\"Menu\"></span></a><br>\n                                                                        foaf:Person                                                            </td>\n                                    <td>\n                                                                                    <ul>\n                                                                                                            \t<li><a href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2Fgroup.aksw\">AKSW</a></li>\n\t                                                                                                                                                \t<li><a href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2Forg.seerose\">SeeRoSe GbR mbH</a></li>\n\t                                                                                                                                                \t<li><a href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fmusicbrainz.org%2Fmm-2.1%2Fartist%2F53c809d4-5ada-4463-95ae-e3cb95488e94\">Farmer's Boulevard</a></li>\n\t                                                                                                    </ul>\n                                                                        </td>\n                                    <td>\n                                                                                                                        Seebi                                                                                                        </td>\n                                    <td>\n                                                                                                                        <a href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fpics%2Fpeople%2Fseebi.jpg\">\n                                        <img class=\"object\" src=\"http://sebastian.dietzold.de/pics/people/seebi.jpg\" alt=\"image of http://sebastian.dietzold.de/pics/people/seebi.jpg\">                                    </a>\n                                                                                                        </td>\n                            </tr>\n                    <tr class=\"even\">\n                <td class=\"selector\">\n                    <input id=\"selector-4\" name=\"r[]\" value=\"http://www.feedface.de#NormanHeino\" type=\"checkbox\">\n                </td>\n                <td class=\"enumeration\"><label for=\"selector-4\">4.</label></td>\n                <td>\n                    <span class=\"icon-button expand\"></span><a class=\"hasMenu expandable Resource\" about=\"http://www.feedface.de#NormanHeino\" typeof=\"http://xmlns.com/foaf/0.1/Person\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fwww.feedface.de%23NormanHeino\">\n                        NormanHeino                    <span class=\"toggle\" title=\"Menu\"></span></a><br>\n                                                                        foaf:Person                                                            </td>\n                                    <td>\n                                                                                                                        <a href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2Fgroup.aksw\">\n                                        AKSW                                    </a>\n                                                                                                        </td>\n                                    <td>\n                                                                                                                                                                                                                                </td>\n                                    <td>\n                                                                                                                                                                                                                                </td>\n                            </tr>\n                    <tr class=\"odd\">\n                <td class=\"selector\">\n                    <input id=\"selector-5\" name=\"r[]\" value=\"http://www.informatik.uni-leipzig.de/~auer/foaf.rdf#me\" type=\"checkbox\">\n                </td>\n                <td class=\"enumeration\"><label for=\"selector-5\">5.</label></td>\n                <td>\n                    <span class=\"icon-button expand\"></span><a class=\"hasMenu expandable Resource\" about=\"http://www.informatik.uni-leipzig.de/~auer/foaf.rdf#me\" typeof=\"http://xmlns.com/foaf/0.1/Person\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fwww.informatik.uni-leipzig.de%2F%7Eauer%2Ffoaf.rdf%23me\">\n                        me                    <span class=\"toggle\" title=\"Menu\"></span></a><br>\n                                                                        foaf:Person                                                            </td>\n                                    <td>\n                                                                                                                        <a href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2Fgroup.aksw\">\n                                        AKSW                                    </a>\n                                                                                                        </td>\n                                    <td>\n                                                                                                                                                                                                                                </td>\n                                    <td>\n                                                                                                                        <a href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fwacko.informatik.uni-leipzig.de%2Fimages%2FjpegPhoto.php%3Fname%3Dsn%26value%3DAuer\">\n                                        <img class=\"object\" src=\"http://wacko.informatik.uni-leipzig.de/images/jpegPhoto.php?name=sn&amp;value=Auer\" alt=\"image of http://wacko.informatik.uni-leipzig.de/images/jpegPhoto.php?name=sn&amp;value=Auer\">                                    </a>\n                                                                                                        </td>\n                            </tr>\n                    <tr class=\"even\">\n                <td class=\"selector\">\n                    <input id=\"selector-6\" name=\"r[]\" value=\"http://www.thomas-riechert.de/rdf/foaf.rdf#me\" type=\"checkbox\">\n                </td>\n                <td class=\"enumeration\"><label for=\"selector-6\">6.</label></td>\n                <td>\n                    <span class=\"icon-button expand\"></span><a class=\"hasMenu expandable Resource\" about=\"http://www.thomas-riechert.de/rdf/foaf.rdf#me\" typeof=\"http://xmlns.com/foaf/0.1/Person\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fwww.thomas-riechert.de%2Frdf%2Ffoaf.rdf%23me\">\n                        me                    <span class=\"toggle\" title=\"Menu\"></span></a><br>\n                                                                        foaf:Person                                                            </td>\n                                    <td>\n                                                                                                                        <a href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2Fgroup.aksw\">\n                                        AKSW                                    </a>\n                                                                                                        </td>\n                                    <td>\n                                                                                                                                                                                                                                </td>\n                                    <td>\n                                                                                                                        <a href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fwacko.informatik.uni-leipzig.de%2Fimages%2FjpegPhoto.php%3Fname%3Dsn%26value%3DRiechert\">\n                                        <img class=\"object\" src=\"http://wacko.informatik.uni-leipzig.de/images/jpegPhoto.php?name=sn&amp;value=Riechert\" alt=\"image of http://wacko.informatik.uni-leipzig.de/images/jpegPhoto.php?name=sn&amp;value=Riechert\">                                    </a>\n                                                                                                        </td>\n                            </tr>\n            </tbody></table>\n                        </div><!-- .innercontent -->\n\n                                                    </form>\n                                                <div class=\"innerwindows\">\n                            <div class=\"window windowbuttonscount-right-1 has-menu\" id=\"exploretags\">\n\n            <h1 class=\"title\">Explore Tags</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n                                        <div class=\"Resource ui-droppable\" id=\"exploretags-content\" name=\"exploretags-content\" about=\"http://xmlns.com/foaf/0.1/Person\">\n    <ul class=\"bullets-none separated-vertical\">\n            <li class=\"even has-contextmenu-area\">\n            member<sup>-1</sup>\n            <div class=\"contextmenu\">\n                <a class=\"delete-cloudproperty Resource item\" about=\"http://xmlns.com/foaf/0.1/member\"><span class=\"icon icon-close\" title=\"Entfernen\"><span>Entfernen</span></span></a>\n            </div>\n        <ol title=\"member\" about=\"http://xmlns.com/foaf/0.1/member\" class=\"bullets-none separated-horizontal InverseProperty Resource\">\n                    <li><a value=\"http://sebastian.dietzold.de/terms/group.aksw\" about=\"http://sebastian.dietzold.de/terms/group.aksw\" type=\"uri\" datatype=\"\" language=\"\" class=\"cloudvalue tagweight4 selected Resource\" cloudproperty=\"http://xmlns.com/foaf/0.1/member\">\n                    AKSW                </a>\n            </li>\n                    <li><a value=\"http://musicbrainz.org/mm-2.1/artist/53c809d4-5ada-4463-95ae-e3cb95488e94\" about=\"http://musicbrainz.org/mm-2.1/artist/53c809d4-5ada-4463-95ae-e3cb95488e94\" type=\"uri\" datatype=\"\" language=\"\" class=\"cloudvalue tagweight0 Resource\" cloudproperty=\"http://xmlns.com/foaf/0.1/member\">\n                    Farmer's Boulevard                </a>\n            </li>\n                    <li><a value=\"http://sebastian.dietzold.de/terms/org.seerose\" about=\"http://sebastian.dietzold.de/terms/org.seerose\" type=\"uri\" datatype=\"\" language=\"\" class=\"cloudvalue tagweight0 Resource\" cloudproperty=\"http://xmlns.com/foaf/0.1/member\">\n                    SeeRoSe GbR mbH                </a>\n            </li>\n                </ol>\n                </li>\n             <li class=\"odd has-contextmenu-area\">\n            current project\n            <div class=\"contextmenu\">\n                <a class=\"delete-cloudproperty Resource item\" about=\"http://xmlns.com/foaf/0.1/currentProject\"><span class=\"icon icon-close\" title=\"Entfernen\"><span>Entfernen</span></span></a>\n            </div>\n        <ol title=\"current project\" about=\"http://xmlns.com/foaf/0.1/currentProject\" class=\"bullets-none separated-horizontal Resource\">\n                    <li><a value=\"http://sebastian.dietzold.de/terms/project.wackofork\" about=\"http://sebastian.dietzold.de/terms/project.wackofork\" type=\"uri\" datatype=\"\" language=\"\" class=\"cloudvalue tagweight0 Resource\" cloudproperty=\"http://xmlns.com/foaf/0.1/currentProject\">\n                    WackoFork                </a>\n            </li>\n                    <li><a value=\"http://sebastian.dietzold.de/terms/org.seerose\" about=\"http://sebastian.dietzold.de/terms/org.seerose\" type=\"uri\" datatype=\"\" language=\"\" class=\"cloudvalue tagweight0 Resource\" cloudproperty=\"http://xmlns.com/foaf/0.1/currentProject\">\n                    SeeRoSe GbR mbH                </a>\n            </li>\n                    <li><a value=\"http://musicbrainz.org/mm-2.1/artist/53c809d4-5ada-4463-95ae-e3cb95488e94\" about=\"http://musicbrainz.org/mm-2.1/artist/53c809d4-5ada-4463-95ae-e3cb95488e94\" type=\"uri\" datatype=\"\" language=\"\" class=\"cloudvalue tagweight0 Resource\" cloudproperty=\"http://xmlns.com/foaf/0.1/currentProject\">\n                    Farmer's Boulevard                </a>\n            </li>\n                    <li><a value=\"http://sebastian.dietzold.de/terms/project.sxhc\" about=\"http://sebastian.dietzold.de/terms/project.sxhc\" type=\"uri\" datatype=\"\" language=\"\" class=\"cloudvalue tagweight0 Resource\" cloudproperty=\"http://xmlns.com/foaf/0.1/currentProject\">\n                    sxhc.de                </a>\n            </li>\n                    <li><a value=\"http://sebastian.dietzold.de/terms/project.spiders\" about=\"http://sebastian.dietzold.de/terms/project.spiders\" type=\"uri\" datatype=\"\" language=\"\" class=\"cloudvalue tagweight0 Resource\" cloudproperty=\"http://xmlns.com/foaf/0.1/currentProject\">\n                    caucasus-spiders.info                </a>\n            </li>\n                    <li><a value=\"http://sebastian.dietzold.de/terms/project.softwiki\" about=\"http://sebastian.dietzold.de/terms/project.softwiki\" type=\"uri\" datatype=\"\" language=\"\" class=\"cloudvalue tagweight0 Resource\" cloudproperty=\"http://xmlns.com/foaf/0.1/currentProject\">\n                    SoftWiki                </a>\n            </li>\n                </ol>\n                </li>\n          </ul>\n</div>                </div><!-- .window .content -->\n\n                    <div class=\"cmDiv\"><ul class=\"menu clickMenu\">\n                                        <li class=\"main\">View            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"javascript:resetSelectedTags()\">Reset selected tags</a></li>\n                                                                                            <li>Number of showed tags            <img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/submenu-indicator.png\" class=\"liArrow\"><div style=\"position: absolute;\" class=\"outerbox\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"javascript:count(5)\">5</a></li>\n                                                                                <li><a href=\"javascript:count(10)\">10</a></li>\n                                                                                <li><a href=\"javascript:count(20)\">20</a></li>\n                                                </ul></div>\n        </li>\n                                                                                                <li>Sort            <img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/submenu-indicator.png\" class=\"liArrow\"><div style=\"position: absolute;\" class=\"outerbox\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"javascript:sortTagCloud(1)\">by name</a></li>\n                                                                                <li><a href=\"javascript:sortTagCloud(2)\">by frequency</a></li>\n                                                </ul></div>\n        </li>\n                                                    </ul></div>\n        </li>\n                    </ul><div style=\"clear: both; visibility: hidden;\"></div></div>\n\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n<div class=\"window windowbuttonscount-right-1\" id=\"showproperties\">\n\n            <h1 class=\"title\">Show Properties</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n                                            <div>\n        <form id=\"instancesconfig\" action=\"#\" method=\"post\">\n                <input value=\"\" name=\"instancesconfig\" type=\"hidden\">\n        </form>\n    </div>\n    <ul class=\"bullets-none separated-horizontal\">\n                                            <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://purl.org/vocab/bio/0.1/keywords\" title=\"keywords\">keywords<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://purl.org/vocab/bio/0.1/olb\" title=\"olb\">olb<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://purl.org/vocab/relationship/acquaintanceOf\" title=\"acquaintance of\">acquaintance of<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://purl.org/vocab/relationship/closeFriendOf\" title=\"close friend of\">close friend of<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://purl.org/vocab/relationship/colleagueOf\" title=\"colleague of\">colleague of<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://purl.org/vocab/relationship/worksWith\" title=\"works with\">works with<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://www.w3.org/2000/01/rdf-schema#seeAlso\" title=\"seeAlso\">seeAlso<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://www.w3.org/2000/10/swap/pim/contact#home\" title=\"home\">home<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://www.w3.org/2000/10/swap/pim/contact#nearestAirport\" title=\"nearestAirport\">nearestAirport<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://www.w3.org/2000/10/swap/pim/contact#office\" title=\"office\">office<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://www.w3.org/2002/07/owl#sameAs\" title=\"sameAs\">sameAs<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/based_near\" title=\"based near\">based near<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/birthday\" title=\"birthday\">birthday<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/currentProject\" title=\"current project\">current project<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable selected\" about=\"http://xmlns.com/foaf/0.1/depiction\" title=\"depiction\">depiction<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/firstName\" title=\"firstName\">firstName<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/gender\" title=\"gender\">gender<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/holdsAccount\" title=\"holds account\">holds account<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/homepage\" title=\"homepage\">homepage<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/jabberID\" title=\"jabber ID\">jabber ID<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/knows\" title=\"knows\">knows<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/mbox\" title=\"personal mailbox\">personal mailbox<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/mbox_sha1sum\" title=\"sha1sum of a personal mailbox URI name\">sha1sum of a personal mailbox URI name<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/name\" title=\"name\">name<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable selected\" about=\"http://xmlns.com/foaf/0.1/nick\" title=\"nickname\">nickname<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/pastProject\" title=\"past project\">past project<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/phone\" title=\"phone\">phone<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/pubkeyAddress\" title=\"foaf:pubkeyAddress\">foaf:pubkeyAddress<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/publications\" title=\"publications\">publications<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/schoolHomepage\" title=\"schoolHomepage\">schoolHomepage<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/surname\" title=\"Surname\">Surname<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/weblog\" title=\"weblog\">weblog<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li><a class=\"show-property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/workInfoHomepage\" title=\"work info homepage\">work info homepage<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                                                <li class=\"last-child\"><a class=\"show-property Property hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/workplaceHomepage\" title=\"workplace homepage\">workplace homepage<span class=\"toggle\" title=\"Menu\"></span></a></li>\n                        </ul>\n\t<ul class=\"bullets-none separated-horizontal\">\n\t    \t\t\t\t    \t\t        <li><a class=\"show-property InverseProperty hasMenu Resource ui-draggable\" about=\"http://purl.org/vocab/relationship/worksWith\" title=\"works with\">works with<span class=\"toggle\" title=\"Menu\"></span></a><sup>-1</sup></li>\n\t\t    \t\t\t\t    \t\t        <li><a class=\"show-property InverseProperty hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/maker\" title=\"maker\">maker<span class=\"toggle\" title=\"Menu\"></span></a><sup>-1</sup></li>\n\t\t    \t\t\t\t    \t\t        <li><a class=\"show-property InverseProperty hasMenu Resource ui-draggable selected\" about=\"http://xmlns.com/foaf/0.1/member\" title=\"member\">member<span class=\"toggle\" title=\"Menu\"></span></a><sup>-1</sup></li>\n\t\t    \t\t\t\t    \t\t        <li><a class=\"show-property InverseProperty hasMenu Resource ui-draggable\" about=\"http://xmlns.com/foaf/0.1/primaryTopic\" title=\"primary topic\">primary topic<span class=\"toggle\" title=\"Menu\"></span></a><sup>-1</sup></li>\n\t\t    \t\t\t</ul>\n\n                </div><!-- .window .content -->\n\n\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n<div class=\"window windowbuttonscount-right-1\" id=\"filter\">\n\n            <h1 class=\"title\">Filter</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n                                        <div id=\"filterbox\">\n    <!--ul id=\"list\"></ul-->\n\n            <ul class=\"bullets-none separated-vertical\">\n                <li id=\"explore-inverse-http://sebastian.dietzold.de/terms/group.aksw-http://xmlns.com/foaf/0.1/member\" class=\"even filter\">\n            <a class=\"hasMenu Resource\" about=\"http://xmlns.com/foaf/0.1/member\" href=\"http://localhost/ow/trunk/view/r/foaf%3Amember\">\n                member            <span class=\"toggle\" title=\"Menu\"></span></a>\n                            <sup>-1</sup>\n                        equals                                                <a class=\"hasMenu Resource\" about=\"http://sebastian.dietzold.de/terms/group.aksw\" href=\"http://localhost/ow/trunk/view/?r=http%3A%2F%2Fsebastian.dietzold.de%2Fterms%2Fgroup.aksw\">\n                        group.aksw                    <span class=\"toggle\" title=\"Menu\"></span></a>\n                                                <a class=\"delete\">x</a>\n        </li>\n            </ul>\n\n    <p>\n        <a class=\"minibutton\" href=\"javascript:showAddFilterBox()\">Add Filter</a>\n        <a class=\"minibutton\" href=\"javascript:removeAllFilters()\">Clear</a>\n    </p>\n    <div style=\"display: none;\" id=\"addFilterWindowOverlay\">\n        <div class=\"window windowbuttonscount-right-1\" id=\"addwindow\">\n            <h2 class=\"title\">Add Filter</h2>\n            <table>\n                <tbody><tr>\n                    <td>\n                        <select id=\"property\" size=\"7\">\n                                                        <option about=\"http://purl.org/vocab/bio/0.1/keywords\" class=\"Resource\">keywords</option>\n                                                        <option about=\"http://purl.org/vocab/bio/0.1/olb\" class=\"Resource\">olb</option>\n                                                        <option about=\"http://purl.org/vocab/relationship/acquaintanceOf\" class=\"Resource\">acquaintance of</option>\n                                                        <option about=\"http://purl.org/vocab/relationship/closeFriendOf\" class=\"Resource\">close friend of</option>\n                                                        <option about=\"http://purl.org/vocab/relationship/colleagueOf\" class=\"Resource\">colleague of</option>\n                                                        <option about=\"http://purl.org/vocab/relationship/worksWith\" class=\"Resource\">works with</option>\n                                                        <option about=\"http://www.w3.org/2000/01/rdf-schema#seeAlso\" class=\"Resource\">seeAlso</option>\n                                                        <option about=\"http://www.w3.org/2000/10/swap/pim/contact#home\" class=\"Resource\">home</option>\n                                                        <option about=\"http://www.w3.org/2000/10/swap/pim/contact#nearestAirport\" class=\"Resource\">nearestAirport</option>\n                                                        <option about=\"http://www.w3.org/2000/10/swap/pim/contact#office\" class=\"Resource\">office</option>\n                                                        <option about=\"http://www.w3.org/2002/07/owl#sameAs\" class=\"Resource\">sameAs</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/based_near\" class=\"Resource\">based near</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/birthday\" class=\"Resource\">birthday</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/currentProject\" class=\"Resource\">current project</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/depiction\" class=\"Resource\">depiction</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/firstName\" class=\"Resource\">firstName</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/gender\" class=\"Resource\">gender</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/holdsAccount\" class=\"Resource\">holds account</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/homepage\" class=\"Resource\">homepage</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/jabberID\" class=\"Resource\">jabber ID</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/knows\" class=\"Resource\">knows</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/mbox\" class=\"Resource\">personal mailbox</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/mbox_sha1sum\" class=\"Resource\">sha1sum of a personal mailbox URI name</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/name\" class=\"Resource\">name</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/nick\" class=\"Resource\">nickname</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/pastProject\" class=\"Resource\">past project</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/phone\" class=\"Resource\">phone</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/pubkeyAddress\" class=\"Resource\">foaf:pubkeyAddress</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/publications\" class=\"Resource\">publications</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/schoolHomepage\" class=\"Resource\">schoolHomepage</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/surname\" class=\"Resource\">Surname</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/weblog\" class=\"Resource\">weblog</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/workInfoHomepage\" class=\"Resource\">work info homepage</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/workplaceHomepage\" class=\"Resource\">workplace homepage</option>\n                                                                                    <option about=\"http://purl.org/vocab/relationship/worksWith\" class=\"Resource InverseProperty\">works with (inverse)</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/maker\" class=\"Resource InverseProperty\">maker (inverse)</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/member\" class=\"Resource InverseProperty\">member (inverse)</option>\n                                                        <option about=\"http://xmlns.com/foaf/0.1/primaryTopic\" class=\"Resource InverseProperty\">primary topic (inverse)</option>\n                                                    </select>\n                    </td>\n                    <td style=\"vertical-align: middle;\">\n                        equals\n                    </td>\n                    <td>\n                        <select id=\"possiblevalues\" size=\"7\">\n                                <option>none loaded</option>\n                        </select>\n                    </td>\n                </tr>\n            </tbody></table>\n            <div style=\"padding: 10px;\">\n                or<br>\n                <select id=\"resttype\">\n                        <option>contains</option>\n                </select>\n                <input id=\"value\" type=\"text\">\n                <formset><a id=\"add\" class=\"button minibutton\">set</a>\n                <a id=\"addwindowhide\" class=\"button minibutton\">cancel</a></formset>\n            </div>\n        <div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div>\n    </div>\n</div>\n                </div><!-- .window .content -->\n\n\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n                        </div><!-- .innerwindows -->\n\n                    </div><!-- .content .has-innerwindows -->\n\n\n                    <div class=\"messagebox statusbar\">\n                    <div class=\"statustool\"></div>\n                    <div class=\"statustool\">Search returned 6 results.</div>\n                    <div class=\"statustool\">Query execution took 60 ms.</div>\n            </div>\n            </div><!-- .slidehelper -->\n        <div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n    </div><!-- .section-mainwindows -->\n\n    <div class=\"section-sidewindows\">\n        <div class=\"window windowbuttonscount-right-1 has-menu\" id=\"application\">\n\n            <h1 class=\"title\">OntoWiki (Admin)</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n\n<form name=\"search\" method=\"get\" action=\"http://localhost/ow/trunk/resource/instances/\">\n\t\t<p class=\"width98\">\n\t\t<label class=\"display-block onlyAural\" for=\"searchtext-input\">Search for Resources</label>\n\t\t<input class=\"text width99 inner-label\" id=\"searchtext-input\" name=\"s\" value=\"\" type=\"text\">\n\t</p>\n\t\t<p>\n\t\t<!--label class=\"display-block\">\n\t\t    \t\t\t<input class=\"checkbox\" type=\"checkbox\" name=\"allModels\" id=\"allModels\" />\n\t\t\tSearch all Knowledge Bases\t\t</label-->\n\t\t\t\t<!--a class=\"button submit\">Submit</a-->\n\t</p>\n</form>\n                </div><!-- .window .content -->\n\n                    <div class=\"cmDiv\"><ul class=\"menu clickMenu\">\n                                        <li class=\"main\">User            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"http://localhost/ow/trunk/application/register\">Register New User</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/application/preferences\">Preferences</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/application/logout\">Logout</a></li>\n                                                </ul></div>\n        </li>\n                                <li class=\"main\">Extras            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"http://localhost/ow/trunk/querybuilding/editor\">SPARQL Query Editor</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/index/news\">News</a></li>\n                                                </ul></div>\n        </li>\n                                <li class=\"main\">Help            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"http://ontowiki.net/Projects/OntoWiki/Help\">Documentation</a></li>\n                                                                                <li><a href=\"http://code.google.com/p/ontowiki/issues/entry\">Bug Report</a></li>\n                                                                                <li><a href=\"http://ontowiki.net/Projects/OntoWiki/ChangeLog#0.9.5\">Version Info</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/application/about\">About</a></li>\n                                                </ul></div>\n        </li>\n                                <li class=\"main\">Debug            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"http://localhost/ow/trunk/debug/clearmodulecache\">Clear Module Cache</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/debug/cleartranslationcache\">Clear Translation Cache</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/debug/clearquerycache\">Clear Query Cache</a></li>\n                                                                                <li><a href=\"http://localhost/ow/trunk/debug/destroysession\">Destroy Session</a></li>\n                                                </ul></div>\n        </li>\n                    </ul><div style=\"clear: both; visibility: hidden;\"></div></div>\n\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n<div class=\"window has-contextmenus-block windowbuttonscount-right-1 windowbuttonscount-left-1\" id=\"modellist\">\n\n            <h1 class=\"title\">Knowledge Bases</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n                                            <ol class=\"bullets-none separated-vertical\">\n    \t    \t\t<li>\n    \t\t\t<a class=\"Model Resource\" href=\"http://localhost/ow/trunk/model/select/?m=http%3A%2F%2Flocalhost%2FOntoWiki%2FConfig%2F\" about=\"http://localhost/OntoWiki/Config/\">\n    \t\t\t\tOntoWiki System Configuration    \t\t\t<span class=\"button\"></span></a>\n    \t\t</li>\n    \t    \t\t<li>\n    \t\t\t<a class=\"Model selected Resource\" href=\"http://localhost/ow/trunk/model/select/?m=http%3A%2F%2Fsebastian.dietzold.de%2Frdf%2Ffoaf.rdf\" about=\"http://sebastian.dietzold.de/rdf/foaf.rdf\">\n    \t\t\t\tSeebis FOAF Profile    \t\t\t<span class=\"button\"></span></a>\n    \t\t</li>\n    \t    </ol>\n                </div><!-- .window .content -->\n\n\n                    <div class=\"contextmenu\">\n                <ul>\n                        <li><a href=\"http://localhost/ow/trunk/model/create\">Create Knowledge Base</a></li>\n                                </ul>\n                <hr>\n            <ul>\n                                <li>\n                                    <a class=\"modellist_hidden_button show\">\n                   Show Hidden Knowledge Bases                </a>\n            </li>\n            </ul>\n            </div>\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"><span class=\"button button-contextmenu\"></span></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n<div class=\"window has-contextmenus-block windowbuttonscount-right-1\" id=\"hierarchy\">\n\n            <h1 class=\"title\">Classes</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n                                        <!--form name=\"search\" method=\"get\" action=\"\">\n\t<p class=\"width98\">\n\t\t<label class=\"display-block\" for=\"hierarchy-input\">Type to search ...</label>\n\t\t<input class=\"inner-label text width100 live-search\" type=\"text\" id=\"hierarchy-input\" name=\"q\"/>\n\t</p>\n</form-->\n\t<ul class=\"bullets-none separated-vertical hierarchy\">\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/?r=http%3A%2F%2Fpurl.org%2Frss%2F1.0%2Fchannel\" about=\"http://purl.org/rss/1.0/channel\">\n\t\t\t\t\tchannel\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/?r=http%3A%2F%2Fwww.w3.org%2F2002%2F12%2Fcal%2Fical%23Vcalendar\" about=\"http://www.w3.org/2002/12/cal/ical#Vcalendar\">\n\t\t\t\t\tVcalendar\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AGroup\" about=\"http://xmlns.com/foaf/0.1/Group\">\n\t\t\t\t\tGroup\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AOnlineAccount\" about=\"http://xmlns.com/foaf/0.1/OnlineAccount\">\n\t\t\t\t\tOnline Account\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AOrganization\" about=\"http://xmlns.com/foaf/0.1/Organization\">\n\t\t\t\t\tOrganization\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class selected Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3APerson\" about=\"http://xmlns.com/foaf/0.1/Person\">\n\t\t\t\t\tPerson\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3APersonalProfileDocument\" about=\"http://xmlns.com/foaf/0.1/PersonalProfileDocument\">\n\t\t\t\t\tPersonalProfileDocument\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AProject\" about=\"http://xmlns.com/foaf/0.1/Project\">\n\t\t\t\t\tProject\t\t\t\t<span class=\"button\"></span></a>\n\t\t\t\t\t\t\t</li>\n\t\t\t</ul>\n                </div><!-- .window .content -->\n\n\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n<div class=\"window has-contextmenus-block windowbuttonscount-right-1 has-menu\" id=\"navigation\">\n\n            <h1 class=\"title\">Navigation</h1>\n\n    <div class=\"slidehelper\">\n\n\n                                    <div class=\"content\">\n\n<p><input class=\"text width98 inner-label\" id=\"navigation-input\" name=\"navigation-input\" value=\"\" type=\"text\"></p>\n<p style=\"overflow: hidden; margin-left: 0px;\" id=\"navigation-content\" class=\"\">\n    <ol class=\"bullets-none separated-vertical\">\n            <li class=\"even\">\n            <a class=\"navigation Resource\" about=\"http://purl.org/rss/1.0/channel\">channel<span class=\"button\"></span></a>\n        </li>\n            <li class=\"odd\">\n            <a class=\"navigation Resource\" about=\"http://www.w3.org/2002/12/cal/ical#Vcalendar\">ical#Vcalendar<span class=\"button\"></span></a>\n        </li>\n            <li class=\"even\">\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/Group\">Group<span class=\"button\"></span></a>\n        </li>\n            <li class=\"odd\">\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/OnlineAccount\">OnlineAccount<span class=\"button\"></span></a>\n        </li>\n            <li class=\"even\">\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/Organization\">Organization<span class=\"button\"></span></a>\n        </li>\n            <li class=\"odd\">\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/Person\">Person<span class=\"button\"></span></a>\n        </li>\n            <li class=\"even\">\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/PersonalProfileDocument\">PersonalProfileDocument<span class=\"button\"></span></a>\n        </li>\n            <li class=\"odd\">\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/Project\">Project<span class=\"button\"></span></a>\n        </li>\n        </ol>\n\n<pre></pre></p>\n                </div><!-- .window .content -->\n\n                    <div class=\"cmDiv\"><ul class=\"menu clickMenu\">\n                                        <li class=\"main\">Type            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"javascript:navigationEvent('setType', 'skos')\">SKOS</a></li>\n                                                                                <li><a href=\"javascript:navigationEvent('setType', 'classes')\">Classes</a></li>\n                                                </ul></div>\n        </li>\n                                <li class=\"main\">View            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"javascript:navigationEvent('reset')\">Reset Navigation</a></li>\n                                                                                            <li>Number of entries            <img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/submenu-indicator.png\" class=\"liArrow\"><div style=\"position: absolute;\" class=\"outerbox\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"javascript:navigationEvent('setCount', 10)\">10</a></li>\n                                                                                <li><a href=\"javascript:navigationEvent('setCount', 20)\">20</a></li>\n                                                                                <li><a href=\"javascript:navigationEvent('setCount', 30)\">30</a></li>\n                                                                                <li><a href=\"javascript:navigationEvent('setCount', 'all')\">all</a></li>\n                                                </ul></div>\n        </li>\n                                                                                                <li>Sort            <img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/submenu-indicator.png\" class=\"liArrow\"><div style=\"position: absolute;\" class=\"outerbox\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\n                                                            <li><a href=\"javascript:navigationEvent('setSort', 'name')\">by name</a></li>\n                                                                                <li><a href=\"javascript:navigationEvent('setSort', 'frequency')\">by frequency</a></li>\n                                                </ul></div>\n        </li>\n                                                    </ul></div>\n        </li>\n                    </ul><div style=\"clear: both; visibility: hidden;\"></div></div>\n\n\n    </div><!-- .slidehelper -->\n\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\n    <span style=\"cursor: ew-resize; position: absolute; height: 831px;\" class=\"resizer-horizontal ui-draggable\"></span></div><!-- .section-sidewindows -->\n        <!-- Rendered in 434 ms using 23 SPARQL queries. -->\n<div class=\"contextmenu-enhanced\"></div>\n\n    </body>\n</html>\n\n"
  },
  {
    "path": "extensions/themes/silverblue/sandbox/tables.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n        \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\n<head>\n<title>OntoWiki sandbox : Form examples</title>\n<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n\n<!-- included js libraries -->\n<script type=\"text/javascript\" src=\"./../scripts/main.js\"></script>\n\n<!-- ontowiki stylesheets -->\n<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"./../styles/old.css\" />\n<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"./../styles/default.css\" />\n<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"./../styles/clickmenu.css\" />\n\n<!-- IE conditional stylesheets -->\n<!--[if IE 7]>\n    <link rel=\"stylesheet\" media=\"screen\" href=\"./../styles/default.ie7.css\" />\n<![endif]-->\n<!--[if lte IE 6]>\n    <link rel=\"stylesheet\" media=\"screen\" href=\"./../styles/default.ie6.css\" />\n    <link rel=\"stylesheet\" media=\"screen\" href=\"./../styles/clickmenu.msie.css\" />\n<![endif]-->\n\n</head>\n\n<body xmlns:owl=\"http://www.w3.org/2002/07/owl/\" xmlns:SysOnt=\"http://ns.ontowiki.net/SysOnt/\" class=\"javascript-on\">\n\n<div class=\"section-mainwindows\"><!-- Section 1 -->\n\n<div class=\"window\">\n    <h1 class=\"title\">Table Examples</h1>\n    <div class=\"content\">\n\n    <table cellspacing=\"0\">\n    <caption>without class value</caption>\n    <thead>\n        <tr>\n            <th>Property</th>\n            <th>Value</th>\n        </tr>\n    </thead>\n    <tbody>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    </table>\n\n    <table cellspacing=\"0\" class=\"separated-vertical\">\n    <caption>.separated-vertical</caption>\n    <thead>\n        <tr>\n            <th>Property</th>\n            <th>Value</th>\n        </tr>\n    </thead>\n    <tbody>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    <tbody>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    </table>\n\n    <table cellspacing=\"0\" class=\"separated-horizontal\">\n    <caption>.separated-horizontal</caption>\n    <thead>\n        <tr>\n            <th>Property</th>\n            <th>Value</th>\n        </tr>\n    </thead>\n    <tbody>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    <tbody>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    </table>\n\n    <table cellspacing=\"0\" class=\"separated-vertical separated-horizontal\">\n    <caption>.separated-vertical + .separated-horizontal</caption>\n    <thead>\n        <tr>\n            <th>Property</th>\n            <th>Value</th>\n        </tr>\n    </thead>\n    <tbody>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    <tbody>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    </table>\n\n    <table class=\"backgrounded spaced-vertical\">\n    <caption>.backgrounded + .spaced-vertical</caption>\n    <thead>\n        <tr>\n            <th>Property</th>\n            <th>Value</th>\n        </tr>\n    </thead>\n    <tbody>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    <tbody>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    </table>\n\n    <table class=\"backgrounded spaced-vertical spaced-horizontal\">\n    <caption>.backgrounded + .spaced-vertical + .spaced-horizontal</caption>\n    <thead>\n        <tr>\n            <th>Property</th>\n            <th>Value</th>\n        </tr>\n    </thead>\n    <tbody>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    <tbody>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    </table>\n\n    <table class=\"backgrounded spaced-vertical separated-horizontal\">\n    <caption>.backgrounded + .spaced-vertical + .separated-horizontal + tr.odd</caption>\n    <thead>\n        <tr>\n            <th>Property</th>\n            <th>Value</th>\n        </tr>\n    </thead>\n    <tbody>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr class=\"odd\">\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    <tbody>\n        <tr class=\"odd\">\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr class=\"odd\">\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    </table>\n\n    <table class=\"separated-vertical\">\n    <caption>thead.backgrounded + .separated-vertical + tr.odd</caption>\n    <thead class=\"backgrounded\">\n        <tr>\n            <th>Property</th>\n            <th>Value</th>\n        </tr>\n    </thead>\n    <tbody>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr class=\"odd\">\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    <tbody>\n        <tr class=\"odd\">\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Acomment\">comment</a></td>\n            <td><span id=\"stmId165\" class=\"statement\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-165\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId165 --></td>\n        </tr>\n        <tr>\n            <td><a href=\"http://localhost/ontowiki/resource/view/rdfs%3Alabel\">label</a></td>\n            <td><span id=\"stmId164\" class=\"statement\">OntoWiki System Config<a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-164\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a></span><!-- stmId164 --></td>\n        </tr>\n        <tr class=\"odd\">\n            <td><a href=\"http://localhost/ontowiki/resource/view/owl%3Aimports\">owl:imports</a></td>\n            <td><span id=\"stmId167\" class=\"statement\"><a about=\"http://ns.ontowiki.net/SysOnt/\" class=\"expandable Resource\" href=\"http://localhost/ontowiki/resource/view/?r=http%3A%2F%2Fns.ontowiki.net%2FSysOnt%2F\"><span title=\"This schema model provides the vocabulary to configure an OntoWiki installation (e.g. terms for access control). Some terms are copied from FOAF.\" class=\"help\">OntoWiki System Ontology</span></a><a class=\"inline-edit\" style=\"display: none;\"><img class=\"clickicon drop\" id=\"statement-167\" src=\"http://localhost/ontowiki/themes/default/images/icon-delete.png\" alt=\"delete\"></a><span id=\"inst-167\"></span></span><!-- stmId167 --></td>\n        </tr>\n    </tbody>\n    </table>\n\n\n    <h2>Tables with Input fields</h2>\n    <form method=\"post\" action=\"http://localhost/ontowiki/resource/edit/http%3A%2F%2Flocalhost%2FOntoWiki%2FConfig%2F\">\n    <fieldset>\n    \n    <fieldset><legend>Resource</legend>\n\n        <table class=\"separated-vertical\">\n        <colgroup>\n            <col width=\"1*\">\n            <col width=\"4*\">\n        </colgroup>\n        <tbody>\n            <tr class=\"row-input\">\n                <td>Label:</td><td><input type=\"text\" class=\"text width50\" name=\"label\" value=\"OntoWiki System Config\" /></td>\n            </tr>\n            <tr class=\"odd row-input\">\n                <td>Identifier (URI):</td>\n                <td><div>\n                    <input type=\"text\" name=\"uri\" class=\"text width50\" value=\"http://localhost/OntoWiki/Config/\" />\n                    <input type=\"hidden\" name=\"olduri\" value=\"http://localhost/OntoWiki/Config/\" />\n                </div></td>\n            </tr>\n        </tbody>\n        </table>\n\n    </fieldset>\n\n    <fieldset><legend>Properties</legend>\n\n    <table class=\"separated-vertical\">\n    <colgroup>\n        <col width=\"1*\">\n        <col width=\"4*\">\n    </colgroup>\n    <tbody>\n        <tr class=\"row-input\">\n            <td><input type=\"text\" id=\"autosuggest46dbe1be8a9aa\" class=\"property autosuggest text width90\" value=\"rdfs:comment\" onchange=\"updateTable(this, '46dbe1be8a9aa')\" /></td>\n            <td>\n                <div id=\"container-46dbe1be92910\" class=\"LiteralEditContainer\">\n                <input type=\"hidden\" id=\"model-46dbe1be92910\" value=\"http://localhost/OntoWiki/Config/\" />\n                <input type=\"hidden\" id=\"property-46dbe1be92910\" value=\"http://www.w3.org/2000/01/rdf-schema#comment\" />\n                <textarea rows=\"5\" cols=\"25\" class=\"width33\" name=\"prop[http://www.w3.org/2000/01/rdf-schema#comment][1][value]\" class=\"LiteralEditValue\" id=\"value-46dbe1be929101\">This is your OntoWiki configuration model. You can configure model based access control and some actions here.</textarea>\n                <div class=\"LiteralEditOptionsContainer\" id=\"opt-cont46dbe1be929101\">\n                @<input type=\"text\" name=\"prop[http://www.w3.org/2000/01/rdf-schema#comment][1][lang]\" class=\"LiteralEditLang text width25\" value=\"Lang\" id=\"lang-46dbe1be929101\" />\n                ^^<input type=\"text\" readonly=\"readonly\" name=\"prop[http://www.w3.org/2000/01/rdf-schema#comment][1][dtype]\" class=\"LiteralEditDtype text width25\" value=\"String\" id=\"dtype-46dbe1be929101\" />\n                <img class=\"delete button\" id=\"img-46dbe1be929101\" src=\"http://localhost/ontowiki/lib/Erfurt/public/images/delete.gif\" alt=\"del\" />\n                </div>\n                </div>\n                <a href=\"javascript:getEmptyHtml(this,'46dbe1be92910','container-46dbe1be92910','LiteralEdit')\" title=\"Add a value\"><img src=\"http://localhost/ontowiki/lib/Erfurt/public/images/plus_big.png\" alt=\"+\"/></a>\n                <input type=\"hidden\" id=\"count-46dbe1be92910\" value=\"1\" />\n                <input type=\"hidden\" id=\"name-46dbe1be92910\" value=\"prop[http://www.w3.org/2000/01/rdf-schema#comment]\" />\n            </td>\n        </tr>\n        <tr class=\"odd row-input\">\n            <td>\n            <input type=\"text\" id=\"autosuggest46dbe1be940a5\" class=\"property autosuggest text width90\" value=\"owl:imports\" \n            onchange=\"updateTable(this, '46dbe1be940a5')\" />\n            </td>\n            <td>\n            <div id=\"container-46dbe1be95fe1\" class=\"ResourceEditContainer\">\n            <input type=\"hidden\" id=\"model-46dbe1be95fe1\" value=\"http://localhost/OntoWiki/Config/\" />\n            <input type=\"hidden\" id=\"property-46dbe1be95fe1\" value=\"http://www.w3.org/2002/07/owl#imports\" />\n            <input type=\"text\" name=\"prop[http://www.w3.org/2002/07/owl#imports][1][uri]\" class=\"ResourceEditValue text width50\" value=\"http://ns.ontowiki.net/SysOnt/\" id=\"value-46dbe1be95fe11\" />\n            <img class=\"delete button\" id=\"img-46dbe1be95fe11\" src=\"http://localhost/ontowiki/lib/Erfurt/public/images/delete.gif\" alt=\"del\" />\n            </div>\n            <a href=\"javascript:getEmptyHtml(this,'46dbe1be95fe1','container-46dbe1be95fe1','ResourceEdit')\" title=\"Add a value\"><img src=\"http://localhost/ontowiki/lib/Erfurt/public/images/plus_big.png\" alt=\"+\"/></a>\n            <input type=\"hidden\" id=\"count-46dbe1be95fe1\" value=\"1\" />\n            <input type=\"hidden\" id=\"name-46dbe1be95fe1\" value=\"prop[http://www.w3.org/2002/07/owl#imports]\" />\n            </td>\n        </tr>\n    </tbody>\n    </table>\n\n    </fieldset>\n\n    <div>\n        <button type=\"submit\" name=\"submit\">Submit Values</button>\n        <a class=\"formbutton\">Add Property</a>\n    </div>\n    \n    </fieldset>\n    </form>\n\n\n    <table class=\"separated-vertical rdfa\" about=\"http://3ba.se/conferences/AIMSA2006\"\n             xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"             xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"             xmlns:owl=\"http://www.w3.org/2002/07/owl#\"             xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\"             xmlns:sysont=\"http://ns.ontowiki.net/SysOnt/\"             xmlns:dc=\"http://purl.org/dc/elements/1.1/\"             xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"             xmlns:doap=\"http://usefulinc.com/ns/doap#\"             xmlns:wordnet=\"http://xmlns.com/wordnet/1.6/\"             xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\"             xmlns:sioc=\"http://rdfs.org/sioc/ns#\"             xmlns:swrc=\"http://swrc.ontoware.org/ontology#\"             xmlns:lcl=\"http://ns.aksw.org/e-learning/lcl/\"             xmlns:geo=\"http://www.w3.org/2003/01/geo/wgs84_pos#\"             xmlns:__default=\"http://3ba.se/conferences/\"    >\n        <tbody id=\"group1\">\n            <tr class=\"grouptitle\"><th colspan=\"2\"><a class=\"toggle\" href=\"#group1\"> </a>Gruppe Eins</th></tr>\n            <tr class=\"onlyAural\"><th>Attribut</th><th>Wert</th></tr>\n            <tr>\n                <td width=\"25%\"><a href=\"http://localhost/OntoWiki/view/r/URL\">URL</a></td>\n                <td><span property=\"__default:URL\" content=\"http://aimsa2006.inrialpes.fr/\" datatype=\"xsd:anyURI\"><a href=\"http://aimsa2006.inrialpes.fr/\">http://aimsa2006.inrialpes.fr/</a></span></td>\n            </tr>\n            <tr>\n                <td width=\"25%\"><a href=\"http://localhost/OntoWiki/view/r/acceptanceNotification\">acceptance Notification</a></td>\n                <td><span property=\"__default:acceptanceNotification\" content=\"2006-06-10\" datatype=\"xsd:date\">2006-06-10</span></td>\n            </tr>\n            <tr>\n                <td width=\"25%\"><a href=\"http://localhost/OntoWiki/view/r/camera-readySubmission\">camera-ready Submission</a></td>\n                <td><span property=\"__default:camera-readySubmission\" content=\"2006-06-30\" datatype=\"xsd:date\">2006-06-30</span></td>\n            </tr>\n            <tr>\n                <td width=\"25%\"><a href=\"http://localhost/OntoWiki/view/r/end\">end</a></td>\n                <td><span property=\"__default:end\" content=\"2006-09-15\" datatype=\"xsd:date\">2006-09-15</span></td>\n            </tr>\n        </tbody>\n        <tbody class=\"closed\" id=\"group2\">\n            <tr class=\"grouptitle\"><th colspan=\"2\"><a class=\"toggle\" href=\"#group2\"> </a>Gruppe Zwei</th></tr>\n            <tr class=\"onlyAural\"><th>Attribut</th><th>Wert</th></tr>\n            <tr>\n                <td width=\"25%\"><a href=\"http://localhost/OntoWiki/view/r/place\">Place</a></td>\n                <td><span property=\"__default:place\" content=\"Varna, Bulgaria\" datatype=\"xsd:string\">Varna, Bulgaria</span></td>\n            </tr>\n            <tr>\n                <td width=\"25%\"><a href=\"http://localhost/OntoWiki/view/r/price\">price</a></td>\n                <td><span property=\"__default:price\" content=\"300\" datatype=\"xsd:integer\">300</span></td>\n            </tr>\n            <tr>\n                <td width=\"25%\"><a href=\"http://localhost/OntoWiki/view/r/start\">start</a></td>\n                <td><span property=\"__default:start\" content=\"2006-09-13\" datatype=\"xsd:date\">2006-09-13</span></td>\n            </tr>\n        </tbody>\n        <tbody id=\"group3\">\n            <tr class=\"grouptitle\"><th colspan=\"2\"><a class=\"toggle\" href=\"#group3\"> </a>Gruppe Drei</th></tr>\n            <tr class=\"onlyAural\"><th>Attribut</th><th>Wert</th></tr>\n            <tr>\n                <td width=\"25%\"><a href=\"http://localhost/OntoWiki/view/r/submissionsDue\">Submissions due</a></td>\n                <td><span property=\"__default:submissionsDue\" content=\"2006-04-15\" datatype=\"xsd:date\">2006-04-15</span></td>\n            </tr>\n            <tr>\n                <td width=\"25%\"><a href=\"http://localhost/OntoWiki/view/r/swrc%3Atitle\">Title</a></td>\n                <td><span property=\"swrc:title\" content=\"12th International Conference on Artificial Intelligence: Methodology, Systems, Applications\" datatype=\"xsd:string\">12th International Conference on <a href=\"#\" class=\"hasMenu\">Artificial Intelligence<span class=\"toggle\" title=\"{Werkzeuge}\"></span></a>: Methodology, Systems, Applications</span></td>\n            </tr>\n            <tr>\n                <td width=\"25%\"><a href=\"http://localhost/OntoWiki/view/r/swrc%3Ayear\">swrc:year</a></td>\n                <td><span property=\"swrc:year\" content=\"2006\" >2006</span></td>\n            </tr>\n        </tbody>\n        <tbody id=\"group4\">\n            <tr class=\"grouptitle\"><th colspan=\"2\"><a class=\"toggle\" href=\"#group4\"> </a>Gruppe Vier</th></tr>\n            <tr class=\"onlyAural\"><th>Attribut</th><th>Wert</th></tr>\n            <tr>\n                <td width=\"25%\"><a href=\"http://localhost/OntoWiki/view/r/rdfs%3Alabel\">label</a></td>\n                <td><span property=\"rdfs:label\" content=\"AIMSA2006\" >AIMSA2006</span></td>\n            </tr>\n            <tr>\n                <td width=\"25%\"><a href=\"http://localhost/OntoWiki/view/r/geo%3Alat\">latitude</a></td>\n                <td><span property=\"geo:lat\" content=\"43.206667\" datatype=\"xsd:float\">43.206667</span></td>\n            </tr>\n            <tr>\n                <td width=\"25%\"><a href=\"http://localhost/OntoWiki/view/r/geo%3Along\">longitude</a></td>\n                <td><span property=\"geo:long\" content=\"27.918889\" datatype=\"xsd:float\">27.918889</span></td>\n            </tr>\n        </tbody>\n    </table>\n\n\n\n    </div>\n</div>\n\n</div><!-- Section 1 -->\n\n<div class=\"section-sidewindows\"><!-- Section 2 -->\n\n    <div class=\"window\">\n        <h1 class=\"title\">Sandboxes</h1>\n        <div class=\"content\">\n            <ol class=\"bullets-none separated-vertical has-contextmenus-block\">\n                <li><a href=\"forms.html\">Form Examples</a></li>\n                <li><a href=\"tables.html\" class=\"selected\">Table Examples</a></li>\n                <li><a href=\"filter.html\">Filter GUI</a></li>\n            </ol>\n        </div>\n    </div>\n\n</div><!-- Section 2 -->\n\n</body>\n</html>\n\n"
  },
  {
    "path": "extensions/themes/silverblue/sandbox/uitest.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\r\n        \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n\r\n<head>\r\n<title>OntoWiki — Instances of Person</title>    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<meta name=\"generator\" content=\"OntoWiki — Collaborative Knowledge Engineering\" />\r\n<link rel=\"stylesheet\" href=\"./../styles/default.css\" type=\"text/css\" media=\"screen\" />\r\n<!-- jQuery -->\r\n<script type=\"text/javascript\" src=\"./../scripts/libraries/jquery-1.9.1.js\"></script>\r\n<script type=\"text/javascript\" src=\"./../scripts/libraries/jquery-ui-1.8.22.js\"></script>\r\n<script type=\"text/javascript\">\r\n    $(document).ready(function() {\r\n        $('#button-tests button, #button-tests input, #button-tests a').button().click(function(){ $('#dialog-test').dialog('open'); });\r\n        $('#tabs').tabs();\r\n        $('#progressbar-1').progressbar({ value: 75 });\r\n        $('#progressbar-2').progressbar({ value: 20 });\r\n        $('#dialog-test').dialog({autoOpen: false});\r\n        $('#slider-1').slider();\r\n        $('#slider-2').slider({ value: 100, max: 400, min: 0, step: 10});\r\n        $('#accordion').accordion();\r\n    });\r\n</script>\r\n</head>\r\n<body>\r\n    <h3>tabs</h3>\r\n    <div id=\"tabs\">\r\n        <ul>\r\n            <li><a href=\"#tabs-1\">tab1</a></li>\r\n            <li><a href=\"#tabs-2\">tab2</a></li>\r\n            <li><a href=\"#tabs-3\">tab3</a></li>\r\n        </ul>\r\n        <div id=\"tabs-1\">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</div>\r\n        <div id=\"tabs-2\">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</div>\r\n        <div id=\"tabs-3\">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div>\r\n    </div>\r\n    <h3>buttons - click to open dialog</h3>\r\n    <div id=\"button-tests\">\r\n        <p>\r\n            <button>Element Button</button>\r\n            <input value=\"Submit Button\" type=\"submit\"></input>\r\n            <a href=\"#\">An anchor Button</a>\r\n        </p>\r\n    </div>\r\n    <h3>progressbars</h3>\r\n    <div id=\"progressbar-test\">\r\n        <div id=\"progressbar-1\"></div>\r\n        <br></br>\r\n        <div id=\"progressbar-2\"></div>\r\n    </div>\r\n    <div id=\"dialog-test\" title=\"Ontowiki Dialog Test\">\r\n\t<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>\r\n    </div>\r\n    <h3>slider</h3>\r\n    <div id=\"slider-test\">\r\n        <div id=\"slider-1\"></div>\r\n        <br></br>\r\n        <div id=\"slider-2\"></div>\r\n    </div>\r\n    <h3>accordion</h3>\r\n    <div id=\"accordion\">\r\n        <h3>One</h3>\r\n        <div>\r\n            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam\r\n        </div>\r\n        <h3>Two</h3>\r\n        <div>\r\n            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam\r\n        </div>\r\n        <h3>Three</h3>\r\n        <div>\r\n            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam\r\n        </div>\r\n    </div>\r\n</body>\r\n</html>\r\n"
  },
  {
    "path": "extensions/themes/silverblue/sandbox/uitestow.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\r\n        \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n\r\n<head>\r\n<title>OntoWiki � Instances of Person</title>    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<meta name=\"generator\" content=\"OntoWiki � Collaborative Knowledge Engineering\" />\r\n<script type=\"text/javascript\">\r\nvar urlBase = \"http://localhost/ow/trunk/\";\r\nvar themeUrlBase = \"http://localhost/ow/trunk/extensions/themes/silverblue/\";\r\nvar _OWSESSION = \"ONTOWIKItrunk\";\r\nvar widgetBase = \"http://localhost/ow/trunk/libraries/RDFauthor/\";\r\nvar defaultGraph = \"http://sebastian.dietzold.de/rdf/foaf.rdf\";\r\nvar defaultResource = \"http://xmlns.com/foaf/0.1/Person\";\r\n</script>\r\n\r\n    <!-- jQuery -->\r\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery-1.9.1.js\"></script>\r\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery-ui-1.8.22.js\"></script>\r\n\r\n    <!-- included js libraries -->\r\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.json.js\"></script>\r\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.livequery.js\"></script>\r\n\r\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.clickmenu.js\"></script>\r\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.simplemodal.js\"></script>\r\n    <script type=\"text/javascript\" src=\"./../scripts/libraries/jquery.tablesorter.js\"></script>\r\n\r\n    <!-- ontowiki js -->\r\n    <script type=\"text/javascript\" src=\"./../themes/silverblue/scripts/jquery.ontowiki.js\"></script>\r\n    <script type=\"text/javascript\" src=\"./../themes/silverblue/scripts/main.js\"></script>\r\n\r\n    <!-- dynamic js -->\r\n\r\n<script type=\"text/javascript\">\r\n    //<![CDATA[\r\nvar classUri = \"foaf:Person\";    //]]>\r\n</script>\r\n\r\n<script type=\"text/javascript\">\r\n    $(document).ready(function() {\r\n        var tags = [{\r\n                label: \"Sebastian Tramp\",\r\n                source: \"Auto-generated URI\",\r\n                uri: \"http://tramp.de\"\r\n            },\r\n            {\r\n                label: \"Norman Heino\",\r\n                source: \"Sindice result\",\r\n                uri: \"http://heino.de\"\r\n            },\r\n            {\r\n                label: \"Philipp Frischmuth\",\r\n                source: \"Local result\",\r\n                uri: \"http://frischmuth.de\"\r\n            },\r\n            {\r\n                label: \"Clemens Hoffmann\",\r\n                source: \"Auto-generated URI\",\r\n                uri: \"http://hoffmann.de\"\r\n            }\r\n        ];\r\n        \r\n        $('#button-tests button, #button-tests input, #button-tests a').button().click(function(){ $('#dialog-test').dialog('open'); return false;});\r\n        $('#button-tests-2 button, #button-tests-2 input, #button-tests-2 a').button().click(function(){ $('#dialog-test').dialog('open'); return false;});\r\n        $('#tabs').tabs();\r\n        $('#tabs2').tabs();\r\n        $('#progressbar-1').progressbar({ value: 75 });\r\n        $('#progressbar-2').progressbar({ value: 20 });\r\n        $('#dialog-test').dialog({autoOpen: false});\r\n        $('#slider-1').slider();\r\n        $('#slider-2').slider({ value: 100, max: 400, min: 0, step: 50});\r\n        $('#accordion').accordion();\r\n        $('#progressbar-3').progressbar({ value: 75 });\r\n        $('#progressbar-4').progressbar({ value: 20 });\r\n        $('#slider-3').slider();\r\n        $('#slider-4').slider({ value: 100, max: 400, min: 0, step: 10});\r\n        $('#accordion-2').accordion();\r\n        $('#datepicker').datepicker();\r\n        $('#datepicker-2').datepicker();\r\n        $('#autocomplete').autocomplete({ \r\n            source: tags,\r\n            focus: function( event, ui ) {\r\n                    $( \"#autocomplete\" ).val( ui.item.label );\r\n                    return false;\r\n            },\r\n            select: function( event, ui ) {\r\n                    $( \"#autocomplete\" ).val( ui.item.label );\r\n            }\r\n        }).data( \"autocomplete\" )._renderItem = function( ul, item ) {\r\n                return $( \"<li></li>\" )\r\n                        .data( \"item.autocomplete\", item )\r\n                        .append( \"<a><span class='resource-edit-source'>\" + item.source + \"</span><span class='resource-edit-label'>\" + item.label + \"</span><span class='resource-edit-uri'>\" + item.uri + \"</span></a>\" )\r\n                        .appendTo( ul );\r\n        };\r\n        $('#autocomplete-2').autocomplete({ \r\n            source: tags,\r\n            focus: function( event, ui ) {\r\n                    $( \"#autocomplete-2\" ).val( ui.item.label );\r\n                    return false;\r\n            },\r\n            select: function( event, ui ) {\r\n                    $( \"#autocomplete-2\" ).val( ui.item.label );\r\n            }\r\n        }).data( \"autocomplete\" )._renderItem = function( ul, item ) {\r\n                return $( \"<li></li>\" )\r\n                        .data( \"item.autocomplete\", item )\r\n                        .append( \"<a><span class='resource-edit-source'>\" + item.source + \"</span><span class='resource-edit-label'>\" + item.label + \"</span><span class='resource-edit-uri'>\" + item.uri + \"</span></a>\" )\r\n                        .appendTo( ul );\r\n        };\r\n        $('#autocomplete-3').autocomplete({ source: tags });\r\n        $('#autocomplete-4').autocomplete({ source: tags });\r\n    });\r\n</script>\r\n\r\n    <!-- ontowiki stylesheets -->\r\n\r\n    <link rel=\"stylesheet\" href=\"./../styles/default.css\" type=\"text/css\" media=\"screen\" />\r\n    <link rel=\"stylesheet\" href=\"./../styles/clickmenu.css\" type=\"text/css\" media=\"screen\" />\r\n    <link rel=\"stylesheet\" href=\"./../styles/jquery-ui.css\" type=\"text/css\" media=\"screen\" />\r\n\r\n    <!-- IE conditional stylesheets -->\r\n    <!--[if lte IE 6]><link rel=\"stylesheet\" media=\"screen\" href=\"http://localhost/ow/trunk/extensions/themes/silverblue/styles/default.ie6.css\" /><![endif]-->\r\n    <!--[if lte IE 6]><link rel=\"stylesheet\" media=\"screen\" href=\"http://localhost/ow/trunk/extensions/themes/silverblue/styles/clickmenu.msie.css\" /><![endif]-->\r\n    <!--[if IE 7]><link rel=\"stylesheet\" media=\"screen\" href=\"http://localhost/ow/trunk/extensions/themes/silverblue/styles/default.ie7.css\" /><![endif]-->\r\n\r\n    <!-- dynamic styles -->\r\n    </head>\r\n\r\n\r\n\r\n</head>\r\n    <body class=\"javascript-off\">\r\n\r\n\r\n    <script type=\"text/javascript\">\r\n        // get body element\r\n        var body = document.body;\r\n        var bodyClass = body.className;\r\n        // set javascript = on\r\n        bodyClass = bodyClass.replace(/javascript-off/g, \"javascript-on\");\r\n        // process changes\r\n        body.setAttribute(\"class\", bodyClass, 0);\r\n    </script>\r\n\r\n    <script type=\"text/javascript\">\r\n    //<![CDATA[\r\n/* from modules/navigation/ */\r\nvar navigationConfigString = '{\"default\":\"classes\",\"config\":{\"skos\":{\"name\":\"SKOS\",\"hierarchyTypes\":[\"http:\\/\\/www.w3.org\\/2004\\/02\\/skos\\/core#Concept\",\"http:\\/\\/www.w3.org\\/2004\\/02\\/skos\\/core#Collection\"],\"hierarchyRelations\":{\"in\":[\"http:\\/\\/www.w3.org\\/2004\\/02\\/skos\\/core#broader\"],\"out\":[\"http:\\/\\/www.w3.org\\/2004\\/02\\/skos\\/core#narrower\"]}},\"classes\":{\"name\":\"Classes\",\"hierarchyTypes\":[\"http:\\/\\/www.w3.org\\/2000\\/01\\/rdf-schema#Class\",\"http:\\/\\/www.w3.org\\/2002\\/07\\/owl#Class\"],\"hierarchyRelations\":{\"in\":[\"http:\\/\\/www.w3.org\\/2000\\/01\\/rdf-schema#subClassOf\"]},\"instanceRelation\":{\"out\":[\"http:\\/\\/www.w3.org\\/1999\\/02\\/22-rdf-syntax-ns#type\"]},\"hiddenNS\":[\"http:\\/\\/www.w3.org\\/1999\\/02\\/22-rdf-syntax-ns#\",\"http:\\/\\/www.w3.org\\/2000\\/01\\/rdf-schema#\",\"http:\\/\\/www.w3.org\\/2002\\/07\\/owl#\"],\"hiddenRelation\":[\"http:\\/\\/ns.ontowiki.net\\/SysOnt\\/hidden\"]}}}'\r\nvar navigationConfig = $.evalJSON(navigationConfigString);\r\n    //]]>\r\n</script>\r\n    <div class=\"section-mainwindows\">\r\n        <div class=\"window tabbed windowbuttonscount-right-1\">\r\n                        <h1 class=\"title\">Instances of Person</h1>\r\n            <div class=\"slidehelper\">\r\n                                    <ol class=\"tabs\">\r\n                    <li id=\"index\" class=\"active\">\r\n                <a href=\"http://localhost/ow/trunk/list/r/foaf%3APerson\">Instances</a>\r\n            </li>\r\n                    <li id=\"history\" class=\"\">\r\n                <a href=\"http://localhost/ow/trunk/history/list/r/foaf%3APerson\">History</a>\r\n            </li>\r\n                    <li id=\"community\" class=\"\">\r\n                <a href=\"http://localhost/ow/trunk/community/list/r/foaf%3APerson\">Community</a>\r\n            </li>\r\n                    <li id=\"source\" class=\"\">\r\n                <a href=\"http://localhost/ow/trunk/source/edit/r/foaf%3APerson\">Source</a>\r\n            </li>\r\n            </ol>\r\n\r\n                                    <div class=\"content has-innerwindows active-tab-content\">\r\n                                                    <form action=\"http://localhost/ow/trunk/resource/delete\" method=\"post\" name=\"instancelist\" enctype=\"multipart/form-data\">\r\n                                                                        <input name=\"redirect\" value=\"http://localhost/ow/trunk/list/r/foaf%3APerson\" type=\"hidden\">\r\n\r\n                                                    <div class=\"messagebox\"><div class=\"toolbar\"><a href=\"uitestow.html\" class=\"button edit\"><span>jQuery UI Testpage</span></a><a class=\"button edit\"><img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/icon-save2.png\"><span>&nbsp;Save Changes</span></a><a class=\"button edit\"><img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/icon-cancel.png\"><span>&nbsp;Cancel</span></a><a class=\"button separator\"></a><a class=\"button init-resource\"><img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/icon-editadd.png\"><span>&nbsp;Add Instance</span></a><a class=\"button separator\"></a><a class=\"button submit\"><img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/icon-delete.png\"><span>&nbsp;Delete Selected</span></a></div></div>\r\n\r\n                        <div class=\"innercontent\">\r\n    <h3>datepicker</h3>\r\n    <div>\r\n        <p>Date: <input id=\"datepicker\" class=\"text\" type=\"text\"></p>\r\n    </div>\r\n    <h3>autocomplete - type space to get all results</h3>\r\n    <div>\r\n        <p><input id=\"autocomplete\" class=\"text\" type=\"text\"></p>\r\n        <p><input id=\"autocomplete-3\" class=\"text\" type=\"text\"></p>\r\n    </div>\r\n    <h3>tabs</h3>\r\n    <div id=\"tabs\">\r\n        <ul>\r\n            <li><a href=\"#tabs-1\">tab1</a></li>\r\n            <li><a href=\"#tabs-2\">tab2</a></li>\r\n            <li><a href=\"#tabs-3\">tab3</a></li>\r\n        </ul>\r\n        <div id=\"tabs-1\">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</div>\r\n        <div id=\"tabs-2\">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</div>\r\n        <div id=\"tabs-3\">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div>\r\n    </div>\r\n    <h3>buttons - click to open dialog</h3>\r\n    <div id=\"button-tests\">\r\n        <p>\r\n            <button>Element Button</button>\r\n            <input value=\"Submit Button\" type=\"submit\"></input>\r\n            <a href=\"#\">An anchor Button</a>\r\n        </p>\r\n    </div>\r\n    <h3>progressbars</h3>\r\n    <div id=\"progressbar-test\">\r\n        <div id=\"progressbar-1\"></div>\r\n        <br></br>\r\n        <div id=\"progressbar-2\"></div>\r\n    </div>\r\n    <div id=\"dialog-test\" title=\"Ontowiki Dialog Test\">\r\n\t<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>\r\n    </div>\r\n    <h3>slider</h3>\r\n    <div id=\"slider-test\">\r\n        <div id=\"slider-1\"></div>\r\n        <br></br>\r\n        <div id=\"slider-2\"></div>\r\n    </div>\r\n    <h3>accordion</h3>\r\n    <div id=\"accordion\">\r\n        <h3>One</h3>\r\n        <div>\r\n            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam\r\n        </div>\r\n        <h3>Two</h3>\r\n        <div>\r\n            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam\r\n        </div>\r\n        <h3>Three</h3>\r\n        <div>\r\n            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam\r\n        </div>\r\n    </div>\r\n    \r\n                        </div><!-- .innercontent -->\r\n\r\n                                                    </form>\r\n                                                <div class=\"innerwindows\">\r\n    <h3>datepicker</h3>\r\n    <div>\r\n        <p>Date: <input id=\"datepicker-2\" class=\"text\" type=\"text\"></p>\r\n    </div>\r\n    <h3>autocomplete - type space to get all results</h3>\r\n    <div>\r\n        <p><input id=\"autocomplete-2\" class=\"text\" type=\"text\"></p>\r\n        <p><input id=\"autocomplete-4\" class=\"text\" type=\"text\"></p>\r\n    </div>\r\n    <h3>tabs</h3>\r\n    <div id=\"tabs2\">\r\n        <ul>\r\n            <li><a href=\"#tabs-2_1\">tab1</a></li>\r\n            <li><a href=\"#tabs-2_2\">tab2</a></li>\r\n            <li><a href=\"#tabs-2_3\">tab3</a></li>\r\n        </ul>\r\n        <div id=\"tabs-2_1\">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</div>\r\n        <div id=\"tabs-2_2\">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</div>\r\n        <div id=\"tabs-2_3\">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div>\r\n    </div>\r\n    <h3>buttons - click to open dialog</h3>\r\n    <div id=\"button-tests-2\">\r\n        <p>\r\n            <button>Element Button</button>\r\n            <input value=\"Submit Button\" type=\"submit\"></input>\r\n            <a href=\"#\">An anchor Button</a>\r\n        </p>\r\n    </div>\r\n    <h3>progressbars</h3>\r\n    <div id=\"progressbar-test\">\r\n        <div id=\"progressbar-3\"></div>\r\n        <br></br>\r\n        <div id=\"progressbar-4\"></div>\r\n    </div>\r\n    <h3>slider</h3>\r\n    <div id=\"slider-test\">\r\n        <div id=\"slider-3\"></div>\r\n        <br></br>\r\n        <div id=\"slider-4\"></div>\r\n    </div>\r\n    <h3>accordion</h3>\r\n    <div id=\"accordion-2\">\r\n        <h3>One</h3>\r\n        <div>\r\n            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam\r\n        </div>\r\n        <h3>Two</h3>\r\n        <div>\r\n            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam\r\n        </div>\r\n        <h3>Three</h3>\r\n        <div>\r\n            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam\r\n        </div>\r\n    </div>\r\n\r\n</div><!-- .window -->\r\n                        </div><!-- .innerwindows -->\r\n\r\n                    </div><!-- .content .has-innerwindows -->\r\n\r\n\r\n                    <div class=\"messagebox statusbar\">\r\n            </div>\r\n            </div><!-- .slidehelper -->\r\n        <div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\r\n    </div><!-- .section-mainwindows -->\r\n\r\n    <div class=\"section-sidewindows\">\r\n        <div class=\"window windowbuttonscount-right-1 has-menu\" id=\"application\">\r\n\r\n            <h1 class=\"title\">OntoWiki (Admin)</h1>\r\n\r\n    <div class=\"slidehelper\">\r\n\r\n\r\n                                    <div class=\"content\">\r\n\r\n<form name=\"search\" method=\"get\" action=\"http://localhost/ow/trunk/resource/instances/\">\r\n\t\t<p class=\"width98\">\r\n\t\t<label class=\"display-block onlyAural\" for=\"searchtext-input\">Search for Resources</label>\r\n\t\t<input class=\"text width99 inner-label\" id=\"searchtext-input\" name=\"s\" value=\"\" type=\"text\">\r\n\t</p>\r\n\t\t<p>\r\n\t\t<!--label class=\"display-block\">\r\n\t\t    \t\t\t<input class=\"checkbox\" type=\"checkbox\" name=\"allModels\" id=\"allModels\" />\r\n\t\t\tSearch all Knowledge Bases\t\t</label-->\r\n\t\t\t\t<!--a class=\"button submit\">Submit</a-->\r\n\t</p>\r\n</form>\r\n                </div><!-- .window .content -->\r\n\r\n                    <div class=\"cmDiv\"><ul class=\"menu clickMenu\">\r\n                                        <li class=\"main\">User            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\r\n                                                            <li><a href=\"http://localhost/ow/trunk/application/register\">Register New User</a></li>\r\n                                                                                <li><a href=\"http://localhost/ow/trunk/application/preferences\">Preferences</a></li>\r\n                                                                                <li><a href=\"http://localhost/ow/trunk/application/logout\">Logout</a></li>\r\n                                                </ul></div>\r\n        </li>\r\n                                <li class=\"main\">Extras            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\r\n                                                            <li><a href=\"http://localhost/ow/trunk/querybuilding/editor\">SPARQL Query Editor</a></li>\r\n                                                                                <li><a href=\"http://localhost/ow/trunk/index/news\">News</a></li>\r\n                                                </ul></div>\r\n        </li>\r\n                                <li class=\"main\">Help            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\r\n                                                            <li><a href=\"http://ontowiki.net/Projects/OntoWiki/Help\">Documentation</a></li>\r\n                                                                                <li><a href=\"http://code.google.com/p/ontowiki/issues/entry\">Bug Report</a></li>\r\n                                                                                <li><a href=\"http://ontowiki.net/Projects/OntoWiki/ChangeLog#0.9.5\">Version Info</a></li>\r\n                                                                                <li><a href=\"http://localhost/ow/trunk/application/about\">About</a></li>\r\n                                                </ul></div>\r\n        </li>\r\n                                <li class=\"main\">Debug            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\r\n                                                            <li><a href=\"http://localhost/ow/trunk/debug/clearmodulecache\">Clear Module Cache</a></li>\r\n                                                                                <li><a href=\"http://localhost/ow/trunk/debug/cleartranslationcache\">Clear Translation Cache</a></li>\r\n                                                                                <li><a href=\"http://localhost/ow/trunk/debug/clearquerycache\">Clear Query Cache</a></li>\r\n                                                                                <li><a href=\"http://localhost/ow/trunk/debug/destroysession\">Destroy Session</a></li>\r\n                                                </ul></div>\r\n        </li>\r\n                    </ul><div style=\"clear: both; visibility: hidden;\"></div></div>\r\n\r\n\r\n    </div><!-- .slidehelper -->\r\n\r\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\r\n<div class=\"window has-contextmenus-block windowbuttonscount-right-1 windowbuttonscount-left-1\" id=\"modellist\">\r\n\r\n            <h1 class=\"title\">Knowledge Bases</h1>\r\n\r\n    <div class=\"slidehelper\">\r\n\r\n\r\n                                    <div class=\"content\">\r\n                                            <ol class=\"bullets-none separated-vertical\">\r\n    \t    \t\t<li>\r\n    \t\t\t<a class=\"Model Resource\" href=\"http://localhost/ow/trunk/model/select/?m=http%3A%2F%2Flocalhost%2FOntoWiki%2FConfig%2F\" about=\"http://localhost/OntoWiki/Config/\">\r\n    \t\t\t\tOntoWiki System Configuration    \t\t\t<span class=\"button\"></span></a>\r\n    \t\t</li>\r\n    \t    \t\t<li>\r\n    \t\t\t<a class=\"Model selected Resource\" href=\"http://localhost/ow/trunk/model/select/?m=http%3A%2F%2Fsebastian.dietzold.de%2Frdf%2Ffoaf.rdf\" about=\"http://sebastian.dietzold.de/rdf/foaf.rdf\">\r\n    \t\t\t\tSeebis FOAF Profile    \t\t\t<span class=\"button\"></span></a>\r\n    \t\t</li>\r\n    \t    </ol>\r\n                </div><!-- .window .content -->\r\n\r\n\r\n                    <div class=\"contextmenu\">\r\n                <ul>\r\n                        <li><a href=\"http://localhost/ow/trunk/model/create\">Create Knowledge Base</a></li>\r\n                                </ul>\r\n                <hr>\r\n            <ul>\r\n                                <li>\r\n                                    <a class=\"modellist_hidden_button show\">\r\n                   Show Hidden Knowledge Bases                </a>\r\n            </li>\r\n            </ul>\r\n            </div>\r\n\r\n    </div><!-- .slidehelper -->\r\n\r\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"><span class=\"button button-contextmenu\"></span></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\r\n<div class=\"window has-contextmenus-block windowbuttonscount-right-1\" id=\"hierarchy\">\r\n\r\n            <h1 class=\"title\">Classes</h1>\r\n\r\n    <div class=\"slidehelper\">\r\n\r\n\r\n                                    <div class=\"content\">\r\n                                        <!--form name=\"search\" method=\"get\" action=\"\">\r\n\t<p class=\"width98\">\r\n\t\t<label class=\"display-block\" for=\"hierarchy-input\">Type to search ...</label>\r\n\t\t<input class=\"inner-label text width100 live-search\" type=\"text\" id=\"hierarchy-input\" name=\"q\"/>\r\n\t</p>\r\n</form-->\r\n\t<ul class=\"bullets-none separated-vertical hierarchy\">\r\n\t\t\t\t\t<li>\r\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/?r=http%3A%2F%2Fpurl.org%2Frss%2F1.0%2Fchannel\" about=\"http://purl.org/rss/1.0/channel\">\r\n\t\t\t\t\tchannel\t\t\t\t<span class=\"button\"></span></a>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t<li>\r\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/?r=http%3A%2F%2Fwww.w3.org%2F2002%2F12%2Fcal%2Fical%23Vcalendar\" about=\"http://www.w3.org/2002/12/cal/ical#Vcalendar\">\r\n\t\t\t\t\tVcalendar\t\t\t\t<span class=\"button\"></span></a>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t<li>\r\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AGroup\" about=\"http://xmlns.com/foaf/0.1/Group\">\r\n\t\t\t\t\tGroup\t\t\t\t<span class=\"button\"></span></a>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t<li>\r\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AOnlineAccount\" about=\"http://xmlns.com/foaf/0.1/OnlineAccount\">\r\n\t\t\t\t\tOnline Account\t\t\t\t<span class=\"button\"></span></a>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t<li>\r\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AOrganization\" about=\"http://xmlns.com/foaf/0.1/Organization\">\r\n\t\t\t\t\tOrganization\t\t\t\t<span class=\"button\"></span></a>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t<li>\r\n\t\t\t    \t\t\t    <a class=\"Class selected Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3APerson\" about=\"http://xmlns.com/foaf/0.1/Person\">\r\n\t\t\t\t\tPerson\t\t\t\t<span class=\"button\"></span></a>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t<li>\r\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3APersonalProfileDocument\" about=\"http://xmlns.com/foaf/0.1/PersonalProfileDocument\">\r\n\t\t\t\t\tPersonalProfileDocument\t\t\t\t<span class=\"button\"></span></a>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t<li>\r\n\t\t\t    \t\t\t    <a class=\"Class Resource\" href=\"http://localhost/ow/trunk/list/r/foaf%3AProject\" about=\"http://xmlns.com/foaf/0.1/Project\">\r\n\t\t\t\t\tProject\t\t\t\t<span class=\"button\"></span></a>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t</ul>\r\n                </div><!-- .window .content -->\r\n\r\n\r\n\r\n    </div><!-- .slidehelper -->\r\n\r\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\r\n<div class=\"window has-contextmenus-block windowbuttonscount-right-1 has-menu\" id=\"navigation\">\r\n\r\n            <h1 class=\"title\">Navigation</h1>\r\n\r\n    <div class=\"slidehelper\">\r\n\r\n\r\n                                    <div class=\"content\">\r\n\r\n<p><input class=\"text width98 inner-label\" id=\"navigation-input\" name=\"navigation-input\" value=\"\" type=\"text\"></p>\r\n<p style=\"overflow: hidden; margin-left: 0px;\" id=\"navigation-content\" class=\"\">\r\n    <ol class=\"bullets-none separated-vertical\">\r\n            <li class=\"even\">\r\n            <a class=\"navigation Resource\" about=\"http://purl.org/rss/1.0/channel\">channel<span class=\"button\"></span></a>\r\n        </li>\r\n            <li class=\"odd\">\r\n            <a class=\"navigation Resource\" about=\"http://www.w3.org/2002/12/cal/ical#Vcalendar\">ical#Vcalendar<span class=\"button\"></span></a>\r\n        </li>\r\n            <li class=\"even\">\r\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/Group\">Group<span class=\"button\"></span></a>\r\n        </li>\r\n            <li class=\"odd\">\r\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/OnlineAccount\">OnlineAccount<span class=\"button\"></span></a>\r\n        </li>\r\n            <li class=\"even\">\r\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/Organization\">Organization<span class=\"button\"></span></a>\r\n        </li>\r\n            <li class=\"odd\">\r\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/Person\">Person<span class=\"button\"></span></a>\r\n        </li>\r\n            <li class=\"even\">\r\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/PersonalProfileDocument\">PersonalProfileDocument<span class=\"button\"></span></a>\r\n        </li>\r\n            <li class=\"odd\">\r\n            <a class=\"navigation Resource\" about=\"http://xmlns.com/foaf/0.1/Project\">Project<span class=\"button\"></span></a>\r\n        </li>\r\n        </ol>\r\n\r\n<pre></pre></p>\r\n                </div><!-- .window .content -->\r\n\r\n                    <div class=\"cmDiv\"><ul class=\"menu clickMenu\">\r\n                                        <li class=\"main\">Type            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\r\n                                                            <li><a href=\"javascript:navigationEvent('setType', 'skos')\">SKOS</a></li>\r\n                                                                                <li><a href=\"javascript:navigationEvent('setType', 'classes')\">Classes</a></li>\r\n                                                </ul></div>\r\n        </li>\r\n                                <li class=\"main\">View            <div style=\"position: absolute;\" class=\"outerbox inner\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\r\n                                                            <li><a href=\"javascript:navigationEvent('reset')\">Reset Navigation</a></li>\r\n                                                                                            <li>Number of entries            <img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/submenu-indicator.png\" class=\"liArrow\"><div style=\"position: absolute;\" class=\"outerbox\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\r\n                                                            <li><a href=\"javascript:navigationEvent('setCount', 10)\">10</a></li>\r\n                                                                                <li><a href=\"javascript:navigationEvent('setCount', 20)\">20</a></li>\r\n                                                                                <li><a href=\"javascript:navigationEvent('setCount', 30)\">30</a></li>\r\n                                                                                <li><a href=\"javascript:navigationEvent('setCount', 'all')\">all</a></li>\r\n                                                </ul></div>\r\n        </li>\r\n                                                                                                <li>Sort            <img src=\"http://localhost/ow/trunk/extensions/themes/silverblue/images/submenu-indicator.png\" class=\"liArrow\"><div style=\"position: absolute;\" class=\"outerbox\"><div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div><ul class=\"innerBox\">\r\n                                                            <li><a href=\"javascript:navigationEvent('setSort', 'name')\">by name</a></li>\r\n                                                                                <li><a href=\"javascript:navigationEvent('setSort', 'frequency')\">by frequency</a></li>\r\n                                                </ul></div>\r\n        </li>\r\n                                                    </ul></div>\r\n        </li>\r\n                    </ul><div style=\"clear: both; visibility: hidden;\"></div></div>\r\n\r\n\r\n    </div><!-- .slidehelper -->\r\n\r\n<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"><span class=\"button button-windowminimize\"></span></div></div></div><!-- .window -->\r\n    <span style=\"cursor: ew-resize; position: absolute; height: 831px;\" class=\"resizer-horizontal ui-draggable\"></span></div><!-- .section-sidewindows -->\r\n        <!-- Rendered in 434 ms using 23 SPARQL queries. -->\r\n<div class=\"contextmenu-enhanced\"></div>\r\n\r\n    </body>\r\n</html>\r\n\r\n"
  },
  {
    "path": "extensions/themes/silverblue/scripts/jquery.ontowiki.js",
    "content": "/*\n * OntoWiki jQuery extensions\n *\n * @package    theme\n * @copyright  Copyright (c) 2010, {@link http://aksw.org AKSW}\n * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n(function($) {\n    \n    /**\n     *  Enhances input fields with inner labels\n     */\n    $.fn.innerLabel = function() {\n        return this.each(function() {\n            // the input field\n            var input = $(this);\n            // the associated label element\n            var label = $('label[for=' + input.attr('id') + ']');\n            // the label text\n            var labelText = label.text();\n            \n            if (typeof label != 'undefined') {\n                input.focus(function() {\n                    // if if label text is input's only content, set it empty\n                    if (input.val() == labelText) {\n                        input.val('');\n                    }\n                }).blur(function() {\n                    // if nothing has been entered, set label text\n                    if (input.val() == '') {\n                        input.val(labelText);\n                    }\n                })\n                \n                label.addClass('onlyAural');\n            }\n        });\n    }\n    \n    /**\n     * Enhances input fields where the predefined value must be kept as a\n     * prefix for any value entered.\n     */\n    $.fn.prefixValue = function() {\n        return this.each(function() {\n            var input = $(this);\n            var prefix = input.val();\n            \n            input.keyup(function() {\n                if (!input.val().match(prefix)) {\n                    input.val(prefix);\n                }\n            });\n            \n            input.blur(function() {\n                if (!input.val().match(prefix)) {\n                    input.val(prefix);\n                }\n            });\n        });\n    }\n    \n    /**\n     * Enhances windows with desktop-style GUI elements\n     */\n    $.fn.enhanceWindow = function() {\n        return this.each(function() {\n            var win = $(this);\n\n            // add window buttons\n            win.children('.window-buttons').remove();\n            win.append('<div class=\"window-buttons\"><div class=\"window-buttons-left\"></div><div class=\"window-buttons-right\"></div></div>');\n\n            win.find('.window-buttons-right').append('<span class=\"button button-windowminimize\"></span>');\n            win.addClass('windowbuttonscount-right-1');\n\n            if (win.hasClass('is-minimized')) {\n                win.find('.button-windowminimize')\n                    .removeClass('button-windowminimize')\n                    .addClass('button-windowrestore');\n            }\n\n            // minimize\n            win.find('.button-windowminimize').click(function() {\n                win.toggleWindow();\n            })\n            // restore\n            win.find('.button-windowrestore').click(function() {\n                win.toggleWindow();\n            })\n            // minimize/maximize on title\n            // win.find('.title').dblclick(function() {\n            //     win.toggleWindow();\n            // })\n            \n            // context menu button\n            if (win.children('div').children('.contextmenu').length) {\n                win.find('.window-buttons-left').append('<span class=\"button button-contextmenu\"></span>');\n                win.addClass('windowbuttonscount-left-1');\n\n                // context menu action\n                win.find('.button-contextmenu').click(function(event) {\n                    showWindowMenu(event);\n                })\n            }\n\n            // add menu\n            if (win.children('div').children('ul.menu').length) {\n                win.addClass('has-menu');\n                win.children('div').children('ul.menu').clickMenu();\n            }\n\n            // create the additional tabbed class\n            if (win.children('div').children('.tabs').length > 0) {\n                win.addClass('tabbed');\n                \n                if (win.children('div').children('.active-tab-content').length == 0) {\n                    win.children('div').children('.content').eq(0).addClass('active-tab-content');\n                }\n            }\n            return win;\n        });\n    }\n    \n    /**\n     * Minimizes/restores a window\n     */\n    $.fn.toggleWindow = function() {\n        var win = this;\n        \n        if (win.hasClass('is-minimized')) {\n            // TODO: why is this necessary\n            win.children('.slidehelper').hide();\n            win.removeClass('is-minimized');\n\n            if (win.hasClass('has-menu-disabled')) {\n                win.removeClass('has-menu-disabled').addClass('has-menu');\n            }\n\n            win.children('.slidehelper')\n                .slideDown(effectTime, function() {\n                    win.find('.button-windowrestore')\n                        .removeClass('button-windowrestore')\n                        .addClass('button-windowminimize');\n                    }\n                );\n\n            win.find('div.cmDiv').adjustClickMenu();\n\n            sessionStore(win.attr('id'), 1, {encode: true, namespace: 'Module_Registry'});\n        } else {\n            win.find('h1.title').attr('style', '');\n            win.children('.slidehelper')\n                .slideUp(effectTime, function() {\n                    win.find('.button-windowminimize')\n                        .removeClass('button-windowminimize')\n                        .addClass('button-windowrestore');\n\n                        if (win.hasClass('has-menu')) {\n                            win.removeClass('has-menu').addClass('has-menu-disabled');\n                        }\n                        win.addClass('is-minimized');\n                    }\n                );\n\n            sessionStore(win.attr('id'), 2, {encode: true, namespace: 'Module_Registry'});\n        }\n    }\n    \n    /**\n     * Make link expandable\n     */\n    $.fn.expandable = function() {\n        return this.each(function() {\n            if (!$(this).prev().hasClass('collapse')) {\n                $(this).before('<span class=\"icon-button expand\"></span>');\n            }\n            $(this).prev().click(function(event) {\n                toggleExpansion(event);\n                return false; // -> event is not given further\n            });\n        })\n    }\n\n    /**\n     * Enhance link with a menu toogle for showResourceMenu\n     */\n    $.fn.createResourceMenuToggle = function() {\n        return this.each(function() {\n            //if (!$(this).find('span.toggle')) {\n                $(this).append('<span class=\"toggle\" title=\"Menu\"></span>');\n            //}\n            $(this).children('span.toggle')\n                .mouseover(function() {\n                    hideHref($(this).parent());\n                    $('.contextmenu-enhanced .contextmenu').remove(); // remove all other menus\n                })\n                .click(function(event) {\n                    showResourceMenu(event);\n                })\n                .mouseout(function() {\n                    showHref($(this).parent())\n                });\n        })\n    }\n    \n    /**\n     * Make inline elements editable.\n     */\n    $.fn.makeEditable = function () {\n         return this.each(function() {\n             if($(this).hasClass('editable')){\n                 $(this).addClass('has-contextmenu-area').css('display', 'block');\n\n                 if ($(this).children('.contextmenu').length < 1) {\n                     $(this).append('<div class=\"contextmenu\"></div>');\n                 }\n\n                 $(this).children('.contextmenu').append('\\\n                     <div class=\"item\">\\\n                         <span class=\"icon icon-edit\" title=\"Edit these values\">\\\n                         </span>\\\n                         <!--span class=\"icon icon-delete\" title=\"Delete all values\">\\\n                         </span-->\\\n                     </div>\\\n                 ');\n             }\n         })\n    }\n    \n    /**\n     * Checks whether two elements are equal\n     */\n    $.fn.equals = function (element) {\n        return this.each(function () {\n            \n        });\n    }\n\n    /**\n     * adjust the space what is needed by the window menu\n     */\n    $.fn.adjustClickMenu = function () {\n        return this.each(function () {\n            var menu = $(this);\n            var window = menu.parents('div.window');\n            if (window.attr('id') !== 'application') {\n                window.children('h1.title').attr('style', 'margin-bottom:'+menu.outerHeight(true)+'px !important;');\n            }\n        });\n    }\n\n})(jQuery);\n\n//-----------------------------------------------------------------------------\n// Defaults\n//-----------------------------------------------------------------------------\n\n// set defaults for clickmenu\n$.fn.clickMenu.setDefaults({arrowSrc: themeUrlBase + 'images/submenu-indicator.png'});\n"
  },
  {
    "path": "extensions/themes/silverblue/scripts/libraries/jquery-1.9.1.js",
    "content": "/*!\n * jQuery JavaScript Library v1.9.1\n * http://jquery.com/\n *\n * Includes Sizzle.js\n * http://sizzlejs.com/\n *\n * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2013-2-4\n */\n(function( window, undefined ) {\n\n// Can't do this because several apps including ASP.NET trace\n// the stack via arguments.caller.callee and Firefox dies if\n// you try to trace through \"use strict\" call chains. (#13335)\n// Support: Firefox 18+\n//\"use strict\";\nvar\n\t// The deferred used on DOM ready\n\treadyList,\n\n\t// A central reference to the root jQuery(document)\n\trootjQuery,\n\n\t// Support: IE<9\n\t// For `typeof node.method` instead of `node.method !== undefined`\n\tcore_strundefined = typeof undefined,\n\n\t// Use the correct document accordingly with window argument (sandbox)\n\tdocument = window.document,\n\tlocation = window.location,\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$,\n\n\t// [[Class]] -> type pairs\n\tclass2type = {},\n\n\t// List of deleted data cache ids, so we can reuse them\n\tcore_deletedIds = [],\n\n\tcore_version = \"1.9.1\",\n\n\t// Save a reference to some core methods\n\tcore_concat = core_deletedIds.concat,\n\tcore_push = core_deletedIds.push,\n\tcore_slice = core_deletedIds.slice,\n\tcore_indexOf = core_deletedIds.indexOf,\n\tcore_toString = class2type.toString,\n\tcore_hasOwn = class2type.hasOwnProperty,\n\tcore_trim = core_version.trim,\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\treturn new jQuery.fn.init( selector, context, rootjQuery );\n\t},\n\n\t// Used for matching numbers\n\tcore_pnum = /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source,\n\n\t// Used for splitting on whitespace\n\tcore_rnotwhite = /\\S+/g,\n\n\t// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)\n\trtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\trquickExpr = /^(?:(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/,\n\n\t// Match a standalone tag\n\trsingleTag = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,\n\n\t// JSON RegExp\n\trvalidchars = /^[\\],:{}\\s]*$/,\n\trvalidbraces = /(?:^|:|,)(?:\\s*\\[)+/g,\n\trvalidescape = /\\\\(?:[\"\\\\\\/bfnrt]|u[\\da-fA-F]{4})/g,\n\trvalidtokens = /\"[^\"\\\\\\r\\n]*\"|true|false|null|-?(?:\\d+\\.|)\\d+(?:[eE][+-]?\\d+|)/g,\n\n\t// Matches dashed string for camelizing\n\trmsPrefix = /^-ms-/,\n\trdashAlpha = /-([\\da-z])/gi,\n\n\t// Used by jQuery.camelCase as callback to replace()\n\tfcamelCase = function( all, letter ) {\n\t\treturn letter.toUpperCase();\n\t},\n\n\t// The ready event handler\n\tcompleted = function( event ) {\n\n\t\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\t\tif ( document.addEventListener || event.type === \"load\" || document.readyState === \"complete\" ) {\n\t\t\tdetach();\n\t\t\tjQuery.ready();\n\t\t}\n\t},\n\t// Clean-up method for dom ready events\n\tdetach = function() {\n\t\tif ( document.addEventListener ) {\n\t\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed, false );\n\t\t\twindow.removeEventListener( \"load\", completed, false );\n\n\t\t} else {\n\t\t\tdocument.detachEvent( \"onreadystatechange\", completed );\n\t\t\twindow.detachEvent( \"onload\", completed );\n\t\t}\n\t};\n\njQuery.fn = jQuery.prototype = {\n\t// The current version of jQuery being used\n\tjquery: core_version,\n\n\tconstructor: jQuery,\n\tinit: function( selector, context, rootjQuery ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector.charAt(0) === \"<\" && selector.charAt( selector.length - 1 ) === \">\" && selector.length >= 3 ) {\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && (match[1] || !context) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[1] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[0] : context;\n\n\t\t\t\t\t// scripts is true for back-compat\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[1],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( jQuery.isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[2] );\n\n\t\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\t\tif ( elem && elem.parentNode ) {\n\t\t\t\t\t\t// Handle the case where IE and Opera return items\n\t\t\t\t\t\t// by name instead of ID\n\t\t\t\t\t\tif ( elem.id !== match[2] ) {\n\t\t\t\t\t\t\treturn rootjQuery.find( selector );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Otherwise, we inject the element directly into the jQuery object\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t\tthis[0] = elem;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.context = document;\n\t\t\t\t\tthis.selector = selector;\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || rootjQuery ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis.context = this[0] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( jQuery.isFunction( selector ) ) {\n\t\t\treturn rootjQuery.ready( selector );\n\t\t}\n\n\t\tif ( selector.selector !== undefined ) {\n\t\t\tthis.selector = selector.selector;\n\t\t\tthis.context = selector.context;\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t},\n\n\t// Start with an empty selector\n\tselector: \"\",\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\t// The number of elements contained in the matched element set\n\tsize: function() {\n\t\treturn this.length;\n\t},\n\n\ttoArray: function() {\n\t\treturn core_slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\t\treturn num == null ?\n\n\t\t\t// Return a 'clean' array\n\t\t\tthis.toArray() :\n\n\t\t\t// Return just the object\n\t\t\t( num < 0 ? this[ this.length + num ] : this[ num ] );\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\t\tret.context = this.context;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\t// (You can seed the arguments with an array of args, but this is\n\t// only used internally.)\n\teach: function( callback, args ) {\n\t\treturn jQuery.each( this, callback, args );\n\t},\n\n\tready: function( fn ) {\n\t\t// Add the callback\n\t\tjQuery.ready.promise().done( fn );\n\n\t\treturn this;\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( core_slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map(this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t}));\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor(null);\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: core_push,\n\tsort: [].sort,\n\tsplice: [].splice\n};\n\n// Give the init function the jQuery prototype for later instantiation\njQuery.fn.init.prototype = jQuery.fn;\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar src, copyIsArray, copy, name, options, clone,\n\t\ttarget = arguments[0] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !jQuery.isFunction(target) ) {\n\t\ttarget = {};\n\t}\n\n\t// extend jQuery itself if only one argument is passed\n\tif ( length === i ) {\n\t\ttarget = this;\n\t\t--i;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\t\t// Only deal with non-null/undefined values\n\t\tif ( (options = arguments[ i ]) != null ) {\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend({\n\tnoConflict: function( deep ) {\n\t\tif ( window.$ === jQuery ) {\n\t\t\twindow.$ = _$;\n\t\t}\n\n\t\tif ( deep && window.jQuery === jQuery ) {\n\t\t\twindow.jQuery = _jQuery;\n\t\t}\n\n\t\treturn jQuery;\n\t},\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See #6781\n\treadyWait: 1,\n\n\t// Hold (or release) the ready event\n\tholdReady: function( hold ) {\n\t\tif ( hold ) {\n\t\t\tjQuery.readyWait++;\n\t\t} else {\n\t\t\tjQuery.ready( true );\n\t\t}\n\t},\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n\t\tif ( !document.body ) {\n\t\t\treturn setTimeout( jQuery.ready );\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\n\t\t// Trigger any bound ready events\n\t\tif ( jQuery.fn.trigger ) {\n\t\t\tjQuery( document ).trigger(\"ready\").off(\"ready\");\n\t\t}\n\t},\n\n\t// See test/unit/core.js for details concerning isFunction.\n\t// Since version 1.3, DOM methods and functions like alert\n\t// aren't supported. They return false on IE (#2968).\n\tisFunction: function( obj ) {\n\t\treturn jQuery.type(obj) === \"function\";\n\t},\n\n\tisArray: Array.isArray || function( obj ) {\n\t\treturn jQuery.type(obj) === \"array\";\n\t},\n\n\tisWindow: function( obj ) {\n\t\treturn obj != null && obj == obj.window;\n\t},\n\n\tisNumeric: function( obj ) {\n\t\treturn !isNaN( parseFloat(obj) ) && isFinite( obj );\n\t},\n\n\ttype: function( obj ) {\n\t\tif ( obj == null ) {\n\t\t\treturn String( obj );\n\t\t}\n\t\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\t\tclass2type[ core_toString.call(obj) ] || \"object\" :\n\t\t\ttypeof obj;\n\t},\n\n\tisPlainObject: function( obj ) {\n\t\t// Must be an Object.\n\t\t// Because of IE, we also have to check the presence of the constructor property.\n\t\t// Make sure that DOM nodes and window objects don't pass through, as well\n\t\tif ( !obj || jQuery.type(obj) !== \"object\" || obj.nodeType || jQuery.isWindow( obj ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t// Not own constructor property must be Object\n\t\t\tif ( obj.constructor &&\n\t\t\t\t!core_hasOwn.call(obj, \"constructor\") &&\n\t\t\t\t!core_hasOwn.call(obj.constructor.prototype, \"isPrototypeOf\") ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\t// IE8,9 Will throw exceptions on certain host objects #9897\n\t\t\treturn false;\n\t\t}\n\n\t\t// Own properties are enumerated firstly, so to speed up,\n\t\t// if last one is own, then all properties are own.\n\n\t\tvar key;\n\t\tfor ( key in obj ) {}\n\n\t\treturn key === undefined || core_hasOwn.call( obj, key );\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\t// data: string of html\n\t// context (optional): If specified, the fragment will be created in this context, defaults to document\n\t// keepScripts (optional): If true, will include scripts passed in the html string\n\tparseHTML: function( data, context, keepScripts ) {\n\t\tif ( !data || typeof data !== \"string\" ) {\n\t\t\treturn null;\n\t\t}\n\t\tif ( typeof context === \"boolean\" ) {\n\t\t\tkeepScripts = context;\n\t\t\tcontext = false;\n\t\t}\n\t\tcontext = context || document;\n\n\t\tvar parsed = rsingleTag.exec( data ),\n\t\t\tscripts = !keepScripts && [];\n\n\t\t// Single tag\n\t\tif ( parsed ) {\n\t\t\treturn [ context.createElement( parsed[1] ) ];\n\t\t}\n\n\t\tparsed = jQuery.buildFragment( [ data ], context, scripts );\n\t\tif ( scripts ) {\n\t\t\tjQuery( scripts ).remove();\n\t\t}\n\t\treturn jQuery.merge( [], parsed.childNodes );\n\t},\n\n\tparseJSON: function( data ) {\n\t\t// Attempt to parse using the native JSON parser first\n\t\tif ( window.JSON && window.JSON.parse ) {\n\t\t\treturn window.JSON.parse( data );\n\t\t}\n\n\t\tif ( data === null ) {\n\t\t\treturn data;\n\t\t}\n\n\t\tif ( typeof data === \"string\" ) {\n\n\t\t\t// Make sure leading/trailing whitespace is removed (IE can't handle it)\n\t\t\tdata = jQuery.trim( data );\n\n\t\t\tif ( data ) {\n\t\t\t\t// Make sure the incoming data is actual JSON\n\t\t\t\t// Logic borrowed from http://json.org/json2.js\n\t\t\t\tif ( rvalidchars.test( data.replace( rvalidescape, \"@\" )\n\t\t\t\t\t.replace( rvalidtokens, \"]\" )\n\t\t\t\t\t.replace( rvalidbraces, \"\")) ) {\n\n\t\t\t\t\treturn ( new Function( \"return \" + data ) )();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tjQuery.error( \"Invalid JSON: \" + data );\n\t},\n\n\t// Cross-browser xml parsing\n\tparseXML: function( data ) {\n\t\tvar xml, tmp;\n\t\tif ( !data || typeof data !== \"string\" ) {\n\t\t\treturn null;\n\t\t}\n\t\ttry {\n\t\t\tif ( window.DOMParser ) { // Standard\n\t\t\t\ttmp = new DOMParser();\n\t\t\t\txml = tmp.parseFromString( data , \"text/xml\" );\n\t\t\t} else { // IE\n\t\t\t\txml = new ActiveXObject( \"Microsoft.XMLDOM\" );\n\t\t\t\txml.async = \"false\";\n\t\t\t\txml.loadXML( data );\n\t\t\t}\n\t\t} catch( e ) {\n\t\t\txml = undefined;\n\t\t}\n\t\tif ( !xml || !xml.documentElement || xml.getElementsByTagName( \"parsererror\" ).length ) {\n\t\t\tjQuery.error( \"Invalid XML: \" + data );\n\t\t}\n\t\treturn xml;\n\t},\n\n\tnoop: function() {},\n\n\t// Evaluates a script in a global context\n\t// Workarounds based on findings by Jim Driscoll\n\t// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context\n\tglobalEval: function( data ) {\n\t\tif ( data && jQuery.trim( data ) ) {\n\t\t\t// We use execScript on Internet Explorer\n\t\t\t// We use an anonymous function so that context is window\n\t\t\t// rather than jQuery in Firefox\n\t\t\t( window.execScript || function( data ) {\n\t\t\t\twindow[ \"eval\" ].call( window, data );\n\t\t\t} )( data );\n\t\t}\n\t},\n\n\t// Convert dashed to camelCase; used by the css and data modules\n\t// Microsoft forgot to hump their vendor prefix (#9572)\n\tcamelCase: function( string ) {\n\t\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n\t},\n\n\tnodeName: function( elem, name ) {\n\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\t},\n\n\t// args is for internal usage only\n\teach: function( obj, callback, args ) {\n\t\tvar value,\n\t\t\ti = 0,\n\t\t\tlength = obj.length,\n\t\t\tisArray = isArraylike( obj );\n\n\t\tif ( args ) {\n\t\t\tif ( isArray ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tvalue = callback.apply( obj[ i ], args );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( i in obj ) {\n\t\t\t\t\tvalue = callback.apply( obj[ i ], args );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// A special, fast, case for the most common use of each\n\t\t} else {\n\t\t\tif ( isArray ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tvalue = callback.call( obj[ i ], i, obj[ i ] );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( i in obj ) {\n\t\t\t\t\tvalue = callback.call( obj[ i ], i, obj[ i ] );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\t// Use native String.trim function wherever possible\n\ttrim: core_trim && !core_trim.call(\"\\uFEFF\\xA0\") ?\n\t\tfunction( text ) {\n\t\t\treturn text == null ?\n\t\t\t\t\"\" :\n\t\t\t\tcore_trim.call( text );\n\t\t} :\n\n\t\t// Otherwise use our own trimming functionality\n\t\tfunction( text ) {\n\t\t\treturn text == null ?\n\t\t\t\t\"\" :\n\t\t\t\t( text + \"\" ).replace( rtrim, \"\" );\n\t\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArraylike( Object(arr) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcore_push.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\tvar len;\n\n\t\tif ( arr ) {\n\t\t\tif ( core_indexOf ) {\n\t\t\t\treturn core_indexOf.call( arr, elem, i );\n\t\t\t}\n\n\t\t\tlen = arr.length;\n\t\t\ti = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;\n\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t// Skip accessing in sparse arrays\n\t\t\t\tif ( i in arr && arr[ i ] === elem ) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t},\n\n\tmerge: function( first, second ) {\n\t\tvar l = second.length,\n\t\t\ti = first.length,\n\t\t\tj = 0;\n\n\t\tif ( typeof l === \"number\" ) {\n\t\t\tfor ( ; j < l; j++ ) {\n\t\t\t\tfirst[ i++ ] = second[ j ];\n\t\t\t}\n\t\t} else {\n\t\t\twhile ( second[j] !== undefined ) {\n\t\t\t\tfirst[ i++ ] = second[ j++ ];\n\t\t\t}\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, inv ) {\n\t\tvar retVal,\n\t\t\tret = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length;\n\t\tinv = !!inv;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tretVal = !!callback( elems[ i ], i );\n\t\t\tif ( inv !== retVal ) {\n\t\t\t\tret.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar value,\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tisArray = isArraylike( elems ),\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their\n\t\tif ( isArray ) {\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret[ ret.length ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret[ ret.length ] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn core_concat.apply( [], ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// Bind a function to a context, optionally partially applying any\n\t// arguments.\n\tproxy: function( fn, context ) {\n\t\tvar args, proxy, tmp;\n\n\t\tif ( typeof context === \"string\" ) {\n\t\t\ttmp = fn[ context ];\n\t\t\tcontext = fn;\n\t\t\tfn = tmp;\n\t\t}\n\n\t\t// Quick check to determine if target is callable, in the spec\n\t\t// this throws a TypeError, but we will just return undefined.\n\t\tif ( !jQuery.isFunction( fn ) ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Simulated bind\n\t\targs = core_slice.call( arguments, 2 );\n\t\tproxy = function() {\n\t\t\treturn fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );\n\t\t};\n\n\t\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\t\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\t\treturn proxy;\n\t},\n\n\t// Multifunctional method to get and set values of a collection\n\t// The value/s can optionally be executed if it's a function\n\taccess: function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\t\tvar i = 0,\n\t\t\tlength = elems.length,\n\t\t\tbulk = key == null;\n\n\t\t// Sets many values\n\t\tif ( jQuery.type( key ) === \"object\" ) {\n\t\t\tchainable = true;\n\t\t\tfor ( i in key ) {\n\t\t\t\tjQuery.access( elems, fn, i, key[i], true, emptyGet, raw );\n\t\t\t}\n\n\t\t// Sets one value\n\t\t} else if ( value !== undefined ) {\n\t\t\tchainable = true;\n\n\t\t\tif ( !jQuery.isFunction( value ) ) {\n\t\t\t\traw = true;\n\t\t\t}\n\n\t\t\tif ( bulk ) {\n\t\t\t\t// Bulk operations run against the entire set\n\t\t\t\tif ( raw ) {\n\t\t\t\t\tfn.call( elems, value );\n\t\t\t\t\tfn = null;\n\n\t\t\t\t// ...except when executing function values\n\t\t\t\t} else {\n\t\t\t\t\tbulk = fn;\n\t\t\t\t\tfn = function( elem, key, value ) {\n\t\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( fn ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tfn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn chainable ?\n\t\t\telems :\n\n\t\t\t// Gets\n\t\t\tbulk ?\n\t\t\t\tfn.call( elems ) :\n\t\t\t\tlength ? fn( elems[0], key ) : emptyGet;\n\t},\n\n\tnow: function() {\n\t\treturn ( new Date() ).getTime();\n\t}\n});\n\njQuery.ready.promise = function( obj ) {\n\tif ( !readyList ) {\n\n\t\treadyList = jQuery.Deferred();\n\n\t\t// Catch cases where $(document).ready() is called after the browser event has already occurred.\n\t\t// we once tried to use readyState \"interactive\" here, but it caused issues like the one\n\t\t// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15\n\t\tif ( document.readyState === \"complete\" ) {\n\t\t\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\t\t\tsetTimeout( jQuery.ready );\n\n\t\t// Standards-based browsers support DOMContentLoaded\n\t\t} else if ( document.addEventListener ) {\n\t\t\t// Use the handy event callback\n\t\t\tdocument.addEventListener( \"DOMContentLoaded\", completed, false );\n\n\t\t\t// A fallback to window.onload, that will always work\n\t\t\twindow.addEventListener( \"load\", completed, false );\n\n\t\t// If IE event model is used\n\t\t} else {\n\t\t\t// Ensure firing before onload, maybe late but safe also for iframes\n\t\t\tdocument.attachEvent( \"onreadystatechange\", completed );\n\n\t\t\t// A fallback to window.onload, that will always work\n\t\t\twindow.attachEvent( \"onload\", completed );\n\n\t\t\t// If IE and not a frame\n\t\t\t// continually check to see if the document is ready\n\t\t\tvar top = false;\n\n\t\t\ttry {\n\t\t\t\ttop = window.frameElement == null && document.documentElement;\n\t\t\t} catch(e) {}\n\n\t\t\tif ( top && top.doScroll ) {\n\t\t\t\t(function doScrollCheck() {\n\t\t\t\t\tif ( !jQuery.isReady ) {\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Use the trick by Diego Perini\n\t\t\t\t\t\t\t// http://javascript.nwbox.com/IEContentLoaded/\n\t\t\t\t\t\t\ttop.doScroll(\"left\");\n\t\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\t\treturn setTimeout( doScrollCheck, 50 );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// detach all dom ready events\n\t\t\t\t\t\tdetach();\n\n\t\t\t\t\t\t// and execute any waiting functions\n\t\t\t\t\t\tjQuery.ready();\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t}\n\t\t}\n\t}\n\treturn readyList.promise( obj );\n};\n\n// Populate the class2type map\njQuery.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function(i, name) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\nfunction isArraylike( obj ) {\n\tvar length = obj.length,\n\t\ttype = jQuery.type( obj );\n\n\tif ( jQuery.isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\tif ( obj.nodeType === 1 && length ) {\n\t\treturn true;\n\t}\n\n\treturn type === \"array\" || type !== \"function\" &&\n\t\t( length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj );\n}\n\n// All jQuery objects should point back to these\nrootjQuery = jQuery(document);\n// String to Object options format cache\nvar optionsCache = {};\n\n// Convert String-formatted options into Object-formatted ones and store in cache\nfunction createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\t( optionsCache[ options ] || createOptions( options ) ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\t\t// Last fire value (for non-forgettable lists)\n\t\tmemory,\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\t\t// End of the loop when firing\n\t\tfiringLength,\n\t\t// Index of currently firing callback (modified by remove if needed)\n\t\tfiringIndex,\n\t\t// First callback to fire (used internally by add and fireWith)\n\t\tfiringStart,\n\t\t// Actual callback list\n\t\tlist = [],\n\t\t// Stack of fire calls for repeatable lists\n\t\tstack = !options.once && [],\n\t\t// Fire callbacks\n\t\tfire = function( data ) {\n\t\t\tmemory = options.memory && data;\n\t\t\tfired = true;\n\t\t\tfiringIndex = firingStart || 0;\n\t\t\tfiringStart = 0;\n\t\t\tfiringLength = list.length;\n\t\t\tfiring = true;\n\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {\n\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\n\t\t\t\t\tmemory = false; // To prevent further calls using add\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiring = false;\n\t\t\tif ( list ) {\n\t\t\t\tif ( stack ) {\n\t\t\t\t\tif ( stack.length ) {\n\t\t\t\t\t\tfire( stack.shift() );\n\t\t\t\t\t}\n\t\t\t\t} else if ( memory ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t} else {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Actual Callbacks object\n\t\tself = {\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\t// First, we save the current length\n\t\t\t\t\tvar start = list.length;\n\t\t\t\t\t(function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tvar type = jQuery.type( arg );\n\t\t\t\t\t\t\tif ( type === \"function\" ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== \"string\" ) {\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})( arguments );\n\t\t\t\t\t// Do we need to add the callbacks to the\n\t\t\t\t\t// current firing batch?\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tfiringLength = list.length;\n\t\t\t\t\t// With memory, if we're not firing then\n\t\t\t\t\t// we should call right away\n\t\t\t\t\t} else if ( memory ) {\n\t\t\t\t\t\tfiringStart = start;\n\t\t\t\t\t\tfire( memory );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\t\tvar index;\n\t\t\t\t\t\twhile( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\t\tlist.splice( index, 1 );\n\t\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\t\t\tif ( index <= firingLength ) {\n\t\t\t\t\t\t\t\t\tfiringLength--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );\n\t\t\t},\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tlist = [];\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Have the list do nothing anymore\n\t\t\tdisable: function() {\n\t\t\t\tlist = stack = memory = undefined;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it disabled?\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\t\t\t// Lock the list in its current state\n\t\t\tlock: function() {\n\t\t\t\tstack = undefined;\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it locked?\n\t\t\tlocked: function() {\n\t\t\t\treturn !stack;\n\t\t\t},\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\targs = args || [];\n\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\tif ( list && ( !fired || stack ) ) {\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tstack.push( args );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfire( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar action = tuple[ 0 ],\n\t\t\t\t\t\t\t\tfn = jQuery.isFunction( fns[ i ] ) && fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ](function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ action + \"With\" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ]\n\t\t\tdeferred[ tuple[0] ] = function() {\n\t\t\t\tdeferred[ tuple[0] + \"With\" ]( this === deferred ? promise : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = core_slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;\n\t\t\t\t\tif( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\njQuery.support = (function() {\n\n\tvar support, all, a,\n\t\tinput, select, fragment,\n\t\topt, eventName, isSupported, i,\n\t\tdiv = document.createElement(\"div\");\n\n\t// Setup\n\tdiv.setAttribute( \"className\", \"t\" );\n\tdiv.innerHTML = \"  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>\";\n\n\t// Support tests won't run in some limited or non-browser environments\n\tall = div.getElementsByTagName(\"*\");\n\ta = div.getElementsByTagName(\"a\")[ 0 ];\n\tif ( !all || !a || !all.length ) {\n\t\treturn {};\n\t}\n\n\t// First batch of tests\n\tselect = document.createElement(\"select\");\n\topt = select.appendChild( document.createElement(\"option\") );\n\tinput = div.getElementsByTagName(\"input\")[ 0 ];\n\n\ta.style.cssText = \"top:1px;float:left;opacity:.5\";\n\tsupport = {\n\t\t// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)\n\t\tgetSetAttribute: div.className !== \"t\",\n\n\t\t// IE strips leading whitespace when .innerHTML is used\n\t\tleadingWhitespace: div.firstChild.nodeType === 3,\n\n\t\t// Make sure that tbody elements aren't automatically inserted\n\t\t// IE will insert them into empty tables\n\t\ttbody: !div.getElementsByTagName(\"tbody\").length,\n\n\t\t// Make sure that link elements get serialized correctly by innerHTML\n\t\t// This requires a wrapper element in IE\n\t\thtmlSerialize: !!div.getElementsByTagName(\"link\").length,\n\n\t\t// Get the style information from getAttribute\n\t\t// (IE uses .cssText instead)\n\t\tstyle: /top/.test( a.getAttribute(\"style\") ),\n\n\t\t// Make sure that URLs aren't manipulated\n\t\t// (IE normalizes it by default)\n\t\threfNormalized: a.getAttribute(\"href\") === \"/a\",\n\n\t\t// Make sure that element opacity exists\n\t\t// (IE uses filter instead)\n\t\t// Use a regex to work around a WebKit issue. See #5145\n\t\topacity: /^0.5/.test( a.style.opacity ),\n\n\t\t// Verify style float existence\n\t\t// (IE uses styleFloat instead of cssFloat)\n\t\tcssFloat: !!a.style.cssFloat,\n\n\t\t// Check the default checkbox/radio value (\"\" on WebKit; \"on\" elsewhere)\n\t\tcheckOn: !!input.value,\n\n\t\t// Make sure that a selected-by-default option has a working selected property.\n\t\t// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)\n\t\toptSelected: opt.selected,\n\n\t\t// Tests for enctype support on a form (#6743)\n\t\tenctype: !!document.createElement(\"form\").enctype,\n\n\t\t// Makes sure cloning an html5 element does not cause problems\n\t\t// Where outerHTML is undefined, this still works\n\t\thtml5Clone: document.createElement(\"nav\").cloneNode( true ).outerHTML !== \"<:nav></:nav>\",\n\n\t\t// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode\n\t\tboxModel: document.compatMode === \"CSS1Compat\",\n\n\t\t// Will be defined later\n\t\tdeleteExpando: true,\n\t\tnoCloneEvent: true,\n\t\tinlineBlockNeedsLayout: false,\n\t\tshrinkWrapBlocks: false,\n\t\treliableMarginRight: true,\n\t\tboxSizingReliable: true,\n\t\tpixelPosition: false\n\t};\n\n\t// Make sure checked status is properly cloned\n\tinput.checked = true;\n\tsupport.noCloneChecked = input.cloneNode( true ).checked;\n\n\t// Make sure that the options inside disabled selects aren't marked as disabled\n\t// (WebKit marks them as disabled)\n\tselect.disabled = true;\n\tsupport.optDisabled = !opt.disabled;\n\n\t// Support: IE<9\n\ttry {\n\t\tdelete div.test;\n\t} catch( e ) {\n\t\tsupport.deleteExpando = false;\n\t}\n\n\t// Check if we can trust getAttribute(\"value\")\n\tinput = document.createElement(\"input\");\n\tinput.setAttribute( \"value\", \"\" );\n\tsupport.input = input.getAttribute( \"value\" ) === \"\";\n\n\t// Check if an input maintains its value after becoming a radio\n\tinput.value = \"t\";\n\tinput.setAttribute( \"type\", \"radio\" );\n\tsupport.radioValue = input.value === \"t\";\n\n\t// #11217 - WebKit loses check when the name is after the checked attribute\n\tinput.setAttribute( \"checked\", \"t\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tfragment = document.createDocumentFragment();\n\tfragment.appendChild( input );\n\n\t// Check if a disconnected checkbox will retain its checked\n\t// value of true after appended to the DOM (IE6/7)\n\tsupport.appendChecked = input.checked;\n\n\t// WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE<9\n\t// Opera does not clone events (and typeof div.attachEvent === undefined).\n\t// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()\n\tif ( div.attachEvent ) {\n\t\tdiv.attachEvent( \"onclick\", function() {\n\t\t\tsupport.noCloneEvent = false;\n\t\t});\n\n\t\tdiv.cloneNode( true ).click();\n\t}\n\n\t// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)\n\t// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php\n\tfor ( i in { submit: true, change: true, focusin: true }) {\n\t\tdiv.setAttribute( eventName = \"on\" + i, \"t\" );\n\n\t\tsupport[ i + \"Bubbles\" ] = eventName in window || div.attributes[ eventName ].expando === false;\n\t}\n\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\t// Run tests that need a body at doc ready\n\tjQuery(function() {\n\t\tvar container, marginDiv, tds,\n\t\t\tdivReset = \"padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;\",\n\t\t\tbody = document.getElementsByTagName(\"body\")[0];\n\n\t\tif ( !body ) {\n\t\t\t// Return for frameset docs that don't have a body\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer = document.createElement(\"div\");\n\t\tcontainer.style.cssText = \"border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px\";\n\n\t\tbody.appendChild( container ).appendChild( div );\n\n\t\t// Support: IE8\n\t\t// Check if table cells still have offsetWidth/Height when they are set\n\t\t// to display:none and there are still other visible table cells in a\n\t\t// table row; if so, offsetWidth/Height are not reliable for use when\n\t\t// determining if an element has been hidden directly using\n\t\t// display:none (it is still safe to use offsets if a parent element is\n\t\t// hidden; don safety goggles and see bug #4512 for more information).\n\t\tdiv.innerHTML = \"<table><tr><td></td><td>t</td></tr></table>\";\n\t\ttds = div.getElementsByTagName(\"td\");\n\t\ttds[ 0 ].style.cssText = \"padding:0;margin:0;border:0;display:none\";\n\t\tisSupported = ( tds[ 0 ].offsetHeight === 0 );\n\n\t\ttds[ 0 ].style.display = \"\";\n\t\ttds[ 1 ].style.display = \"none\";\n\n\t\t// Support: IE8\n\t\t// Check if empty table cells still have offsetWidth/Height\n\t\tsupport.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );\n\n\t\t// Check box-sizing and margin behavior\n\t\tdiv.innerHTML = \"\";\n\t\tdiv.style.cssText = \"box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;\";\n\t\tsupport.boxSizing = ( div.offsetWidth === 4 );\n\t\tsupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );\n\n\t\t// Use window.getComputedStyle because jsdom on node.js will break without it.\n\t\tif ( window.getComputedStyle ) {\n\t\t\tsupport.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== \"1%\";\n\t\t\tsupport.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: \"4px\" } ).width === \"4px\";\n\n\t\t\t// Check if div with explicit width and no margin-right incorrectly\n\t\t\t// gets computed margin-right based on width of container. (#3333)\n\t\t\t// Fails in WebKit before Feb 2011 nightlies\n\t\t\t// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right\n\t\t\tmarginDiv = div.appendChild( document.createElement(\"div\") );\n\t\t\tmarginDiv.style.cssText = div.style.cssText = divReset;\n\t\t\tmarginDiv.style.marginRight = marginDiv.style.width = \"0\";\n\t\t\tdiv.style.width = \"1px\";\n\n\t\t\tsupport.reliableMarginRight =\n\t\t\t\t!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );\n\t\t}\n\n\t\tif ( typeof div.style.zoom !== core_strundefined ) {\n\t\t\t// Support: IE<8\n\t\t\t// Check if natively block-level elements act like inline-block\n\t\t\t// elements when setting their display to 'inline' and giving\n\t\t\t// them layout\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdiv.style.cssText = divReset + \"width:1px;padding:1px;display:inline;zoom:1\";\n\t\t\tsupport.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );\n\n\t\t\t// Support: IE6\n\t\t\t// Check if elements with layout shrink-wrap their children\n\t\t\tdiv.style.display = \"block\";\n\t\t\tdiv.innerHTML = \"<div></div>\";\n\t\t\tdiv.firstChild.style.width = \"5px\";\n\t\t\tsupport.shrinkWrapBlocks = ( div.offsetWidth !== 3 );\n\n\t\t\tif ( support.inlineBlockNeedsLayout ) {\n\t\t\t\t// Prevent IE 6 from affecting layout for positioned elements #11048\n\t\t\t\t// Prevent IE from shrinking the body in IE 7 mode #12869\n\t\t\t\t// Support: IE<8\n\t\t\t\tbody.style.zoom = 1;\n\t\t\t}\n\t\t}\n\n\t\tbody.removeChild( container );\n\n\t\t// Null elements to avoid leaks in IE\n\t\tcontainer = div = tds = marginDiv = null;\n\t});\n\n\t// Null elements to avoid leaks in IE\n\tall = select = fragment = opt = a = input = null;\n\n\treturn support;\n})();\n\nvar rbrace = /(?:\\{[\\s\\S]*\\}|\\[[\\s\\S]*\\])$/,\n\trmultiDash = /([A-Z])/g;\n\nfunction internalData( elem, name, data, pvt /* Internal Use Only */ ){\n\tif ( !jQuery.acceptData( elem ) ) {\n\t\treturn;\n\t}\n\n\tvar thisCache, ret,\n\t\tinternalKey = jQuery.expando,\n\t\tgetByName = typeof name === \"string\",\n\n\t\t// We have to handle DOM nodes and JS objects differently because IE6-7\n\t\t// can't GC object references properly across the DOM-JS boundary\n\t\tisNode = elem.nodeType,\n\n\t\t// Only DOM nodes need the global jQuery cache; JS object data is\n\t\t// attached directly to the object so GC can occur automatically\n\t\tcache = isNode ? jQuery.cache : elem,\n\n\t\t// Only defining an ID for JS objects if its cache already exists allows\n\t\t// the code to shortcut on the same path as a DOM node with no cache\n\t\tid = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;\n\n\t// Avoid doing any more work than we need to when trying to get data on an\n\t// object that has no data at all\n\tif ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {\n\t\treturn;\n\t}\n\n\tif ( !id ) {\n\t\t// Only DOM nodes need a new unique ID for each element since their data\n\t\t// ends up in the global cache\n\t\tif ( isNode ) {\n\t\t\telem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;\n\t\t} else {\n\t\t\tid = internalKey;\n\t\t}\n\t}\n\n\tif ( !cache[ id ] ) {\n\t\tcache[ id ] = {};\n\n\t\t// Avoids exposing jQuery metadata on plain JS objects when the object\n\t\t// is serialized using JSON.stringify\n\t\tif ( !isNode ) {\n\t\t\tcache[ id ].toJSON = jQuery.noop;\n\t\t}\n\t}\n\n\t// An object can be passed to jQuery.data instead of a key/value pair; this gets\n\t// shallow copied over onto the existing cache\n\tif ( typeof name === \"object\" || typeof name === \"function\" ) {\n\t\tif ( pvt ) {\n\t\t\tcache[ id ] = jQuery.extend( cache[ id ], name );\n\t\t} else {\n\t\t\tcache[ id ].data = jQuery.extend( cache[ id ].data, name );\n\t\t}\n\t}\n\n\tthisCache = cache[ id ];\n\n\t// jQuery data() is stored in a separate object inside the object's internal data\n\t// cache in order to avoid key collisions between internal data and user-defined\n\t// data.\n\tif ( !pvt ) {\n\t\tif ( !thisCache.data ) {\n\t\t\tthisCache.data = {};\n\t\t}\n\n\t\tthisCache = thisCache.data;\n\t}\n\n\tif ( data !== undefined ) {\n\t\tthisCache[ jQuery.camelCase( name ) ] = data;\n\t}\n\n\t// Check for both converted-to-camel and non-converted data property names\n\t// If a data property was specified\n\tif ( getByName ) {\n\n\t\t// First Try to find as-is property data\n\t\tret = thisCache[ name ];\n\n\t\t// Test for null|undefined property data\n\t\tif ( ret == null ) {\n\n\t\t\t// Try to find the camelCased property\n\t\t\tret = thisCache[ jQuery.camelCase( name ) ];\n\t\t}\n\t} else {\n\t\tret = thisCache;\n\t}\n\n\treturn ret;\n}\n\nfunction internalRemoveData( elem, name, pvt ) {\n\tif ( !jQuery.acceptData( elem ) ) {\n\t\treturn;\n\t}\n\n\tvar i, l, thisCache,\n\t\tisNode = elem.nodeType,\n\n\t\t// See jQuery.data for more information\n\t\tcache = isNode ? jQuery.cache : elem,\n\t\tid = isNode ? elem[ jQuery.expando ] : jQuery.expando;\n\n\t// If there is already no cache entry for this object, there is no\n\t// purpose in continuing\n\tif ( !cache[ id ] ) {\n\t\treturn;\n\t}\n\n\tif ( name ) {\n\n\t\tthisCache = pvt ? cache[ id ] : cache[ id ].data;\n\n\t\tif ( thisCache ) {\n\n\t\t\t// Support array or space separated string names for data keys\n\t\t\tif ( !jQuery.isArray( name ) ) {\n\n\t\t\t\t// try the string as a key before any manipulation\n\t\t\t\tif ( name in thisCache ) {\n\t\t\t\t\tname = [ name ];\n\t\t\t\t} else {\n\n\t\t\t\t\t// split the camel cased version by spaces unless a key with the spaces exists\n\t\t\t\t\tname = jQuery.camelCase( name );\n\t\t\t\t\tif ( name in thisCache ) {\n\t\t\t\t\t\tname = [ name ];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tname = name.split(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// If \"name\" is an array of keys...\n\t\t\t\t// When data is initially created, via (\"key\", \"val\") signature,\n\t\t\t\t// keys will be converted to camelCase.\n\t\t\t\t// Since there is no way to tell _how_ a key was added, remove\n\t\t\t\t// both plain key and camelCase key. #12786\n\t\t\t\t// This will only penalize the array argument path.\n\t\t\t\tname = name.concat( jQuery.map( name, jQuery.camelCase ) );\n\t\t\t}\n\n\t\t\tfor ( i = 0, l = name.length; i < l; i++ ) {\n\t\t\t\tdelete thisCache[ name[i] ];\n\t\t\t}\n\n\t\t\t// If there is no data left in the cache, we want to continue\n\t\t\t// and let the cache object itself get destroyed\n\t\t\tif ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t// See jQuery.data for more information\n\tif ( !pvt ) {\n\t\tdelete cache[ id ].data;\n\n\t\t// Don't destroy the parent cache unless the internal data object\n\t\t// had been the only thing left in it\n\t\tif ( !isEmptyDataObject( cache[ id ] ) ) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Destroy the cache\n\tif ( isNode ) {\n\t\tjQuery.cleanData( [ elem ], true );\n\n\t// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)\n\t} else if ( jQuery.support.deleteExpando || cache != cache.window ) {\n\t\tdelete cache[ id ];\n\n\t// When all else fails, null\n\t} else {\n\t\tcache[ id ] = null;\n\t}\n}\n\njQuery.extend({\n\tcache: {},\n\n\t// Unique for each copy of jQuery on the page\n\t// Non-digits removed to match rinlinejQuery\n\texpando: \"jQuery\" + ( core_version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// The following elements throw uncatchable exceptions if you\n\t// attempt to add expando properties to them.\n\tnoData: {\n\t\t\"embed\": true,\n\t\t// Ban all objects except for Flash (which handle expandos)\n\t\t\"object\": \"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",\n\t\t\"applet\": true\n\t},\n\n\thasData: function( elem ) {\n\t\telem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];\n\t\treturn !!elem && !isEmptyDataObject( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn internalData( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\treturn internalRemoveData( elem, name );\n\t},\n\n\t// For internal use only.\n\t_data: function( elem, name, data ) {\n\t\treturn internalData( elem, name, data, true );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\treturn internalRemoveData( elem, name, true );\n\t},\n\n\t// A method for determining if a DOM node can handle the data expando\n\tacceptData: function( elem ) {\n\t\t// Do not set data on non-element because it will not be cleared (#8335).\n\t\tif ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];\n\n\t\t// nodes accept data unless otherwise specified; rejection can be conditional\n\t\treturn !noData || noData !== true && elem.getAttribute(\"classid\") === noData;\n\t}\n});\n\njQuery.fn.extend({\n\tdata: function( key, value ) {\n\t\tvar attrs, name,\n\t\t\telem = this[0],\n\t\t\ti = 0,\n\t\t\tdata = null;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = jQuery.data( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !jQuery._data( elem, \"parsedAttrs\" ) ) {\n\t\t\t\t\tattrs = elem.attributes;\n\t\t\t\t\tfor ( ; i < attrs.length; i++ ) {\n\t\t\t\t\t\tname = attrs[i].name;\n\n\t\t\t\t\t\tif ( !name.indexOf( \"data-\" ) ) {\n\t\t\t\t\t\t\tname = jQuery.camelCase( name.slice(5) );\n\n\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tjQuery._data( elem, \"parsedAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each(function() {\n\t\t\t\tjQuery.data( this, key );\n\t\t\t});\n\t\t}\n\n\t\treturn jQuery.access( this, function( value ) {\n\n\t\t\tif ( value === undefined ) {\n\t\t\t\t// Try to fetch any internally stored data first\n\t\t\t\treturn elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;\n\t\t\t}\n\n\t\t\tthis.each(function() {\n\t\t\t\tjQuery.data( this, key, value );\n\t\t\t});\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.removeData( this, key );\n\t\t});\n\t}\n});\n\nfunction dataAttr( elem, key, data ) {\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\n\t\tvar name = \"data-\" + key.replace( rmultiDash, \"-$1\" ).toLowerCase();\n\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = data === \"true\" ? true :\n\t\t\t\t\tdata === \"false\" ? false :\n\t\t\t\t\tdata === \"null\" ? null :\n\t\t\t\t\t// Only convert to a number if it doesn't change the string\n\t\t\t\t\t+data + \"\" === data ? +data :\n\t\t\t\t\trbrace.test( data ) ? jQuery.parseJSON( data ) :\n\t\t\t\t\t\tdata;\n\t\t\t} catch( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tjQuery.data( elem, key, data );\n\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\n\treturn data;\n}\n\n// checks a cache object for emptiness\nfunction isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\njQuery.extend({\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = jQuery._data( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || jQuery.isArray(data) ) {\n\t\t\t\t\tqueue = jQuery._data( elem, type, jQuery.makeArray(data) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\thooks.cur = fn;\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// not intended for public consumption - generates a queueHooks object, or returns the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn jQuery._data( elem, key ) || jQuery._data( elem, key, {\n\t\t\tempty: jQuery.Callbacks(\"once memory\").add(function() {\n\t\t\t\tjQuery._removeData( elem, type + \"queue\" );\n\t\t\t\tjQuery._removeData( elem, key );\n\t\t\t})\n\t\t});\n\t}\n});\n\njQuery.fn.extend({\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[0], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each(function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[0] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t});\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t});\n\t},\n\t// Based off of the plugin by Clint Helfers, with permission.\n\t// http://blindsignals.com/index.php/2009/07/jquery-delay/\n\tdelay: function( time, type ) {\n\t\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\t\ttype = type || \"fx\";\n\n\t\treturn this.queue( type, function( next, hooks ) {\n\t\t\tvar timeout = setTimeout( next, time );\n\t\t\thooks.stop = function() {\n\t\t\t\tclearTimeout( timeout );\n\t\t\t};\n\t\t});\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile( i-- ) {\n\t\t\ttmp = jQuery._data( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n});\nvar nodeHook, boolHook,\n\trclass = /[\\t\\r\\n]/g,\n\trreturn = /\\r/g,\n\trfocusable = /^(?:input|select|textarea|button|object)$/i,\n\trclickable = /^(?:a|area)$/i,\n\trboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,\n\truseDefault = /^(?:checked|selected)$/i,\n\tgetSetAttribute = jQuery.support.getSetAttribute,\n\tgetSetInput = jQuery.support.input;\n\njQuery.fn.extend({\n\tattr: function( name, value ) {\n\t\treturn jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t});\n\t},\n\n\tprop: function( name, value ) {\n\t\treturn jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\tname = jQuery.propFix[ name ] || name;\n\t\treturn this.each(function() {\n\t\t\t// try/catch handles cases where IE balks (such as removing a property on window)\n\t\t\ttry {\n\t\t\t\tthis[ name ] = undefined;\n\t\t\t\tdelete this[ name ];\n\t\t\t} catch( e ) {}\n\t\t});\n\t},\n\n\taddClass: function( value ) {\n\t\tvar classes, elem, cur, clazz, j,\n\t\t\ti = 0,\n\t\t\tlen = this.length,\n\t\t\tproceed = typeof value === \"string\" && value;\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, this.className ) );\n\t\t\t});\n\t\t}\n\n\t\tif ( proceed ) {\n\t\t\t// The disjunction here is for better compressibility (see removeClass)\n\t\t\tclasses = ( value || \"\" ).match( core_rnotwhite ) || [];\n\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\telem = this[ i ];\n\t\t\t\tcur = elem.nodeType === 1 && ( elem.className ?\n\t\t\t\t\t( \" \" + elem.className + \" \" ).replace( rclass, \" \" ) :\n\t\t\t\t\t\" \"\n\t\t\t\t);\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (clazz = classes[j++]) ) {\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += clazz + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telem.className = jQuery.trim( cur );\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classes, elem, cur, clazz, j,\n\t\t\ti = 0,\n\t\t\tlen = this.length,\n\t\t\tproceed = arguments.length === 0 || typeof value === \"string\" && value;\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, this.className ) );\n\t\t\t});\n\t\t}\n\t\tif ( proceed ) {\n\t\t\tclasses = ( value || \"\" ).match( core_rnotwhite ) || [];\n\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\telem = this[ i ];\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = elem.nodeType === 1 && ( elem.className ?\n\t\t\t\t\t( \" \" + elem.className + \" \" ).replace( rclass, \" \" ) :\n\t\t\t\t\t\"\"\n\t\t\t\t);\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (clazz = classes[j++]) ) {\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + clazz + \" \" ) >= 0 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + clazz + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telem.className = value ? jQuery.trim( cur ) : \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar type = typeof value,\n\t\t\tisBool = typeof stateVal === \"boolean\";\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( i ) {\n\t\t\t\tjQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );\n\t\t\t});\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tif ( type === \"string\" ) {\n\t\t\t\t// toggle individual class names\n\t\t\t\tvar className,\n\t\t\t\t\ti = 0,\n\t\t\t\t\tself = jQuery( this ),\n\t\t\t\t\tstate = stateVal,\n\t\t\t\t\tclassNames = value.match( core_rnotwhite ) || [];\n\n\t\t\t\twhile ( (className = classNames[ i++ ]) ) {\n\t\t\t\t\t// check each className given, space separated list\n\t\t\t\t\tstate = isBool ? state : !self.hasClass( className );\n\t\t\t\t\tself[ state ? \"addClass\" : \"removeClass\" ]( className );\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( type === core_strundefined || type === \"boolean\" ) {\n\t\t\t\tif ( this.className ) {\n\t\t\t\t\t// store className if set\n\t\t\t\t\tjQuery._data( this, \"__className__\", this.className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed \"false\",\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tthis.className = this.className || value === false ? \"\" : jQuery._data( this, \"__className__\" ) || \"\";\n\t\t\t}\n\t\t});\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className = \" \" + selector + \" \",\n\t\t\ti = 0,\n\t\t\tl = this.length;\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tif ( this[i].nodeType === 1 && (\" \" + this[i].className + \" \").replace(rclass, \" \").indexOf( className ) >= 0 ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t},\n\n\tval: function( value ) {\n\t\tvar ret, hooks, isFunction,\n\t\t\telem = this[0];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks && \"get\" in hooks && (ret = hooks.get( elem, \"value\" )) !== undefined ) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\treturn typeof ret === \"string\" ?\n\t\t\t\t\t// handle most common string cases\n\t\t\t\t\tret.replace(rreturn, \"\") :\n\t\t\t\t\t// handle cases where value is null/undef or number\n\t\t\t\t\tret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tisFunction = jQuery.isFunction( value );\n\n\t\treturn this.each(function( i ) {\n\t\t\tvar val,\n\t\t\t\tself = jQuery(this);\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isFunction ) {\n\t\t\t\tval = value.call( this, i, self.val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\t\t\t} else if ( jQuery.isArray( val ) ) {\n\t\t\t\tval = jQuery.map(val, function ( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t});\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !(\"set\" in hooks) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t});\n\t}\n});\n\njQuery.extend({\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\t\t\t\t// attributes.value is undefined in Blackberry 4.7 but\n\t\t\t\t// uses .value. See #6932\n\t\t\t\tvar val = elem.attributes.value;\n\t\t\t\treturn !val || val.specified ? elem.value : elem.text;\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\" || index < 0,\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length,\n\t\t\t\t\ti = index < 0 ?\n\t\t\t\t\t\tmax :\n\t\t\t\t\t\tone ? index : 0;\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// oldIE doesn't update selected after form reset (#2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t( jQuery.support.optDisabled ? !option.disabled : option.getAttribute(\"disabled\") === null ) &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar values = jQuery.makeArray( value );\n\n\t\t\t\tjQuery(elem).find(\"option\").each(function() {\n\t\t\t\t\tthis.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;\n\t\t\t\t});\n\n\t\t\t\tif ( !values.length ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t},\n\n\tattr: function( elem, name, value ) {\n\t\tvar hooks, notxml, ret,\n\t\t\tnType = elem.nodeType;\n\n\t\t// don't get/set attributes on text, comment and attribute nodes\n\t\tif ( !elem || nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === core_strundefined ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\tnotxml = nType !== 1 || !jQuery.isXMLDoc( elem );\n\n\t\t// All attributes are lowercase\n\t\t// Grab necessary hook if one is defined\n\t\tif ( notxml ) {\n\t\t\tname = name.toLowerCase();\n\t\t\thooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\n\t\t\t} else if ( hooks && notxml && \"set\" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {\n\t\t\t\treturn ret;\n\n\t\t\t} else {\n\t\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t} else if ( hooks && notxml && \"get\" in hooks && (ret = hooks.get( elem, name )) !== null ) {\n\t\t\treturn ret;\n\n\t\t} else {\n\n\t\t\t// In IE9+, Flash objects don't have .getAttribute (#12945)\n\t\t\t// Support: IE9+\n\t\t\tif ( typeof elem.getAttribute !== core_strundefined ) {\n\t\t\t\tret =  elem.getAttribute( name );\n\t\t\t}\n\n\t\t\t// Non-existent attributes return null, we normalize to undefined\n\t\t\treturn ret == null ?\n\t\t\t\tundefined :\n\t\t\t\tret;\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name, propName,\n\t\t\ti = 0,\n\t\t\tattrNames = value && value.match( core_rnotwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( (name = attrNames[i++]) ) {\n\t\t\t\tpropName = jQuery.propFix[ name ] || name;\n\n\t\t\t\t// Boolean attributes get special treatment (#10870)\n\t\t\t\tif ( rboolean.test( name ) ) {\n\t\t\t\t\t// Set corresponding property to false for boolean attributes\n\t\t\t\t\t// Also clear defaultChecked/defaultSelected (if appropriate) for IE<8\n\t\t\t\t\tif ( !getSetAttribute && ruseDefault.test( name ) ) {\n\t\t\t\t\t\telem[ jQuery.camelCase( \"default-\" + name ) ] =\n\t\t\t\t\t\t\telem[ propName ] = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\telem[ propName ] = false;\n\t\t\t\t\t}\n\n\t\t\t\t// See #9699 for explanation of this approach (setting first, then removal)\n\t\t\t\t} else {\n\t\t\t\t\tjQuery.attr( elem, name, \"\" );\n\t\t\t\t}\n\n\t\t\t\telem.removeAttribute( getSetAttribute ? name : propName );\n\t\t\t}\n\t\t}\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !jQuery.support.radioValue && value === \"radio\" && jQuery.nodeName(elem, \"input\") ) {\n\t\t\t\t\t// Setting the type on a radio button after the value resets the value in IE6-9\n\t\t\t\t\t// Reset value to default in case type is set after value during creation\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\ttabindex: \"tabIndex\",\n\t\treadonly: \"readOnly\",\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\",\n\t\tmaxlength: \"maxLength\",\n\t\tcellspacing: \"cellSpacing\",\n\t\tcellpadding: \"cellPadding\",\n\t\trowspan: \"rowSpan\",\n\t\tcolspan: \"colSpan\",\n\t\tusemap: \"useMap\",\n\t\tframeborder: \"frameBorder\",\n\t\tcontenteditable: \"contentEditable\"\n\t},\n\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks, notxml,\n\t\t\tnType = elem.nodeType;\n\n\t\t// don't get/set properties on text, comment and attribute nodes\n\t\tif ( !elem || nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tnotxml = nType !== 1 || !jQuery.isXMLDoc( elem );\n\n\t\tif ( notxml ) {\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( hooks && \"set\" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {\n\t\t\t\treturn ret;\n\n\t\t\t} else {\n\t\t\t\treturn ( elem[ name ] = value );\n\t\t\t}\n\n\t\t} else {\n\t\t\tif ( hooks && \"get\" in hooks && (ret = hooks.get( elem, name )) !== null ) {\n\t\t\t\treturn ret;\n\n\t\t\t} else {\n\t\t\t\treturn elem[ name ];\n\t\t\t}\n\t\t}\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\t\t\t\t// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set\n\t\t\t\t// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n\t\t\t\tvar attributeNode = elem.getAttributeNode(\"tabindex\");\n\n\t\t\t\treturn attributeNode && attributeNode.specified ?\n\t\t\t\t\tparseInt( attributeNode.value, 10 ) :\n\t\t\t\t\trfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?\n\t\t\t\t\t\t0 :\n\t\t\t\t\t\tundefined;\n\t\t\t}\n\t\t}\n\t}\n});\n\n// Hook for boolean attributes\nboolHook = {\n\tget: function( elem, name ) {\n\t\tvar\n\t\t\t// Use .prop to determine if this attribute is understood as boolean\n\t\t\tprop = jQuery.prop( elem, name ),\n\n\t\t\t// Fetch it accordingly\n\t\t\tattr = typeof prop === \"boolean\" && elem.getAttribute( name ),\n\t\t\tdetail = typeof prop === \"boolean\" ?\n\n\t\t\t\tgetSetInput && getSetAttribute ?\n\t\t\t\t\tattr != null :\n\t\t\t\t\t// oldIE fabricates an empty string for missing boolean attributes\n\t\t\t\t\t// and conflates checked/selected into attroperties\n\t\t\t\t\truseDefault.test( name ) ?\n\t\t\t\t\t\telem[ jQuery.camelCase( \"default-\" + name ) ] :\n\t\t\t\t\t\t!!attr :\n\n\t\t\t\t// fetch an attribute node for properties not recognized as boolean\n\t\t\t\telem.getAttributeNode( name );\n\n\t\treturn detail && detail.value !== false ?\n\t\t\tname.toLowerCase() :\n\t\t\tundefined;\n\t},\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {\n\t\t\t// IE<8 needs the *property* name\n\t\t\telem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );\n\n\t\t// Use defaultChecked and defaultSelected for oldIE\n\t\t} else {\n\t\t\telem[ jQuery.camelCase( \"default-\" + name ) ] = elem[ name ] = true;\n\t\t}\n\n\t\treturn name;\n\t}\n};\n\n// fix oldIE value attroperty\nif ( !getSetInput || !getSetAttribute ) {\n\tjQuery.attrHooks.value = {\n\t\tget: function( elem, name ) {\n\t\t\tvar ret = elem.getAttributeNode( name );\n\t\t\treturn jQuery.nodeName( elem, \"input\" ) ?\n\n\t\t\t\t// Ignore the value *property* by using defaultValue\n\t\t\t\telem.defaultValue :\n\n\t\t\t\tret && ret.specified ? ret.value : undefined;\n\t\t},\n\t\tset: function( elem, value, name ) {\n\t\t\tif ( jQuery.nodeName( elem, \"input\" ) ) {\n\t\t\t\t// Does not return so that setAttribute is also used\n\t\t\t\telem.defaultValue = value;\n\t\t\t} else {\n\t\t\t\t// Use nodeHook if defined (#1954); otherwise setAttribute is fine\n\t\t\t\treturn nodeHook && nodeHook.set( elem, value, name );\n\t\t\t}\n\t\t}\n\t};\n}\n\n// IE6/7 do not support getting/setting some attributes with get/setAttribute\nif ( !getSetAttribute ) {\n\n\t// Use this for any attribute in IE6/7\n\t// This fixes almost every IE6/7 issue\n\tnodeHook = jQuery.valHooks.button = {\n\t\tget: function( elem, name ) {\n\t\t\tvar ret = elem.getAttributeNode( name );\n\t\t\treturn ret && ( name === \"id\" || name === \"name\" || name === \"coords\" ? ret.value !== \"\" : ret.specified ) ?\n\t\t\t\tret.value :\n\t\t\t\tundefined;\n\t\t},\n\t\tset: function( elem, value, name ) {\n\t\t\t// Set the existing or create a new attribute node\n\t\t\tvar ret = elem.getAttributeNode( name );\n\t\t\tif ( !ret ) {\n\t\t\t\telem.setAttributeNode(\n\t\t\t\t\t(ret = elem.ownerDocument.createAttribute( name ))\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tret.value = value += \"\";\n\n\t\t\t// Break association with cloned elements by also using setAttribute (#9646)\n\t\t\treturn name === \"value\" || value === elem.getAttribute( name ) ?\n\t\t\t\tvalue :\n\t\t\t\tundefined;\n\t\t}\n\t};\n\n\t// Set contenteditable to false on removals(#10429)\n\t// Setting to empty string throws an error as an invalid value\n\tjQuery.attrHooks.contenteditable = {\n\t\tget: nodeHook.get,\n\t\tset: function( elem, value, name ) {\n\t\t\tnodeHook.set( elem, value === \"\" ? false : value, name );\n\t\t}\n\t};\n\n\t// Set width and height to auto instead of 0 on empty string( Bug #8150 )\n\t// This is for removals\n\tjQuery.each([ \"width\", \"height\" ], function( i, name ) {\n\t\tjQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( value === \"\" ) {\n\t\t\t\t\telem.setAttribute( name, \"auto\" );\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n\n\n// Some attributes require a special call on IE\n// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !jQuery.support.hrefNormalized ) {\n\tjQuery.each([ \"href\", \"src\", \"width\", \"height\" ], function( i, name ) {\n\t\tjQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar ret = elem.getAttribute( name, 2 );\n\t\t\t\treturn ret == null ? undefined : ret;\n\t\t\t}\n\t\t});\n\t});\n\n\t// href/src property should get the full normalized URL (#10299/#12915)\n\tjQuery.each([ \"href\", \"src\" ], function( i, name ) {\n\t\tjQuery.propHooks[ name ] = {\n\t\t\tget: function( elem ) {\n\t\t\t\treturn elem.getAttribute( name, 4 );\n\t\t\t}\n\t\t};\n\t});\n}\n\nif ( !jQuery.support.style ) {\n\tjQuery.attrHooks.style = {\n\t\tget: function( elem ) {\n\t\t\t// Return undefined in the case of empty string\n\t\t\t// Note: IE uppercases css property names, but if we were to .toLowerCase()\n\t\t\t// .cssText, that would destroy case senstitivity in URL's, like in \"background\"\n\t\t\treturn elem.style.cssText || undefined;\n\t\t},\n\t\tset: function( elem, value ) {\n\t\t\treturn ( elem.style.cssText = value + \"\" );\n\t\t}\n\t};\n}\n\n// Safari mis-reports the default selected property of an option\n// Accessing the parent's selectedIndex property fixes it\nif ( !jQuery.support.optSelected ) {\n\tjQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {\n\t\tget: function( elem ) {\n\t\t\tvar parent = elem.parentNode;\n\n\t\t\tif ( parent ) {\n\t\t\t\tparent.selectedIndex;\n\n\t\t\t\t// Make sure that it also works with optgroups, see #5701\n\t\t\t\tif ( parent.parentNode ) {\n\t\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t});\n}\n\n// IE6/7 call enctype encoding\nif ( !jQuery.support.enctype ) {\n\tjQuery.propFix.enctype = \"encoding\";\n}\n\n// Radios and checkboxes getter/setter\nif ( !jQuery.support.checkOn ) {\n\tjQuery.each([ \"radio\", \"checkbox\" ], function() {\n\t\tjQuery.valHooks[ this ] = {\n\t\t\tget: function( elem ) {\n\t\t\t\t// Handle the case where in Webkit \"\" is returned instead of \"on\" if a value isn't specified\n\t\t\t\treturn elem.getAttribute(\"value\") === null ? \"on\" : elem.value;\n\t\t\t}\n\t\t};\n\t});\n}\njQuery.each([ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {\n\t\tset: function( elem, value ) {\n\t\t\tif ( jQuery.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );\n\t\t\t}\n\t\t}\n\t});\n});\nvar rformElems = /^(?:input|select|textarea)$/i,\n\trkeyEvent = /^key/,\n\trmouseEvent = /^(?:mouse|contextmenu)|click/,\n\trfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\trtypenamespace = /^([^.]*)(?:\\.(.+)|)$/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\t\tvar tmp, events, t, handleObjIn,\n\t\t\tspecial, eventHandle, handleObj,\n\t\t\thandlers, type, namespaces, origType,\n\t\t\telemData = jQuery._data( elem );\n\n\t\t// Don't attach events to noData or text/comment nodes (but allow plain objects)\n\t\tif ( !elemData ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !(events = elemData.events) ) {\n\t\t\tevents = elemData.events = {};\n\t\t}\n\t\tif ( !(eventHandle = elemData.handle) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?\n\t\t\t\t\tjQuery.event.dispatch.apply( eventHandle.elem, arguments ) :\n\t\t\t\t\tundefined;\n\t\t\t};\n\t\t\t// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events\n\t\t\teventHandle.elem = elem;\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\t// jQuery(...).bind(\"mouseover mouseout\", fn);\n\t\ttypes = ( types || \"\" ).match( core_rnotwhite ) || [\"\"];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[t] ) || [];\n\t\t\ttype = origType = tmp[1];\n\t\t\tnamespaces = ( tmp[2] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend({\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join(\".\")\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !(handlers = events[ type ]) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener/attachEvent if the special events handler returns false\n\t\t\t\tif ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\t\t\t\t\t// Bind the global event handler to the element\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle, false );\n\n\t\t\t\t\t} else if ( elem.attachEvent ) {\n\t\t\t\t\t\telem.attachEvent( \"on\" + type, eventHandle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t\t// Nullify elem to prevent memory leaks in IE\n\t\telem = null;\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\t\tvar j, handleObj, tmp,\n\t\t\torigCount, t, events,\n\t\t\tspecial, handlers, type,\n\t\t\tnamespaces, origType,\n\t\t\telemData = jQuery.hasData( elem ) && jQuery._data( elem );\n\n\t\tif ( !elemData || !(events = elemData.events) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( core_rnotwhite ) || [\"\"];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[t] ) || [];\n\t\t\ttype = origType = tmp[1];\n\t\t\tnamespaces = ( tmp[2] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[2] && new RegExp( \"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector || selector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdelete elemData.handle;\n\n\t\t\t// removeData also checks for emptiness and clears the expando if empty\n\t\t\t// so use it instead of delete\n\t\t\tjQuery._removeData( elem, \"events\" );\n\t\t}\n\t},\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\t\tvar handle, ontype, cur,\n\t\t\tbubbleType, special, tmp, i,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = core_hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = core_hasOwn.call( event, \"namespace\" ) ? event.namespace.split(\".\") : [];\n\n\t\tcur = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf(\".\") >= 0 ) {\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split(\".\");\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf(\":\") < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\tevent.isTrigger = true;\n\t\tevent.namespace = namespaces.join(\".\");\n\t\tevent.namespace_re = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (#9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === (elem.ownerDocument || document) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {\n\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = ( jQuery._data( cur, \"events\" ) || {} )[ event.type ] && jQuery._data( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&\n\t\t\t\t!(type === \"click\" && jQuery.nodeName( elem, \"a\" )) && jQuery.acceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name name as the event.\n\t\t\t\t// Can't use an .isFunction() check here because IE6/7 fails that test.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (#6170)\n\t\t\t\tif ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\t\t\t\t\ttry {\n\t\t\t\t\t\telem[ type ]();\n\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t// IE<9 dies on focus/blur to hidden element (#1486,#12518)\n\t\t\t\t\t\t// only reproducible on winXP IE8 native, not IE9 in IE8 mode\n\t\t\t\t\t}\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\tdispatch: function( event ) {\n\n\t\t// Make a writable jQuery.Event from the native event object\n\t\tevent = jQuery.event.fix( event );\n\n\t\tvar i, ret, handleObj, matched, j,\n\t\t\thandlerQueue = [],\n\t\t\targs = core_slice.call( arguments ),\n\t\t\thandlers = ( jQuery._data( this, \"events\" ) || {} )[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[0] = event;\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// Triggered event must either 1) have no namespace, or\n\t\t\t\t// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).\n\t\t\t\tif ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )\n\t\t\t\t\t\t\t.apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( (event.result = ret) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar sel, handleObj, matches, i,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\t// Black-hole SVG <use> instance trees (#13180)\n\t\t// Avoid non-left-click bubbling in Firefox (#3861)\n\t\tif ( delegateCount && cur.nodeType && (!event.button || event.type !== \"click\") ) {\n\n\t\t\tfor ( ; cur != this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't check non-elements (#13208)\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== \"click\") ) {\n\t\t\t\t\tmatches = [];\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (#13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matches[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatches[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) >= 0 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matches[ sel ] ) {\n\t\t\t\t\t\t\tmatches.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matches.length ) {\n\t\t\t\t\t\thandlerQueue.push({ elem: cur, handlers: matches });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\tfix: function( event ) {\n\t\tif ( event[ jQuery.expando ] ) {\n\t\t\treturn event;\n\t\t}\n\n\t\t// Create a writable copy of the event object and normalize some properties\n\t\tvar i, prop, copy,\n\t\t\ttype = event.type,\n\t\t\toriginalEvent = event,\n\t\t\tfixHook = this.fixHooks[ type ];\n\n\t\tif ( !fixHook ) {\n\t\t\tthis.fixHooks[ type ] = fixHook =\n\t\t\t\trmouseEvent.test( type ) ? this.mouseHooks :\n\t\t\t\trkeyEvent.test( type ) ? this.keyHooks :\n\t\t\t\t{};\n\t\t}\n\t\tcopy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;\n\n\t\tevent = new jQuery.Event( originalEvent );\n\n\t\ti = copy.length;\n\t\twhile ( i-- ) {\n\t\t\tprop = copy[ i ];\n\t\t\tevent[ prop ] = originalEvent[ prop ];\n\t\t}\n\n\t\t// Support: IE<9\n\t\t// Fix target property (#1925)\n\t\tif ( !event.target ) {\n\t\t\tevent.target = originalEvent.srcElement || document;\n\t\t}\n\n\t\t// Support: Chrome 23+, Safari?\n\t\t// Target should not be a text node (#504, #13143)\n\t\tif ( event.target.nodeType === 3 ) {\n\t\t\tevent.target = event.target.parentNode;\n\t\t}\n\n\t\t// Support: IE<9\n\t\t// For mouse/key events, metaKey==false if it's undefined (#3368, #11328)\n\t\tevent.metaKey = !!event.metaKey;\n\n\t\treturn fixHook.filter ? fixHook.filter( event, originalEvent ) : event;\n\t},\n\n\t// Includes some event props shared by KeyEvent and MouseEvent\n\tprops: \"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which\".split(\" \"),\n\n\tfixHooks: {},\n\n\tkeyHooks: {\n\t\tprops: \"char charCode key keyCode\".split(\" \"),\n\t\tfilter: function( event, original ) {\n\n\t\t\t// Add which for key events\n\t\t\tif ( event.which == null ) {\n\t\t\t\tevent.which = original.charCode != null ? original.charCode : original.keyCode;\n\t\t\t}\n\n\t\t\treturn event;\n\t\t}\n\t},\n\n\tmouseHooks: {\n\t\tprops: \"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement\".split(\" \"),\n\t\tfilter: function( event, original ) {\n\t\t\tvar body, eventDoc, doc,\n\t\t\t\tbutton = original.button,\n\t\t\t\tfromElement = original.fromElement;\n\n\t\t\t// Calculate pageX/Y if missing and clientX/Y available\n\t\t\tif ( event.pageX == null && original.clientX != null ) {\n\t\t\t\teventDoc = event.target.ownerDocument || document;\n\t\t\t\tdoc = eventDoc.documentElement;\n\t\t\t\tbody = eventDoc.body;\n\n\t\t\t\tevent.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );\n\t\t\t\tevent.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );\n\t\t\t}\n\n\t\t\t// Add relatedTarget, if necessary\n\t\t\tif ( !event.relatedTarget && fromElement ) {\n\t\t\t\tevent.relatedTarget = fromElement === event.target ? original.toElement : fromElement;\n\t\t\t}\n\n\t\t\t// Add which for click: 1 === left; 2 === middle; 3 === right\n\t\t\t// Note: button is not normalized, so don't use it\n\t\t\tif ( !event.which && button !== undefined ) {\n\t\t\t\tevent.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );\n\t\t\t}\n\n\t\t\treturn event;\n\t\t}\n\t},\n\n\tspecial: {\n\t\tload: {\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tclick: {\n\t\t\t// For checkbox, fire native event so checked state will be right\n\t\t\ttrigger: function() {\n\t\t\t\tif ( jQuery.nodeName( this, \"input\" ) && this.type === \"checkbox\" && this.click ) {\n\t\t\t\t\tthis.click();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tfocus: {\n\t\t\t// Fire native event if possible so blur/focus sequence is correct\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this !== document.activeElement && this.focus ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.focus();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t// Support: IE<9\n\t\t\t\t\t\t// If we error on focus to hidden element (#1486, #12518),\n\t\t\t\t\t\t// let .trigger() run the handlers\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tdelegateType: \"focusin\"\n\t\t},\n\t\tblur: {\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this === document.activeElement && this.blur ) {\n\t\t\t\t\tthis.blur();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdelegateType: \"focusout\"\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Even when returnValue equals to undefined Firefox will still show alert\n\t\t\t\tif ( event.result !== undefined ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tsimulate: function( type, elem, event, bubble ) {\n\t\t// Piggyback on a donor event to simulate a different one.\n\t\t// Fake originalEvent to avoid donor's stopPropagation, but if the\n\t\t// simulated event prevents default then we do the same on the donor.\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{ type: type,\n\t\t\t\tisSimulated: true,\n\t\t\t\toriginalEvent: {}\n\t\t\t}\n\t\t);\n\t\tif ( bubble ) {\n\t\t\tjQuery.event.trigger( e, null, elem );\n\t\t} else {\n\t\t\tjQuery.event.dispatch.call( elem, e );\n\t\t}\n\t\tif ( e.isDefaultPrevented() ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n};\n\njQuery.removeEvent = document.removeEventListener ?\n\tfunction( elem, type, handle ) {\n\t\tif ( elem.removeEventListener ) {\n\t\t\telem.removeEventListener( type, handle, false );\n\t\t}\n\t} :\n\tfunction( elem, type, handle ) {\n\t\tvar name = \"on\" + type;\n\n\t\tif ( elem.detachEvent ) {\n\n\t\t\t// #8545, #7054, preventing memory leaks for custom events in IE6-8\n\t\t\t// detachEvent needed property on element, by name of that event, to properly expose it to GC\n\t\t\tif ( typeof elem[ name ] === core_strundefined ) {\n\t\t\t\telem[ name ] = null;\n\t\t\t}\n\n\t\t\telem.detachEvent( name, handle );\n\t\t}\n\t};\n\njQuery.Event = function( src, props ) {\n\t// Allow instantiation without the 'new' keyword\n\tif ( !(this instanceof jQuery.Event) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||\n\t\t\tsrc.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || jQuery.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\t\tif ( !e ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If preventDefault exists, run it on the original event\n\t\tif ( e.preventDefault ) {\n\t\t\te.preventDefault();\n\n\t\t// Support: IE\n\t\t// Otherwise set the returnValue property of the original event to false\n\t\t} else {\n\t\t\te.returnValue = false;\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\t\tif ( !e ) {\n\t\t\treturn;\n\t\t}\n\t\t// If stopPropagation exists, run it on the original event\n\t\tif ( e.stopPropagation ) {\n\t\t\te.stopPropagation();\n\t\t}\n\n\t\t// Support: IE\n\t\t// Set the cancelBubble property of the original event to true\n\t\te.cancelBubble = true;\n\t},\n\tstopImmediatePropagation: function() {\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\njQuery.each({\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mousenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || (related !== target && !jQuery.contains( target, related )) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n});\n\n// IE submit delegation\nif ( !jQuery.support.submitBubbles ) {\n\n\tjQuery.event.special.submit = {\n\t\tsetup: function() {\n\t\t\t// Only need this for delegated form submit events\n\t\t\tif ( jQuery.nodeName( this, \"form\" ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Lazy-add a submit handler when a descendant form may potentially be submitted\n\t\t\tjQuery.event.add( this, \"click._submit keypress._submit\", function( e ) {\n\t\t\t\t// Node name check avoids a VML-related crash in IE (#9807)\n\t\t\t\tvar elem = e.target,\n\t\t\t\t\tform = jQuery.nodeName( elem, \"input\" ) || jQuery.nodeName( elem, \"button\" ) ? elem.form : undefined;\n\t\t\t\tif ( form && !jQuery._data( form, \"submitBubbles\" ) ) {\n\t\t\t\t\tjQuery.event.add( form, \"submit._submit\", function( event ) {\n\t\t\t\t\t\tevent._submit_bubble = true;\n\t\t\t\t\t});\n\t\t\t\t\tjQuery._data( form, \"submitBubbles\", true );\n\t\t\t\t}\n\t\t\t});\n\t\t\t// return undefined since we don't need an event listener\n\t\t},\n\n\t\tpostDispatch: function( event ) {\n\t\t\t// If form was submitted by the user, bubble the event up the tree\n\t\t\tif ( event._submit_bubble ) {\n\t\t\t\tdelete event._submit_bubble;\n\t\t\t\tif ( this.parentNode && !event.isTrigger ) {\n\t\t\t\t\tjQuery.event.simulate( \"submit\", this.parentNode, event, true );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tteardown: function() {\n\t\t\t// Only need this for delegated form submit events\n\t\t\tif ( jQuery.nodeName( this, \"form\" ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Remove delegated handlers; cleanData eventually reaps submit handlers attached above\n\t\t\tjQuery.event.remove( this, \"._submit\" );\n\t\t}\n\t};\n}\n\n// IE change delegation and checkbox/radio fix\nif ( !jQuery.support.changeBubbles ) {\n\n\tjQuery.event.special.change = {\n\n\t\tsetup: function() {\n\n\t\t\tif ( rformElems.test( this.nodeName ) ) {\n\t\t\t\t// IE doesn't fire change on a check/radio until blur; trigger it on click\n\t\t\t\t// after a propertychange. Eat the blur-change in special.change.handle.\n\t\t\t\t// This still fires onchange a second time for check/radio after blur.\n\t\t\t\tif ( this.type === \"checkbox\" || this.type === \"radio\" ) {\n\t\t\t\t\tjQuery.event.add( this, \"propertychange._change\", function( event ) {\n\t\t\t\t\t\tif ( event.originalEvent.propertyName === \"checked\" ) {\n\t\t\t\t\t\t\tthis._just_changed = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tjQuery.event.add( this, \"click._change\", function( event ) {\n\t\t\t\t\t\tif ( this._just_changed && !event.isTrigger ) {\n\t\t\t\t\t\t\tthis._just_changed = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Allow triggered, simulated change events (#11500)\n\t\t\t\t\t\tjQuery.event.simulate( \"change\", this, event, true );\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// Delegated event; lazy-add a change handler on descendant inputs\n\t\t\tjQuery.event.add( this, \"beforeactivate._change\", function( e ) {\n\t\t\t\tvar elem = e.target;\n\n\t\t\t\tif ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, \"changeBubbles\" ) ) {\n\t\t\t\t\tjQuery.event.add( elem, \"change._change\", function( event ) {\n\t\t\t\t\t\tif ( this.parentNode && !event.isSimulated && !event.isTrigger ) {\n\t\t\t\t\t\t\tjQuery.event.simulate( \"change\", this.parentNode, event, true );\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tjQuery._data( elem, \"changeBubbles\", true );\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\thandle: function( event ) {\n\t\t\tvar elem = event.target;\n\n\t\t\t// Swallow native change events from checkbox/radio, we already triggered them above\n\t\t\tif ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== \"radio\" && elem.type !== \"checkbox\") ) {\n\t\t\t\treturn event.handleObj.handler.apply( this, arguments );\n\t\t\t}\n\t\t},\n\n\t\tteardown: function() {\n\t\t\tjQuery.event.remove( this, \"._change\" );\n\n\t\t\treturn !rformElems.test( this.nodeName );\n\t\t}\n\t};\n}\n\n// Create \"bubbling\" focus and blur events\nif ( !jQuery.support.focusinBubbles ) {\n\tjQuery.each({ focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler while someone wants focusin/focusout\n\t\tvar attaches = 0,\n\t\t\thandler = function( event ) {\n\t\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );\n\t\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\t\t\t\tif ( attaches++ === 0 ) {\n\t\t\t\t\tdocument.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tif ( --attaches === 0 ) {\n\t\t\t\t\tdocument.removeEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n}\n\njQuery.fn.extend({\n\n\ton: function( types, selector, data, fn, /*INTERNAL*/ one ) {\n\t\tvar type, origFn;\n\n\t\t// Types can be a map of types/handlers\n\t\tif ( typeof types === \"object\" ) {\n\t\t\t// ( types-Object, selector, data )\n\t\t\tif ( typeof selector !== \"string\" ) {\n\t\t\t\t// ( types-Object, data )\n\t\t\t\tdata = data || selector;\n\t\t\t\tselector = undefined;\n\t\t\t}\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.on( type, selector, data, types[ type ], one );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tif ( data == null && fn == null ) {\n\t\t\t// ( types, fn )\n\t\t\tfn = selector;\n\t\t\tdata = selector = undefined;\n\t\t} else if ( fn == null ) {\n\t\t\tif ( typeof selector === \"string\" ) {\n\t\t\t\t// ( types, selector, fn )\n\t\t\t\tfn = data;\n\t\t\t\tdata = undefined;\n\t\t\t} else {\n\t\t\t\t// ( types, data, fn )\n\t\t\t\tfn = data;\n\t\t\t\tdata = selector;\n\t\t\t\tselector = undefined;\n\t\t\t}\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t} else if ( !fn ) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif ( one === 1 ) {\n\t\t\torigFn = fn;\n\t\t\tfn = function( event ) {\n\t\t\t\t// Can use an empty set, since event contains the info\n\t\t\t\tjQuery().off( event );\n\t\t\t\treturn origFn.apply( this, arguments );\n\t\t\t};\n\t\t\t// Use same guid so caller can remove using origFn\n\t\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.add( this, types, fn, data, selector );\n\t\t});\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn this.on( types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\t\t\t// ( event )  dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ? handleObj.origType + \".\" + handleObj.namespace : handleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each(function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t});\n\t},\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ? this.off( selector, \"**\" ) : this.off( types, selector || \"**\", fn );\n\t},\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t});\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[0];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n});\n/*!\n * Sizzle CSS Selector Engine\n * Copyright 2012 jQuery Foundation and other contributors\n * Released under the MIT license\n * http://sizzlejs.com/\n */\n(function( window, undefined ) {\n\nvar i,\n\tcachedruns,\n\tExpr,\n\tgetText,\n\tisXML,\n\tcompile,\n\thasDuplicate,\n\toutermostContext,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsXML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\tsortOrder,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + -(new Date()),\n\tpreferredDoc = window.document,\n\tsupport = {},\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\n\t// General-purpose constants\n\tstrundefined = typeof undefined,\n\tMAX_NEGATIVE = 1 << 31,\n\n\t// Array methods\n\tarr = [],\n\tpop = arr.pop,\n\tpush = arr.push,\n\tslice = arr.slice,\n\t// Use a stripped-down indexOf if we can't use a native one\n\tindexOf = arr.indexOf || function( elem ) {\n\t\tvar i = 0,\n\t\t\tlen = this.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( this[i] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\n\t// Regular expressions\n\n\t// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\t// http://www.w3.org/TR/css3-syntax/#characters\n\tcharacterEncoding = \"(?:\\\\\\\\.|[\\\\w-]|[^\\\\x00-\\\\xa0])+\",\n\n\t// Loosely modeled on CSS identifier characters\n\t// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors\n\t// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n\tidentifier = characterEncoding.replace( \"w\", \"w#\" ),\n\n\t// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors\n\toperators = \"([*^$|!~]?=)\",\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + characterEncoding + \")\" + whitespace +\n\t\t\"*(?:\" + operators + whitespace + \"*(?:(['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|(\" + identifier + \")|)|)\" + whitespace + \"*\\\\]\",\n\n\t// Prefer arguments quoted,\n\t//   then not containing pseudos/brackets,\n\t//   then attribute selectors/non-parenthetical expressions,\n\t//   then anything else\n\t// These preferences are here to reduce the number of selectors\n\t//   needing tokenize in the PSEUDO preFilter\n\tpseudos = \":(\" + characterEncoding + \")(?:\\\\(((['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes.replace( 3, 8 ) + \")*)|.*)\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([\\\\x20\\\\t\\\\r\\\\n\\\\f>+~])\" + whitespace + \"*\" ),\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + characterEncoding + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + characterEncoding + \")\" ),\n\t\t\"NAME\": new RegExp( \"^\\\\[name=['\\\"]?(\" + characterEncoding + \")['\\\"]?\\\\]\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + characterEncoding.replace( \"w\", \"w*\" ) + \")\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace +\n\t\t\t\"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace +\n\t\t\t\"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" +\n\t\t\twhitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trsibling = /[\\x20\\t\\r\\n\\f]*[+~]/,\n\n\trnative = /^[^{]+\\{\\s*\\[native code/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trescape = /'|\\\\/g,\n\trattributeQuotes = /\\=[\\x20\\t\\r\\n\\f]*([^'\"\\]]*)[\\x20\\t\\r\\n\\f]*\\]/g,\n\n\t// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = /\\\\([\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|.)/g,\n\tfunescape = function( _, escaped ) {\n\t\tvar high = \"0x\" + escaped - 0x10000;\n\t\t// NaN means non-codepoint\n\t\treturn high !== high ?\n\t\t\tescaped :\n\t\t\t// BMP codepoint\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t};\n\n// Use a stripped-down slice if we can't use a native one\ntry {\n\tslice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;\n} catch ( e ) {\n\tslice = function( i ) {\n\t\tvar elem,\n\t\t\tresults = [];\n\t\twhile ( (elem = this[i++]) ) {\n\t\t\tresults.push( elem );\n\t\t}\n\t\treturn results;\n\t};\n}\n\n/**\n * For feature detection\n * @param {Function} fn The function to test for native support\n */\nfunction isNative( fn ) {\n\treturn rnative.test( fn + \"\" );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {Function(string, Object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar cache,\n\t\tkeys = [];\n\n\treturn (cache = function( key, value ) {\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key += \" \" ) > Expr.cacheLength ) {\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn (cache[ key ] = value);\n\t});\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created div and expects a boolean result\n */\nfunction assert( fn ) {\n\tvar div = document.createElement(\"div\");\n\n\ttry {\n\t\treturn fn( div );\n\t} catch (e) {\n\t\treturn false;\n\t} finally {\n\t\t// release memory in IE\n\t\tdiv = null;\n\t}\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar match, elem, m, nodeType,\n\t\t// QSA vars\n\t\ti, groups, old, nid, newContext, newSelector;\n\n\tif ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\n\tcontext = context || document;\n\tresults = results || [];\n\n\tif ( !selector || typeof selector !== \"string\" ) {\n\t\treturn results;\n\t}\n\n\tif ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {\n\t\treturn [];\n\t}\n\n\tif ( !documentIsXML && !seed ) {\n\n\t\t// Shortcuts\n\t\tif ( (match = rquickExpr.exec( selector )) ) {\n\t\t\t// Speed-up: Sizzle(\"#ID\")\n\t\t\tif ( (m = match[1]) ) {\n\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\telem = context.getElementById( m );\n\t\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\t\tif ( elem && elem.parentNode ) {\n\t\t\t\t\t\t// Handle the case where IE, Opera, and Webkit return items\n\t\t\t\t\t\t// by name instead of ID\n\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Context is not a document\n\t\t\t\t\tif ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&\n\t\t\t\t\t\tcontains( context, elem ) && elem.id === m ) {\n\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Speed-up: Sizzle(\"TAG\")\n\t\t\t} else if ( match[2] ) {\n\t\t\t\tpush.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );\n\t\t\t\treturn results;\n\n\t\t\t// Speed-up: Sizzle(\".CLASS\")\n\t\t\t} else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {\n\t\t\t\tpush.apply( results, slice.call(context.getElementsByClassName( m ), 0) );\n\t\t\t\treturn results;\n\t\t\t}\n\t\t}\n\n\t\t// QSA path\n\t\tif ( support.qsa && !rbuggyQSA.test(selector) ) {\n\t\t\told = true;\n\t\t\tnid = expando;\n\t\t\tnewContext = context;\n\t\t\tnewSelector = nodeType === 9 && selector;\n\n\t\t\t// qSA works strangely on Element-rooted queries\n\t\t\t// We can work around this by specifying an extra ID on the root\n\t\t\t// and working up from there (Thanks to Andrew Dupont for the technique)\n\t\t\t// IE 8 doesn't work on object elements\n\t\t\tif ( nodeType === 1 && context.nodeName.toLowerCase() !== \"object\" ) {\n\t\t\t\tgroups = tokenize( selector );\n\n\t\t\t\tif ( (old = context.getAttribute(\"id\")) ) {\n\t\t\t\t\tnid = old.replace( rescape, \"\\\\$&\" );\n\t\t\t\t} else {\n\t\t\t\t\tcontext.setAttribute( \"id\", nid );\n\t\t\t\t}\n\t\t\t\tnid = \"[id='\" + nid + \"'] \";\n\n\t\t\t\ti = groups.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tgroups[i] = nid + toSelector( groups[i] );\n\t\t\t\t}\n\t\t\t\tnewContext = rsibling.test( selector ) && context.parentNode || context;\n\t\t\t\tnewSelector = groups.join(\",\");\n\t\t\t}\n\n\t\t\tif ( newSelector ) {\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results, slice.call( newContext.querySelectorAll(\n\t\t\t\t\t\tnewSelector\n\t\t\t\t\t), 0 ) );\n\t\t\t\t\treturn results;\n\t\t\t\t} catch(qsaError) {\n\t\t\t\t} finally {\n\t\t\t\t\tif ( !old ) {\n\t\t\t\t\t\tcontext.removeAttribute(\"id\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Detect xml\n * @param {Element|Object} elem An element or a document\n */\nisXML = Sizzle.isXML = function( elem ) {\n\t// documentElement is verified for cases where it doesn't yet exist\n\t// (such as loading iframes in IE - #4833)\n\tvar documentElement = elem && (elem.ownerDocument || elem).documentElement;\n\treturn documentElement ? documentElement.nodeName !== \"HTML\" : false;\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar doc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// If no document and documentElement is available, return\n\tif ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Set our document\n\tdocument = doc;\n\tdocElem = doc.documentElement;\n\n\t// Support tests\n\tdocumentIsXML = isXML( doc );\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.tagNameNoComments = assert(function( div ) {\n\t\tdiv.appendChild( doc.createComment(\"\") );\n\t\treturn !div.getElementsByTagName(\"*\").length;\n\t});\n\n\t// Check if attributes should be retrieved by attribute nodes\n\tsupport.attributes = assert(function( div ) {\n\t\tdiv.innerHTML = \"<select></select>\";\n\t\tvar type = typeof div.lastChild.getAttribute(\"multiple\");\n\t\t// IE8 returns a string for some attributes even when not present\n\t\treturn type !== \"boolean\" && type !== \"string\";\n\t});\n\n\t// Check if getElementsByClassName can be trusted\n\tsupport.getByClassName = assert(function( div ) {\n\t\t// Opera can't find a second classname (in 9.6)\n\t\tdiv.innerHTML = \"<div class='hidden e'></div><div class='hidden'></div>\";\n\t\tif ( !div.getElementsByClassName || !div.getElementsByClassName(\"e\").length ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Safari 3.2 caches class attributes and doesn't catch changes\n\t\tdiv.lastChild.className = \"e\";\n\t\treturn div.getElementsByClassName(\"e\").length === 2;\n\t});\n\n\t// Check if getElementById returns elements by name\n\t// Check if getElementsByName privileges form controls or returns elements by ID\n\tsupport.getByName = assert(function( div ) {\n\t\t// Inject content\n\t\tdiv.id = expando + 0;\n\t\tdiv.innerHTML = \"<a name='\" + expando + \"'></a><div name='\" + expando + \"'></div>\";\n\t\tdocElem.insertBefore( div, docElem.firstChild );\n\n\t\t// Test\n\t\tvar pass = doc.getElementsByName &&\n\t\t\t// buggy browsers will return fewer than the correct 2\n\t\t\tdoc.getElementsByName( expando ).length === 2 +\n\t\t\t// buggy browsers will return more than the correct 0\n\t\t\tdoc.getElementsByName( expando + 0 ).length;\n\t\tsupport.getIdNotName = !doc.getElementById( expando );\n\n\t\t// Cleanup\n\t\tdocElem.removeChild( div );\n\n\t\treturn pass;\n\t});\n\n\t// IE6/7 return modified attributes\n\tExpr.attrHandle = assert(function( div ) {\n\t\tdiv.innerHTML = \"<a href='#'></a>\";\n\t\treturn div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&\n\t\t\tdiv.firstChild.getAttribute(\"href\") === \"#\";\n\t}) ?\n\t\t{} :\n\t\t{\n\t\t\t\"href\": function( elem ) {\n\t\t\t\treturn elem.getAttribute( \"href\", 2 );\n\t\t\t},\n\t\t\t\"type\": function( elem ) {\n\t\t\t\treturn elem.getAttribute(\"type\");\n\t\t\t}\n\t\t};\n\n\t// ID find and filter\n\tif ( support.getIdNotName ) {\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== strundefined && !documentIsXML ) {\n\t\t\t\tvar m = context.getElementById( id );\n\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\treturn m && m.parentNode ? [m] : [];\n\t\t\t}\n\t\t};\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute(\"id\") === attrId;\n\t\t\t};\n\t\t};\n\t} else {\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== strundefined && !documentIsXML ) {\n\t\t\t\tvar m = context.getElementById( id );\n\n\t\t\t\treturn m ?\n\t\t\t\t\tm.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode(\"id\").value === id ?\n\t\t\t\t\t\t[m] :\n\t\t\t\t\t\tundefined :\n\t\t\t\t\t[];\n\t\t\t}\n\t\t};\n\t\tExpr.filter[\"ID\"] =  function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode(\"id\");\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[\"TAG\"] = support.tagNameNoComments ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== strundefined ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\t\t\t}\n\t\t} :\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( (elem = results[i++]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Name\n\tExpr.find[\"NAME\"] = support.getByName && function( tag, context ) {\n\t\tif ( typeof context.getElementsByName !== strundefined ) {\n\t\t\treturn context.getElementsByName( name );\n\t\t}\n\t};\n\n\t// Class\n\tExpr.find[\"CLASS\"] = support.getByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21),\n\t// no need to also add to buggyMatches since matches checks buggyQSA\n\t// A support test would require too much code (would include document ready)\n\trbuggyQSA = [ \":focus\" ];\n\n\tif ( (support.qsa = isNative(doc.querySelectorAll)) ) {\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert(function( div ) {\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explictly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// http://bugs.jquery.com/ticket/12359\n\t\t\tdiv.innerHTML = \"<select><option selected=''></option></select>\";\n\n\t\t\t// IE8 - Some boolean attributes are not treated correctly\n\t\t\tif ( !div.querySelectorAll(\"[selected]\").length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:checked|disabled|ismap|multiple|readonly|selected|value)\" );\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":checked\").length ) {\n\t\t\t\trbuggyQSA.push(\":checked\");\n\t\t\t}\n\t\t});\n\n\t\tassert(function( div ) {\n\n\t\t\t// Opera 10-12/IE8 - ^= $= *= and empty values\n\t\t\t// Should not select anything\n\t\t\tdiv.innerHTML = \"<input type='hidden' i=''/>\";\n\t\t\tif ( div.querySelectorAll(\"[i^='']\").length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:\\\"\\\"|'')\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":enabled\").length ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tdiv.querySelectorAll(\"*,:x\");\n\t\t\trbuggyQSA.push(\",.*:\");\n\t\t});\n\t}\n\n\tif ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector) )) ) {\n\n\t\tassert(function( div ) {\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( div, \"div\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( div, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t});\n\t}\n\n\trbuggyQSA = new RegExp( rbuggyQSA.join(\"|\") );\n\trbuggyMatches = new RegExp( rbuggyMatches.join(\"|\") );\n\n\t// Element contains another\n\t// Purposefully does not implement inclusive descendent\n\t// As in, an element does not contain itself\n\tcontains = isNative(docElem.contains) || docElem.compareDocumentPosition ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t));\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( (b = b.parentNode) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t// Document order sorting\n\tsortOrder = docElem.compareDocumentPosition ?\n\tfunction( a, b ) {\n\t\tvar compare;\n\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tif ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {\n\t\t\tif ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {\n\t\t\t\tif ( a === doc || contains( preferredDoc, a ) ) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tif ( b === doc || contains( preferredDoc, b ) ) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn compare & 4 ? -1 : 1;\n\t\t}\n\n\t\treturn a.compareDocumentPosition ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\t} else if ( !aup || !bup ) {\n\t\t\treturn a === doc ? -1 :\n\t\t\t\tb === doc ? 1 :\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[i] === bp[i] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[i], bp[i] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\tap[i] === preferredDoc ? -1 :\n\t\t\tbp[i] === preferredDoc ? 1 :\n\t\t\t0;\n\t};\n\n\t// Always assume the presence of duplicates if sort doesn't\n\t// pass them to our comparison function (as in Google Chrome).\n\thasDuplicate = false;\n\t[0, 0].sort( sortOrder );\n\tsupport.detectDuplicates = hasDuplicate;\n\n\treturn document;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\t// Make sure that attribute selectors are quoted\n\texpr = expr.replace( rattributeQuotes, \"='$1']\" );\n\n\t// rbuggyQSA always contains :focus, so no need for an existence check\n\tif ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\t\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t\t// fragment in IE 9\n\t\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch(e) {}\n\t}\n\n\treturn Sizzle( expr, document, null, [elem] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\t// Set document vars if needed\n\tif ( ( context.ownerDocument || context ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\tvar val;\n\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tif ( !documentIsXML ) {\n\t\tname = name.toLowerCase();\n\t}\n\tif ( (val = Expr.attrHandle[ name ]) ) {\n\t\treturn val( elem );\n\t}\n\tif ( documentIsXML || support.attributes ) {\n\t\treturn elem.getAttribute( name );\n\t}\n\treturn ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?\n\t\tname :\n\t\tval && val.specified ? val.value : null;\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n// Document sorting and removing duplicates\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\ti = 1,\n\t\tj = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\tfor ( ; (elem = results[i]); i++ ) {\n\t\t\tif ( elem === results[ i - 1 ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\treturn results;\n};\n\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( (cur = cur.nextSibling) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n// Returns a function to use in pseudos for input types\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n// Returns a function to use in pseudos for buttons\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}\n\n// Returns a function to use in pseudos for positionals\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\t\t// If no nodeType, this is expected to be an array\n\t\tfor ( ; (node = elem[i]); i++ ) {\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (see #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[1] = match[1].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[3] = ( match[4] || match[5] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[2] === \"~=\" ) {\n\t\t\t\tmatch[3] = \" \" + match[3] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[1] = match[1].toLowerCase();\n\n\t\t\tif ( match[1].slice( 0, 3 ) === \"nth\" ) {\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[3] ) {\n\t\t\t\t\tSizzle.error( match[0] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === \"even\" || match[3] === \"odd\" ) );\n\t\t\t\tmatch[5] = +( ( match[7] + match[8] ) || match[3] === \"odd\" );\n\n\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[3] ) {\n\t\t\t\tSizzle.error( match[0] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[5] && match[2];\n\n\t\t\tif ( matchExpr[\"CHILD\"].test( match[0] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[4] ) {\n\t\t\t\tmatch[2] = match[4];\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t(excess = tokenize( unquoted, true )) &&\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t(excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[0] = match[0].slice( 0, excess );\n\t\t\t\tmatch[2] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeName ) {\n\t\t\tif ( nodeName === \"*\" ) {\n\t\t\t\treturn function() { return true; };\n\t\t\t}\n\n\t\t\tnodeName = nodeName.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t(pattern = new RegExp( \"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\" )) &&\n\t\t\t\tclassCache( className, function( elem ) {\n\t\t\t\t\treturn pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute(\"class\")) || \"\" );\n\t\t\t\t});\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tvar cache, outerCache, node, diff, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( (node = node[ dir ]) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\t\t\t\t\t\t\touterCache = parent[ expando ] || (parent[ expando ] = {});\n\t\t\t\t\t\t\tcache = outerCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[0] === dirruns && cache[1];\n\t\t\t\t\t\t\tdiff = cache[0] === dirruns && cache[2];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\touterCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {\n\t\t\t\t\t\t\tdiff = cache[1];\n\n\t\t\t\t\t\t// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\tif ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {\n\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction(function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf.call( seed, matched[i] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[i] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction(function( selector ) {\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction(function( seed, matches, context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = unmatched[i]) ) {\n\t\t\t\t\t\t\tseed[i] = !(matches[i] = elem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}) :\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tinput[0] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t}),\n\n\t\t\"has\": markFunction(function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t}),\n\n\t\t\"contains\": markFunction(function( text ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t}),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\t\t\t// lang value must be a valid identifider\n\t\t\tif ( !ridentifier.test(lang || \"\") ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( (elemLang = documentIsXML ?\n\t\t\t\t\t\telem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\") :\n\t\t\t\t\t\telem.lang) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( (elem = elem.parentNode) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t}),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": function( elem ) {\n\t\t\treturn elem.disabled === false;\n\t\t},\n\n\t\t\"disabled\": function( elem ) {\n\t\t\treturn elem.disabled === true;\n\t\t},\n\n\t\t\"checked\": function( elem ) {\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn (nodeName === \"input\" && !!elem.checked) || (nodeName === \"option\" && !!elem.selected);\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),\n\t\t\t//   not comment, processing instructions, or others\n\t\t\t// Thanks to Diego Perini for the nodeName shortcut\n\t\t\t//   Greater than \"@\" means alpha characters (specifically not starting with \"#\" or \"?\")\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeName > \"@\" || elem.nodeType === 3 || elem.nodeType === 4 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[\"empty\"]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\t// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)\n\t\t\t// use getAttribute instead to test this case\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\t\t\t\t( (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === elem.type );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo(function() {\n\t\t\treturn [ 0 ];\n\t\t}),\n\n\t\t\"last\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t}),\n\n\t\t\"eq\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t}),\n\n\t\t\"even\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"odd\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"lt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"gt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t})\n\t}\n};\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\nfunction tokenize( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || (match = rcomma.exec( soFar )) ) {\n\t\t\tif ( match ) {\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[0].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( tokens = [] );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( (match = rcombinators.exec( soFar )) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push( {\n\t\t\t\tvalue: matched,\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[0].replace( rtrim, \" \" )\n\t\t\t} );\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\n\t\t\t\t(match = preFilters[ type ]( match ))) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push( {\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t} );\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n}\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[i].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tcheckNonElements = base && dir === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar data, cache, outerCache,\n\t\t\t\tdirkey = dirruns + \" \" + doneName;\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || (elem[ expando ] = {});\n\t\t\t\t\t\tif ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {\n\t\t\t\t\t\t\tif ( (data = cache[1]) === true || data === cachedruns ) {\n\t\t\t\t\t\t\t\treturn data === true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcache = outerCache[ dir ] = [ dirkey ];\n\t\t\t\t\t\t\tcache[1] = matcher( elem, context, xml ) || cachedruns;\n\t\t\t\t\t\t\tif ( cache[1] === true ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[i]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[0];\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (elem = unmatched[i]) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction(function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts( selector || \"*\", context.nodeType ? [ context ] : context, [] ),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( (elem = temp[i]) ) {\n\t\t\t\t\tmatcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = matcherOut[i]) ) {\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( (matcherIn[i] = elem) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, (matcherOut = []), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( (elem = matcherOut[i]) &&\n\t\t\t\t\t\t(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {\n\n\t\t\t\t\t\tseed[temp] = !(results[temp] = elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[0].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[\" \"],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf.call( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\treturn ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t(checkContext = context).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (matcher = Expr.relative[ tokens[i].type ]) ) {\n\t\t\tmatchers = [ addCombinator(elementMatcher( matchers ), matcher) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[j].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\t// A counter to specify which element is currently being matched\n\tvar matcherCachedRuns = 0,\n\t\tbySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, expandContext ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tsetMatched = [],\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\toutermost = expandContext != null,\n\t\t\t\tcontextBackup = outermostContext,\n\t\t\t\t// We must always have either seed elements or context\n\t\t\t\telems = seed || byElement && Expr.find[\"TAG\"]( \"*\", expandContext && context.parentNode || context ),\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);\n\n\t\t\tif ( outermost ) {\n\t\t\t\toutermostContext = context !== document && context;\n\t\t\t\tcachedruns = matcherCachedRuns;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Keep `i` a string if there are no elements so `matchedCount` will be \"00\" below\n\t\t\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (matcher = elementMatchers[j++]) ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t\tcachedruns = ++matcherCachedRuns;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( (elem = !matcher && elem) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\tmatchedCount += i;\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (matcher = setMatchers[j++]) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !(unmatched[i] || setMatched[i]) ) {\n\t\t\t\t\t\t\t\tsetMatched[i] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !group ) {\n\t\t\tgroup = tokenize( selector );\n\t\t}\n\t\ti = group.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( group[i] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\t}\n\treturn cached;\n};\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[i], results );\n\t}\n\treturn results;\n}\n\nfunction select( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tmatch = tokenize( selector );\n\n\tif ( !seed ) {\n\t\t// Try to minimize operations if there is only one group\n\t\tif ( match.length === 1 ) {\n\n\t\t\t// Take a shortcut and set the context if the root selector is an ID\n\t\t\ttokens = match[0] = match[0].slice( 0 );\n\t\t\tif ( tokens.length > 2 && (token = tokens[0]).type === \"ID\" &&\n\t\t\t\t\tcontext.nodeType === 9 && !documentIsXML &&\n\t\t\t\t\tExpr.relative[ tokens[1].type ] ) {\n\n\t\t\t\tcontext = Expr.find[\"ID\"]( token.matches[0].replace( runescape, funescape ), context )[0];\n\t\t\t\tif ( !context ) {\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\n\t\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t\t}\n\n\t\t\t// Fetch a seed set for right-to-left matching\n\t\t\ti = matchExpr[\"needsContext\"].test( selector ) ? 0 : tokens.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\ttoken = tokens[i];\n\n\t\t\t\t// Abort if we hit a combinator\n\t\t\t\tif ( Expr.relative[ (type = token.type) ] ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( (find = Expr.find[ type ]) ) {\n\t\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\t\tif ( (seed = find(\n\t\t\t\t\t\ttoken.matches[0].replace( runescape, funescape ),\n\t\t\t\t\t\trsibling.test( tokens[0].type ) && context.parentNode || context\n\t\t\t\t\t)) ) {\n\n\t\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\t\tpush.apply( results, slice.call( seed, 0 ) );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\tcompile( selector, match )(\n\t\tseed,\n\t\tcontext,\n\t\tdocumentIsXML,\n\t\tresults,\n\t\trsibling.test( selector )\n\t);\n\treturn results;\n}\n\n// Deprecated\nExpr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"];\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nExpr.filters = setFilters.prototype = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\n// Initialize with the default document\nsetDocument();\n\n// Override sizzle attribute retrieval\nSizzle.attr = jQuery.attr;\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\njQuery.expr[\":\"] = jQuery.expr.pseudos;\njQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\n\n\n})( window );\nvar runtil = /Until$/,\n\trparentsprev = /^(?:parents|prev(?:Until|All))/,\n\tisSimple = /^.[^:#\\[\\.,]*$/,\n\trneedsContext = jQuery.expr.match.needsContext,\n\t// methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend({\n\tfind: function( selector ) {\n\t\tvar i, ret, self,\n\t\t\tlen = this.length;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\tself = this;\n\t\t\treturn this.pushStack( jQuery( selector ).filter(function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}) );\n\t\t}\n\n\t\tret = [];\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, this[ i ], ret );\n\t\t}\n\n\t\t// Needed because $( selector, context ) becomes $( context ).find( selector )\n\t\tret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );\n\t\tret.selector = ( this.selector ? this.selector + \" \" : \"\" ) + selector;\n\t\treturn ret;\n\t},\n\n\thas: function( target ) {\n\t\tvar i,\n\t\t\ttargets = jQuery( target, this ),\n\t\t\tlen = targets.length;\n\n\t\treturn this.filter(function() {\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[i] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow(this, selector, false) );\n\t},\n\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow(this, selector, true) );\n\t},\n\n\tis: function( selector ) {\n\t\treturn !!selector && (\n\t\t\ttypeof selector === \"string\" ?\n\t\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\t\trneedsContext.test( selector ) ?\n\t\t\t\t\tjQuery( selector, this.context ).index( this[0] ) >= 0 :\n\t\t\t\t\tjQuery.filter( selector, this ).length > 0 :\n\t\t\t\tthis.filter( selector ).length > 0 );\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tret = [],\n\t\t\tpos = rneedsContext.test( selectors ) || typeof selectors !== \"string\" ?\n\t\t\t\tjQuery( selectors, context || this.context ) :\n\t\t\t\t0;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tcur = this[i];\n\n\t\t\twhile ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {\n\t\t\t\tif ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {\n\t\t\t\t\tret.push( cur );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );\n\t},\n\n\t// Determine the position of an element within\n\t// the matched set of elements\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn jQuery.inArray( this[0], jQuery( elem ) );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn jQuery.inArray(\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[0] : elem, this );\n\t},\n\n\tadd: function( selector, context ) {\n\t\tvar set = typeof selector === \"string\" ?\n\t\t\t\tjQuery( selector, context ) :\n\t\t\t\tjQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),\n\t\t\tall = jQuery.merge( this.get(), set );\n\n\t\treturn this.pushStack( jQuery.unique(all) );\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter(selector)\n\t\t);\n\t}\n});\n\njQuery.fn.andSelf = jQuery.fn.addBack;\n\nfunction sibling( cur, dir ) {\n\tdo {\n\t\tcur = cur[ dir ];\n\t} while ( cur && cur.nodeType !== 1 );\n\n\treturn cur;\n}\n\njQuery.each({\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn jQuery.dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn jQuery.dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn jQuery.dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn jQuery.sibling( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\treturn jQuery.nodeName( elem, \"iframe\" ) ?\n\t\t\telem.contentDocument || elem.contentWindow.document :\n\t\t\tjQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar ret = jQuery.map( this, fn, until );\n\n\t\tif ( !runtil.test( name ) ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tret = jQuery.filter( selector, ret );\n\t\t}\n\n\t\tret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;\n\n\t\tif ( this.length > 1 && rparentsprev.test( name ) ) {\n\t\t\tret = ret.reverse();\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n});\n\njQuery.extend({\n\tfilter: function( expr, elems, not ) {\n\t\tif ( not ) {\n\t\t\texpr = \":not(\" + expr + \")\";\n\t\t}\n\n\t\treturn elems.length === 1 ?\n\t\t\tjQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :\n\t\t\tjQuery.find.matches(expr, elems);\n\t},\n\n\tdir: function( elem, dir, until ) {\n\t\tvar matched = [],\n\t\t\tcur = elem[ dir ];\n\n\t\twhile ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {\n\t\t\tif ( cur.nodeType === 1 ) {\n\t\t\t\tmatched.push( cur );\n\t\t\t}\n\t\t\tcur = cur[dir];\n\t\t}\n\t\treturn matched;\n\t},\n\n\tsibling: function( n, elem ) {\n\t\tvar r = [];\n\n\t\tfor ( ; n; n = n.nextSibling ) {\n\t\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\t\tr.push( n );\n\t\t\t}\n\t\t}\n\n\t\treturn r;\n\t}\n});\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, keep ) {\n\n\t// Can't pass null or undefined to indexOf in Firefox 4\n\t// Set to 0 to skip string check\n\tqualifier = qualifier || 0;\n\n\tif ( jQuery.isFunction( qualifier ) ) {\n\t\treturn jQuery.grep(elements, function( elem, i ) {\n\t\t\tvar retVal = !!qualifier.call( elem, i, elem );\n\t\t\treturn retVal === keep;\n\t\t});\n\n\t} else if ( qualifier.nodeType ) {\n\t\treturn jQuery.grep(elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) === keep;\n\t\t});\n\n\t} else if ( typeof qualifier === \"string\" ) {\n\t\tvar filtered = jQuery.grep(elements, function( elem ) {\n\t\t\treturn elem.nodeType === 1;\n\t\t});\n\n\t\tif ( isSimple.test( qualifier ) ) {\n\t\t\treturn jQuery.filter(qualifier, filtered, !keep);\n\t\t} else {\n\t\t\tqualifier = jQuery.filter( qualifier, filtered );\n\t\t}\n\t}\n\n\treturn jQuery.grep(elements, function( elem ) {\n\t\treturn ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;\n\t});\n}\nfunction createSafeFragment( document ) {\n\tvar list = nodeNames.split( \"|\" ),\n\t\tsafeFrag = document.createDocumentFragment();\n\n\tif ( safeFrag.createElement ) {\n\t\twhile ( list.length ) {\n\t\t\tsafeFrag.createElement(\n\t\t\t\tlist.pop()\n\t\t\t);\n\t\t}\n\t}\n\treturn safeFrag;\n}\n\nvar nodeNames = \"abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|\" +\n\t\t\"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video\",\n\trinlinejQuery = / jQuery\\d+=\"(?:null|\\d+)\"/g,\n\trnoshimcache = new RegExp(\"<(?:\" + nodeNames + \")[\\\\s/>]\", \"i\"),\n\trleadingWhitespace = /^\\s+/,\n\trxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/gi,\n\trtagName = /<([\\w:]+)/,\n\trtbody = /<tbody/i,\n\trhtml = /<|&#?\\w+;/,\n\trnoInnerhtml = /<(?:script|style|link)/i,\n\tmanipulation_rcheckableType = /^(?:checkbox|radio)$/i,\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\trscriptType = /^$|\\/(?:java|ecma)script/i,\n\trscriptTypeMasked = /^true\\/(.*)/,\n\trcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g,\n\n\t// We have to close these tags to support XHTML (#13200)\n\twrapMap = {\n\t\toption: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n\t\tlegend: [ 1, \"<fieldset>\", \"</fieldset>\" ],\n\t\tarea: [ 1, \"<map>\", \"</map>\" ],\n\t\tparam: [ 1, \"<object>\", \"</object>\" ],\n\t\tthead: [ 1, \"<table>\", \"</table>\" ],\n\t\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\t\tcol: [ 2, \"<table><tbody></tbody><colgroup>\", \"</colgroup></table>\" ],\n\t\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t\t// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,\n\t\t// unless wrapped in a div with non-breaking characters in front of it.\n\t\t_default: jQuery.support.htmlSerialize ? [ 0, \"\", \"\" ] : [ 1, \"X<div>\", \"</div>\"  ]\n\t},\n\tsafeFragment = createSafeFragment( document ),\n\tfragmentDiv = safeFragment.appendChild( document.createElement(\"div\") );\n\nwrapMap.optgroup = wrapMap.option;\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\njQuery.fn.extend({\n\ttext: function( value ) {\n\t\treturn jQuery.access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );\n\t\t}, null, value, arguments.length );\n\t},\n\n\twrapAll: function( html ) {\n\t\tif ( jQuery.isFunction( html ) ) {\n\t\t\treturn this.each(function(i) {\n\t\t\t\tjQuery(this).wrapAll( html.call(this, i) );\n\t\t\t});\n\t\t}\n\n\t\tif ( this[0] ) {\n\t\t\t// The elements to wrap the target around\n\t\t\tvar wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);\n\n\t\t\tif ( this[0].parentNode ) {\n\t\t\t\twrap.insertBefore( this[0] );\n\t\t\t}\n\n\t\t\twrap.map(function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstChild && elem.firstChild.nodeType === 1 ) {\n\t\t\t\t\telem = elem.firstChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t}).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( jQuery.isFunction( html ) ) {\n\t\t\treturn this.each(function(i) {\n\t\t\t\tjQuery(this).wrapInner( html.call(this, i) );\n\t\t\t});\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t});\n\t},\n\n\twrap: function( html ) {\n\t\tvar isFunction = jQuery.isFunction( html );\n\n\t\treturn this.each(function(i) {\n\t\t\tjQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );\n\t\t});\n\t},\n\n\tunwrap: function() {\n\t\treturn this.parent().each(function() {\n\t\t\tif ( !jQuery.nodeName( this, \"body\" ) ) {\n\t\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t\t}\n\t\t}).end();\n\t},\n\n\tappend: function() {\n\t\treturn this.domManip(arguments, true, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tthis.appendChild( elem );\n\t\t\t}\n\t\t});\n\t},\n\n\tprepend: function() {\n\t\treturn this.domManip(arguments, true, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tthis.insertBefore( elem, this.firstChild );\n\t\t\t}\n\t\t});\n\t},\n\n\tbefore: function() {\n\t\treturn this.domManip( arguments, false, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t});\n\t},\n\n\tafter: function() {\n\t\treturn this.domManip( arguments, false, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t});\n\t},\n\n\t// keepData is for internal use only--do not document\n\tremove: function( selector, keepData ) {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = this[i]) != null; i++ ) {\n\t\t\tif ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {\n\t\t\t\tif ( !keepData && elem.nodeType === 1 ) {\n\t\t\t\t\tjQuery.cleanData( getAll( elem ) );\n\t\t\t\t}\n\n\t\t\t\tif ( elem.parentNode ) {\n\t\t\t\t\tif ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {\n\t\t\t\t\t\tsetGlobalEval( getAll( elem, \"script\" ) );\n\t\t\t\t\t}\n\t\t\t\t\telem.parentNode.removeChild( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = this[i]) != null; i++ ) {\n\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t}\n\n\t\t\t// Remove any remaining nodes\n\t\t\twhile ( elem.firstChild ) {\n\t\t\t\telem.removeChild( elem.firstChild );\n\t\t\t}\n\n\t\t\t// If this is a select, ensure that it displays empty (#12336)\n\t\t\t// Support: IE<9\n\t\t\tif ( elem.options && jQuery.nodeName( elem, \"select\" ) ) {\n\t\t\t\telem.options.length = 0;\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function () {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t});\n\t},\n\n\thtml: function( value ) {\n\t\treturn jQuery.access( this, function( value ) {\n\t\t\tvar elem = this[0] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined ) {\n\t\t\t\treturn elem.nodeType === 1 ?\n\t\t\t\t\telem.innerHTML.replace( rinlinejQuery, \"\" ) :\n\t\t\t\t\tundefined;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t( jQuery.support.htmlSerialize || !rnoshimcache.test( value )  ) &&\n\t\t\t\t( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [\"\", \"\"] )[1].toLowerCase() ] ) {\n\n\t\t\t\tvalue = value.replace( rxhtmlTag, \"<$1></$2>\" );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor (; i < l; i++ ) {\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\telem = this[i] || {};\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch(e) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function( value ) {\n\t\tvar isFunc = jQuery.isFunction( value );\n\n\t\t// Make sure that the elements are removed from the DOM before they are inserted\n\t\t// this can help fix replacing a parent with child elements\n\t\tif ( !isFunc && typeof value !== \"string\" ) {\n\t\t\tvalue = jQuery( value ).not( this ).detach();\n\t\t}\n\n\t\treturn this.domManip( [ value ], true, function( elem ) {\n\t\t\tvar next = this.nextSibling,\n\t\t\t\tparent = this.parentNode;\n\n\t\t\tif ( parent ) {\n\t\t\t\tjQuery( this ).remove();\n\t\t\t\tparent.insertBefore( elem, next );\n\t\t\t}\n\t\t});\n\t},\n\n\tdetach: function( selector ) {\n\t\treturn this.remove( selector, true );\n\t},\n\n\tdomManip: function( args, table, callback ) {\n\n\t\t// Flatten any nested arrays\n\t\targs = core_concat.apply( [], args );\n\n\t\tvar first, node, hasScripts,\n\t\t\tscripts, doc, fragment,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tset = this,\n\t\t\tiNoClone = l - 1,\n\t\t\tvalue = args[0],\n\t\t\tisFunction = jQuery.isFunction( value );\n\n\t\t// We can't cloneNode fragments that contain checked, in WebKit\n\t\tif ( isFunction || !( l <= 1 || typeof value !== \"string\" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {\n\t\t\treturn this.each(function( index ) {\n\t\t\t\tvar self = set.eq( index );\n\t\t\t\tif ( isFunction ) {\n\t\t\t\t\targs[0] = value.call( this, index, table ? self.html() : undefined );\n\t\t\t\t}\n\t\t\t\tself.domManip( args, table, callback );\n\t\t\t});\n\t\t}\n\n\t\tif ( l ) {\n\t\t\tfragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );\n\t\t\tfirst = fragment.firstChild;\n\n\t\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\t\tfragment = first;\n\t\t\t}\n\n\t\t\tif ( first ) {\n\t\t\t\ttable = table && jQuery.nodeName( first, \"tr\" );\n\t\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\t\thasScripts = scripts.length;\n\n\t\t\t\t// Use the original fragment for the last item instead of the first because it can end up\n\t\t\t\t// being emptied incorrectly in certain situations (#8070).\n\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\tnode = fragment;\n\n\t\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\t\tif ( hasScripts ) {\n\t\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcallback.call(\n\t\t\t\t\t\ttable && jQuery.nodeName( this[i], \"table\" ) ?\n\t\t\t\t\t\t\tfindOrAppend( this[i], \"tbody\" ) :\n\t\t\t\t\t\t\tthis[i],\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\ti\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( hasScripts ) {\n\t\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t\t// Reenable scripts\n\t\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t\t!jQuery._data( node, \"globalEval\" ) && jQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\t\tif ( node.src ) {\n\t\t\t\t\t\t\t\t// Hope ajax is available...\n\t\t\t\t\t\t\t\tjQuery.ajax({\n\t\t\t\t\t\t\t\t\turl: node.src,\n\t\t\t\t\t\t\t\t\ttype: \"GET\",\n\t\t\t\t\t\t\t\t\tdataType: \"script\",\n\t\t\t\t\t\t\t\t\tasync: false,\n\t\t\t\t\t\t\t\t\tglobal: false,\n\t\t\t\t\t\t\t\t\t\"throws\": true\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.globalEval( ( node.text || node.textContent || node.innerHTML || \"\" ).replace( rcleanScript, \"\" ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Fix #11809: Avoid leaking memory\n\t\t\t\tfragment = first = null;\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n});\n\nfunction findOrAppend( elem, tag ) {\n\treturn elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\tvar attr = elem.getAttributeNode(\"type\");\n\telem.type = ( attr && attr.specified ) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tvar match = rscriptTypeMasked.exec( elem.type );\n\tif ( match ) {\n\t\telem.type = match[1];\n\t} else {\n\t\telem.removeAttribute(\"type\");\n\t}\n\treturn elem;\n}\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\n\tif ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {\n\t\treturn;\n\t}\n\n\tvar type, i, l,\n\t\toldData = jQuery._data( src ),\n\t\tcurData = jQuery._data( dest, oldData ),\n\t\tevents = oldData.events;\n\n\tif ( events ) {\n\t\tdelete curData.handle;\n\t\tcurData.events = {};\n\n\t\tfor ( type in events ) {\n\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t}\n\t\t}\n\t}\n\n\t// make the cloned public data object a copy from the original\n\tif ( curData.data ) {\n\t\tcurData.data = jQuery.extend( {}, curData.data );\n\t}\n}\n\nfunction fixCloneNodeIssues( src, dest ) {\n\tvar nodeName, e, data;\n\n\t// We do not need to do anything for non-Elements\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\tnodeName = dest.nodeName.toLowerCase();\n\n\t// IE6-8 copies events bound via attachEvent when using cloneNode.\n\tif ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {\n\t\tdata = jQuery._data( dest );\n\n\t\tfor ( e in data.events ) {\n\t\t\tjQuery.removeEvent( dest, e, data.handle );\n\t\t}\n\n\t\t// Event data gets referenced instead of copied if the expando gets copied too\n\t\tdest.removeAttribute( jQuery.expando );\n\t}\n\n\t// IE blanks contents when cloning scripts, and tries to evaluate newly-set text\n\tif ( nodeName === \"script\" && dest.text !== src.text ) {\n\t\tdisableScript( dest ).text = src.text;\n\t\trestoreScript( dest );\n\n\t// IE6-10 improperly clones children of object elements using classid.\n\t// IE10 throws NoModificationAllowedError if parent is null, #12132.\n\t} else if ( nodeName === \"object\" ) {\n\t\tif ( dest.parentNode ) {\n\t\t\tdest.outerHTML = src.outerHTML;\n\t\t}\n\n\t\t// This path appears unavoidable for IE9. When cloning an object\n\t\t// element in IE9, the outerHTML strategy above is not sufficient.\n\t\t// If the src has innerHTML and the destination does not,\n\t\t// copy the src.innerHTML into the dest.innerHTML. #10324\n\t\tif ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {\n\t\t\tdest.innerHTML = src.innerHTML;\n\t\t}\n\n\t} else if ( nodeName === \"input\" && manipulation_rcheckableType.test( src.type ) ) {\n\t\t// IE6-8 fails to persist the checked state of a cloned checkbox\n\t\t// or radio button. Worse, IE6-7 fail to give the cloned element\n\t\t// a checked appearance if the defaultChecked value isn't also set\n\n\t\tdest.defaultChecked = dest.checked = src.checked;\n\n\t\t// IE6-7 get confused and end up setting the value of a cloned\n\t\t// checkbox/radio button to an empty string instead of \"on\"\n\t\tif ( dest.value !== src.value ) {\n\t\t\tdest.value = src.value;\n\t\t}\n\n\t// IE6-8 fails to return the selected option to the default selected\n\t// state when cloning options\n\t} else if ( nodeName === \"option\" ) {\n\t\tdest.defaultSelected = dest.selected = src.defaultSelected;\n\n\t// IE6-8 fails to set the defaultValue to the correct value when\n\t// cloning other types of input fields\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\njQuery.each({\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\ti = 0,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone(true);\n\t\t\tjQuery( insert[i] )[ original ]( elems );\n\n\t\t\t// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()\n\t\t\tcore_push.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n});\n\nfunction getAll( context, tag ) {\n\tvar elems, elem,\n\t\ti = 0,\n\t\tfound = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || \"*\" ) :\n\t\t\ttypeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || \"*\" ) :\n\t\t\tundefined;\n\n\tif ( !found ) {\n\t\tfor ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {\n\t\t\tif ( !tag || jQuery.nodeName( elem, tag ) ) {\n\t\t\t\tfound.push( elem );\n\t\t\t} else {\n\t\t\t\tjQuery.merge( found, getAll( elem, tag ) );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn tag === undefined || tag && jQuery.nodeName( context, tag ) ?\n\t\tjQuery.merge( [ context ], found ) :\n\t\tfound;\n}\n\n// Used in buildFragment, fixes the defaultChecked property\nfunction fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}\n\njQuery.extend({\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar destElements, node, clone, i, srcElements,\n\t\t\tinPage = jQuery.contains( elem.ownerDocument, elem );\n\n\t\tif ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( \"<\" + elem.nodeName + \">\" ) ) {\n\t\t\tclone = elem.cloneNode( true );\n\n\t\t// IE<=8 does not properly clone detached, unknown element nodes\n\t\t} else {\n\t\t\tfragmentDiv.innerHTML = elem.outerHTML;\n\t\t\tfragmentDiv.removeChild( clone = fragmentDiv.firstChild );\n\t\t}\n\n\t\tif ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&\n\t\t\t\t(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\t// Fix all IE cloning issues\n\t\t\tfor ( i = 0; (node = srcElements[i]) != null; ++i ) {\n\t\t\t\t// Ensure that the destination node is not null; Fixes #9587\n\t\t\t\tif ( destElements[i] ) {\n\t\t\t\t\tfixCloneNodeIssues( node, destElements[i] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0; (node = srcElements[i]) != null; i++ ) {\n\t\t\t\t\tcloneCopyEvent( node, destElements[i] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\tdestElements = srcElements = node = null;\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tbuildFragment: function( elems, context, scripts, selection ) {\n\t\tvar j, elem, contains,\n\t\t\ttmp, tag, tbody, wrap,\n\t\t\tl = elems.length,\n\n\t\t\t// Ensure a safe fragment\n\t\t\tsafe = createSafeFragment( context ),\n\n\t\t\tnodes = [],\n\t\t\ti = 0;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\telem = elems[ i ];\n\n\t\t\tif ( elem || elem === 0 ) {\n\n\t\t\t\t// Add nodes directly\n\t\t\t\tif ( jQuery.type( elem ) === \"object\" ) {\n\t\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t\t// Convert non-html into a text node\n\t\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t\t// Convert html into DOM nodes\n\t\t\t\t} else {\n\t\t\t\t\ttmp = tmp || safe.appendChild( context.createElement(\"div\") );\n\n\t\t\t\t\t// Deserialize a standard representation\n\t\t\t\t\ttag = ( rtagName.exec( elem ) || [\"\", \"\"] )[1].toLowerCase();\n\t\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\n\t\t\t\t\ttmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, \"<$1></$2>\" ) + wrap[2];\n\n\t\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\t\tj = wrap[0];\n\t\t\t\t\twhile ( j-- ) {\n\t\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Manually add leading whitespace removed by IE\n\t\t\t\t\tif ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {\n\t\t\t\t\t\tnodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove IE's autoinserted <tbody> from table fragments\n\t\t\t\t\tif ( !jQuery.support.tbody ) {\n\n\t\t\t\t\t\t// String was a <table>, *may* have spurious <tbody>\n\t\t\t\t\t\telem = tag === \"table\" && !rtbody.test( elem ) ?\n\t\t\t\t\t\t\ttmp.firstChild :\n\n\t\t\t\t\t\t\t// String was a bare <thead> or <tfoot>\n\t\t\t\t\t\t\twrap[1] === \"<table>\" && !rtbody.test( elem ) ?\n\t\t\t\t\t\t\t\ttmp :\n\t\t\t\t\t\t\t\t0;\n\n\t\t\t\t\t\tj = elem && elem.childNodes.length;\n\t\t\t\t\t\twhile ( j-- ) {\n\t\t\t\t\t\t\tif ( jQuery.nodeName( (tbody = elem.childNodes[j]), \"tbody\" ) && !tbody.childNodes.length ) {\n\t\t\t\t\t\t\t\telem.removeChild( tbody );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t\t// Fix #12392 for WebKit and IE > 9\n\t\t\t\t\ttmp.textContent = \"\";\n\n\t\t\t\t\t// Fix #12392 for oldIE\n\t\t\t\t\twhile ( tmp.firstChild ) {\n\t\t\t\t\t\ttmp.removeChild( tmp.firstChild );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remember the top-level container for proper cleanup\n\t\t\t\t\ttmp = safe.lastChild;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Fix #11356: Clear elements from fragment\n\t\tif ( tmp ) {\n\t\t\tsafe.removeChild( tmp );\n\t\t}\n\n\t\t// Reset defaultChecked for any radios and checkboxes\n\t\t// about to be appended to the DOM in IE 6/7 (#8060)\n\t\tif ( !jQuery.support.appendChecked ) {\n\t\t\tjQuery.grep( getAll( nodes, \"input\" ), fixDefaultChecked );\n\t\t}\n\n\t\ti = 0;\n\t\twhile ( (elem = nodes[ i++ ]) ) {\n\n\t\t\t// #4087 - If origin and destination elements are the same, and this is\n\t\t\t// that element, do not do anything\n\t\t\tif ( selection && jQuery.inArray( elem, selection ) !== -1 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tcontains = jQuery.contains( elem.ownerDocument, elem );\n\n\t\t\t// Append to fragment\n\t\t\ttmp = getAll( safe.appendChild( elem ), \"script\" );\n\n\t\t\t// Preserve script evaluation history\n\t\t\tif ( contains ) {\n\t\t\t\tsetGlobalEval( tmp );\n\t\t\t}\n\n\t\t\t// Capture executables\n\t\t\tif ( scripts ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (elem = tmp[ j++ ]) ) {\n\t\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\t\tscripts.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttmp = null;\n\n\t\treturn safe;\n\t},\n\n\tcleanData: function( elems, /* internal */ acceptData ) {\n\t\tvar elem, type, id, data,\n\t\t\ti = 0,\n\t\t\tinternalKey = jQuery.expando,\n\t\t\tcache = jQuery.cache,\n\t\t\tdeleteExpando = jQuery.support.deleteExpando,\n\t\t\tspecial = jQuery.event.special;\n\n\t\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\n\t\t\tif ( acceptData || jQuery.acceptData( elem ) ) {\n\n\t\t\t\tid = elem[ internalKey ];\n\t\t\t\tdata = id && cache[ id ];\n\n\t\t\t\tif ( data ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove cache only if it was not already removed by jQuery.event.remove\n\t\t\t\t\tif ( cache[ id ] ) {\n\n\t\t\t\t\t\tdelete cache[ id ];\n\n\t\t\t\t\t\t// IE does not allow us to delete expando properties from nodes,\n\t\t\t\t\t\t// nor does it have a removeAttribute function on Document nodes;\n\t\t\t\t\t\t// we must handle all of these cases\n\t\t\t\t\t\tif ( deleteExpando ) {\n\t\t\t\t\t\t\tdelete elem[ internalKey ];\n\n\t\t\t\t\t\t} else if ( typeof elem.removeAttribute !== core_strundefined ) {\n\t\t\t\t\t\t\telem.removeAttribute( internalKey );\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telem[ internalKey ] = null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcore_deletedIds.push( id );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n});\nvar iframe, getStyles, curCSS,\n\tralpha = /alpha\\([^)]*\\)/i,\n\tropacity = /opacity\\s*=\\s*([^)]*)/,\n\trposition = /^(top|right|bottom|left)$/,\n\t// swappable if display is none or starts with table except \"table\", \"table-cell\", or \"table-caption\"\n\t// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\trmargin = /^margin/,\n\trnumsplit = new RegExp( \"^(\" + core_pnum + \")(.*)$\", \"i\" ),\n\trnumnonpx = new RegExp( \"^(\" + core_pnum + \")(?!px)[a-z%]+$\", \"i\" ),\n\trrelNum = new RegExp( \"^([+-])=(\" + core_pnum + \")\", \"i\" ),\n\telemdisplay = { BODY: \"block\" },\n\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: 0,\n\t\tfontWeight: 400\n\t},\n\n\tcssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ],\n\tcssPrefixes = [ \"Webkit\", \"O\", \"Moz\", \"ms\" ];\n\n// return a css property mapped to a potentially vendor prefixed property\nfunction vendorPropName( style, name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in style ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt(0).toUpperCase() + name.slice(1),\n\t\torigName = name,\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in style ) {\n\t\t\treturn name;\n\t\t}\n\t}\n\n\treturn origName;\n}\n\nfunction isHidden( elem, el ) {\n\t// isHidden might be called from jQuery#filter function;\n\t// in that case, element will be second argument\n\telem = el || elem;\n\treturn jQuery.css( elem, \"display\" ) === \"none\" || !jQuery.contains( elem.ownerDocument, elem );\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem, hidden,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvalues[ index ] = jQuery._data( elem, \"olddisplay\" );\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\t\t\t// Reset the inline display of this element to learn if it is\n\t\t\t// being hidden by cascaded rules or not\n\t\t\tif ( !values[ index ] && display === \"none\" ) {\n\t\t\t\telem.style.display = \"\";\n\t\t\t}\n\n\t\t\t// Set elements which have been overridden with display: none\n\t\t\t// in a stylesheet to whatever the default browser style is\n\t\t\t// for such an element\n\t\t\tif ( elem.style.display === \"\" && isHidden( elem ) ) {\n\t\t\t\tvalues[ index ] = jQuery._data( elem, \"olddisplay\", css_defaultDisplay(elem.nodeName) );\n\t\t\t}\n\t\t} else {\n\n\t\t\tif ( !values[ index ] ) {\n\t\t\t\thidden = isHidden( elem );\n\n\t\t\t\tif ( display && display !== \"none\" || !hidden ) {\n\t\t\t\t\tjQuery._data( elem, \"olddisplay\", hidden ? display : jQuery.css( elem, \"display\" ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of most of the elements in a second loop\n\t// to avoid the constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( !show || elem.style.display === \"none\" || elem.style.display === \"\" ) {\n\t\t\telem.style.display = show ? values[ index ] || \"\" : \"none\";\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend({\n\tcss: function( name, value ) {\n\t\treturn jQuery.access( this, function( elem, name, value ) {\n\t\t\tvar len, styles,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( jQuery.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t},\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tvar bool = typeof state === \"boolean\";\n\n\t\treturn this.each(function() {\n\t\t\tif ( bool ? state : isHidden( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t});\n\t}\n});\n\njQuery.extend({\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Exclude the following css properties to add px\n\tcssNumber: {\n\t\t\"columnCount\": true,\n\t\t\"fillOpacity\": true,\n\t\t\"fontWeight\": true,\n\t\t\"lineHeight\": true,\n\t\t\"opacity\": true,\n\t\t\"orphans\": true,\n\t\t\"widows\": true,\n\t\t\"zIndex\": true,\n\t\t\"zoom\": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {\n\t\t// normalize float css property\n\t\t\"float\": jQuery.support.cssFloat ? \"cssFloat\" : \"styleFloat\"\n\t},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = jQuery.camelCase( name ),\n\t\t\tstyle = elem.style;\n\n\t\tname = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );\n\n\t\t// gets hook for the prefixed version\n\t\t// followed by the unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// convert relative number strings (+= or -=) to relative numbers. #7345\n\t\t\tif ( type === \"string\" && (ret = rrelNum.exec( value )) ) {\n\t\t\t\tvalue = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );\n\t\t\t\t// Fixes bug #9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that NaN and null values aren't set. See: #7116\n\t\t\tif ( value == null || type === \"number\" && isNaN( value ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add 'px' to the (except for certain CSS properties)\n\t\t\tif ( type === \"number\" && !jQuery.cssNumber[ origName ] ) {\n\t\t\t\tvalue += \"px\";\n\t\t\t}\n\n\t\t\t// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,\n\t\t\t// but it would mean to define eight (for every problematic property) identical functions\n\t\t\tif ( !jQuery.support.clearCloneStyle && value === \"\" && name.indexOf(\"background\") === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !(\"set\" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {\n\n\t\t\t\t// Wrapped to prevent IE from throwing errors when 'invalid' values are provided\n\t\t\t\t// Fixes bug #5509\n\t\t\t\ttry {\n\t\t\t\t\tstyle[ name ] = value;\n\t\t\t\t} catch(e) {}\n\t\t\t}\n\n\t\t} else {\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar num, val, hooks,\n\t\t\torigName = jQuery.camelCase( name );\n\n\t\t// Make sure that we're working with the right name\n\t\tname = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );\n\n\t\t// gets hook for the prefixed version\n\t\t// followed by the unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t//convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Return, converting to number if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || jQuery.isNumeric( num ) ? num || 0 : val;\n\t\t}\n\t\treturn val;\n\t},\n\n\t// A method for quickly swapping in/out CSS properties to get correct calculations\n\tswap: function( elem, options, callback, args ) {\n\t\tvar ret, name,\n\t\t\told = {};\n\n\t\t// Remember the old values, and insert the new ones\n\t\tfor ( name in options ) {\n\t\t\told[ name ] = elem.style[ name ];\n\t\t\telem.style[ name ] = options[ name ];\n\t\t}\n\n\t\tret = callback.apply( elem, args || [] );\n\n\t\t// Revert the old values\n\t\tfor ( name in options ) {\n\t\t\telem.style[ name ] = old[ name ];\n\t\t}\n\n\t\treturn ret;\n\t}\n});\n\n// NOTE: we've included the \"window\" in window.getComputedStyle\n// because jsdom on node.js will break without it.\nif ( window.getComputedStyle ) {\n\tgetStyles = function( elem ) {\n\t\treturn window.getComputedStyle( elem, null );\n\t};\n\n\tcurCSS = function( elem, name, _computed ) {\n\t\tvar width, minWidth, maxWidth,\n\t\t\tcomputed = _computed || getStyles( elem ),\n\n\t\t\t// getPropertyValue is only needed for .css('filter') in IE9, see #12537\n\t\t\tret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,\n\t\t\tstyle = elem.style;\n\n\t\tif ( computed ) {\n\n\t\t\tif ( ret === \"\" && !jQuery.contains( elem.ownerDocument, elem ) ) {\n\t\t\t\tret = jQuery.style( elem, name );\n\t\t\t}\n\n\t\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t\t// Chrome < 17 and Safari 5.0 uses \"computed value\" instead of \"used value\" for margin-right\n\t\t\t// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels\n\t\t\t// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values\n\t\t\tif ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {\n\n\t\t\t\t// Remember the original values\n\t\t\t\twidth = style.width;\n\t\t\t\tminWidth = style.minWidth;\n\t\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t\t// Put in the new values to get a computed value out\n\t\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\t\tret = computed.width;\n\n\t\t\t\t// Revert the changed values\n\t\t\t\tstyle.width = width;\n\t\t\t\tstyle.minWidth = minWidth;\n\t\t\t\tstyle.maxWidth = maxWidth;\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t};\n} else if ( document.documentElement.currentStyle ) {\n\tgetStyles = function( elem ) {\n\t\treturn elem.currentStyle;\n\t};\n\n\tcurCSS = function( elem, name, _computed ) {\n\t\tvar left, rs, rsLeft,\n\t\t\tcomputed = _computed || getStyles( elem ),\n\t\t\tret = computed ? computed[ name ] : undefined,\n\t\t\tstyle = elem.style;\n\n\t\t// Avoid setting ret to empty string here\n\t\t// so we don't default to auto\n\t\tif ( ret == null && style && style[ name ] ) {\n\t\t\tret = style[ name ];\n\t\t}\n\n\t\t// From the awesome hack by Dean Edwards\n\t\t// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n\n\t\t// If we're not dealing with a regular pixel number\n\t\t// but a number that has a weird ending, we need to convert it to pixels\n\t\t// but not position css attributes, as those are proportional to the parent element instead\n\t\t// and we can't measure the parent instead because it might trigger a \"stacking dolls\" problem\n\t\tif ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\tleft = style.left;\n\t\t\trs = elem.runtimeStyle;\n\t\t\trsLeft = rs && rs.left;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tif ( rsLeft ) {\n\t\t\t\trs.left = elem.currentStyle.left;\n\t\t\t}\n\t\t\tstyle.left = name === \"fontSize\" ? \"1em\" : ret;\n\t\t\tret = style.pixelLeft + \"px\";\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.left = left;\n\t\t\tif ( rsLeft ) {\n\t\t\t\trs.left = rsLeft;\n\t\t\t}\n\t\t}\n\n\t\treturn ret === \"\" ? \"auto\" : ret;\n\t};\n}\n\nfunction setPositiveNumber( elem, value, subtract ) {\n\tvar matches = rnumsplit.exec( value );\n\treturn matches ?\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {\n\tvar i = extra === ( isBorderBox ? \"border\" : \"content\" ) ?\n\t\t// If we already have the right measurement, avoid augmentation\n\t\t4 :\n\t\t// Otherwise initialize for horizontal or vertical properties\n\t\tname === \"width\" ? 1 : 0,\n\n\t\tval = 0;\n\n\tfor ( ; i < 4; i += 2 ) {\n\t\t// both box models exclude margin, so add it if we want it\n\t\tif ( extra === \"margin\" ) {\n\t\t\tval += jQuery.css( elem, extra + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\tif ( isBorderBox ) {\n\t\t\t// border-box includes padding, so remove it if we want content\n\t\t\tif ( extra === \"content\" ) {\n\t\t\t\tval -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// at this point, extra isn't border nor margin, so remove border\n\t\t\tif ( extra !== \"margin\" ) {\n\t\t\t\tval -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t} else {\n\t\t\t// at this point, extra isn't content, so add padding\n\t\t\tval += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// at this point, extra isn't content nor padding, so add border\n\t\t\tif ( extra !== \"padding\" ) {\n\t\t\t\tval += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn val;\n}\n\nfunction getWidthOrHeight( elem, name, extra ) {\n\n\t// Start with offset property, which is equivalent to the border-box value\n\tvar valueIsBorderBox = true,\n\t\tval = name === \"width\" ? elem.offsetWidth : elem.offsetHeight,\n\t\tstyles = getStyles( elem ),\n\t\tisBorderBox = jQuery.support.boxSizing && jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t// some non-html elements return undefined for offsetWidth, so check for null/undefined\n\t// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285\n\t// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668\n\tif ( val <= 0 || val == null ) {\n\t\t// Fall back to computed then uncomputed css if necessary\n\t\tval = curCSS( elem, name, styles );\n\t\tif ( val < 0 || val == null ) {\n\t\t\tval = elem.style[ name ];\n\t\t}\n\n\t\t// Computed unit is not pixels. Stop here and return.\n\t\tif ( rnumnonpx.test(val) ) {\n\t\t\treturn val;\n\t\t}\n\n\t\t// we need the check for style in case a browser which returns unreliable values\n\t\t// for getComputedStyle silently falls back to the reliable elem.style\n\t\tvalueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );\n\n\t\t// Normalize \"\", auto, and prepare for extra\n\t\tval = parseFloat( val ) || 0;\n\t}\n\n\t// use the active box-sizing model to add/subtract irrelevant styles\n\treturn ( val +\n\t\taugmentWidthOrHeight(\n\t\t\telem,\n\t\t\tname,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles\n\t\t)\n\t) + \"px\";\n}\n\n// Try to determine the default display value of an element\nfunction css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}\n\n// Called ONLY from within css_defaultDisplay\nfunction actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}\n\njQuery.each([ \"height\", \"width\" ], function( i, name ) {\n\tjQuery.cssHooks[ name ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\t\t\t\t// certain elements can have dimension info if we invisibly show them\n\t\t\t\t// however, it must have a current display style that would benefit from this\n\t\t\t\treturn elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, \"display\" ) ) ?\n\t\t\t\t\tjQuery.swap( elem, cssShow, function() {\n\t\t\t\t\t\treturn getWidthOrHeight( elem, name, extra );\n\t\t\t\t\t}) :\n\t\t\t\t\tgetWidthOrHeight( elem, name, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar styles = extra && getStyles( elem );\n\t\t\treturn setPositiveNumber( elem, value, extra ?\n\t\t\t\taugmentWidthOrHeight(\n\t\t\t\t\telem,\n\t\t\t\t\tname,\n\t\t\t\t\textra,\n\t\t\t\t\tjQuery.support.boxSizing && jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\t\tstyles\n\t\t\t\t) : 0\n\t\t\t);\n\t\t}\n\t};\n});\n\nif ( !jQuery.support.opacity ) {\n\tjQuery.cssHooks.opacity = {\n\t\tget: function( elem, computed ) {\n\t\t\t// IE uses filters for opacity\n\t\t\treturn ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || \"\" ) ?\n\t\t\t\t( 0.01 * parseFloat( RegExp.$1 ) ) + \"\" :\n\t\t\t\tcomputed ? \"1\" : \"\";\n\t\t},\n\n\t\tset: function( elem, value ) {\n\t\t\tvar style = elem.style,\n\t\t\t\tcurrentStyle = elem.currentStyle,\n\t\t\t\topacity = jQuery.isNumeric( value ) ? \"alpha(opacity=\" + value * 100 + \")\" : \"\",\n\t\t\t\tfilter = currentStyle && currentStyle.filter || style.filter || \"\";\n\n\t\t\t// IE has trouble with opacity if it does not have layout\n\t\t\t// Force it by setting the zoom level\n\t\t\tstyle.zoom = 1;\n\n\t\t\t// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652\n\t\t\t// if value === \"\", then remove inline opacity #12685\n\t\t\tif ( ( value >= 1 || value === \"\" ) &&\n\t\t\t\t\tjQuery.trim( filter.replace( ralpha, \"\" ) ) === \"\" &&\n\t\t\t\t\tstyle.removeAttribute ) {\n\n\t\t\t\t// Setting style.filter to null, \"\" & \" \" still leave \"filter:\" in the cssText\n\t\t\t\t// if \"filter:\" is present at all, clearType is disabled, we want to avoid this\n\t\t\t\t// style.removeAttribute is IE Only, but so apparently is this code path...\n\t\t\t\tstyle.removeAttribute( \"filter\" );\n\n\t\t\t\t// if there is no filter style applied in a css rule or unset inline opacity, we are done\n\t\t\t\tif ( value === \"\" || currentStyle && !currentStyle.filter ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// otherwise, set new filter values\n\t\t\tstyle.filter = ralpha.test( filter ) ?\n\t\t\t\tfilter.replace( ralpha, opacity ) :\n\t\t\t\tfilter + \" \" + opacity;\n\t\t}\n\t};\n}\n\n// These hooks cannot be added until DOM ready because the support test\n// for it is not run until after DOM ready\njQuery(function() {\n\tif ( !jQuery.support.reliableMarginRight ) {\n\t\tjQuery.cssHooks.marginRight = {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\t\t\t\t\t// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right\n\t\t\t\t\t// Work around by temporarily setting element display to inline-block\n\t\t\t\t\treturn jQuery.swap( elem, { \"display\": \"inline-block\" },\n\t\t\t\t\t\tcurCSS, [ elem, \"marginRight\" ] );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\t// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n\t// getComputedStyle returns percent when specified for top/left/bottom/right\n\t// rather than make the css module depend on the offset module, we just check for it here\n\tif ( !jQuery.support.pixelPosition && jQuery.fn.position ) {\n\t\tjQuery.each( [ \"top\", \"left\" ], function( i, prop ) {\n\t\t\tjQuery.cssHooks[ prop ] = {\n\t\t\t\tget: function( elem, computed ) {\n\t\t\t\t\tif ( computed ) {\n\t\t\t\t\t\tcomputed = curCSS( elem, prop );\n\t\t\t\t\t\t// if curCSS returns percentage, fallback to offset\n\t\t\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\t\t\tcomputed;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t}\n\n});\n\nif ( jQuery.expr && jQuery.expr.filters ) {\n\tjQuery.expr.filters.hidden = function( elem ) {\n\t\t// Support: Opera <= 12.12\n\t\t// Opera reports offsetWidths and offsetHeights less than zero on some elements\n\t\treturn elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||\n\t\t\t(!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, \"display\" )) === \"none\");\n\t};\n\n\tjQuery.expr.filters.visible = function( elem ) {\n\t\treturn !jQuery.expr.filters.hidden( elem );\n\t};\n}\n\n// These hooks are used by animate to expand properties\njQuery.each({\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split(\" \") : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( !rmargin.test( prefix ) ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n});\nvar r20 = /%20/g,\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\njQuery.fn.extend({\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map(function(){\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t})\n\t\t.filter(function(){\n\t\t\tvar type = this.type;\n\t\t\t// Use .is(\":disabled\") so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !manipulation_rcheckableType.test( type ) );\n\t\t})\n\t\t.map(function( i, elem ){\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\treturn val == null ?\n\t\t\t\tnull :\n\t\t\t\tjQuery.isArray( val ) ?\n\t\t\t\t\tjQuery.map( val, function( val ){\n\t\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t\t}) :\n\t\t\t\t\t{ name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t}).get();\n\t}\n});\n\n//Serialize an array of form elements or a set of\n//key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, value ) {\n\t\t\t// If value is a function, invoke it and return its value\n\t\t\tvalue = jQuery.isFunction( value ) ? value() : ( value == null ? \"\" : value );\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" + encodeURIComponent( value );\n\t\t};\n\n\t// Set traditional to true for jQuery <= 1.3.2 behavior.\n\tif ( traditional === undefined ) {\n\t\ttraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t});\n\n\t} else {\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" ).replace( r20, \"+\" );\n};\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( jQuery.isArray( obj ) ) {\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams( prefix + \"[\" + ( typeof v === \"object\" ? i : \"\" ) + \"]\", v, traditional, add );\n\t\t\t}\n\t\t});\n\n\t} else if ( !traditional && jQuery.type( obj ) === \"object\" ) {\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\njQuery.each( (\"blur focus focusin focusout load resize scroll unload click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup error contextmenu\").split(\" \"), function( i, name ) {\n\n\t// Handle event binding\n\tjQuery.fn[ name ] = function( data, fn ) {\n\t\treturn arguments.length > 0 ?\n\t\t\tthis.on( name, null, data, fn ) :\n\t\t\tthis.trigger( name );\n\t};\n});\n\njQuery.fn.hover = function( fnOver, fnOut ) {\n\treturn this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n};\nvar\n\t// Document location\n\tajaxLocParts,\n\tajaxLocation,\n\tajax_nonce = jQuery.now(),\n\n\tajax_rquery = /\\?/,\n\trhash = /#.*$/,\n\trts = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)\\r?$/mg, // IE leaves an \\r character at EOL\n\t// #7653, #8125, #8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\trurl = /^([\\w.+-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+)|)|)/,\n\n\t// Keep a copy of the old load method\n\t_load = jQuery.fn.load,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t *    - BEFORE asking for a transport\n\t *    - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat(\"*\");\n\n// #8138, IE may throw an exception when accessing\n// a field from window.location if document.domain has been set\ntry {\n\tajaxLocation = location.href;\n} catch( e ) {\n\t// Use the href attribute of an A element\n\t// since IE will modify it given document.location\n\tajaxLocation = document.createElement( \"a\" );\n\tajaxLocation.href = \"\";\n\tajaxLocation = ajaxLocation.href;\n}\n\n// Segment location into parts\najaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];\n\n\t\tif ( jQuery.isFunction( func ) ) {\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( (dataType = dataTypes[i++]) ) {\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[0] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t(structure[ dataType ] = structure[ dataType ] || []).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t(structure[ dataType ] = structure[ dataType ] || []).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\njQuery.fn.load = function( url, params, callback ) {\n\tif ( typeof url !== \"string\" && _load ) {\n\t\treturn _load.apply( this, arguments );\n\t}\n\n\tvar selector, response, type,\n\t\tself = this,\n\t\toff = url.indexOf(\" \");\n\n\tif ( off >= 0 ) {\n\t\tselector = url.slice( off, url.length );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( jQuery.isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax({\n\t\t\turl: url,\n\n\t\t\t// if \"type\" variable is undefined, then \"GET\" method will be used\n\t\t\ttype: type,\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t}).done(function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery(\"<div>\").append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t}).complete( callback && function( jqXHR, status ) {\n\t\t\tself.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t});\n\t}\n\n\treturn this;\n};\n\n// Attach a bunch of functions for handling common AJAX events\njQuery.each( [ \"ajaxStart\", \"ajaxStop\", \"ajaxComplete\", \"ajaxError\", \"ajaxSuccess\", \"ajaxSend\" ], function( i, type ){\n\tjQuery.fn[ type ] = function( fn ){\n\t\treturn this.on( type, fn );\n\t};\n});\n\njQuery.each( [ \"get\", \"post\" ], function( i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\t\t// shift arguments if data argument was omitted\n\t\tif ( jQuery.isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\treturn jQuery.ajax({\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t});\n\t};\n});\n\njQuery.extend({\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: ajaxLocation,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /xml/,\n\t\t\thtml: /html/,\n\t\t\tjson: /json/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": window.String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": jQuery.parseJSON,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar // Cross-domain detection vars\n\t\t\tparts,\n\t\t\t// Loop variable\n\t\t\ti,\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\t\t\t// Response headers as string\n\t\t\tresponseHeadersString,\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\n\t\t\ttransport,\n\t\t\t// Response headers\n\t\t\tresponseHeaders,\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\tjQuery.event,\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks(\"once memory\"),\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\t\t\t// The jqXHR state\n\t\t\tstate = 0,\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( state === 2 ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( (match = rheaders.exec( responseHeadersString )) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[1].toLowerCase() ] = match[ 2 ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match;\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn state === 2 ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tvar lname = name.toLowerCase();\n\t\t\t\t\tif ( !state ) {\n\t\t\t\t\t\tname = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( !state ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( state < 2 ) {\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\t// Lazy-add the new callback in a way that preserves old ones\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR ).complete = completeDeferred.add;\n\t\tjqXHR.success = jqXHR.done;\n\t\tjqXHR.error = jqXHR.fail;\n\n\t\t// Remove hash character (#7531: and string promotion)\n\t\t// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)\n\t\t// Handle falsy url in the settings object (#10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || ajaxLocation ) + \"\" ).replace( rhash, \"\" ).replace( rprotocol, ajaxLocParts[ 1 ] + \"//\" );\n\n\t\t// Alias method option to type as per ticket #12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = jQuery.trim( s.dataType || \"*\" ).toLowerCase().match( core_rnotwhite ) || [\"\"];\n\n\t\t// A cross-domain request is in order when we have a protocol:host:port mismatch\n\t\tif ( s.crossDomain == null ) {\n\t\t\tparts = rurl.exec( s.url.toLowerCase() );\n\t\t\ts.crossDomain = !!( parts &&\n\t\t\t\t( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||\n\t\t\t\t\t( parts[ 3 ] || ( parts[ 1 ] === \"http:\" ? 80 : 443 ) ) !=\n\t\t\t\t\t\t( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === \"http:\" ? 80 : 443 ) ) )\n\t\t\t);\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( state === 2 ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\tfireGlobals = s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger(\"ajaxStart\");\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\tcacheURL = s.url;\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// If data is available, append data to url\n\t\t\tif ( s.data ) {\n\t\t\t\tcacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data );\n\t\t\t\t// #9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add anti-cache in url if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\ts.url = rts.test( cacheURL ) ?\n\n\t\t\t\t\t// If there is already a '_' parameter, set its value\n\t\t\t\t\tcacheURL.replace( rts, \"$1_=\" + ajax_nonce++ ) :\n\n\t\t\t\t\t// Otherwise add one to the end\n\t\t\t\t\tcacheURL + ( ajax_rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ajax_nonce++;\n\t\t\t}\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tfor ( i in { success: 1, error: 1, complete: 1 } ) {\n\t\t\tjqXHR[ i ]( s[ i ] );\n\t\t}\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = setTimeout(function() {\n\t\t\t\t\tjqXHR.abort(\"timeout\");\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tstate = 1;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\t\t\t\t// Propagate exception as error if not done\n\t\t\t\tif ( state < 2 ) {\n\t\t\t\t\tdone( -1, e );\n\t\t\t\t// Simply rethrow otherwise\n\t\t\t\t} else {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Called once\n\t\t\tif ( state === 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// State is \"done\" now\n\t\t\tstate = 2;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\tclearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( status >= 200 && status < 300 || status === 304 ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader(\"Last-Modified\");\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader(\"etag\");\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 ) {\n\t\t\t\t\tisSuccess = true;\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tisSuccess = true;\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tisSuccess = ajaxConvert( s, response );\n\t\t\t\t\tstatusText = isSuccess.state;\n\t\t\t\t\tsuccess = isSuccess.data;\n\t\t\t\t\terror = isSuccess.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We extract error from statusText\n\t\t\t\t// then normalize statusText and status for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger(\"ajaxStop\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t}\n});\n\n/* Handles responses to an ajax request:\n * - sets all responseXXX fields accordingly\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n// Chain conversions given the request and the original response\nfunction ajaxConvert( s, response ) {\n\tvar conv2, current, conv, tmp,\n\t\tconverters = {},\n\t\ti = 0,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ];\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n// Install script dataType\njQuery.ajaxSetup({\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /(?:java|ecma)script/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n});\n\n// Handle cache's special case and global\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t\ts.global = false;\n\t}\n});\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function(s) {\n\n\t// This transport only deals with cross domain requests\n\tif ( s.crossDomain ) {\n\n\t\tvar script,\n\t\t\thead = document.head || jQuery(\"head\")[0] || document.documentElement;\n\n\t\treturn {\n\n\t\t\tsend: function( _, callback ) {\n\n\t\t\t\tscript = document.createElement(\"script\");\n\n\t\t\t\tscript.async = true;\n\n\t\t\t\tif ( s.scriptCharset ) {\n\t\t\t\t\tscript.charset = s.scriptCharset;\n\t\t\t\t}\n\n\t\t\t\tscript.src = s.url;\n\n\t\t\t\t// Attach handlers for all browsers\n\t\t\t\tscript.onload = script.onreadystatechange = function( _, isAbort ) {\n\n\t\t\t\t\tif ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {\n\n\t\t\t\t\t\t// Handle memory leak in IE\n\t\t\t\t\t\tscript.onload = script.onreadystatechange = null;\n\n\t\t\t\t\t\t// Remove the script\n\t\t\t\t\t\tif ( script.parentNode ) {\n\t\t\t\t\t\t\tscript.parentNode.removeChild( script );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Dereference the script\n\t\t\t\t\t\tscript = null;\n\n\t\t\t\t\t\t// Callback if not abort\n\t\t\t\t\t\tif ( !isAbort ) {\n\t\t\t\t\t\t\tcallback( 200, \"success\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\t// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending\n\t\t\t\t// Use native DOM manipulation to avoid our domManip AJAX trickery\n\t\t\t\thead.insertBefore( script, head.firstChild );\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( script ) {\n\t\t\t\t\tscript.onload( undefined, true );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n});\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup({\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( ajax_nonce++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n});\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" && !( s.contentType || \"\" ).indexOf(\"application/x-www-form-urlencoded\") && rjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( ajax_rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[\"script json\"] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always(function() {\n\t\t\t// Restore preexisting value\n\t\t\twindow[ callbackName ] = overwritten;\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\t\t\t\t// make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && jQuery.isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t});\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n});\nvar xhrCallbacks, xhrSupported,\n\txhrId = 0,\n\t// #5280: Internet Explorer will keep connections alive if we don't abort on unload\n\txhrOnUnloadAbort = window.ActiveXObject && function() {\n\t\t// Abort all pending requests\n\t\tvar key;\n\t\tfor ( key in xhrCallbacks ) {\n\t\t\txhrCallbacks[ key ]( undefined, true );\n\t\t}\n\t};\n\n// Functions to create xhrs\nfunction createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch( e ) {}\n}\n\nfunction createActiveXHR() {\n\ttry {\n\t\treturn new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n\t} catch( e ) {}\n}\n\n// Create the request object\n// (This is still attached to ajaxSettings for backward compatibility)\njQuery.ajaxSettings.xhr = window.ActiveXObject ?\n\t/* Microsoft failed to properly\n\t * implement the XMLHttpRequest in IE7 (can't request local files),\n\t * so we use the ActiveXObject when it is available\n\t * Additionally XMLHttpRequest can be disabled in IE7/IE8 so\n\t * we need a fallback.\n\t */\n\tfunction() {\n\t\treturn !this.isLocal && createStandardXHR() || createActiveXHR();\n\t} :\n\t// For all other browsers, use the standard XMLHttpRequest object\n\tcreateStandardXHR;\n\n// Determine support properties\nxhrSupported = jQuery.ajaxSettings.xhr();\njQuery.support.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nxhrSupported = jQuery.support.ajax = !!xhrSupported;\n\n// Create transport if the browser can provide an xhr\nif ( xhrSupported ) {\n\n\tjQuery.ajaxTransport(function( s ) {\n\t\t// Cross domain only allowed if supported through XMLHttpRequest\n\t\tif ( !s.crossDomain || jQuery.support.cors ) {\n\n\t\t\tvar callback;\n\n\t\t\treturn {\n\t\t\t\tsend: function( headers, complete ) {\n\n\t\t\t\t\t// Get a new xhr\n\t\t\t\t\tvar handle, i,\n\t\t\t\t\t\txhr = s.xhr();\n\n\t\t\t\t\t// Open the socket\n\t\t\t\t\t// Passing null username, generates a login popup on Opera (#2865)\n\t\t\t\t\tif ( s.username ) {\n\t\t\t\t\t\txhr.open( s.type, s.url, s.async, s.username, s.password );\n\t\t\t\t\t} else {\n\t\t\t\t\t\txhr.open( s.type, s.url, s.async );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply custom fields if provided\n\t\t\t\t\tif ( s.xhrFields ) {\n\t\t\t\t\t\tfor ( i in s.xhrFields ) {\n\t\t\t\t\t\t\txhr[ i ] = s.xhrFields[ i ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Override mime type if needed\n\t\t\t\t\tif ( s.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\t\txhr.overrideMimeType( s.mimeType );\n\t\t\t\t\t}\n\n\t\t\t\t\t// X-Requested-With header\n\t\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\t\tif ( !s.crossDomain && !headers[\"X-Requested-With\"] ) {\n\t\t\t\t\t\theaders[\"X-Requested-With\"] = \"XMLHttpRequest\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// Need an extra try/catch for cross domain requests in Firefox 3\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch( err ) {}\n\n\t\t\t\t\t// Do send the request\n\t\t\t\t\t// This may raise an exception which is actually\n\t\t\t\t\t// handled in jQuery.ajax (so no try/catch here)\n\t\t\t\t\txhr.send( ( s.hasContent && s.data ) || null );\n\n\t\t\t\t\t// Listener\n\t\t\t\t\tcallback = function( _, isAbort ) {\n\t\t\t\t\t\tvar status, responseHeaders, statusText, responses;\n\n\t\t\t\t\t\t// Firefox throws exceptions when accessing properties\n\t\t\t\t\t\t// of an xhr when a network error occurred\n\t\t\t\t\t\t// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)\n\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\t// Was never called and is aborted or complete\n\t\t\t\t\t\t\tif ( callback && ( isAbort || xhr.readyState === 4 ) ) {\n\n\t\t\t\t\t\t\t\t// Only called once\n\t\t\t\t\t\t\t\tcallback = undefined;\n\n\t\t\t\t\t\t\t\t// Do not keep as active anymore\n\t\t\t\t\t\t\t\tif ( handle ) {\n\t\t\t\t\t\t\t\t\txhr.onreadystatechange = jQuery.noop;\n\t\t\t\t\t\t\t\t\tif ( xhrOnUnloadAbort ) {\n\t\t\t\t\t\t\t\t\t\tdelete xhrCallbacks[ handle ];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// If it's an abort\n\t\t\t\t\t\t\t\tif ( isAbort ) {\n\t\t\t\t\t\t\t\t\t// Abort it manually if needed\n\t\t\t\t\t\t\t\t\tif ( xhr.readyState !== 4 ) {\n\t\t\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tresponses = {};\n\t\t\t\t\t\t\t\t\tstatus = xhr.status;\n\t\t\t\t\t\t\t\t\tresponseHeaders = xhr.getAllResponseHeaders();\n\n\t\t\t\t\t\t\t\t\t// When requesting binary data, IE6-9 will throw an exception\n\t\t\t\t\t\t\t\t\t// on any attempt to access responseText (#11426)\n\t\t\t\t\t\t\t\t\tif ( typeof xhr.responseText === \"string\" ) {\n\t\t\t\t\t\t\t\t\t\tresponses.text = xhr.responseText;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Firefox throws an exception when accessing\n\t\t\t\t\t\t\t\t\t// statusText for faulty cross-domain requests\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tstatusText = xhr.statusText;\n\t\t\t\t\t\t\t\t\t} catch( e ) {\n\t\t\t\t\t\t\t\t\t\t// We normalize with Webkit giving an empty statusText\n\t\t\t\t\t\t\t\t\t\tstatusText = \"\";\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Filter status for non standard behaviors\n\n\t\t\t\t\t\t\t\t\t// If the request is local and we have data: assume a success\n\t\t\t\t\t\t\t\t\t// (success with no data won't get notified, that's the best we\n\t\t\t\t\t\t\t\t\t// can do given current implementations)\n\t\t\t\t\t\t\t\t\tif ( !status && s.isLocal && !s.crossDomain ) {\n\t\t\t\t\t\t\t\t\t\tstatus = responses.text ? 200 : 404;\n\t\t\t\t\t\t\t\t\t// IE - #1450: sometimes returns 1223 when it should be 204\n\t\t\t\t\t\t\t\t\t} else if ( status === 1223 ) {\n\t\t\t\t\t\t\t\t\t\tstatus = 204;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch( firefoxAccessException ) {\n\t\t\t\t\t\t\tif ( !isAbort ) {\n\t\t\t\t\t\t\t\tcomplete( -1, firefoxAccessException );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Call complete if needed\n\t\t\t\t\t\tif ( responses ) {\n\t\t\t\t\t\t\tcomplete( status, statusText, responses, responseHeaders );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tif ( !s.async ) {\n\t\t\t\t\t\t// if we're in sync mode we fire the callback\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t} else if ( xhr.readyState === 4 ) {\n\t\t\t\t\t\t// (IE6 & IE7) if it's in cache and has been\n\t\t\t\t\t\t// retrieved directly we need to fire the callback\n\t\t\t\t\t\tsetTimeout( callback );\n\t\t\t\t\t} else {\n\t\t\t\t\t\thandle = ++xhrId;\n\t\t\t\t\t\tif ( xhrOnUnloadAbort ) {\n\t\t\t\t\t\t\t// Create the active xhrs callbacks list if needed\n\t\t\t\t\t\t\t// and attach the unload handler\n\t\t\t\t\t\t\tif ( !xhrCallbacks ) {\n\t\t\t\t\t\t\t\txhrCallbacks = {};\n\t\t\t\t\t\t\t\tjQuery( window ).unload( xhrOnUnloadAbort );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Add to list of active xhrs callbacks\n\t\t\t\t\t\t\txhrCallbacks[ handle ] = callback;\n\t\t\t\t\t\t}\n\t\t\t\t\t\txhr.onreadystatechange = callback;\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\tabort: function() {\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tcallback( undefined, true );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t});\n}\nvar fxNow, timerId,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trfxnum = new RegExp( \"^(?:([+-])=|)(\" + core_pnum + \")([a-z%]*)$\", \"i\" ),\n\trrun = /queueHooks$/,\n\tanimationPrefilters = [ defaultPrefilter ],\n\ttweeners = {\n\t\t\"*\": [function( prop, value ) {\n\t\t\tvar end, unit,\n\t\t\t\ttween = this.createTween( prop, value ),\n\t\t\t\tparts = rfxnum.exec( value ),\n\t\t\t\ttarget = tween.cur(),\n\t\t\t\tstart = +target || 0,\n\t\t\t\tscale = 1,\n\t\t\t\tmaxIterations = 20;\n\n\t\t\tif ( parts ) {\n\t\t\t\tend = +parts[2];\n\t\t\t\tunit = parts[3] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\n\t\t\t\t// We need to compute starting value\n\t\t\t\tif ( unit !== \"px\" && start ) {\n\t\t\t\t\t// Iteratively approximate from a nonzero starting point\n\t\t\t\t\t// Prefer the current property, because this process will be trivial if it uses the same units\n\t\t\t\t\t// Fallback to end or a simple constant\n\t\t\t\t\tstart = jQuery.css( tween.elem, prop, true ) || end || 1;\n\n\t\t\t\t\tdo {\n\t\t\t\t\t\t// If previous iteration zeroed out, double until we get *something*\n\t\t\t\t\t\t// Use a string for doubling factor so we don't accidentally see scale as unchanged below\n\t\t\t\t\t\tscale = scale || \".5\";\n\n\t\t\t\t\t\t// Adjust and apply\n\t\t\t\t\t\tstart = start / scale;\n\t\t\t\t\t\tjQuery.style( tween.elem, prop, start + unit );\n\n\t\t\t\t\t// Update scale, tolerating zero or NaN from tween.cur()\n\t\t\t\t\t// And breaking the loop if scale is unchanged or perfect, or if we've just had enough\n\t\t\t\t\t} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );\n\t\t\t\t}\n\n\t\t\t\ttween.unit = unit;\n\t\t\t\ttween.start = start;\n\t\t\t\t// If a +=/-= token was provided, we're doing a relative animation\n\t\t\t\ttween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;\n\t\t\t}\n\t\t\treturn tween;\n\t\t}]\n\t};\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\tsetTimeout(function() {\n\t\tfxNow = undefined;\n\t});\n\treturn ( fxNow = jQuery.now() );\n}\n\nfunction createTweens( animation, props ) {\n\tjQuery.each( props, function( prop, value ) {\n\t\tvar collection = ( tweeners[ prop ] || [] ).concat( tweeners[ \"*\" ] ),\n\t\t\tindex = 0,\n\t\t\tlength = collection.length;\n\t\tfor ( ; index < length; index++ ) {\n\t\t\tif ( collection[ index ].call( animation, prop, value ) ) {\n\n\t\t\t\t// we're done with this property\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = animationPrefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\t\t\t// don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t}),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\t\t\t\t// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length ; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ]);\n\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t} else {\n\t\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tanimation = deferred.promise({\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, { specialEasing: {} }, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\t\t\t\t\t// if we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length ; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// resolve when we played the last frame\n\t\t\t\t// otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length ; index++ ) {\n\t\tresult = animationPrefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tcreateTweens( animation, props );\n\n\tif ( jQuery.isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t})\n\t);\n\n\t// attach callbacks from options\n\treturn animation.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar value, name, index, easing, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = jQuery.camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( jQuery.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// not quite $.extend, this wont overwrite keys already present.\n\t\t\t// also - reusing 'index' from above because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweener: function( props, callback ) {\n\t\tif ( jQuery.isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.split(\" \");\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length ; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\ttweeners[ prop ] = tweeners[ prop ] || [];\n\t\t\ttweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tanimationPrefilters.unshift( callback );\n\t\t} else {\n\t\t\tanimationPrefilters.push( callback );\n\t\t}\n\t}\n});\n\nfunction defaultPrefilter( elem, props, opts ) {\n\t/*jshint validthis:true */\n\tvar prop, index, length,\n\t\tvalue, dataShow, toggle,\n\t\ttween, hooks, oldfire,\n\t\tanim = this,\n\t\tstyle = elem.style,\n\t\torig = {},\n\t\thandled = [],\n\t\thidden = elem.nodeType && isHidden( elem );\n\n\t// handle queue: false promises\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always(function() {\n\t\t\t// doing this makes sure that the complete handler will be called\n\t\t\t// before this completes\n\t\t\tanim.always(function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t// height/width overflow pass\n\tif ( elem.nodeType === 1 && ( \"height\" in props || \"width\" in props ) ) {\n\t\t// Make sure that nothing sneaks out\n\t\t// Record all 3 overflow attributes because IE does not\n\t\t// change the overflow attribute when overflowX and\n\t\t// overflowY are set to the same value\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Set display property to inline-block for height/width\n\t\t// animations on inline elements that are having width/height animated\n\t\tif ( jQuery.css( elem, \"display\" ) === \"inline\" &&\n\t\t\t\tjQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\t// inline-level elements accept inline-block;\n\t\t\t// block-level elements need to be inline with layout\n\t\t\tif ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === \"inline\" ) {\n\t\t\t\tstyle.display = \"inline-block\";\n\n\t\t\t} else {\n\t\t\t\tstyle.zoom = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tif ( !jQuery.support.shrinkWrapBlocks ) {\n\t\t\tanim.always(function() {\n\t\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t\t});\n\t\t}\n\t}\n\n\n\t// show/hide pass\n\tfor ( index in props ) {\n\t\tvalue = props[ index ];\n\t\tif ( rfxtypes.exec( value ) ) {\n\t\t\tdelete props[ index ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\thandled.push( index );\n\t\t}\n\t}\n\n\tlength = handled.length;\n\tif ( length ) {\n\t\tdataShow = jQuery._data( elem, \"fxshow\" ) || jQuery._data( elem, \"fxshow\", {} );\n\t\tif ( \"hidden\" in dataShow ) {\n\t\t\thidden = dataShow.hidden;\n\t\t}\n\n\t\t// store state if its toggle - enables .stop().toggle() to \"reverse\"\n\t\tif ( toggle ) {\n\t\t\tdataShow.hidden = !hidden;\n\t\t}\n\t\tif ( hidden ) {\n\t\t\tjQuery( elem ).show();\n\t\t} else {\n\t\t\tanim.done(function() {\n\t\t\t\tjQuery( elem ).hide();\n\t\t\t});\n\t\t}\n\t\tanim.done(function() {\n\t\t\tvar prop;\n\t\t\tjQuery._removeData( elem, \"fxshow\" );\n\t\t\tfor ( prop in orig ) {\n\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t}\n\t\t});\n\t\tfor ( index = 0 ; index < length ; index++ ) {\n\t\t\tprop = handled[ index ];\n\t\t\ttween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );\n\t\t\torig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );\n\n\t\t\tif ( !( prop in dataShow ) ) {\n\t\t\t\tdataShow[ prop ] = tween.start;\n\t\t\t\tif ( hidden ) {\n\t\t\t\t\ttween.end = tween.start;\n\t\t\t\t\ttween.start = prop === \"width\" || prop === \"height\" ? 1 : 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || \"swing\";\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\tif ( tween.elem[ tween.prop ] != null &&\n\t\t\t\t(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails\n\t\t\t// so, simple values such as \"10px\" are parsed to Float.\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\t\t\t// use step hook for back compat - use cssHook if its there - use .style if its\n\t\t\t// available and use plain properties where available\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Remove in 2.0 - this supports IE8's panic based approach\n// to setting things on disconnected nodes\n\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.each([ \"toggle\", \"show\", \"hide\" ], function( i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n});\n\njQuery.fn.extend({\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHidden ).css( \"opacity\", 0 ).show()\n\n\t\t\t// animate to the value specified\n\t\t\t.end().animate({ opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\t\t\t\tdoAnimation.finish = function() {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t};\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || jQuery._data( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\t\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue && type !== false ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = jQuery._data( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// start the next in the queue if the last step wasn't forced\n\t\t\t// timers currently will call their complete callbacks, which will dequeue\n\t\t\t// but only if they were gotoEnd\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t});\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each(function() {\n\t\t\tvar index,\n\t\t\t\tdata = jQuery._data( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.cur && hooks.cur.finish ) {\n\t\t\t\thooks.cur.finish.call( this );\n\t\t\t}\n\n\t\t\t// look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t});\n\t}\n});\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\tattrs = { height: type },\n\t\ti = 0;\n\n\t// if we include width, step value is 1 to do all cssExpand values,\n\t// if we don't include width, step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth? 1 : 0;\n\tfor( ; i < 4 ; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\n// Generate shortcuts for custom animations\njQuery.each({\n\tslideDown: genFx(\"show\"),\n\tslideUp: genFx(\"hide\"),\n\tslideToggle: genFx(\"toggle\"),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n});\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tjQuery.isFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !jQuery.isFunction( easing ) && easing\n\t};\n\n\topt.duration = jQuery.fx.off ? 0 : typeof opt.duration === \"number\" ? opt.duration :\n\t\topt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;\n\n\t// normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( jQuery.isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p*Math.PI ) / 2;\n\t}\n};\n\njQuery.timers = [];\njQuery.fx = Tween.prototype.init;\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ttimers = jQuery.timers,\n\t\ti = 0;\n\n\tfxNow = jQuery.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\t\t// Checks the timer has not already been removed\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tif ( timer() && jQuery.timers.push( timer ) ) {\n\t\tjQuery.fx.start();\n\t}\n};\n\njQuery.fx.interval = 13;\n\njQuery.fx.start = function() {\n\tif ( !timerId ) {\n\t\ttimerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );\n\t}\n};\n\njQuery.fx.stop = function() {\n\tclearInterval( timerId );\n\ttimerId = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\t// Default speed\n\t_default: 400\n};\n\n// Back Compat <1.8 extension point\njQuery.fx.step = {};\n\nif ( jQuery.expr && jQuery.expr.filters ) {\n\tjQuery.expr.filters.animated = function( elem ) {\n\t\treturn jQuery.grep(jQuery.timers, function( fn ) {\n\t\t\treturn elem === fn.elem;\n\t\t}).length;\n\t};\n}\njQuery.fn.offset = function( options ) {\n\tif ( arguments.length ) {\n\t\treturn options === undefined ?\n\t\t\tthis :\n\t\t\tthis.each(function( i ) {\n\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t});\n\t}\n\n\tvar docElem, win,\n\t\tbox = { top: 0, left: 0 },\n\t\telem = this[ 0 ],\n\t\tdoc = elem && elem.ownerDocument;\n\n\tif ( !doc ) {\n\t\treturn;\n\t}\n\n\tdocElem = doc.documentElement;\n\n\t// Make sure it's not a disconnected DOM node\n\tif ( !jQuery.contains( docElem, elem ) ) {\n\t\treturn box;\n\t}\n\n\t// If we don't have gBCR, just use 0,0 rather than error\n\t// BlackBerry 5, iOS 3 (original iPhone)\n\tif ( typeof elem.getBoundingClientRect !== core_strundefined ) {\n\t\tbox = elem.getBoundingClientRect();\n\t}\n\twin = getWindow( doc );\n\treturn {\n\t\ttop: box.top  + ( win.pageYOffset || docElem.scrollTop )  - ( docElem.clientTop  || 0 ),\n\t\tleft: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )\n\t};\n};\n\njQuery.offset = {\n\n\tsetOffset: function( elem, options, i ) {\n\t\tvar position = jQuery.css( elem, \"position\" );\n\n\t\t// set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tvar curElem = jQuery( elem ),\n\t\t\tcurOffset = curElem.offset(),\n\t\t\tcurCSSTop = jQuery.css( elem, \"top\" ),\n\t\t\tcurCSSLeft = jQuery.css( elem, \"left\" ),\n\t\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) && jQuery.inArray(\"auto\", [curCSSTop, curCSSLeft]) > -1,\n\t\t\tprops = {}, curPosition = {}, curTop, curLeft;\n\n\t\t// need to be able to calculate position if either top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( jQuery.isFunction( options ) ) {\n\t\t\toptions = options.call( elem, i, curOffset );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\n\njQuery.fn.extend({\n\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset,\n\t\t\tparentOffset = { top: 0, left: 0 },\n\t\t\telem = this[ 0 ];\n\n\t\t// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\t\t\t// we assume that getBoundingClientRect is available when computed position is fixed\n\t\t\toffset = elem.getBoundingClientRect();\n\t\t} else {\n\t\t\t// Get *real* offsetParent\n\t\t\toffsetParent = this.offsetParent();\n\n\t\t\t// Get correct offsets\n\t\t\toffset = this.offset();\n\t\t\tif ( !jQuery.nodeName( offsetParent[ 0 ], \"html\" ) ) {\n\t\t\t\tparentOffset = offsetParent.offset();\n\t\t\t}\n\n\t\t\t// Add offsetParent borders\n\t\t\tparentOffset.top  += jQuery.css( offsetParent[ 0 ], \"borderTopWidth\", true );\n\t\t\tparentOffset.left += jQuery.css( offsetParent[ 0 ], \"borderLeftWidth\", true );\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\t// note: when an element has margin: auto the offsetLeft and marginLeft\n\t\t// are the same in Safari causing offset.left to incorrectly be 0\n\t\treturn {\n\t\t\ttop:  offset.top  - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true)\n\t\t};\n\t},\n\n\toffsetParent: function() {\n\t\treturn this.map(function() {\n\t\t\tvar offsetParent = this.offsetParent || document.documentElement;\n\t\t\twhile ( offsetParent && ( !jQuery.nodeName( offsetParent, \"html\" ) && jQuery.css( offsetParent, \"position\") === \"static\" ) ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\t\t\treturn offsetParent || document.documentElement;\n\t\t});\n\t}\n});\n\n\n// Create scrollLeft and scrollTop methods\njQuery.each( {scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\"}, function( method, prop ) {\n\tvar top = /Y/.test( prop );\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn jQuery.access( this, function( elem, method, val ) {\n\t\t\tvar win = getWindow( elem );\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? (prop in win) ? win[ prop ] :\n\t\t\t\t\twin.document.documentElement[ method ] :\n\t\t\t\t\telem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : jQuery( win ).scrollLeft(),\n\t\t\t\t\ttop ? val : jQuery( win ).scrollTop()\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length, null );\n\t};\n});\n\nfunction getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ?\n\t\telem :\n\t\telem.nodeType === 9 ?\n\t\t\telem.defaultView || elem.parentWindow :\n\t\t\tfalse;\n}\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name }, function( defaultExtra, funcName ) {\n\t\t// margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn jQuery.access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( jQuery.isWindow( elem ) ) {\n\t\t\t\t\t// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there\n\t\t\t\t\t// isn't a whole lot we can do. See pull request at this URL for discussion:\n\t\t\t\t\t// https://github.com/jquery/jquery/pull/764\n\t\t\t\t\treturn elem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest\n\t\t\t\t\t// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable, null );\n\t\t};\n\t});\n});\n// Limit scope pollution from any deprecated API\n// (function() {\n\n// })();\n// Expose jQuery to the global object\nwindow.jQuery = window.$ = jQuery;\n\n// Expose jQuery as an AMD module, but only for AMD loaders that\n// understand the issues with loading multiple versions of jQuery\n// in a page that all might call define(). The loader will indicate\n// they have special allowances for multiple jQuery versions by\n// specifying define.amd.jQuery = true. Register as a named module,\n// since jQuery can be concatenated with other files that may use define,\n// but not use a proper concatenation script that understands anonymous\n// AMD modules. A named AMD is safest and most robust way to register.\n// Lowercase jquery is used because AMD module names are derived from\n// file names, and jQuery is normally delivered in a lowercase file name.\n// Do this after creating the global so that if an AMD module wants to call\n// noConflict to hide this version of jQuery, it will work.\nif ( typeof define === \"function\" && define.amd && define.amd.jQuery ) {\n\tdefine( \"jquery\", [], function () { return jQuery; } );\n}\n\n})( window );\n"
  },
  {
    "path": "extensions/themes/silverblue/scripts/libraries/jquery-migrate-1.3.0.js",
    "content": "/*!\n * jQuery Migrate - v1.3.0 - 2016-01-13\n * Copyright jQuery Foundation and other contributors\n */\n(function( jQuery, window, undefined ) {\n// See http://bugs.jquery.com/ticket/13335\n// \"use strict\";\n\n\njQuery.migrateVersion = \"1.3.0\";\n\n\nvar warnedAbout = {};\n\n// List of warnings already given; public read only\njQuery.migrateWarnings = [];\n\n// Set to true to prevent console output; migrateWarnings still maintained\n// jQuery.migrateMute = false;\n\n// Show a message on the console so devs know we're active\nif ( !jQuery.migrateMute && window.console && window.console.log ) {\n\twindow.console.log(\"JQMIGRATE: Logging is active\");\n}\n\n// Set to false to disable traces that appear with warnings\nif ( jQuery.migrateTrace === undefined ) {\n\tjQuery.migrateTrace = true;\n}\n\n// Forget any warnings we've already given; public\njQuery.migrateReset = function() {\n\twarnedAbout = {};\n\tjQuery.migrateWarnings.length = 0;\n};\n\nfunction migrateWarn( msg) {\n\tvar console = window.console;\n\tif ( !warnedAbout[ msg ] ) {\n\t\twarnedAbout[ msg ] = true;\n\t\tjQuery.migrateWarnings.push( msg );\n\t\tif ( console && console.warn && !jQuery.migrateMute ) {\n\t\t\tconsole.warn( \"JQMIGRATE: \" + msg );\n\t\t\tif ( jQuery.migrateTrace && console.trace ) {\n\t\t\t\tconsole.trace();\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction migrateWarnProp( obj, prop, value, msg ) {\n\tif ( Object.defineProperty ) {\n\t\t// On ES5 browsers (non-oldIE), warn if the code tries to get prop;\n\t\t// allow property to be overwritten in case some other plugin wants it\n\t\ttry {\n\t\t\tObject.defineProperty( obj, prop, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tget: function() {\n\t\t\t\t\tmigrateWarn( msg );\n\t\t\t\t\treturn value;\n\t\t\t\t},\n\t\t\t\tset: function( newValue ) {\n\t\t\t\t\tmigrateWarn( msg );\n\t\t\t\t\tvalue = newValue;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn;\n\t\t} catch( err ) {\n\t\t\t// IE8 is a dope about Object.defineProperty, can't warn there\n\t\t}\n\t}\n\n\t// Non-ES5 (or broken) browser; just set the property\n\tjQuery._definePropertyBroken = true;\n\tobj[ prop ] = value;\n}\n\nif ( document.compatMode === \"BackCompat\" ) {\n\t// jQuery has never supported or tested Quirks Mode\n\tmigrateWarn( \"jQuery is not compatible with Quirks Mode\" );\n}\n\n\nvar attrFn = jQuery( \"<input/>\", { size: 1 } ).attr(\"size\") && jQuery.attrFn,\n\toldAttr = jQuery.attr,\n\tvalueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||\n\t\tfunction() { return null; },\n\tvalueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||\n\t\tfunction() { return undefined; },\n\trnoType = /^(?:input|button)$/i,\n\trnoAttrNodeType = /^[238]$/,\n\trboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,\n\truseDefault = /^(?:checked|selected)$/i;\n\n// jQuery.attrFn\nmigrateWarnProp( jQuery, \"attrFn\", attrFn || {}, \"jQuery.attrFn is deprecated\" );\n\njQuery.attr = function( elem, name, value, pass ) {\n\tvar lowerName = name.toLowerCase(),\n\t\tnType = elem && elem.nodeType;\n\n\tif ( pass ) {\n\t\t// Since pass is used internally, we only warn for new jQuery\n\t\t// versions where there isn't a pass arg in the formal params\n\t\tif ( oldAttr.length < 4 ) {\n\t\t\tmigrateWarn(\"jQuery.fn.attr( props, pass ) is deprecated\");\n\t\t}\n\t\tif ( elem && !rnoAttrNodeType.test( nType ) &&\n\t\t\t(attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) {\n\t\t\treturn jQuery( elem )[ name ]( value );\n\t\t}\n\t}\n\n\t// Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking\n\t// for disconnected elements we don't warn on $( \"<button>\", { type: \"button\" } ).\n\tif ( name === \"type\" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) {\n\t\tmigrateWarn(\"Can't change the 'type' of an input or button in IE 6/7/8\");\n\t}\n\n\t// Restore boolHook for boolean property/attribute synchronization\n\tif ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) {\n\t\tjQuery.attrHooks[ lowerName ] = {\n\t\t\tget: function( elem, name ) {\n\t\t\t\t// Align boolean attributes with corresponding properties\n\t\t\t\t// Fall back to attribute presence where some booleans are not supported\n\t\t\t\tvar attrNode,\n\t\t\t\t\tproperty = jQuery.prop( elem, name );\n\t\t\t\treturn property === true || typeof property !== \"boolean\" &&\n\t\t\t\t\t( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?\n\n\t\t\t\t\tname.toLowerCase() :\n\t\t\t\t\tundefined;\n\t\t\t},\n\t\t\tset: function( elem, value, name ) {\n\t\t\t\tvar propName;\n\t\t\t\tif ( value === false ) {\n\t\t\t\t\t// Remove boolean attributes when set to false\n\t\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\t} else {\n\t\t\t\t\t// value is true since we know at this point it's type boolean and not false\n\t\t\t\t\t// Set boolean attributes to the same name and set the DOM property\n\t\t\t\t\tpropName = jQuery.propFix[ name ] || name;\n\t\t\t\t\tif ( propName in elem ) {\n\t\t\t\t\t\t// Only set the IDL specifically if it already exists on the element\n\t\t\t\t\t\telem[ propName ] = true;\n\t\t\t\t\t}\n\n\t\t\t\t\telem.setAttribute( name, name.toLowerCase() );\n\t\t\t\t}\n\t\t\t\treturn name;\n\t\t\t}\n\t\t};\n\n\t\t// Warn only for attributes that can remain distinct from their properties post-1.9\n\t\tif ( ruseDefault.test( lowerName ) ) {\n\t\t\tmigrateWarn( \"jQuery.fn.attr('\" + lowerName + \"') might use property instead of attribute\" );\n\t\t}\n\t}\n\n\treturn oldAttr.call( jQuery, elem, name, value );\n};\n\n// attrHooks: value\njQuery.attrHooks.value = {\n\tget: function( elem, name ) {\n\t\tvar nodeName = ( elem.nodeName || \"\" ).toLowerCase();\n\t\tif ( nodeName === \"button\" ) {\n\t\t\treturn valueAttrGet.apply( this, arguments );\n\t\t}\n\t\tif ( nodeName !== \"input\" && nodeName !== \"option\" ) {\n\t\t\tmigrateWarn(\"jQuery.fn.attr('value') no longer gets properties\");\n\t\t}\n\t\treturn name in elem ?\n\t\t\telem.value :\n\t\t\tnull;\n\t},\n\tset: function( elem, value ) {\n\t\tvar nodeName = ( elem.nodeName || \"\" ).toLowerCase();\n\t\tif ( nodeName === \"button\" ) {\n\t\t\treturn valueAttrSet.apply( this, arguments );\n\t\t}\n\t\tif ( nodeName !== \"input\" && nodeName !== \"option\" ) {\n\t\t\tmigrateWarn(\"jQuery.fn.attr('value', val) no longer sets properties\");\n\t\t}\n\t\t// Does not return so that setAttribute is also used\n\t\telem.value = value;\n\t}\n};\n\n\nvar matched, browser,\n\toldInit = jQuery.fn.init,\n\toldParseJSON = jQuery.parseJSON,\n\trspaceAngle = /^\\s*</,\n\t// Note: XSS check is done below after string is trimmed\n\trquickExpr = /^([^<]*)(<[\\w\\W]+>)([^>]*)$/;\n\n// $(html) \"looks like html\" rule change\njQuery.fn.init = function( selector, context, rootjQuery ) {\n\tvar match, ret;\n\n\tif ( selector && typeof selector === \"string\" && !jQuery.isPlainObject( context ) &&\n\t\t\t(match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) {\n\t\t// This is an HTML string according to the \"old\" rules; is it still?\n\t\tif ( !rspaceAngle.test( selector ) ) {\n\t\t\tmigrateWarn(\"$(html) HTML strings must start with '<' character\");\n\t\t}\n\t\tif ( match[ 3 ] ) {\n\t\t\tmigrateWarn(\"$(html) HTML text after last tag is ignored\");\n\t\t}\n\n\t\t// Consistently reject any HTML-like string starting with a hash (#9521)\n\t\t// Note that this may break jQuery 1.6.x code that otherwise would work.\n\t\tif ( match[ 0 ].charAt( 0 ) === \"#\" ) {\n\t\t\tmigrateWarn(\"HTML string cannot start with a '#' character\");\n\t\t\tjQuery.error(\"JQMIGRATE: Invalid selector string (XSS)\");\n\t\t}\n\t\t// Now process using loose rules; let pre-1.8 play too\n\t\tif ( context && context.context ) {\n\t\t\t// jQuery object as context; parseHTML expects a DOM object\n\t\t\tcontext = context.context;\n\t\t}\n\t\tif ( jQuery.parseHTML ) {\n\t\t\treturn oldInit.call( this,\n\t\t\t\t\tjQuery.parseHTML( match[ 2 ], context && context.ownerDocument ||\n\t\t\t\t\t\tcontext || document, true ), context, rootjQuery );\n\t\t}\n\t}\n\n\t// jQuery( \"#\" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0\n\tif ( selector === \"#\" ) {\n\t\tmigrateWarn( \"jQuery( '#' ) is not a valid selector\" );\n\t\tselector = [];\n\t}\n\n\tret = oldInit.apply( this, arguments );\n\n\t// Fill in selector and context properties so .live() works\n\tif ( selector && selector.selector !== undefined ) {\n\t\t// A jQuery object, copy its properties\n\t\tret.selector = selector.selector;\n\t\tret.context = selector.context;\n\n\t} else {\n\t\tret.selector = typeof selector === \"string\" ? selector : \"\";\n\t\tif ( selector ) {\n\t\t\tret.context = selector.nodeType? selector : context || document;\n\t\t}\n\t}\n\n\treturn ret;\n};\njQuery.fn.init.prototype = jQuery.fn;\n\n// Let $.parseJSON(falsy_value) return null\njQuery.parseJSON = function( json ) {\n\tif ( !json ) {\n\t\tmigrateWarn(\"jQuery.parseJSON requires a valid JSON string\");\n\t\treturn null;\n\t}\n\treturn oldParseJSON.apply( this, arguments );\n};\n\njQuery.uaMatch = function( ua ) {\n\tua = ua.toLowerCase();\n\n\tvar match = /(chrome)[ \\/]([\\w.]+)/.exec( ua ) ||\n\t\t/(webkit)[ \\/]([\\w.]+)/.exec( ua ) ||\n\t\t/(opera)(?:.*version|)[ \\/]([\\w.]+)/.exec( ua ) ||\n\t\t/(msie) ([\\w.]+)/.exec( ua ) ||\n\t\tua.indexOf(\"compatible\") < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec( ua ) ||\n\t\t[];\n\n\treturn {\n\t\tbrowser: match[ 1 ] || \"\",\n\t\tversion: match[ 2 ] || \"0\"\n\t};\n};\n\n// Don't clobber any existing jQuery.browser in case it's different\nif ( !jQuery.browser ) {\n\tmatched = jQuery.uaMatch( navigator.userAgent );\n\tbrowser = {};\n\n\tif ( matched.browser ) {\n\t\tbrowser[ matched.browser ] = true;\n\t\tbrowser.version = matched.version;\n\t}\n\n\t// Chrome is Webkit, but Webkit is also Safari.\n\tif ( browser.chrome ) {\n\t\tbrowser.webkit = true;\n\t} else if ( browser.webkit ) {\n\t\tbrowser.safari = true;\n\t}\n\n\tjQuery.browser = browser;\n}\n\n// Warn if the code tries to get jQuery.browser\nmigrateWarnProp( jQuery, \"browser\", jQuery.browser, \"jQuery.browser is deprecated\" );\n\n// jQuery.boxModel deprecated in 1.3, jQuery.support.boxModel deprecated in 1.7\njQuery.boxModel = jQuery.support.boxModel = (document.compatMode === \"CSS1Compat\");\nmigrateWarnProp( jQuery, \"boxModel\", jQuery.boxModel, \"jQuery.boxModel is deprecated\" );\nmigrateWarnProp( jQuery.support, \"boxModel\", jQuery.support.boxModel, \"jQuery.support.boxModel is deprecated\" );\n\njQuery.sub = function() {\n\tfunction jQuerySub( selector, context ) {\n\t\treturn new jQuerySub.fn.init( selector, context );\n\t}\n\tjQuery.extend( true, jQuerySub, this );\n\tjQuerySub.superclass = this;\n\tjQuerySub.fn = jQuerySub.prototype = this();\n\tjQuerySub.fn.constructor = jQuerySub;\n\tjQuerySub.sub = this.sub;\n\tjQuerySub.fn.init = function init( selector, context ) {\n\t\tvar instance = jQuery.fn.init.call( this, selector, context, rootjQuerySub );\n\t\treturn instance instanceof jQuerySub ?\n\t\t\tinstance :\n\t\t\tjQuerySub( instance );\n\t};\n\tjQuerySub.fn.init.prototype = jQuerySub.fn;\n\tvar rootjQuerySub = jQuerySub(document);\n\tmigrateWarn( \"jQuery.sub() is deprecated\" );\n\treturn jQuerySub;\n};\n\n// The number of elements contained in the matched element set\njQuery.fn.size = function() {\n\tmigrateWarn( \"jQuery.fn.size() is deprecated; use the .length property\" );\n\treturn this.length;\n};\n\n\nvar internalSwapCall = false;\n\n// If this version of jQuery has .swap(), don't false-alarm on internal uses\nif ( jQuery.swap ) {\n\tjQuery.each( [ \"height\", \"width\", \"reliableMarginRight\" ], function( _, name ) {\n\t\tvar oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get;\n\n\t\tif ( oldHook ) {\n\t\t\tjQuery.cssHooks[ name ].get = function() {\n\t\t\t\tvar ret;\n\n\t\t\t\tinternalSwapCall = true;\n\t\t\t\tret = oldHook.apply( this, arguments );\n\t\t\t\tinternalSwapCall = false;\n\t\t\t\treturn ret;\n\t\t\t};\n\t\t}\n\t});\n}\n\njQuery.swap = function( elem, options, callback, args ) {\n\tvar ret, name,\n\t\told = {};\n\n\tif ( !internalSwapCall ) {\n\t\tmigrateWarn( \"jQuery.swap() is undocumented and deprecated\" );\n\t}\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.apply( elem, args || [] );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\n// Ensure that $.ajax gets the new parseJSON defined in core.js\njQuery.ajaxSetup({\n\tconverters: {\n\t\t\"text json\": jQuery.parseJSON\n\t}\n});\n\n\nvar oldFnData = jQuery.fn.data;\n\njQuery.fn.data = function( name ) {\n\tvar ret, evt,\n\t\telem = this[0];\n\n\t// Handles 1.7 which has this behavior and 1.8 which doesn't\n\tif ( elem && name === \"events\" && arguments.length === 1 ) {\n\t\tret = jQuery.data( elem, name );\n\t\tevt = jQuery._data( elem, name );\n\t\tif ( ( ret === undefined || ret === evt ) && evt !== undefined ) {\n\t\t\tmigrateWarn(\"Use of jQuery.fn.data('events') is deprecated\");\n\t\t\treturn evt;\n\t\t}\n\t}\n\treturn oldFnData.apply( this, arguments );\n};\n\n\nvar rscriptType = /\\/(java|ecma)script/i;\n\n// Since jQuery.clean is used internally on older versions, we only shim if it's missing\nif ( !jQuery.clean ) {\n\tjQuery.clean = function( elems, context, fragment, scripts ) {\n\t\t// Set context per 1.8 logic\n\t\tcontext = context || document;\n\t\tcontext = !context.nodeType && context[0] || context;\n\t\tcontext = context.ownerDocument || context;\n\n\t\tmigrateWarn(\"jQuery.clean() is deprecated\");\n\n\t\tvar i, elem, handleScript, jsTags,\n\t\t\tret = [];\n\n\t\tjQuery.merge( ret, jQuery.buildFragment( elems, context ).childNodes );\n\n\t\t// Complex logic lifted directly from jQuery 1.8\n\t\tif ( fragment ) {\n\t\t\t// Special handling of each script element\n\t\t\thandleScript = function( elem ) {\n\t\t\t\t// Check if we consider it executable\n\t\t\t\tif ( !elem.type || rscriptType.test( elem.type ) ) {\n\t\t\t\t\t// Detach the script and store it in the scripts array (if provided) or the fragment\n\t\t\t\t\t// Return truthy to indicate that it has been handled\n\t\t\t\t\treturn scripts ?\n\t\t\t\t\t\tscripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :\n\t\t\t\t\t\tfragment.appendChild( elem );\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tfor ( i = 0; (elem = ret[i]) != null; i++ ) {\n\t\t\t\t// Check if we're done after handling an executable script\n\t\t\t\tif ( !( jQuery.nodeName( elem, \"script\" ) && handleScript( elem ) ) ) {\n\t\t\t\t\t// Append to fragment and handle embedded scripts\n\t\t\t\t\tfragment.appendChild( elem );\n\t\t\t\t\tif ( typeof elem.getElementsByTagName !== \"undefined\" ) {\n\t\t\t\t\t\t// handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration\n\t\t\t\t\t\tjsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName(\"script\") ), handleScript );\n\n\t\t\t\t\t\t// Splice the scripts into ret after their former ancestor and advance our index beyond them\n\t\t\t\t\t\tret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );\n\t\t\t\t\t\ti += jsTags.length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t};\n}\n\nvar eventAdd = jQuery.event.add,\n\teventRemove = jQuery.event.remove,\n\teventTrigger = jQuery.event.trigger,\n\toldToggle = jQuery.fn.toggle,\n\toldLive = jQuery.fn.live,\n\toldDie = jQuery.fn.die,\n\toldLoad = jQuery.fn.load,\n\tajaxEvents = \"ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess\",\n\trajaxEvent = new RegExp( \"\\\\b(?:\" + ajaxEvents + \")\\\\b\" ),\n\trhoverHack = /(?:^|\\s)hover(\\.\\S+|)\\b/,\n\thoverHack = function( events ) {\n\t\tif ( typeof( events ) !== \"string\" || jQuery.event.special.hover ) {\n\t\t\treturn events;\n\t\t}\n\t\tif ( rhoverHack.test( events ) ) {\n\t\t\tmigrateWarn(\"'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'\");\n\t\t}\n\t\treturn events && events.replace( rhoverHack, \"mouseenter$1 mouseleave$1\" );\n\t};\n\n// Event props removed in 1.9, put them back if needed; no practical way to warn them\nif ( jQuery.event.props && jQuery.event.props[ 0 ] !== \"attrChange\" ) {\n\tjQuery.event.props.unshift( \"attrChange\", \"attrName\", \"relatedNode\", \"srcElement\" );\n}\n\n// Undocumented jQuery.event.handle was \"deprecated\" in jQuery 1.7\nif ( jQuery.event.dispatch ) {\n\tmigrateWarnProp( jQuery.event, \"handle\", jQuery.event.dispatch, \"jQuery.event.handle is undocumented and deprecated\" );\n}\n\n// Support for 'hover' pseudo-event and ajax event warnings\njQuery.event.add = function( elem, types, handler, data, selector ){\n\tif ( elem !== document && rajaxEvent.test( types ) ) {\n\t\tmigrateWarn( \"AJAX events should be attached to document: \" + types );\n\t}\n\teventAdd.call( this, elem, hoverHack( types || \"\" ), handler, data, selector );\n};\njQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){\n\teventRemove.call( this, elem, hoverHack( types ) || \"\", handler, selector, mappedTypes );\n};\n\njQuery.each( [ \"load\", \"unload\", \"error\" ], function( _, name ) {\n\n\tjQuery.fn[ name ] = function() {\n\t\tvar args = Array.prototype.slice.call( arguments, 0 );\n\t\tmigrateWarn( \"jQuery.fn.\" + name + \"() is deprecated\" );\n\n\t\t// If this is an ajax load() the first arg should be the string URL;\n\t\t// technically this could also be the \"Anything\" arg of the event .load()\n\t\t// which just goes to show why this dumb signature has been deprecated!\n\t\t// jQuery custom builds that exclude the Ajax module justifiably die here.\n\t\tif ( name === \"load\" && typeof arguments[ 0 ] === \"string\" ) {\n\t\t\treturn oldLoad.apply( this, arguments );\n\t\t}\n\n\t\targs.splice( 0, 0, name );\n\t\tif ( arguments.length ) {\n\t\t\treturn this.bind.apply( this, args );\n\t\t}\n\n\t\t// Use .triggerHandler here because:\n\t\t// - load and unload events don't need to bubble, only applied to window or image\n\t\t// - error event should not bubble to window, although it does pre-1.7\n\t\t// See http://bugs.jquery.com/ticket/11820\n\t\tthis.triggerHandler.apply( this, args );\n\t\treturn this;\n\t};\n\n});\n\njQuery.fn.toggle = function( fn, fn2 ) {\n\n\t// Don't mess with animation or css toggles\n\tif ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) {\n\t\treturn oldToggle.apply( this, arguments );\n\t}\n\tmigrateWarn(\"jQuery.fn.toggle(handler, handler...) is deprecated\");\n\n\t// Save reference to arguments for access in closure\n\tvar args = arguments,\n\t\tguid = fn.guid || jQuery.guid++,\n\t\ti = 0,\n\t\ttoggler = function( event ) {\n\t\t\t// Figure out which function to execute\n\t\t\tvar lastToggle = ( jQuery._data( this, \"lastToggle\" + fn.guid ) || 0 ) % i;\n\t\t\tjQuery._data( this, \"lastToggle\" + fn.guid, lastToggle + 1 );\n\n\t\t\t// Make sure that clicks stop\n\t\t\tevent.preventDefault();\n\n\t\t\t// and execute the function\n\t\t\treturn args[ lastToggle ].apply( this, arguments ) || false;\n\t\t};\n\n\t// link all the functions, so any of them can unbind this click handler\n\ttoggler.guid = guid;\n\twhile ( i < args.length ) {\n\t\targs[ i++ ].guid = guid;\n\t}\n\n\treturn this.click( toggler );\n};\n\njQuery.fn.live = function( types, data, fn ) {\n\tmigrateWarn(\"jQuery.fn.live() is deprecated\");\n\tif ( oldLive ) {\n\t\treturn oldLive.apply( this, arguments );\n\t}\n\tjQuery( this.context ).on( types, this.selector, data, fn );\n\treturn this;\n};\n\njQuery.fn.die = function( types, fn ) {\n\tmigrateWarn(\"jQuery.fn.die() is deprecated\");\n\tif ( oldDie ) {\n\t\treturn oldDie.apply( this, arguments );\n\t}\n\tjQuery( this.context ).off( types, this.selector || \"**\", fn );\n\treturn this;\n};\n\n// Turn global events into document-triggered events\njQuery.event.trigger = function( event, data, elem, onlyHandlers  ){\n\tif ( !elem && !rajaxEvent.test( event ) ) {\n\t\tmigrateWarn( \"Global events are undocumented and deprecated\" );\n\t}\n\treturn eventTrigger.call( this,  event, data, elem || document, onlyHandlers  );\n};\njQuery.each( ajaxEvents.split(\"|\"),\n\tfunction( _, name ) {\n\t\tjQuery.event.special[ name ] = {\n\t\t\tsetup: function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\t// The document needs no shimming; must be !== for oldIE\n\t\t\t\tif ( elem !== document ) {\n\t\t\t\t\tjQuery.event.add( document, name + \".\" + jQuery.guid, function() {\n\t\t\t\t\t\tjQuery.event.trigger( name, Array.prototype.slice.call( arguments, 1 ), elem, true );\n\t\t\t\t\t});\n\t\t\t\t\tjQuery._data( this, name, jQuery.guid++ );\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tif ( this !== document ) {\n\t\t\t\t\tjQuery.event.remove( document, name + \".\" + jQuery._data( this, name ) );\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t}\n);\n\njQuery.event.special.ready = {\n\tsetup: function() { migrateWarn( \"'ready' event is deprecated\" ); }\n};\n\nvar oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack,\n\toldFind = jQuery.fn.find;\n\njQuery.fn.andSelf = function() {\n\tmigrateWarn(\"jQuery.fn.andSelf() replaced by jQuery.fn.addBack()\");\n\treturn oldSelf.apply( this, arguments );\n};\n\njQuery.fn.find = function( selector ) {\n\tvar ret = oldFind.apply( this, arguments );\n\tret.context = this.context;\n\tret.selector = this.selector ? this.selector + \" \" + selector : selector;\n\treturn ret;\n};\n\n\n// jQuery 1.6 did not support Callbacks, do not warn there\nif ( jQuery.Callbacks ) {\n\n\tvar oldDeferred = jQuery.Deferred,\n\t\ttuples = [\n\t\t\t// action, add listener, callbacks, .then handlers, final state\n\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"),\n\t\t\t\tjQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"),\n\t\t\t\tjQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\"),\n\t\t\t\tjQuery.Callbacks(\"memory\") ]\n\t\t];\n\n\tjQuery.Deferred = function( func ) {\n\t\tvar deferred = oldDeferred(),\n\t\t\tpromise = deferred.promise();\n\n\t\tdeferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\tvar fns = arguments;\n\n\t\t\tmigrateWarn( \"deferred.pipe() is deprecated\" );\n\n\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\tvar fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];\n\t\t\t\t\t// deferred.done(function() { bind to newDefer or newDefer.resolve })\n\t\t\t\t\t// deferred.fail(function() { bind to newDefer or newDefer.reject })\n\t\t\t\t\t// deferred.progress(function() { bind to newDefer or newDefer.notify })\n\t\t\t\t\tdeferred[ tuple[1] ](function() {\n\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ](\n\t\t\t\t\t\t\t\tthis === promise ? newDefer.promise() : this,\n\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tfns = null;\n\t\t\t}).promise();\n\n\t\t};\n\n\t\tdeferred.isResolved = function() {\n\t\t\tmigrateWarn( \"deferred.isResolved is deprecated\" );\n\t\t\treturn deferred.state() === \"resolved\";\n\t\t};\n\n\t\tdeferred.isRejected = function() {\n\t\t\tmigrateWarn( \"deferred.isRejected is deprecated\" );\n\t\t\treturn deferred.state() === \"rejected\";\n\t\t};\n\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\treturn deferred;\n\t};\n\n}\n\n})( jQuery, window );\n"
  },
  {
    "path": "extensions/themes/silverblue/scripts/libraries/jquery-ui-1.8.22.js",
    "content": "/*! jQuery UI - v1.8.22 - 2012-07-24\n* https://github.com/jquery/jquery-ui\n* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.effects.core.js, jquery.effects.blind.js, jquery.effects.bounce.js, jquery.effects.clip.js, jquery.effects.drop.js, jquery.effects.explode.js, jquery.effects.fade.js, jquery.effects.fold.js, jquery.effects.highlight.js, jquery.effects.pulsate.js, jquery.effects.scale.js, jquery.effects.shake.js, jquery.effects.slide.js, jquery.effects.transfer.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.tabs.js\n* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */\n\n(function( $, undefined ) {\n\n// prevent duplicate loading\n// this is only a problem because we proxy existing functions\n// and we don't want to double proxy them\n$.ui = $.ui || {};\nif ( $.ui.version ) {\n\treturn;\n}\n\n$.extend( $.ui, {\n\tversion: \"1.8.22\",\n\n\tkeyCode: {\n\t\tALT: 18,\n\t\tBACKSPACE: 8,\n\t\tCAPS_LOCK: 20,\n\t\tCOMMA: 188,\n\t\tCOMMAND: 91,\n\t\tCOMMAND_LEFT: 91, // COMMAND\n\t\tCOMMAND_RIGHT: 93,\n\t\tCONTROL: 17,\n\t\tDELETE: 46,\n\t\tDOWN: 40,\n\t\tEND: 35,\n\t\tENTER: 13,\n\t\tESCAPE: 27,\n\t\tHOME: 36,\n\t\tINSERT: 45,\n\t\tLEFT: 37,\n\t\tMENU: 93, // COMMAND_RIGHT\n\t\tNUMPAD_ADD: 107,\n\t\tNUMPAD_DECIMAL: 110,\n\t\tNUMPAD_DIVIDE: 111,\n\t\tNUMPAD_ENTER: 108,\n\t\tNUMPAD_MULTIPLY: 106,\n\t\tNUMPAD_SUBTRACT: 109,\n\t\tPAGE_DOWN: 34,\n\t\tPAGE_UP: 33,\n\t\tPERIOD: 190,\n\t\tRIGHT: 39,\n\t\tSHIFT: 16,\n\t\tSPACE: 32,\n\t\tTAB: 9,\n\t\tUP: 38,\n\t\tWINDOWS: 91 // COMMAND\n\t}\n});\n\n// plugins\n$.fn.extend({\n\tpropAttr: $.fn.prop || $.fn.attr,\n\n\t_focus: $.fn.focus,\n\tfocus: function( delay, fn ) {\n\t\treturn typeof delay === \"number\" ?\n\t\t\tthis.each(function() {\n\t\t\t\tvar elem = this;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t$( elem ).focus();\n\t\t\t\t\tif ( fn ) {\n\t\t\t\t\t\tfn.call( elem );\n\t\t\t\t\t}\n\t\t\t\t}, delay );\n\t\t\t}) :\n\t\t\tthis._focus.apply( this, arguments );\n\t},\n\n\tscrollParent: function() {\n\t\tvar scrollParent;\n\t\tif (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {\n\t\t\tscrollParent = this.parents().filter(function() {\n\t\t\t\treturn (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));\n\t\t\t}).eq(0);\n\t\t} else {\n\t\t\tscrollParent = this.parents().filter(function() {\n\t\t\t\treturn (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));\n\t\t\t}).eq(0);\n\t\t}\n\n\t\treturn (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;\n\t},\n\n\tzIndex: function( zIndex ) {\n\t\tif ( zIndex !== undefined ) {\n\t\t\treturn this.css( \"zIndex\", zIndex );\n\t\t}\n\n\t\tif ( this.length ) {\n\t\t\tvar elem = $( this[ 0 ] ), position, value;\n\t\t\twhile ( elem.length && elem[ 0 ] !== document ) {\n\t\t\t\t// Ignore z-index if position is set to a value where z-index is ignored by the browser\n\t\t\t\t// This makes behavior of this function consistent across browsers\n\t\t\t\t// WebKit always returns auto if the element is positioned\n\t\t\t\tposition = elem.css( \"position\" );\n\t\t\t\tif ( position === \"absolute\" || position === \"relative\" || position === \"fixed\" ) {\n\t\t\t\t\t// IE returns 0 when zIndex is not specified\n\t\t\t\t\t// other browsers return a string\n\t\t\t\t\t// we ignore the case of nested elements with an explicit value of 0\n\t\t\t\t\t// <div style=\"z-index: -10;\"><div style=\"z-index: 0;\"></div></div>\n\t\t\t\t\tvalue = parseInt( elem.css( \"zIndex\" ), 10 );\n\t\t\t\t\tif ( !isNaN( value ) && value !== 0 ) {\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telem = elem.parent();\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t},\n\n\tdisableSelection: function() {\n\t\treturn this.bind( ( $.support.selectstart ? \"selectstart\" : \"mousedown\" ) +\n\t\t\t\".ui-disableSelection\", function( event ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t});\n\t},\n\n\tenableSelection: function() {\n\t\treturn this.unbind( \".ui-disableSelection\" );\n\t}\n});\n\n// support: jQuery <1.8\nif ( !$( \"<a>\" ).outerWidth( 1 ).jquery ) {\n\t$.each( [ \"Width\", \"Height\" ], function( i, name ) {\n\t\tvar side = name === \"Width\" ? [ \"Left\", \"Right\" ] : [ \"Top\", \"Bottom\" ],\n\t\t\ttype = name.toLowerCase(),\n\t\t\torig = {\n\t\t\t\tinnerWidth: $.fn.innerWidth,\n\t\t\t\tinnerHeight: $.fn.innerHeight,\n\t\t\t\touterWidth: $.fn.outerWidth,\n\t\t\t\touterHeight: $.fn.outerHeight\n\t\t\t};\n\n\t\tfunction reduce( elem, size, border, margin ) {\n\t\t\t$.each( side, function() {\n\t\t\t\tsize -= parseFloat( $.curCSS( elem, \"padding\" + this, true) ) || 0;\n\t\t\t\tif ( border ) {\n\t\t\t\t\tsize -= parseFloat( $.curCSS( elem, \"border\" + this + \"Width\", true) ) || 0;\n\t\t\t\t}\n\t\t\t\tif ( margin ) {\n\t\t\t\t\tsize -= parseFloat( $.curCSS( elem, \"margin\" + this, true) ) || 0;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn size;\n\t\t}\n\n\t\t$.fn[ \"inner\" + name ] = function( size ) {\n\t\t\tif ( size === undefined ) {\n\t\t\t\treturn orig[ \"inner\" + name ].call( this );\n\t\t\t}\n\n\t\t\treturn this.each(function() {\n\t\t\t\t$( this ).css( type, reduce( this, size ) + \"px\" );\n\t\t\t});\n\t\t};\n\n\t\t$.fn[ \"outer\" + name] = function( size, margin ) {\n\t\t\tif ( typeof size !== \"number\" ) {\n\t\t\t\treturn orig[ \"outer\" + name ].call( this, size );\n\t\t\t}\n\n\t\t\treturn this.each(function() {\n\t\t\t\t$( this).css( type, reduce( this, size, true, margin ) + \"px\" );\n\t\t\t});\n\t\t};\n\t});\n}\n\n// selectors\nfunction focusable( element, isTabIndexNotNaN ) {\n\tvar nodeName = element.nodeName.toLowerCase();\n\tif ( \"area\" === nodeName ) {\n\t\tvar map = element.parentNode,\n\t\t\tmapName = map.name,\n\t\t\timg;\n\t\tif ( !element.href || !mapName || map.nodeName.toLowerCase() !== \"map\" ) {\n\t\t\treturn false;\n\t\t}\n\t\timg = $( \"img[usemap=#\" + mapName + \"]\" )[0];\n\t\treturn !!img && visible( img );\n\t}\n\treturn ( /input|select|textarea|button|object/.test( nodeName )\n\t\t? !element.disabled\n\t\t: \"a\" == nodeName\n\t\t\t? element.href || isTabIndexNotNaN\n\t\t\t: isTabIndexNotNaN)\n\t\t// the element and all of its ancestors must be visible\n\t\t&& visible( element );\n}\n\nfunction visible( element ) {\n\treturn !$( element ).parents().andSelf().filter(function() {\n\t\treturn $.curCSS( this, \"visibility\" ) === \"hidden\" ||\n\t\t\t$.expr.filters.hidden( this );\n\t}).length;\n}\n\n$.extend( $.expr[ \":\" ], {\n\tdata: $.expr.createPseudo ?\n\t\t$.expr.createPseudo(function( dataName ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn !!$.data( elem, dataName );\n\t\t\t};\n\t\t}) :\n\t\t// support: jQuery <1.8\n\t\tfunction( elem, i, match ) {\n\t\t\treturn !!$.data( elem, match[ 3 ] );\n\t\t},\n\n\tfocusable: function( element ) {\n\t\treturn focusable( element, !isNaN( $.attr( element, \"tabindex\" ) ) );\n\t},\n\n\ttabbable: function( element ) {\n\t\tvar tabIndex = $.attr( element, \"tabindex\" ),\n\t\t\tisTabIndexNaN = isNaN( tabIndex );\n\t\treturn ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );\n\t}\n});\n\n// support\n$(function() {\n\tvar body = document.body,\n\t\tdiv = body.appendChild( div = document.createElement( \"div\" ) );\n\n\t// access offsetHeight before setting the style to prevent a layout bug\n\t// in IE 9 which causes the elemnt to continue to take up space even\n\t// after it is removed from the DOM (#8026)\n\tdiv.offsetHeight;\n\n\t$.extend( div.style, {\n\t\tminHeight: \"100px\",\n\t\theight: \"auto\",\n\t\tpadding: 0,\n\t\tborderWidth: 0\n\t});\n\n\t$.support.minHeight = div.offsetHeight === 100;\n\t$.support.selectstart = \"onselectstart\" in div;\n\n\t// set display to none to avoid a layout bug in IE\n\t// http://dev.jquery.com/ticket/4014\n\tbody.removeChild( div ).style.display = \"none\";\n});\n\n// jQuery <1.4.3 uses curCSS, in 1.4.3 - 1.7.2 curCSS = css, 1.8+ only has css\nif ( !$.curCSS ) {\n\t$.curCSS = $.css;\n}\n\n\n\n\n\n// deprecated\n$.extend( $.ui, {\n\t// $.ui.plugin is deprecated.  Use the proxy pattern instead.\n\tplugin: {\n\t\tadd: function( module, option, set ) {\n\t\t\tvar proto = $.ui[ module ].prototype;\n\t\t\tfor ( var i in set ) {\n\t\t\t\tproto.plugins[ i ] = proto.plugins[ i ] || [];\n\t\t\t\tproto.plugins[ i ].push( [ option, set[ i ] ] );\n\t\t\t}\n\t\t},\n\t\tcall: function( instance, name, args ) {\n\t\t\tvar set = instance.plugins[ name ];\n\t\t\tif ( !set || !instance.element[ 0 ].parentNode ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tfor ( var i = 0; i < set.length; i++ ) {\n\t\t\t\tif ( instance.options[ set[ i ][ 0 ] ] ) {\n\t\t\t\t\tset[ i ][ 1 ].apply( instance.element, args );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t\n\t// will be deprecated when we switch to jQuery 1.4 - use jQuery.contains()\n\tcontains: function( a, b ) {\n\t\treturn document.compareDocumentPosition ?\n\t\t\ta.compareDocumentPosition( b ) & 16 :\n\t\t\ta !== b && a.contains( b );\n\t},\n\t\n\t// only used by resizable\n\thasScroll: function( el, a ) {\n\t\n\t\t//If overflow is hidden, the element might have extra content, but the user wants to hide it\n\t\tif ( $( el ).css( \"overflow\" ) === \"hidden\") {\n\t\t\treturn false;\n\t\t}\n\t\n\t\tvar scroll = ( a && a === \"left\" ) ? \"scrollLeft\" : \"scrollTop\",\n\t\t\thas = false;\n\t\n\t\tif ( el[ scroll ] > 0 ) {\n\t\t\treturn true;\n\t\t}\n\t\n\t\t// TODO: determine which cases actually cause this to happen\n\t\t// if the element doesn't have the scroll set, see if it's possible to\n\t\t// set the scroll\n\t\tel[ scroll ] = 1;\n\t\thas = ( el[ scroll ] > 0 );\n\t\tel[ scroll ] = 0;\n\t\treturn has;\n\t},\n\t\n\t// these are odd functions, fix the API or move into individual plugins\n\tisOverAxis: function( x, reference, size ) {\n\t\t//Determines when x coordinate is over \"b\" element axis\n\t\treturn ( x > reference ) && ( x < ( reference + size ) );\n\t},\n\tisOver: function( y, x, top, left, height, width ) {\n\t\t//Determines when x, y coordinates is over \"b\" element\n\t\treturn $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );\n\t}\n});\n\n})( jQuery );\n\n(function( $, undefined ) {\n\n// jQuery 1.4+\nif ( $.cleanData ) {\n\tvar _cleanData = $.cleanData;\n\t$.cleanData = function( elems ) {\n\t\tfor ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {\n\t\t\ttry {\n\t\t\t\t$( elem ).triggerHandler( \"remove\" );\n\t\t\t// http://bugs.jquery.com/ticket/8235\n\t\t\t} catch( e ) {}\n\t\t}\n\t\t_cleanData( elems );\n\t};\n} else {\n\tvar _remove = $.fn.remove;\n\t$.fn.remove = function( selector, keepData ) {\n\t\treturn this.each(function() {\n\t\t\tif ( !keepData ) {\n\t\t\t\tif ( !selector || $.filter( selector, [ this ] ).length ) {\n\t\t\t\t\t$( \"*\", this ).add( [ this ] ).each(function() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$( this ).triggerHandler( \"remove\" );\n\t\t\t\t\t\t// http://bugs.jquery.com/ticket/8235\n\t\t\t\t\t\t} catch( e ) {}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn _remove.call( $(this), selector, keepData );\n\t\t});\n\t};\n}\n\n$.widget = function( name, base, prototype ) {\n\tvar namespace = name.split( \".\" )[ 0 ],\n\t\tfullName;\n\tname = name.split( \".\" )[ 1 ];\n\tfullName = namespace + \"-\" + name;\n\n\tif ( !prototype ) {\n\t\tprototype = base;\n\t\tbase = $.Widget;\n\t}\n\n\t// create selector for plugin\n\t$.expr[ \":\" ][ fullName ] = function( elem ) {\n\t\treturn !!$.data( elem, name );\n\t};\n\n\t$[ namespace ] = $[ namespace ] || {};\n\t$[ namespace ][ name ] = function( options, element ) {\n\t\t// allow instantiation without initializing for simple inheritance\n\t\tif ( arguments.length ) {\n\t\t\tthis._createWidget( options, element );\n\t\t}\n\t};\n\n\tvar basePrototype = new base();\n\t// we need to make the options hash a property directly on the new instance\n\t// otherwise we'll modify the options hash on the prototype that we're\n\t// inheriting from\n//\t$.each( basePrototype, function( key, val ) {\n//\t\tif ( $.isPlainObject(val) ) {\n//\t\t\tbasePrototype[ key ] = $.extend( {}, val );\n//\t\t}\n//\t});\n\tbasePrototype.options = $.extend( true, {}, basePrototype.options );\n\t$[ namespace ][ name ].prototype = $.extend( true, basePrototype, {\n\t\tnamespace: namespace,\n\t\twidgetName: name,\n\t\twidgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,\n\t\twidgetBaseClass: fullName\n\t}, prototype );\n\n\t$.widget.bridge( name, $[ namespace ][ name ] );\n};\n\n$.widget.bridge = function( name, object ) {\n\t$.fn[ name ] = function( options ) {\n\t\tvar isMethodCall = typeof options === \"string\",\n\t\t\targs = Array.prototype.slice.call( arguments, 1 ),\n\t\t\treturnValue = this;\n\n\t\t// allow multiple hashes to be passed on init\n\t\toptions = !isMethodCall && args.length ?\n\t\t\t$.extend.apply( null, [ true, options ].concat(args) ) :\n\t\t\toptions;\n\n\t\t// prevent calls to internal methods\n\t\tif ( isMethodCall && options.charAt( 0 ) === \"_\" ) {\n\t\t\treturn returnValue;\n\t\t}\n\n\t\tif ( isMethodCall ) {\n\t\t\tthis.each(function() {\n\t\t\t\tvar instance = $.data( this, name ),\n\t\t\t\t\tmethodValue = instance && $.isFunction( instance[options] ) ?\n\t\t\t\t\t\tinstance[ options ].apply( instance, args ) :\n\t\t\t\t\t\tinstance;\n\t\t\t\t// TODO: add this back in 1.9 and use $.error() (see #5972)\n//\t\t\t\tif ( !instance ) {\n//\t\t\t\t\tthrow \"cannot call methods on \" + name + \" prior to initialization; \" +\n//\t\t\t\t\t\t\"attempted to call method '\" + options + \"'\";\n//\t\t\t\t}\n//\t\t\t\tif ( !$.isFunction( instance[options] ) ) {\n//\t\t\t\t\tthrow \"no such method '\" + options + \"' for \" + name + \" widget instance\";\n//\t\t\t\t}\n//\t\t\t\tvar methodValue = instance[ options ].apply( instance, args );\n\t\t\t\tif ( methodValue !== instance && methodValue !== undefined ) {\n\t\t\t\t\treturnValue = methodValue;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tthis.each(function() {\n\t\t\t\tvar instance = $.data( this, name );\n\t\t\t\tif ( instance ) {\n\t\t\t\t\tinstance.option( options || {} )._init();\n\t\t\t\t} else {\n\t\t\t\t\t$.data( this, name, new object( options, this ) );\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn returnValue;\n\t};\n};\n\n$.Widget = function( options, element ) {\n\t// allow instantiation without initializing for simple inheritance\n\tif ( arguments.length ) {\n\t\tthis._createWidget( options, element );\n\t}\n};\n\n$.Widget.prototype = {\n\twidgetName: \"widget\",\n\twidgetEventPrefix: \"\",\n\toptions: {\n\t\tdisabled: false\n\t},\n\t_createWidget: function( options, element ) {\n\t\t// $.widget.bridge stores the plugin instance, but we do it anyway\n\t\t// so that it's stored even before the _create function runs\n\t\t$.data( element, this.widgetName, this );\n\t\tthis.element = $( element );\n\t\tthis.options = $.extend( true, {},\n\t\t\tthis.options,\n\t\t\tthis._getCreateOptions(),\n\t\t\toptions );\n\n\t\tvar self = this;\n\t\tthis.element.bind( \"remove.\" + this.widgetName, function() {\n\t\t\tself.destroy();\n\t\t});\n\n\t\tthis._create();\n\t\tthis._trigger( \"create\" );\n\t\tthis._init();\n\t},\n\t_getCreateOptions: function() {\n\t\treturn $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];\n\t},\n\t_create: function() {},\n\t_init: function() {},\n\n\tdestroy: function() {\n\t\tthis.element\n\t\t\t.unbind( \".\" + this.widgetName )\n\t\t\t.removeData( this.widgetName );\n\t\tthis.widget()\n\t\t\t.unbind( \".\" + this.widgetName )\n\t\t\t.removeAttr( \"aria-disabled\" )\n\t\t\t.removeClass(\n\t\t\t\tthis.widgetBaseClass + \"-disabled \" +\n\t\t\t\t\"ui-state-disabled\" );\n\t},\n\n\twidget: function() {\n\t\treturn this.element;\n\t},\n\n\toption: function( key, value ) {\n\t\tvar options = key;\n\n\t\tif ( arguments.length === 0 ) {\n\t\t\t// don't return a reference to the internal hash\n\t\t\treturn $.extend( {}, this.options );\n\t\t}\n\n\t\tif  (typeof key === \"string\" ) {\n\t\t\tif ( value === undefined ) {\n\t\t\t\treturn this.options[ key ];\n\t\t\t}\n\t\t\toptions = {};\n\t\t\toptions[ key ] = value;\n\t\t}\n\n\t\tthis._setOptions( options );\n\n\t\treturn this;\n\t},\n\t_setOptions: function( options ) {\n\t\tvar self = this;\n\t\t$.each( options, function( key, value ) {\n\t\t\tself._setOption( key, value );\n\t\t});\n\n\t\treturn this;\n\t},\n\t_setOption: function( key, value ) {\n\t\tthis.options[ key ] = value;\n\n\t\tif ( key === \"disabled\" ) {\n\t\t\tthis.widget()\n\t\t\t\t[ value ? \"addClass\" : \"removeClass\"](\n\t\t\t\t\tthis.widgetBaseClass + \"-disabled\" + \" \" +\n\t\t\t\t\t\"ui-state-disabled\" )\n\t\t\t\t.attr( \"aria-disabled\", value );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tenable: function() {\n\t\treturn this._setOption( \"disabled\", false );\n\t},\n\tdisable: function() {\n\t\treturn this._setOption( \"disabled\", true );\n\t},\n\n\t_trigger: function( type, event, data ) {\n\t\tvar prop, orig,\n\t\t\tcallback = this.options[ type ];\n\n\t\tdata = data || {};\n\t\tevent = $.Event( event );\n\t\tevent.type = ( type === this.widgetEventPrefix ?\n\t\t\ttype :\n\t\t\tthis.widgetEventPrefix + type ).toLowerCase();\n\t\t// the original event may come from any element\n\t\t// so we need to reset the target on the new event\n\t\tevent.target = this.element[ 0 ];\n\n\t\t// copy original event properties over to the new event\n\t\torig = event.originalEvent;\n\t\tif ( orig ) {\n\t\t\tfor ( prop in orig ) {\n\t\t\t\tif ( !( prop in event ) ) {\n\t\t\t\t\tevent[ prop ] = orig[ prop ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.element.trigger( event, data );\n\n\t\treturn !( $.isFunction(callback) &&\n\t\t\tcallback.call( this.element[0], event, data ) === false ||\n\t\t\tevent.isDefaultPrevented() );\n\t}\n};\n\n})( jQuery );\n\n(function( $, undefined ) {\n\nvar mouseHandled = false;\n$( document ).mouseup( function( e ) {\n\tmouseHandled = false;\n});\n\n$.widget(\"ui.mouse\", {\n\toptions: {\n\t\tcancel: ':input,option',\n\t\tdistance: 1,\n\t\tdelay: 0\n\t},\n\t_mouseInit: function() {\n\t\tvar self = this;\n\n\t\tthis.element\n\t\t\t.bind('mousedown.'+this.widgetName, function(event) {\n\t\t\t\treturn self._mouseDown(event);\n\t\t\t})\n\t\t\t.bind('click.'+this.widgetName, function(event) {\n\t\t\t\tif (true === $.data(event.target, self.widgetName + '.preventClickEvent')) {\n\t\t\t\t    $.removeData(event.target, self.widgetName + '.preventClickEvent');\n\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\n\t\tthis.started = false;\n\t},\n\n\t// TODO: make sure destroying one instance of mouse doesn't mess with\n\t// other instances of mouse\n\t_mouseDestroy: function() {\n\t\tthis.element.unbind('.'+this.widgetName);\n\t\t$(document)\n\t\t\t.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)\n\t\t\t.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);\n\t},\n\n\t_mouseDown: function(event) {\n\t\t// don't let more than one widget handle mouseStart\n\t\tif( mouseHandled ) { return };\n\n\t\t// we may have missed mouseup (out of window)\n\t\t(this._mouseStarted && this._mouseUp(event));\n\n\t\tthis._mouseDownEvent = event;\n\n\t\tvar self = this,\n\t\t\tbtnIsLeft = (event.which == 1),\n\t\t\t// event.target.nodeName works around a bug in IE 8 with\n\t\t\t// disabled inputs (#7620)\n\t\t\telIsCancel = (typeof this.options.cancel == \"string\" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);\n\t\tif (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.mouseDelayMet = !this.options.delay;\n\t\tif (!this.mouseDelayMet) {\n\t\t\tthis._mouseDelayTimer = setTimeout(function() {\n\t\t\t\tself.mouseDelayMet = true;\n\t\t\t}, this.options.delay);\n\t\t}\n\n\t\tif (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {\n\t\t\tthis._mouseStarted = (this._mouseStart(event) !== false);\n\t\t\tif (!this._mouseStarted) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// Click event may never have fired (Gecko & Opera)\n\t\tif (true === $.data(event.target, this.widgetName + '.preventClickEvent')) {\n\t\t\t$.removeData(event.target, this.widgetName + '.preventClickEvent');\n\t\t}\n\n\t\t// these delegates are required to keep context\n\t\tthis._mouseMoveDelegate = function(event) {\n\t\t\treturn self._mouseMove(event);\n\t\t};\n\t\tthis._mouseUpDelegate = function(event) {\n\t\t\treturn self._mouseUp(event);\n\t\t};\n\t\t$(document)\n\t\t\t.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)\n\t\t\t.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);\n\n\t\tevent.preventDefault();\n\t\t\n\t\tmouseHandled = true;\n\t\treturn true;\n\t},\n\n\t_mouseMove: function(event) {\n\t\t// IE mouseup check - mouseup happened when mouse was out of window\n\t\tif ($.browser.msie && !(document.documentMode >= 9) && !event.button) {\n\t\t\treturn this._mouseUp(event);\n\t\t}\n\n\t\tif (this._mouseStarted) {\n\t\t\tthis._mouseDrag(event);\n\t\t\treturn event.preventDefault();\n\t\t}\n\n\t\tif (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {\n\t\t\tthis._mouseStarted =\n\t\t\t\t(this._mouseStart(this._mouseDownEvent, event) !== false);\n\t\t\t(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));\n\t\t}\n\n\t\treturn !this._mouseStarted;\n\t},\n\n\t_mouseUp: function(event) {\n\t\t$(document)\n\t\t\t.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)\n\t\t\t.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);\n\n\t\tif (this._mouseStarted) {\n\t\t\tthis._mouseStarted = false;\n\n\t\t\tif (event.target == this._mouseDownEvent.target) {\n\t\t\t    $.data(event.target, this.widgetName + '.preventClickEvent', true);\n\t\t\t}\n\n\t\t\tthis._mouseStop(event);\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t_mouseDistanceMet: function(event) {\n\t\treturn (Math.max(\n\t\t\t\tMath.abs(this._mouseDownEvent.pageX - event.pageX),\n\t\t\t\tMath.abs(this._mouseDownEvent.pageY - event.pageY)\n\t\t\t) >= this.options.distance\n\t\t);\n\t},\n\n\t_mouseDelayMet: function(event) {\n\t\treturn this.mouseDelayMet;\n\t},\n\n\t// These are placeholder methods, to be overriden by extending plugin\n\t_mouseStart: function(event) {},\n\t_mouseDrag: function(event) {},\n\t_mouseStop: function(event) {},\n\t_mouseCapture: function(event) { return true; }\n});\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.widget(\"ui.draggable\", $.ui.mouse, {\n\twidgetEventPrefix: \"drag\",\n\toptions: {\n\t\taddClasses: true,\n\t\tappendTo: \"parent\",\n\t\taxis: false,\n\t\tconnectToSortable: false,\n\t\tcontainment: false,\n\t\tcursor: \"auto\",\n\t\tcursorAt: false,\n\t\tgrid: false,\n\t\thandle: false,\n\t\thelper: \"original\",\n\t\tiframeFix: false,\n\t\topacity: false,\n\t\trefreshPositions: false,\n\t\trevert: false,\n\t\trevertDuration: 500,\n\t\tscope: \"default\",\n\t\tscroll: true,\n\t\tscrollSensitivity: 20,\n\t\tscrollSpeed: 20,\n\t\tsnap: false,\n\t\tsnapMode: \"both\",\n\t\tsnapTolerance: 20,\n\t\tstack: false,\n\t\tzIndex: false\n\t},\n\t_create: function() {\n\n\t\tif (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css(\"position\")))\n\t\t\tthis.element[0].style.position = 'relative';\n\n\t\t(this.options.addClasses && this.element.addClass(\"ui-draggable\"));\n\t\t(this.options.disabled && this.element.addClass(\"ui-draggable-disabled\"));\n\n\t\tthis._mouseInit();\n\n\t},\n\n\tdestroy: function() {\n\t\tif(!this.element.data('draggable')) return;\n\t\tthis.element\n\t\t\t.removeData(\"draggable\")\n\t\t\t.unbind(\".draggable\")\n\t\t\t.removeClass(\"ui-draggable\"\n\t\t\t\t+ \" ui-draggable-dragging\"\n\t\t\t\t+ \" ui-draggable-disabled\");\n\t\tthis._mouseDestroy();\n\n\t\treturn this;\n\t},\n\n\t_mouseCapture: function(event) {\n\n\t\tvar o = this.options;\n\n\t\t// among others, prevent a drag on a resizable-handle\n\t\tif (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))\n\t\t\treturn false;\n\n\t\t//Quit if we're not on a valid handle\n\t\tthis.handle = this._getHandle(event);\n\t\tif (!this.handle)\n\t\t\treturn false;\n\t\t\n\t\tif ( o.iframeFix ) {\n\t\t\t$(o.iframeFix === true ? \"iframe\" : o.iframeFix).each(function() {\n\t\t\t\t$('<div class=\"ui-draggable-iframeFix\" style=\"background: #fff;\"></div>')\n\t\t\t\t.css({\n\t\t\t\t\twidth: this.offsetWidth+\"px\", height: this.offsetHeight+\"px\",\n\t\t\t\t\tposition: \"absolute\", opacity: \"0.001\", zIndex: 1000\n\t\t\t\t})\n\t\t\t\t.css($(this).offset())\n\t\t\t\t.appendTo(\"body\");\n\t\t\t});\n\t\t}\n\n\t\treturn true;\n\n\t},\n\n\t_mouseStart: function(event) {\n\n\t\tvar o = this.options;\n\n\t\t//Create and append the visible helper\n\t\tthis.helper = this._createHelper(event);\n\n\t\tthis.helper.addClass(\"ui-draggable-dragging\");\n\n\t\t//Cache the helper size\n\t\tthis._cacheHelperProportions();\n\n\t\t//If ddmanager is used for droppables, set the global draggable\n\t\tif($.ui.ddmanager)\n\t\t\t$.ui.ddmanager.current = this;\n\n\t\t/*\n\t\t * - Position generation -\n\t\t * This block generates everything position related - it's the core of draggables.\n\t\t */\n\n\t\t//Cache the margins of the original element\n\t\tthis._cacheMargins();\n\n\t\t//Store the helper's css position\n\t\tthis.cssPosition = this.helper.css(\"position\");\n\t\tthis.scrollParent = this.helper.scrollParent();\n\n\t\t//The element's absolute position on the page minus margins\n\t\tthis.offset = this.positionAbs = this.element.offset();\n\t\tthis.offset = {\n\t\t\ttop: this.offset.top - this.margins.top,\n\t\t\tleft: this.offset.left - this.margins.left\n\t\t};\n\n\t\t$.extend(this.offset, {\n\t\t\tclick: { //Where the click happened, relative to the element\n\t\t\t\tleft: event.pageX - this.offset.left,\n\t\t\t\ttop: event.pageY - this.offset.top\n\t\t\t},\n\t\t\tparent: this._getParentOffset(),\n\t\t\trelative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper\n\t\t});\n\n\t\t//Generate the original position\n\t\tthis.originalPosition = this.position = this._generatePosition(event);\n\t\tthis.originalPageX = event.pageX;\n\t\tthis.originalPageY = event.pageY;\n\n\t\t//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied\n\t\t(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));\n\n\t\t//Set a containment if given in the options\n\t\tif(o.containment)\n\t\t\tthis._setContainment();\n\n\t\t//Trigger event + callbacks\n\t\tif(this._trigger(\"start\", event) === false) {\n\t\t\tthis._clear();\n\t\t\treturn false;\n\t\t}\n\n\t\t//Recache the helper size\n\t\tthis._cacheHelperProportions();\n\n\t\t//Prepare the droppable offsets\n\t\tif ($.ui.ddmanager && !o.dropBehaviour)\n\t\t\t$.ui.ddmanager.prepareOffsets(this, event);\n\n\t\t\n\t\tthis._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position\n\t\t\n\t\t//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)\n\t\tif ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event);\n\t\t\n\t\treturn true;\n\t},\n\n\t_mouseDrag: function(event, noPropagation) {\n\n\t\t//Compute the helpers position\n\t\tthis.position = this._generatePosition(event);\n\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\n\n\t\t//Call plugins and callbacks and use the resulting position if something is returned\n\t\tif (!noPropagation) {\n\t\t\tvar ui = this._uiHash();\n\t\t\tif(this._trigger('drag', event, ui) === false) {\n\t\t\t\tthis._mouseUp({});\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis.position = ui.position;\n\t\t}\n\n\t\tif(!this.options.axis || this.options.axis != \"y\") this.helper[0].style.left = this.position.left+'px';\n\t\tif(!this.options.axis || this.options.axis != \"x\") this.helper[0].style.top = this.position.top+'px';\n\t\tif($.ui.ddmanager) $.ui.ddmanager.drag(this, event);\n\n\t\treturn false;\n\t},\n\n\t_mouseStop: function(event) {\n\n\t\t//If we are using droppables, inform the manager about the drop\n\t\tvar dropped = false;\n\t\tif ($.ui.ddmanager && !this.options.dropBehaviour)\n\t\t\tdropped = $.ui.ddmanager.drop(this, event);\n\n\t\t//if a drop comes from outside (a sortable)\n\t\tif(this.dropped) {\n\t\t\tdropped = this.dropped;\n\t\t\tthis.dropped = false;\n\t\t}\n\t\t\n\t\t//if the original element is no longer in the DOM don't bother to continue (see #8269)\n\t\tvar element = this.element[0], elementInDom = false;\n\t\twhile ( element && (element = element.parentNode) ) {\n\t\t\tif (element == document ) {\n\t\t\t\telementInDom = true;\n\t\t\t}\n\t\t}\n\t\tif ( !elementInDom && this.options.helper === \"original\" )\n\t\t\treturn false;\n\n\t\tif((this.options.revert == \"invalid\" && !dropped) || (this.options.revert == \"valid\" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {\n\t\t\tvar self = this;\n\t\t\t$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {\n\t\t\t\tif(self._trigger(\"stop\", event) !== false) {\n\t\t\t\t\tself._clear();\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tif(this._trigger(\"stop\", event) !== false) {\n\t\t\t\tthis._clear();\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t},\n\t\n\t_mouseUp: function(event) {\n\t\tif (this.options.iframeFix === true) {\n\t\t\t$(\"div.ui-draggable-iframeFix\").each(function() { \n\t\t\t\tthis.parentNode.removeChild(this); \n\t\t\t}); //Remove frame helpers\n\t\t}\n\t\t\n\t\t//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)\n\t\tif( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event);\n\t\t\n\t\treturn $.ui.mouse.prototype._mouseUp.call(this, event);\n\t},\n\t\n\tcancel: function() {\n\t\t\n\t\tif(this.helper.is(\".ui-draggable-dragging\")) {\n\t\t\tthis._mouseUp({});\n\t\t} else {\n\t\t\tthis._clear();\n\t\t}\n\t\t\n\t\treturn this;\n\t\t\n\t},\n\n\t_getHandle: function(event) {\n\n\t\tvar handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;\n\t\t$(this.options.handle, this.element)\n\t\t\t.find(\"*\")\n\t\t\t.andSelf()\n\t\t\t.each(function() {\n\t\t\t\tif(this == event.target) handle = true;\n\t\t\t});\n\n\t\treturn handle;\n\n\t},\n\n\t_createHelper: function(event) {\n\n\t\tvar o = this.options;\n\t\tvar helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element);\n\n\t\tif(!helper.parents('body').length)\n\t\t\thelper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));\n\n\t\tif(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css(\"position\")))\n\t\t\thelper.css(\"position\", \"absolute\");\n\n\t\treturn helper;\n\n\t},\n\n\t_adjustOffsetFromHelper: function(obj) {\n\t\tif (typeof obj == 'string') {\n\t\t\tobj = obj.split(' ');\n\t\t}\n\t\tif ($.isArray(obj)) {\n\t\t\tobj = {left: +obj[0], top: +obj[1] || 0};\n\t\t}\n\t\tif ('left' in obj) {\n\t\t\tthis.offset.click.left = obj.left + this.margins.left;\n\t\t}\n\t\tif ('right' in obj) {\n\t\t\tthis.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;\n\t\t}\n\t\tif ('top' in obj) {\n\t\t\tthis.offset.click.top = obj.top + this.margins.top;\n\t\t}\n\t\tif ('bottom' in obj) {\n\t\t\tthis.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;\n\t\t}\n\t},\n\n\t_getParentOffset: function() {\n\n\t\t//Get the offsetParent and cache its position\n\t\tthis.offsetParent = this.helper.offsetParent();\n\t\tvar po = this.offsetParent.offset();\n\n\t\t// This is a special case where we need to modify a offset calculated on start, since the following happened:\n\t\t// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent\n\t\t// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that\n\t\t//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag\n\t\tif(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {\n\t\t\tpo.left += this.scrollParent.scrollLeft();\n\t\t\tpo.top += this.scrollParent.scrollTop();\n\t\t}\n\n\t\tif((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information\n\t\t|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix\n\t\t\tpo = { top: 0, left: 0 };\n\n\t\treturn {\n\t\t\ttop: po.top + (parseInt(this.offsetParent.css(\"borderTopWidth\"),10) || 0),\n\t\t\tleft: po.left + (parseInt(this.offsetParent.css(\"borderLeftWidth\"),10) || 0)\n\t\t};\n\n\t},\n\n\t_getRelativeOffset: function() {\n\n\t\tif(this.cssPosition == \"relative\") {\n\t\t\tvar p = this.element.position();\n\t\t\treturn {\n\t\t\t\ttop: p.top - (parseInt(this.helper.css(\"top\"),10) || 0) + this.scrollParent.scrollTop(),\n\t\t\t\tleft: p.left - (parseInt(this.helper.css(\"left\"),10) || 0) + this.scrollParent.scrollLeft()\n\t\t\t};\n\t\t} else {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t},\n\n\t_cacheMargins: function() {\n\t\tthis.margins = {\n\t\t\tleft: (parseInt(this.element.css(\"marginLeft\"),10) || 0),\n\t\t\ttop: (parseInt(this.element.css(\"marginTop\"),10) || 0),\n\t\t\tright: (parseInt(this.element.css(\"marginRight\"),10) || 0),\n\t\t\tbottom: (parseInt(this.element.css(\"marginBottom\"),10) || 0)\n\t\t};\n\t},\n\n\t_cacheHelperProportions: function() {\n\t\tthis.helperProportions = {\n\t\t\twidth: this.helper.outerWidth(),\n\t\t\theight: this.helper.outerHeight()\n\t\t};\n\t},\n\n\t_setContainment: function() {\n\n\t\tvar o = this.options;\n\t\tif(o.containment == 'parent') o.containment = this.helper[0].parentNode;\n\t\tif(o.containment == 'document' || o.containment == 'window') this.containment = [\n\t\t\to.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left,\n\t\t\to.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,\n\t\t\t(o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,\n\t\t\t(o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top\n\t\t];\n\n\t\tif(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {\n\t\t        var c = $(o.containment);\n\t\t\tvar ce = c[0]; if(!ce) return;\n\t\t\tvar co = c.offset();\n\t\t\tvar over = ($(ce).css(\"overflow\") != 'hidden');\n\n\t\t\tthis.containment = [\n\t\t\t\t(parseInt($(ce).css(\"borderLeftWidth\"),10) || 0) + (parseInt($(ce).css(\"paddingLeft\"),10) || 0),\n\t\t\t\t(parseInt($(ce).css(\"borderTopWidth\"),10) || 0) + (parseInt($(ce).css(\"paddingTop\"),10) || 0),\n\t\t\t\t(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css(\"borderLeftWidth\"),10) || 0) - (parseInt($(ce).css(\"paddingRight\"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right,\n\t\t\t\t(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css(\"borderTopWidth\"),10) || 0) - (parseInt($(ce).css(\"paddingBottom\"),10) || 0) - this.helperProportions.height - this.margins.top  - this.margins.bottom\n\t\t\t];\n\t\t\tthis.relative_container = c;\n\n\t\t} else if(o.containment.constructor == Array) {\n\t\t\tthis.containment = o.containment;\n\t\t}\n\n\t},\n\n\t_convertPositionTo: function(d, pos) {\n\n\t\tif(!pos) pos = this.position;\n\t\tvar mod = d == \"absolute\" ? 1 : -1;\n\t\tvar o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);\n\n\t\treturn {\n\t\t\ttop: (\n\t\t\t\tpos.top\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t+ this.offset.relative.top * mod\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t+ this.offset.parent.top * mod\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t- ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)\n\t\t\t),\n\t\t\tleft: (\n\t\t\t\tpos.left\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t+ this.offset.relative.left * mod\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t+ this.offset.parent.left * mod\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t- ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)\n\t\t\t)\n\t\t};\n\n\t},\n\n\t_generatePosition: function(event) {\n\n\t\tvar o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);\n\t\tvar pageX = event.pageX;\n\t\tvar pageY = event.pageY;\n\n\t\t/*\n\t\t * - Position constraining -\n\t\t * Constrain the position to a mix of grid, containment.\n\t\t */\n\n\t\tif(this.originalPosition) { //If we are not dragging yet, we won't check for options\n\t\t         var containment;\n\t\t         if(this.containment) {\n\t\t\t\t if (this.relative_container){\n\t\t\t\t     var co = this.relative_container.offset();\n\t\t\t\t     containment = [ this.containment[0] + co.left,\n\t\t\t\t\t\t     this.containment[1] + co.top,\n\t\t\t\t\t\t     this.containment[2] + co.left,\n\t\t\t\t\t\t     this.containment[3] + co.top ];\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t     containment = this.containment;\n\t\t\t\t }\n\n\t\t\t\tif(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left;\n\t\t\t\tif(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top;\n\t\t\t\tif(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left;\n\t\t\t\tif(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top;\n\t\t\t}\n\n\t\t\tif(o.grid) {\n\t\t\t\t//Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)\n\t\t\t\tvar top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;\n\t\t\t\tpageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;\n\n\t\t\t\tvar left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;\n\t\t\t\tpageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\t\t\ttop: (\n\t\t\t\tpageY\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t- this.offset.click.top\t\t\t\t\t\t\t\t\t\t\t\t\t// Click offset (relative to the element)\n\t\t\t\t- this.offset.relative.top\t\t\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t- this.offset.parent.top\t\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t+ ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))\n\t\t\t),\n\t\t\tleft: (\n\t\t\t\tpageX\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t- this.offset.click.left\t\t\t\t\t\t\t\t\t\t\t\t// Click offset (relative to the element)\n\t\t\t\t- this.offset.relative.left\t\t\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t- this.offset.parent.left\t\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t+ ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))\n\t\t\t)\n\t\t};\n\n\t},\n\n\t_clear: function() {\n\t\tthis.helper.removeClass(\"ui-draggable-dragging\");\n\t\tif(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();\n\t\t//if($.ui.ddmanager) $.ui.ddmanager.current = null;\n\t\tthis.helper = null;\n\t\tthis.cancelHelperRemoval = false;\n\t},\n\n\t// From now on bulk stuff - mainly helpers\n\n\t_trigger: function(type, event, ui) {\n\t\tui = ui || this._uiHash();\n\t\t$.ui.plugin.call(this, type, [event, ui]);\n\t\tif(type == \"drag\") this.positionAbs = this._convertPositionTo(\"absolute\"); //The absolute position has to be recalculated after plugins\n\t\treturn $.Widget.prototype._trigger.call(this, type, event, ui);\n\t},\n\n\tplugins: {},\n\n\t_uiHash: function(event) {\n\t\treturn {\n\t\t\thelper: this.helper,\n\t\t\tposition: this.position,\n\t\t\toriginalPosition: this.originalPosition,\n\t\t\toffset: this.positionAbs\n\t\t};\n\t}\n\n});\n\n$.extend($.ui.draggable, {\n\tversion: \"1.8.22\"\n});\n\n$.ui.plugin.add(\"draggable\", \"connectToSortable\", {\n\tstart: function(event, ui) {\n\n\t\tvar inst = $(this).data(\"draggable\"), o = inst.options,\n\t\t\tuiSortable = $.extend({}, ui, { item: inst.element });\n\t\tinst.sortables = [];\n\t\t$(o.connectToSortable).each(function() {\n\t\t\tvar sortable = $.data(this, 'sortable');\n\t\t\tif (sortable && !sortable.options.disabled) {\n\t\t\t\tinst.sortables.push({\n\t\t\t\t\tinstance: sortable,\n\t\t\t\t\tshouldRevert: sortable.options.revert\n\t\t\t\t});\n\t\t\t\tsortable.refreshPositions();\t// Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).\n\t\t\t\tsortable._trigger(\"activate\", event, uiSortable);\n\t\t\t}\n\t\t});\n\n\t},\n\tstop: function(event, ui) {\n\n\t\t//If we are still over the sortable, we fake the stop event of the sortable, but also remove helper\n\t\tvar inst = $(this).data(\"draggable\"),\n\t\t\tuiSortable = $.extend({}, ui, { item: inst.element });\n\n\t\t$.each(inst.sortables, function() {\n\t\t\tif(this.instance.isOver) {\n\n\t\t\t\tthis.instance.isOver = 0;\n\n\t\t\t\tinst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance\n\t\t\t\tthis.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)\n\n\t\t\t\t//The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'\n\t\t\t\tif(this.shouldRevert) this.instance.options.revert = true;\n\n\t\t\t\t//Trigger the stop of the sortable\n\t\t\t\tthis.instance._mouseStop(event);\n\n\t\t\t\tthis.instance.options.helper = this.instance.options._helper;\n\n\t\t\t\t//If the helper has been the original item, restore properties in the sortable\n\t\t\t\tif(inst.options.helper == 'original')\n\t\t\t\t\tthis.instance.currentItem.css({ top: 'auto', left: 'auto' });\n\n\t\t\t} else {\n\t\t\t\tthis.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance\n\t\t\t\tthis.instance._trigger(\"deactivate\", event, uiSortable);\n\t\t\t}\n\n\t\t});\n\n\t},\n\tdrag: function(event, ui) {\n\n\t\tvar inst = $(this).data(\"draggable\"), self = this;\n\n\t\tvar checkPos = function(o) {\n\t\t\tvar dyClick = this.offset.click.top, dxClick = this.offset.click.left;\n\t\t\tvar helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;\n\t\t\tvar itemHeight = o.height, itemWidth = o.width;\n\t\t\tvar itemTop = o.top, itemLeft = o.left;\n\n\t\t\treturn $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);\n\t\t};\n\n\t\t$.each(inst.sortables, function(i) {\n\t\t\t\n\t\t\t//Copy over some variables to allow calling the sortable's native _intersectsWith\n\t\t\tthis.instance.positionAbs = inst.positionAbs;\n\t\t\tthis.instance.helperProportions = inst.helperProportions;\n\t\t\tthis.instance.offset.click = inst.offset.click;\n\t\t\t\n\t\t\tif(this.instance._intersectsWith(this.instance.containerCache)) {\n\n\t\t\t\t//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once\n\t\t\t\tif(!this.instance.isOver) {\n\n\t\t\t\t\tthis.instance.isOver = 1;\n\t\t\t\t\t//Now we fake the start of dragging for the sortable instance,\n\t\t\t\t\t//by cloning the list group item, appending it to the sortable and using it as inst.currentItem\n\t\t\t\t\t//We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)\n\t\t\t\t\tthis.instance.currentItem = $(self).clone().removeAttr('id').appendTo(this.instance.element).data(\"sortable-item\", true);\n\t\t\t\t\tthis.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it\n\t\t\t\t\tthis.instance.options.helper = function() { return ui.helper[0]; };\n\n\t\t\t\t\tevent.target = this.instance.currentItem[0];\n\t\t\t\t\tthis.instance._mouseCapture(event, true);\n\t\t\t\t\tthis.instance._mouseStart(event, true, true);\n\n\t\t\t\t\t//Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes\n\t\t\t\t\tthis.instance.offset.click.top = inst.offset.click.top;\n\t\t\t\t\tthis.instance.offset.click.left = inst.offset.click.left;\n\t\t\t\t\tthis.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;\n\t\t\t\t\tthis.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;\n\n\t\t\t\t\tinst._trigger(\"toSortable\", event);\n\t\t\t\t\tinst.dropped = this.instance.element; //draggable revert needs that\n\t\t\t\t\t//hack so receive/update callbacks work (mostly)\n\t\t\t\t\tinst.currentItem = inst.element;\n\t\t\t\t\tthis.instance.fromOutside = inst;\n\n\t\t\t\t}\n\n\t\t\t\t//Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable\n\t\t\t\tif(this.instance.currentItem) this.instance._mouseDrag(event);\n\n\t\t\t} else {\n\n\t\t\t\t//If it doesn't intersect with the sortable, and it intersected before,\n\t\t\t\t//we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval\n\t\t\t\tif(this.instance.isOver) {\n\n\t\t\t\t\tthis.instance.isOver = 0;\n\t\t\t\t\tthis.instance.cancelHelperRemoval = true;\n\t\t\t\t\t\n\t\t\t\t\t//Prevent reverting on this forced stop\n\t\t\t\t\tthis.instance.options.revert = false;\n\t\t\t\t\t\n\t\t\t\t\t// The out event needs to be triggered independently\n\t\t\t\t\tthis.instance._trigger('out', event, this.instance._uiHash(this.instance));\n\t\t\t\t\t\n\t\t\t\t\tthis.instance._mouseStop(event, true);\n\t\t\t\t\tthis.instance.options.helper = this.instance.options._helper;\n\n\t\t\t\t\t//Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size\n\t\t\t\t\tthis.instance.currentItem.remove();\n\t\t\t\t\tif(this.instance.placeholder) this.instance.placeholder.remove();\n\n\t\t\t\t\tinst._trigger(\"fromSortable\", event);\n\t\t\t\t\tinst.dropped = false; //draggable revert needs that\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t});\n\n\t}\n});\n\n$.ui.plugin.add(\"draggable\", \"cursor\", {\n\tstart: function(event, ui) {\n\t\tvar t = $('body'), o = $(this).data('draggable').options;\n\t\tif (t.css(\"cursor\")) o._cursor = t.css(\"cursor\");\n\t\tt.css(\"cursor\", o.cursor);\n\t},\n\tstop: function(event, ui) {\n\t\tvar o = $(this).data('draggable').options;\n\t\tif (o._cursor) $('body').css(\"cursor\", o._cursor);\n\t}\n});\n\n$.ui.plugin.add(\"draggable\", \"opacity\", {\n\tstart: function(event, ui) {\n\t\tvar t = $(ui.helper), o = $(this).data('draggable').options;\n\t\tif(t.css(\"opacity\")) o._opacity = t.css(\"opacity\");\n\t\tt.css('opacity', o.opacity);\n\t},\n\tstop: function(event, ui) {\n\t\tvar o = $(this).data('draggable').options;\n\t\tif(o._opacity) $(ui.helper).css('opacity', o._opacity);\n\t}\n});\n\n$.ui.plugin.add(\"draggable\", \"scroll\", {\n\tstart: function(event, ui) {\n\t\tvar i = $(this).data(\"draggable\");\n\t\tif(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();\n\t},\n\tdrag: function(event, ui) {\n\n\t\tvar i = $(this).data(\"draggable\"), o = i.options, scrolled = false;\n\n\t\tif(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {\n\n\t\t\tif(!o.axis || o.axis != 'x') {\n\t\t\t\tif((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)\n\t\t\t\t\ti.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;\n\t\t\t\telse if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)\n\t\t\t\t\ti.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;\n\t\t\t}\n\n\t\t\tif(!o.axis || o.axis != 'y') {\n\t\t\t\tif((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)\n\t\t\t\t\ti.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;\n\t\t\t\telse if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)\n\t\t\t\t\ti.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif(!o.axis || o.axis != 'x') {\n\t\t\t\tif(event.pageY - $(document).scrollTop() < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);\n\t\t\t\telse if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);\n\t\t\t}\n\n\t\t\tif(!o.axis || o.axis != 'y') {\n\t\t\t\tif(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);\n\t\t\t\telse if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);\n\t\t\t}\n\n\t\t}\n\n\t\tif(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)\n\t\t\t$.ui.ddmanager.prepareOffsets(i, event);\n\n\t}\n});\n\n$.ui.plugin.add(\"draggable\", \"snap\", {\n\tstart: function(event, ui) {\n\n\t\tvar i = $(this).data(\"draggable\"), o = i.options;\n\t\ti.snapElements = [];\n\n\t\t$(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {\n\t\t\tvar $t = $(this); var $o = $t.offset();\n\t\t\tif(this != i.element[0]) i.snapElements.push({\n\t\t\t\titem: this,\n\t\t\t\twidth: $t.outerWidth(), height: $t.outerHeight(),\n\t\t\t\ttop: $o.top, left: $o.left\n\t\t\t});\n\t\t});\n\n\t},\n\tdrag: function(event, ui) {\n\n\t\tvar inst = $(this).data(\"draggable\"), o = inst.options;\n\t\tvar d = o.snapTolerance;\n\n\t\tvar x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,\n\t\t\ty1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;\n\n\t\tfor (var i = inst.snapElements.length - 1; i >= 0; i--){\n\n\t\t\tvar l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,\n\t\t\t\tt = inst.snapElements[i].top, b = t + inst.snapElements[i].height;\n\n\t\t\t//Yes, I know, this is insane ;)\n\t\t\tif(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {\n\t\t\t\tif(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));\n\t\t\t\tinst.snapElements[i].snapping = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(o.snapMode != 'inner') {\n\t\t\t\tvar ts = Math.abs(t - y2) <= d;\n\t\t\t\tvar bs = Math.abs(b - y1) <= d;\n\t\t\t\tvar ls = Math.abs(l - x2) <= d;\n\t\t\t\tvar rs = Math.abs(r - x1) <= d;\n\t\t\t\tif(ts) ui.position.top = inst._convertPositionTo(\"relative\", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;\n\t\t\t\tif(bs) ui.position.top = inst._convertPositionTo(\"relative\", { top: b, left: 0 }).top - inst.margins.top;\n\t\t\t\tif(ls) ui.position.left = inst._convertPositionTo(\"relative\", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;\n\t\t\t\tif(rs) ui.position.left = inst._convertPositionTo(\"relative\", { top: 0, left: r }).left - inst.margins.left;\n\t\t\t}\n\n\t\t\tvar first = (ts || bs || ls || rs);\n\n\t\t\tif(o.snapMode != 'outer') {\n\t\t\t\tvar ts = Math.abs(t - y1) <= d;\n\t\t\t\tvar bs = Math.abs(b - y2) <= d;\n\t\t\t\tvar ls = Math.abs(l - x1) <= d;\n\t\t\t\tvar rs = Math.abs(r - x2) <= d;\n\t\t\t\tif(ts) ui.position.top = inst._convertPositionTo(\"relative\", { top: t, left: 0 }).top - inst.margins.top;\n\t\t\t\tif(bs) ui.position.top = inst._convertPositionTo(\"relative\", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;\n\t\t\t\tif(ls) ui.position.left = inst._convertPositionTo(\"relative\", { top: 0, left: l }).left - inst.margins.left;\n\t\t\t\tif(rs) ui.position.left = inst._convertPositionTo(\"relative\", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;\n\t\t\t}\n\n\t\t\tif(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))\n\t\t\t\t(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));\n\t\t\tinst.snapElements[i].snapping = (ts || bs || ls || rs || first);\n\n\t\t};\n\n\t}\n});\n\n$.ui.plugin.add(\"draggable\", \"stack\", {\n\tstart: function(event, ui) {\n\n\t\tvar o = $(this).data(\"draggable\").options;\n\n\t\tvar group = $.makeArray($(o.stack)).sort(function(a,b) {\n\t\t\treturn (parseInt($(a).css(\"zIndex\"),10) || 0) - (parseInt($(b).css(\"zIndex\"),10) || 0);\n\t\t});\n\t\tif (!group.length) { return; }\n\t\t\n\t\tvar min = parseInt(group[0].style.zIndex) || 0;\n\t\t$(group).each(function(i) {\n\t\t\tthis.style.zIndex = min + i;\n\t\t});\n\n\t\tthis[0].style.zIndex = min + group.length;\n\n\t}\n});\n\n$.ui.plugin.add(\"draggable\", \"zIndex\", {\n\tstart: function(event, ui) {\n\t\tvar t = $(ui.helper), o = $(this).data(\"draggable\").options;\n\t\tif(t.css(\"zIndex\")) o._zIndex = t.css(\"zIndex\");\n\t\tt.css('zIndex', o.zIndex);\n\t},\n\tstop: function(event, ui) {\n\t\tvar o = $(this).data(\"draggable\").options;\n\t\tif(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);\n\t}\n});\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.widget(\"ui.droppable\", {\n\twidgetEventPrefix: \"drop\",\n\toptions: {\n\t\taccept: '*',\n\t\tactiveClass: false,\n\t\taddClasses: true,\n\t\tgreedy: false,\n\t\thoverClass: false,\n\t\tscope: 'default',\n\t\ttolerance: 'intersect'\n\t},\n\t_create: function() {\n\n\t\tvar o = this.options, accept = o.accept;\n\t\tthis.isover = 0; this.isout = 1;\n\n\t\tthis.accept = $.isFunction(accept) ? accept : function(d) {\n\t\t\treturn d.is(accept);\n\t\t};\n\n\t\t//Store the droppable's proportions\n\t\tthis.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };\n\n\t\t// Add the reference and positions to the manager\n\t\t$.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || [];\n\t\t$.ui.ddmanager.droppables[o.scope].push(this);\n\n\t\t(o.addClasses && this.element.addClass(\"ui-droppable\"));\n\n\t},\n\n\tdestroy: function() {\n\t\tvar drop = $.ui.ddmanager.droppables[this.options.scope];\n\t\tfor ( var i = 0; i < drop.length; i++ )\n\t\t\tif ( drop[i] == this )\n\t\t\t\tdrop.splice(i, 1);\n\n\t\tthis.element\n\t\t\t.removeClass(\"ui-droppable ui-droppable-disabled\")\n\t\t\t.removeData(\"droppable\")\n\t\t\t.unbind(\".droppable\");\n\n\t\treturn this;\n\t},\n\n\t_setOption: function(key, value) {\n\n\t\tif(key == 'accept') {\n\t\t\tthis.accept = $.isFunction(value) ? value : function(d) {\n\t\t\t\treturn d.is(value);\n\t\t\t};\n\t\t}\n\t\t$.Widget.prototype._setOption.apply(this, arguments);\n\t},\n\n\t_activate: function(event) {\n\t\tvar draggable = $.ui.ddmanager.current;\n\t\tif(this.options.activeClass) this.element.addClass(this.options.activeClass);\n\t\t(draggable && this._trigger('activate', event, this.ui(draggable)));\n\t},\n\n\t_deactivate: function(event) {\n\t\tvar draggable = $.ui.ddmanager.current;\n\t\tif(this.options.activeClass) this.element.removeClass(this.options.activeClass);\n\t\t(draggable && this._trigger('deactivate', event, this.ui(draggable)));\n\t},\n\n\t_over: function(event) {\n\n\t\tvar draggable = $.ui.ddmanager.current;\n\t\tif (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element\n\n\t\tif (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {\n\t\t\tif(this.options.hoverClass) this.element.addClass(this.options.hoverClass);\n\t\t\tthis._trigger('over', event, this.ui(draggable));\n\t\t}\n\n\t},\n\n\t_out: function(event) {\n\n\t\tvar draggable = $.ui.ddmanager.current;\n\t\tif (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element\n\n\t\tif (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {\n\t\t\tif(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);\n\t\t\tthis._trigger('out', event, this.ui(draggable));\n\t\t}\n\n\t},\n\n\t_drop: function(event,custom) {\n\n\t\tvar draggable = custom || $.ui.ddmanager.current;\n\t\tif (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element\n\n\t\tvar childrenIntersection = false;\n\t\tthis.element.find(\":data(droppable)\").not(\".ui-draggable-dragging\").each(function() {\n\t\t\tvar inst = $.data(this, 'droppable');\n\t\t\tif(\n\t\t\t\tinst.options.greedy\n\t\t\t\t&& !inst.options.disabled\n\t\t\t\t&& inst.options.scope == draggable.options.scope\n\t\t\t\t&& inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element))\n\t\t\t\t&& $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)\n\t\t\t) { childrenIntersection = true; return false; }\n\t\t});\n\t\tif(childrenIntersection) return false;\n\n\t\tif(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {\n\t\t\tif(this.options.activeClass) this.element.removeClass(this.options.activeClass);\n\t\t\tif(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);\n\t\t\tthis._trigger('drop', event, this.ui(draggable));\n\t\t\treturn this.element;\n\t\t}\n\n\t\treturn false;\n\n\t},\n\n\tui: function(c) {\n\t\treturn {\n\t\t\tdraggable: (c.currentItem || c.element),\n\t\t\thelper: c.helper,\n\t\t\tposition: c.position,\n\t\t\toffset: c.positionAbs\n\t\t};\n\t}\n\n});\n\n$.extend($.ui.droppable, {\n\tversion: \"1.8.22\"\n});\n\n$.ui.intersect = function(draggable, droppable, toleranceMode) {\n\n\tif (!droppable.offset) return false;\n\n\tvar x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,\n\t\ty1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;\n\tvar l = droppable.offset.left, r = l + droppable.proportions.width,\n\t\tt = droppable.offset.top, b = t + droppable.proportions.height;\n\n\tswitch (toleranceMode) {\n\t\tcase 'fit':\n\t\t\treturn (l <= x1 && x2 <= r\n\t\t\t\t&& t <= y1 && y2 <= b);\n\t\t\tbreak;\n\t\tcase 'intersect':\n\t\t\treturn (l < x1 + (draggable.helperProportions.width / 2) // Right Half\n\t\t\t\t&& x2 - (draggable.helperProportions.width / 2) < r // Left Half\n\t\t\t\t&& t < y1 + (draggable.helperProportions.height / 2) // Bottom Half\n\t\t\t\t&& y2 - (draggable.helperProportions.height / 2) < b ); // Top Half\n\t\t\tbreak;\n\t\tcase 'pointer':\n\t\t\tvar draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),\n\t\t\t\tdraggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),\n\t\t\t\tisOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);\n\t\t\treturn isOver;\n\t\t\tbreak;\n\t\tcase 'touch':\n\t\t\treturn (\n\t\t\t\t\t(y1 >= t && y1 <= b) ||\t// Top edge touching\n\t\t\t\t\t(y2 >= t && y2 <= b) ||\t// Bottom edge touching\n\t\t\t\t\t(y1 < t && y2 > b)\t\t// Surrounded vertically\n\t\t\t\t) && (\n\t\t\t\t\t(x1 >= l && x1 <= r) ||\t// Left edge touching\n\t\t\t\t\t(x2 >= l && x2 <= r) ||\t// Right edge touching\n\t\t\t\t\t(x1 < l && x2 > r)\t\t// Surrounded horizontally\n\t\t\t\t);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn false;\n\t\t\tbreak;\n\t\t}\n\n};\n\n/*\n\tThis manager tracks offsets of draggables and droppables\n*/\n$.ui.ddmanager = {\n\tcurrent: null,\n\tdroppables: { 'default': [] },\n\tprepareOffsets: function(t, event) {\n\n\t\tvar m = $.ui.ddmanager.droppables[t.options.scope] || [];\n\t\tvar type = event ? event.type : null; // workaround for #2317\n\t\tvar list = (t.currentItem || t.element).find(\":data(droppable)\").andSelf();\n\n\t\tdroppablesLoop: for (var i = 0; i < m.length; i++) {\n\n\t\t\tif(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue;\t//No disabled and non-accepted\n\t\t\tfor (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item\n\t\t\tm[i].visible = m[i].element.css(\"display\") != \"none\"; if(!m[i].visible) continue; \t\t\t\t\t\t\t\t\t//If the element is not visible, continue\n\n\t\t\tif(type == \"mousedown\") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables\n\n\t\t\tm[i].offset = m[i].element.offset();\n\t\t\tm[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };\n\n\t\t}\n\n\t},\n\tdrop: function(draggable, event) {\n\n\t\tvar dropped = false;\n\t\t$.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {\n\n\t\t\tif(!this.options) return;\n\t\t\tif (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))\n\t\t\t\tdropped = this._drop.call(this, event) || dropped;\n\n\t\t\tif (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {\n\t\t\t\tthis.isout = 1; this.isover = 0;\n\t\t\t\tthis._deactivate.call(this, event);\n\t\t\t}\n\n\t\t});\n\t\treturn dropped;\n\n\t},\n\tdragStart: function( draggable, event ) {\n\t\t//Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)\n\t\tdraggable.element.parents( \":not(body,html)\" ).bind( \"scroll.droppable\", function() {\n\t\t\tif( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event );\n\t\t});\n\t},\n\tdrag: function(draggable, event) {\n\n\t\t//If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.\n\t\tif(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);\n\n\t\t//Run through all droppables and check their positions based on specific tolerance options\n\t\t$.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {\n\n\t\t\tif(this.options.disabled || this.greedyChild || !this.visible) return;\n\t\t\tvar intersects = $.ui.intersect(draggable, this, this.options.tolerance);\n\n\t\t\tvar c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);\n\t\t\tif(!c) return;\n\n\t\t\tvar parentInstance;\n\t\t\tif (this.options.greedy) {\n\t\t\t\tvar parent = this.element.parents(':data(droppable):eq(0)');\n\t\t\t\tif (parent.length) {\n\t\t\t\t\tparentInstance = $.data(parent[0], 'droppable');\n\t\t\t\t\tparentInstance.greedyChild = (c == 'isover' ? 1 : 0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// we just moved into a greedy child\n\t\t\tif (parentInstance && c == 'isover') {\n\t\t\t\tparentInstance['isover'] = 0;\n\t\t\t\tparentInstance['isout'] = 1;\n\t\t\t\tparentInstance._out.call(parentInstance, event);\n\t\t\t}\n\n\t\t\tthis[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;\n\t\t\tthis[c == \"isover\" ? \"_over\" : \"_out\"].call(this, event);\n\n\t\t\t// we just moved out of a greedy child\n\t\t\tif (parentInstance && c == 'isout') {\n\t\t\t\tparentInstance['isout'] = 0;\n\t\t\t\tparentInstance['isover'] = 1;\n\t\t\t\tparentInstance._over.call(parentInstance, event);\n\t\t\t}\n\t\t});\n\n\t},\n\tdragStop: function( draggable, event ) {\n\t\tdraggable.element.parents( \":not(body,html)\" ).unbind( \"scroll.droppable\" );\n\t\t//Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)\n\t\tif( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event );\n\t}\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.widget(\"ui.resizable\", $.ui.mouse, {\n\twidgetEventPrefix: \"resize\",\n\toptions: {\n\t\talsoResize: false,\n\t\tanimate: false,\n\t\tanimateDuration: \"slow\",\n\t\tanimateEasing: \"swing\",\n\t\taspectRatio: false,\n\t\tautoHide: false,\n\t\tcontainment: false,\n\t\tghost: false,\n\t\tgrid: false,\n\t\thandles: \"e,s,se\",\n\t\thelper: false,\n\t\tmaxHeight: null,\n\t\tmaxWidth: null,\n\t\tminHeight: 10,\n\t\tminWidth: 10,\n\t\tzIndex: 1000\n\t},\n\t_create: function() {\n\n\t\tvar self = this, o = this.options;\n\t\tthis.element.addClass(\"ui-resizable\");\n\n\t\t$.extend(this, {\n\t\t\t_aspectRatio: !!(o.aspectRatio),\n\t\t\taspectRatio: o.aspectRatio,\n\t\t\toriginalElement: this.element,\n\t\t\t_proportionallyResizeElements: [],\n\t\t\t_helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null\n\t\t});\n\n\t\t//Wrap the element if it cannot hold child nodes\n\t\tif(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {\n\n\t\t\t//Create a wrapper element and set the wrapper to the new current internal element\n\t\t\tthis.element.wrap(\n\t\t\t\t$('<div class=\"ui-wrapper\" style=\"overflow: hidden;\"></div>').css({\n\t\t\t\t\tposition: this.element.css('position'),\n\t\t\t\t\twidth: this.element.outerWidth(),\n\t\t\t\t\theight: this.element.outerHeight(),\n\t\t\t\t\ttop: this.element.css('top'),\n\t\t\t\t\tleft: this.element.css('left')\n\t\t\t\t})\n\t\t\t);\n\n\t\t\t//Overwrite the original this.element\n\t\t\tthis.element = this.element.parent().data(\n\t\t\t\t\"resizable\", this.element.data('resizable')\n\t\t\t);\n\n\t\t\tthis.elementIsWrapper = true;\n\n\t\t\t//Move margins to the wrapper\n\t\t\tthis.element.css({ marginLeft: this.originalElement.css(\"marginLeft\"), marginTop: this.originalElement.css(\"marginTop\"), marginRight: this.originalElement.css(\"marginRight\"), marginBottom: this.originalElement.css(\"marginBottom\") });\n\t\t\tthis.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});\n\n\t\t\t//Prevent Safari textarea resize\n\t\t\tthis.originalResizeStyle = this.originalElement.css('resize');\n\t\t\tthis.originalElement.css('resize', 'none');\n\n\t\t\t//Push the actual element to our proportionallyResize internal array\n\t\t\tthis._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));\n\n\t\t\t// avoid IE jump (hard set the margin)\n\t\t\tthis.originalElement.css({ margin: this.originalElement.css('margin') });\n\n\t\t\t// fix handlers offset\n\t\t\tthis._proportionallyResize();\n\n\t\t}\n\n\t\tthis.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? \"e,s,se\" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' });\n\t\tif(this.handles.constructor == String) {\n\n\t\t\tif(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';\n\t\t\tvar n = this.handles.split(\",\"); this.handles = {};\n\n\t\t\tfor(var i = 0; i < n.length; i++) {\n\n\t\t\t\tvar handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;\n\t\t\t\tvar axis = $('<div class=\"ui-resizable-handle ' + hname + '\"></div>');\n\n\t\t\t\t// Apply zIndex to all handles - see #7960\n\t\t\t\taxis.css({ zIndex: o.zIndex });\n\n\t\t\t\t//TODO : What's going on here?\n\t\t\t\tif ('se' == handle) {\n\t\t\t\t\taxis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');\n\t\t\t\t};\n\n\t\t\t\t//Insert into internal handles object and append to element\n\t\t\t\tthis.handles[handle] = '.ui-resizable-'+handle;\n\t\t\t\tthis.element.append(axis);\n\t\t\t}\n\n\t\t}\n\n\t\tthis._renderAxis = function(target) {\n\n\t\t\ttarget = target || this.element;\n\n\t\t\tfor(var i in this.handles) {\n\n\t\t\t\tif(this.handles[i].constructor == String)\n\t\t\t\t\tthis.handles[i] = $(this.handles[i], this.element).show();\n\n\t\t\t\t//Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)\n\t\t\t\tif (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {\n\n\t\t\t\t\tvar axis = $(this.handles[i], this.element), padWrapper = 0;\n\n\t\t\t\t\t//Checking the correct pad and border\n\t\t\t\t\tpadWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();\n\n\t\t\t\t\t//The padding type i have to apply...\n\t\t\t\t\tvar padPos = [ 'padding',\n\t\t\t\t\t\t/ne|nw|n/.test(i) ? 'Top' :\n\t\t\t\t\t\t/se|sw|s/.test(i) ? 'Bottom' :\n\t\t\t\t\t\t/^e$/.test(i) ? 'Right' : 'Left' ].join(\"\");\n\n\t\t\t\t\ttarget.css(padPos, padWrapper);\n\n\t\t\t\t\tthis._proportionallyResize();\n\n\t\t\t\t}\n\n\t\t\t\t//TODO: What's that good for? There's not anything to be executed left\n\t\t\t\tif(!$(this.handles[i]).length)\n\t\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t};\n\n\t\t//TODO: make renderAxis a prototype function\n\t\tthis._renderAxis(this.element);\n\n\t\tthis._handles = $('.ui-resizable-handle', this.element)\n\t\t\t.disableSelection();\n\n\t\t//Matching axis name\n\t\tthis._handles.mouseover(function() {\n\t\t\tif (!self.resizing) {\n\t\t\t\tif (this.className)\n\t\t\t\t\tvar axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);\n\t\t\t\t//Axis, default = se\n\t\t\t\tself.axis = axis && axis[1] ? axis[1] : 'se';\n\t\t\t}\n\t\t});\n\n\t\t//If we want to auto hide the elements\n\t\tif (o.autoHide) {\n\t\t\tthis._handles.hide();\n\t\t\t$(this.element)\n\t\t\t\t.addClass(\"ui-resizable-autohide\")\n\t\t\t\t.hover(function() {\n\t\t\t\t\tif (o.disabled) return;\n\t\t\t\t\t$(this).removeClass(\"ui-resizable-autohide\");\n\t\t\t\t\tself._handles.show();\n\t\t\t\t},\n\t\t\t\tfunction(){\n\t\t\t\t\tif (o.disabled) return;\n\t\t\t\t\tif (!self.resizing) {\n\t\t\t\t\t\t$(this).addClass(\"ui-resizable-autohide\");\n\t\t\t\t\t\tself._handles.hide();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t\t//Initialize the mouse interaction\n\t\tthis._mouseInit();\n\n\t},\n\n\tdestroy: function() {\n\n\t\tthis._mouseDestroy();\n\n\t\tvar _destroy = function(exp) {\n\t\t\t$(exp).removeClass(\"ui-resizable ui-resizable-disabled ui-resizable-resizing\")\n\t\t\t\t.removeData(\"resizable\").unbind(\".resizable\").find('.ui-resizable-handle').remove();\n\t\t};\n\n\t\t//TODO: Unwrap at same DOM position\n\t\tif (this.elementIsWrapper) {\n\t\t\t_destroy(this.element);\n\t\t\tvar wrapper = this.element;\n\t\t\twrapper.after(\n\t\t\t\tthis.originalElement.css({\n\t\t\t\t\tposition: wrapper.css('position'),\n\t\t\t\t\twidth: wrapper.outerWidth(),\n\t\t\t\t\theight: wrapper.outerHeight(),\n\t\t\t\t\ttop: wrapper.css('top'),\n\t\t\t\t\tleft: wrapper.css('left')\n\t\t\t\t})\n\t\t\t).remove();\n\t\t}\n\n\t\tthis.originalElement.css('resize', this.originalResizeStyle);\n\t\t_destroy(this.originalElement);\n\n\t\treturn this;\n\t},\n\n\t_mouseCapture: function(event) {\n\t\tvar handle = false;\n\t\tfor (var i in this.handles) {\n\t\t\tif ($(this.handles[i])[0] == event.target) {\n\t\t\t\thandle = true;\n\t\t\t}\n\t\t}\n\n\t\treturn !this.options.disabled && handle;\n\t},\n\n\t_mouseStart: function(event) {\n\n\t\tvar o = this.options, iniPos = this.element.position(), el = this.element;\n\n\t\tthis.resizing = true;\n\t\tthis.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };\n\n\t\t// bugfix for http://dev.jquery.com/ticket/1749\n\t\tif (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {\n\t\t\tel.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });\n\t\t}\n\n\t\tthis._renderProxy();\n\n\t\tvar curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));\n\n\t\tif (o.containment) {\n\t\t\tcurleft += $(o.containment).scrollLeft() || 0;\n\t\t\tcurtop += $(o.containment).scrollTop() || 0;\n\t\t}\n\n\t\t//Store needed variables\n\t\tthis.offset = this.helper.offset();\n\t\tthis.position = { left: curleft, top: curtop };\n\t\tthis.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };\n\t\tthis.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };\n\t\tthis.originalPosition = { left: curleft, top: curtop };\n\t\tthis.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };\n\t\tthis.originalMousePosition = { left: event.pageX, top: event.pageY };\n\n\t\t//Aspect Ratio\n\t\tthis.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);\n\n\t    var cursor = $('.ui-resizable-' + this.axis).css('cursor');\n\t    $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);\n\n\t\tel.addClass(\"ui-resizable-resizing\");\n\t\tthis._propagate(\"start\", event);\n\t\treturn true;\n\t},\n\n\t_mouseDrag: function(event) {\n\n\t\t//Increase performance, avoid regex\n\t\tvar el = this.helper, o = this.options, props = {},\n\t\t\tself = this, smp = this.originalMousePosition, a = this.axis;\n\n\t\tvar dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;\n\t\tvar trigger = this._change[a];\n\t\tif (!trigger) return false;\n\n\t\t// Calculate the attrs that will be change\n\t\tvar data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;\n\n\t\t// Put this in the mouseDrag handler since the user can start pressing shift while resizing\n\t\tthis._updateVirtualBoundaries(event.shiftKey);\n\t\tif (this._aspectRatio || event.shiftKey)\n\t\t\tdata = this._updateRatio(data, event);\n\n\t\tdata = this._respectSize(data, event);\n\n\t\t// plugins callbacks need to be called first\n\t\tthis._propagate(\"resize\", event);\n\n\t\tel.css({\n\t\t\ttop: this.position.top + \"px\", left: this.position.left + \"px\",\n\t\t\twidth: this.size.width + \"px\", height: this.size.height + \"px\"\n\t\t});\n\n\t\tif (!this._helper && this._proportionallyResizeElements.length)\n\t\t\tthis._proportionallyResize();\n\n\t\tthis._updateCache(data);\n\n\t\t// calling the user callback at the end\n\t\tthis._trigger('resize', event, this.ui());\n\n\t\treturn false;\n\t},\n\n\t_mouseStop: function(event) {\n\n\t\tthis.resizing = false;\n\t\tvar o = this.options, self = this;\n\n\t\tif(this._helper) {\n\t\t\tvar pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),\n\t\t\t\tsoffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,\n\t\t\t\tsoffsetw = ista ? 0 : self.sizeDiff.width;\n\n\t\t\tvar s = { width: (self.helper.width()  - soffsetw), height: (self.helper.height() - soffseth) },\n\t\t\t\tleft = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,\n\t\t\t\ttop = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;\n\n\t\t\tif (!o.animate)\n\t\t\t\tthis.element.css($.extend(s, { top: top, left: left }));\n\n\t\t\tself.helper.height(self.size.height);\n\t\t\tself.helper.width(self.size.width);\n\n\t\t\tif (this._helper && !o.animate) this._proportionallyResize();\n\t\t}\n\n\t\t$('body').css('cursor', 'auto');\n\n\t\tthis.element.removeClass(\"ui-resizable-resizing\");\n\n\t\tthis._propagate(\"stop\", event);\n\n\t\tif (this._helper) this.helper.remove();\n\t\treturn false;\n\n\t},\n\n    _updateVirtualBoundaries: function(forceAspectRatio) {\n        var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b;\n\n        b = {\n            minWidth: isNumber(o.minWidth) ? o.minWidth : 0,\n            maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,\n            minHeight: isNumber(o.minHeight) ? o.minHeight : 0,\n            maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity\n        };\n\n        if(this._aspectRatio || forceAspectRatio) {\n            // We want to create an enclosing box whose aspect ration is the requested one\n            // First, compute the \"projected\" size for each dimension based on the aspect ratio and other dimension\n            pMinWidth = b.minHeight * this.aspectRatio;\n            pMinHeight = b.minWidth / this.aspectRatio;\n            pMaxWidth = b.maxHeight * this.aspectRatio;\n            pMaxHeight = b.maxWidth / this.aspectRatio;\n\n            if(pMinWidth > b.minWidth) b.minWidth = pMinWidth;\n            if(pMinHeight > b.minHeight) b.minHeight = pMinHeight;\n            if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth;\n            if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight;\n        }\n        this._vBoundaries = b;\n    },\n\n\t_updateCache: function(data) {\n\t\tvar o = this.options;\n\t\tthis.offset = this.helper.offset();\n\t\tif (isNumber(data.left)) this.position.left = data.left;\n\t\tif (isNumber(data.top)) this.position.top = data.top;\n\t\tif (isNumber(data.height)) this.size.height = data.height;\n\t\tif (isNumber(data.width)) this.size.width = data.width;\n\t},\n\n\t_updateRatio: function(data, event) {\n\n\t\tvar o = this.options, cpos = this.position, csize = this.size, a = this.axis;\n\n\t\tif (isNumber(data.height)) data.width = (data.height * this.aspectRatio);\n\t\telse if (isNumber(data.width)) data.height = (data.width / this.aspectRatio);\n\n\t\tif (a == 'sw') {\n\t\t\tdata.left = cpos.left + (csize.width - data.width);\n\t\t\tdata.top = null;\n\t\t}\n\t\tif (a == 'nw') {\n\t\t\tdata.top = cpos.top + (csize.height - data.height);\n\t\t\tdata.left = cpos.left + (csize.width - data.width);\n\t\t}\n\n\t\treturn data;\n\t},\n\n\t_respectSize: function(data, event) {\n\n\t\tvar el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,\n\t\t\t\tismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),\n\t\t\t\t\tisminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);\n\n\t\tif (isminw) data.width = o.minWidth;\n\t\tif (isminh) data.height = o.minHeight;\n\t\tif (ismaxw) data.width = o.maxWidth;\n\t\tif (ismaxh) data.height = o.maxHeight;\n\n\t\tvar dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;\n\t\tvar cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);\n\n\t\tif (isminw && cw) data.left = dw - o.minWidth;\n\t\tif (ismaxw && cw) data.left = dw - o.maxWidth;\n\t\tif (isminh && ch)\tdata.top = dh - o.minHeight;\n\t\tif (ismaxh && ch)\tdata.top = dh - o.maxHeight;\n\n\t\t// fixing jump error on top/left - bug #2330\n\t\tvar isNotwh = !data.width && !data.height;\n\t\tif (isNotwh && !data.left && data.top) data.top = null;\n\t\telse if (isNotwh && !data.top && data.left) data.left = null;\n\n\t\treturn data;\n\t},\n\n\t_proportionallyResize: function() {\n\n\t\tvar o = this.options;\n\t\tif (!this._proportionallyResizeElements.length) return;\n\t\tvar element = this.helper || this.element;\n\n\t\tfor (var i=0; i < this._proportionallyResizeElements.length; i++) {\n\n\t\t\tvar prel = this._proportionallyResizeElements[i];\n\n\t\t\tif (!this.borderDif) {\n\t\t\t\tvar b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],\n\t\t\t\t\tp = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];\n\n\t\t\t\tthis.borderDif = $.map(b, function(v, i) {\n\t\t\t\t\tvar border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;\n\t\t\t\t\treturn border + padding;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))\n\t\t\t\tcontinue;\n\n\t\t\tprel.css({\n\t\t\t\theight: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,\n\t\t\t\twidth: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0\n\t\t\t});\n\n\t\t};\n\n\t},\n\n\t_renderProxy: function() {\n\n\t\tvar el = this.element, o = this.options;\n\t\tthis.elementOffset = el.offset();\n\n\t\tif(this._helper) {\n\n\t\t\tthis.helper = this.helper || $('<div style=\"overflow:hidden;\"></div>');\n\n\t\t\t// fix ie6 offset TODO: This seems broken\n\t\t\tvar ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),\n\t\t\tpxyoffset = ( ie6 ? 2 : -1 );\n\n\t\t\tthis.helper.addClass(this._helper).css({\n\t\t\t\twidth: this.element.outerWidth() + pxyoffset,\n\t\t\t\theight: this.element.outerHeight() + pxyoffset,\n\t\t\t\tposition: 'absolute',\n\t\t\t\tleft: this.elementOffset.left - ie6offset +'px',\n\t\t\t\ttop: this.elementOffset.top - ie6offset +'px',\n\t\t\t\tzIndex: ++o.zIndex //TODO: Don't modify option\n\t\t\t});\n\n\t\t\tthis.helper\n\t\t\t\t.appendTo(\"body\")\n\t\t\t\t.disableSelection();\n\n\t\t} else {\n\t\t\tthis.helper = this.element;\n\t\t}\n\n\t},\n\n\t_change: {\n\t\te: function(event, dx, dy) {\n\t\t\treturn { width: this.originalSize.width + dx };\n\t\t},\n\t\tw: function(event, dx, dy) {\n\t\t\tvar o = this.options, cs = this.originalSize, sp = this.originalPosition;\n\t\t\treturn { left: sp.left + dx, width: cs.width - dx };\n\t\t},\n\t\tn: function(event, dx, dy) {\n\t\t\tvar o = this.options, cs = this.originalSize, sp = this.originalPosition;\n\t\t\treturn { top: sp.top + dy, height: cs.height - dy };\n\t\t},\n\t\ts: function(event, dx, dy) {\n\t\t\treturn { height: this.originalSize.height + dy };\n\t\t},\n\t\tse: function(event, dx, dy) {\n\t\t\treturn $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));\n\t\t},\n\t\tsw: function(event, dx, dy) {\n\t\t\treturn $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));\n\t\t},\n\t\tne: function(event, dx, dy) {\n\t\t\treturn $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));\n\t\t},\n\t\tnw: function(event, dx, dy) {\n\t\t\treturn $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));\n\t\t}\n\t},\n\n\t_propagate: function(n, event) {\n\t\t$.ui.plugin.call(this, n, [event, this.ui()]);\n\t\t(n != \"resize\" && this._trigger(n, event, this.ui()));\n\t},\n\n\tplugins: {},\n\n\tui: function() {\n\t\treturn {\n\t\t\toriginalElement: this.originalElement,\n\t\t\telement: this.element,\n\t\t\thelper: this.helper,\n\t\t\tposition: this.position,\n\t\t\tsize: this.size,\n\t\t\toriginalSize: this.originalSize,\n\t\t\toriginalPosition: this.originalPosition\n\t\t};\n\t}\n\n});\n\n$.extend($.ui.resizable, {\n\tversion: \"1.8.22\"\n});\n\n/*\n * Resizable Extensions\n */\n\n$.ui.plugin.add(\"resizable\", \"alsoResize\", {\n\n\tstart: function (event, ui) {\n\t\tvar self = $(this).data(\"resizable\"), o = self.options;\n\n\t\tvar _store = function (exp) {\n\t\t\t$(exp).each(function() {\n\t\t\t\tvar el = $(this);\n\t\t\t\tel.data(\"resizable-alsoresize\", {\n\t\t\t\t\twidth: parseInt(el.width(), 10), height: parseInt(el.height(), 10),\n\t\t\t\t\tleft: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10)\n\t\t\t\t});\n\t\t\t});\n\t\t};\n\n\t\tif (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {\n\t\t\tif (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }\n\t\t\telse { $.each(o.alsoResize, function (exp) { _store(exp); }); }\n\t\t}else{\n\t\t\t_store(o.alsoResize);\n\t\t}\n\t},\n\n\tresize: function (event, ui) {\n\t\tvar self = $(this).data(\"resizable\"), o = self.options, os = self.originalSize, op = self.originalPosition;\n\n\t\tvar delta = {\n\t\t\theight: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,\n\t\t\ttop: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0\n\t\t},\n\n\t\t_alsoResize = function (exp, c) {\n\t\t\t$(exp).each(function() {\n\t\t\t\tvar el = $(this), start = $(this).data(\"resizable-alsoresize\"), style = {}, \n\t\t\t\t\tcss = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left'];\n\n\t\t\t\t$.each(css, function (i, prop) {\n\t\t\t\t\tvar sum = (start[prop]||0) + (delta[prop]||0);\n\t\t\t\t\tif (sum && sum >= 0)\n\t\t\t\t\t\tstyle[prop] = sum || null;\n\t\t\t\t});\n\n\t\t\t\tel.css(style);\n\t\t\t});\n\t\t};\n\n\t\tif (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {\n\t\t\t$.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });\n\t\t}else{\n\t\t\t_alsoResize(o.alsoResize);\n\t\t}\n\t},\n\n\tstop: function (event, ui) {\n\t\t$(this).removeData(\"resizable-alsoresize\");\n\t}\n});\n\n$.ui.plugin.add(\"resizable\", \"animate\", {\n\n\tstop: function(event, ui) {\n\t\tvar self = $(this).data(\"resizable\"), o = self.options;\n\n\t\tvar pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),\n\t\t\t\t\tsoffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,\n\t\t\t\t\t\tsoffsetw = ista ? 0 : self.sizeDiff.width;\n\n\t\tvar style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },\n\t\t\t\t\tleft = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,\n\t\t\t\t\t\ttop = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;\n\n\t\tself.element.animate(\n\t\t\t$.extend(style, top && left ? { top: top, left: left } : {}), {\n\t\t\t\tduration: o.animateDuration,\n\t\t\t\teasing: o.animateEasing,\n\t\t\t\tstep: function() {\n\n\t\t\t\t\tvar data = {\n\t\t\t\t\t\twidth: parseInt(self.element.css('width'), 10),\n\t\t\t\t\t\theight: parseInt(self.element.css('height'), 10),\n\t\t\t\t\t\ttop: parseInt(self.element.css('top'), 10),\n\t\t\t\t\t\tleft: parseInt(self.element.css('left'), 10)\n\t\t\t\t\t};\n\n\t\t\t\t\tif (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });\n\n\t\t\t\t\t// propagating resize, and updating values for each animation step\n\t\t\t\t\tself._updateCache(data);\n\t\t\t\t\tself._propagate(\"resize\", event);\n\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n});\n\n$.ui.plugin.add(\"resizable\", \"containment\", {\n\n\tstart: function(event, ui) {\n\t\tvar self = $(this).data(\"resizable\"), o = self.options, el = self.element;\n\t\tvar oc = o.containment,\tce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;\n\t\tif (!ce) return;\n\n\t\tself.containerElement = $(ce);\n\n\t\tif (/document/.test(oc) || oc == document) {\n\t\t\tself.containerOffset = { left: 0, top: 0 };\n\t\t\tself.containerPosition = { left: 0, top: 0 };\n\n\t\t\tself.parentData = {\n\t\t\t\telement: $(document), left: 0, top: 0,\n\t\t\t\twidth: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight\n\t\t\t};\n\t\t}\n\n\t\t// i'm a node, so compute top, left, right, bottom\n\t\telse {\n\t\t\tvar element = $(ce), p = [];\n\t\t\t$([ \"Top\", \"Right\", \"Left\", \"Bottom\" ]).each(function(i, name) { p[i] = num(element.css(\"padding\" + name)); });\n\n\t\t\tself.containerOffset = element.offset();\n\t\t\tself.containerPosition = element.position();\n\t\t\tself.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };\n\n\t\t\tvar co = self.containerOffset, ch = self.containerSize.height,\tcw = self.containerSize.width,\n\t\t\t\t\t\twidth = ($.ui.hasScroll(ce, \"left\") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);\n\n\t\t\tself.parentData = {\n\t\t\t\telement: ce, left: co.left, top: co.top, width: width, height: height\n\t\t\t};\n\t\t}\n\t},\n\n\tresize: function(event, ui) {\n\t\tvar self = $(this).data(\"resizable\"), o = self.options,\n\t\t\t\tps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,\n\t\t\t\tpRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;\n\n\t\tif (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;\n\n\t\tif (cp.left < (self._helper ? co.left : 0)) {\n\t\t\tself.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));\n\t\t\tif (pRatio) self.size.height = self.size.width / self.aspectRatio;\n\t\t\tself.position.left = o.helper ? co.left : 0;\n\t\t}\n\n\t\tif (cp.top < (self._helper ? co.top : 0)) {\n\t\t\tself.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);\n\t\t\tif (pRatio) self.size.width = self.size.height * self.aspectRatio;\n\t\t\tself.position.top = self._helper ? co.top : 0;\n\t\t}\n\n\t\tself.offset.left = self.parentData.left+self.position.left;\n\t\tself.offset.top = self.parentData.top+self.position.top;\n\n\t\tvar woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),\n\t\t\t\t\thoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );\n\n\t\tvar isParent = self.containerElement.get(0) == self.element.parent().get(0),\n\t\t    isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));\n\n\t\tif(isParent && isOffsetRelative) woset -= self.parentData.left;\n\n\t\tif (woset + self.size.width >= self.parentData.width) {\n\t\t\tself.size.width = self.parentData.width - woset;\n\t\t\tif (pRatio) self.size.height = self.size.width / self.aspectRatio;\n\t\t}\n\n\t\tif (hoset + self.size.height >= self.parentData.height) {\n\t\t\tself.size.height = self.parentData.height - hoset;\n\t\t\tif (pRatio) self.size.width = self.size.height * self.aspectRatio;\n\t\t}\n\t},\n\n\tstop: function(event, ui){\n\t\tvar self = $(this).data(\"resizable\"), o = self.options, cp = self.position,\n\t\t\t\tco = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;\n\n\t\tvar helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height;\n\n\t\tif (self._helper && !o.animate && (/relative/).test(ce.css('position')))\n\t\t\t$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });\n\n\t\tif (self._helper && !o.animate && (/static/).test(ce.css('position')))\n\t\t\t$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });\n\n\t}\n});\n\n$.ui.plugin.add(\"resizable\", \"ghost\", {\n\n\tstart: function(event, ui) {\n\n\t\tvar self = $(this).data(\"resizable\"), o = self.options, cs = self.size;\n\n\t\tself.ghost = self.originalElement.clone();\n\t\tself.ghost\n\t\t\t.css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })\n\t\t\t.addClass('ui-resizable-ghost')\n\t\t\t.addClass(typeof o.ghost == 'string' ? o.ghost : '');\n\n\t\tself.ghost.appendTo(self.helper);\n\n\t},\n\n\tresize: function(event, ui){\n\t\tvar self = $(this).data(\"resizable\"), o = self.options;\n\t\tif (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });\n\t},\n\n\tstop: function(event, ui){\n\t\tvar self = $(this).data(\"resizable\"), o = self.options;\n\t\tif (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));\n\t}\n\n});\n\n$.ui.plugin.add(\"resizable\", \"grid\", {\n\n\tresize: function(event, ui) {\n\t\tvar self = $(this).data(\"resizable\"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;\n\t\to.grid = typeof o.grid == \"number\" ? [o.grid, o.grid] : o.grid;\n\t\tvar ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);\n\n\t\tif (/^(se|s|e)$/.test(a)) {\n\t\t\tself.size.width = os.width + ox;\n\t\t\tself.size.height = os.height + oy;\n\t\t}\n\t\telse if (/^(ne)$/.test(a)) {\n\t\t\tself.size.width = os.width + ox;\n\t\t\tself.size.height = os.height + oy;\n\t\t\tself.position.top = op.top - oy;\n\t\t}\n\t\telse if (/^(sw)$/.test(a)) {\n\t\t\tself.size.width = os.width + ox;\n\t\t\tself.size.height = os.height + oy;\n\t\t\tself.position.left = op.left - ox;\n\t\t}\n\t\telse {\n\t\t\tself.size.width = os.width + ox;\n\t\t\tself.size.height = os.height + oy;\n\t\t\tself.position.top = op.top - oy;\n\t\t\tself.position.left = op.left - ox;\n\t\t}\n\t}\n\n});\n\nvar num = function(v) {\n\treturn parseInt(v, 10) || 0;\n};\n\nvar isNumber = function(value) {\n\treturn !isNaN(parseInt(value, 10));\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.widget(\"ui.selectable\", $.ui.mouse, {\n\toptions: {\n\t\tappendTo: 'body',\n\t\tautoRefresh: true,\n\t\tdistance: 0,\n\t\tfilter: '*',\n\t\ttolerance: 'touch'\n\t},\n\t_create: function() {\n\t\tvar self = this;\n\n\t\tthis.element.addClass(\"ui-selectable\");\n\n\t\tthis.dragged = false;\n\n\t\t// cache selectee children based on filter\n\t\tvar selectees;\n\t\tthis.refresh = function() {\n\t\t\tselectees = $(self.options.filter, self.element[0]);\n\t\t\tselectees.addClass(\"ui-selectee\");\n\t\t\tselectees.each(function() {\n\t\t\t\tvar $this = $(this);\n\t\t\t\tvar pos = $this.offset();\n\t\t\t\t$.data(this, \"selectable-item\", {\n\t\t\t\t\telement: this,\n\t\t\t\t\t$element: $this,\n\t\t\t\t\tleft: pos.left,\n\t\t\t\t\ttop: pos.top,\n\t\t\t\t\tright: pos.left + $this.outerWidth(),\n\t\t\t\t\tbottom: pos.top + $this.outerHeight(),\n\t\t\t\t\tstartselected: false,\n\t\t\t\t\tselected: $this.hasClass('ui-selected'),\n\t\t\t\t\tselecting: $this.hasClass('ui-selecting'),\n\t\t\t\t\tunselecting: $this.hasClass('ui-unselecting')\n\t\t\t\t});\n\t\t\t});\n\t\t};\n\t\tthis.refresh();\n\n\t\tthis.selectees = selectees.addClass(\"ui-selectee\");\n\n\t\tthis._mouseInit();\n\n\t\tthis.helper = $(\"<div class='ui-selectable-helper'></div>\");\n\t},\n\n\tdestroy: function() {\n\t\tthis.selectees\n\t\t\t.removeClass(\"ui-selectee\")\n\t\t\t.removeData(\"selectable-item\");\n\t\tthis.element\n\t\t\t.removeClass(\"ui-selectable ui-selectable-disabled\")\n\t\t\t.removeData(\"selectable\")\n\t\t\t.unbind(\".selectable\");\n\t\tthis._mouseDestroy();\n\n\t\treturn this;\n\t},\n\n\t_mouseStart: function(event) {\n\t\tvar self = this;\n\n\t\tthis.opos = [event.pageX, event.pageY];\n\n\t\tif (this.options.disabled)\n\t\t\treturn;\n\n\t\tvar options = this.options;\n\n\t\tthis.selectees = $(options.filter, this.element[0]);\n\n\t\tthis._trigger(\"start\", event);\n\n\t\t$(options.appendTo).append(this.helper);\n\t\t// position helper (lasso)\n\t\tthis.helper.css({\n\t\t\t\"left\": event.clientX,\n\t\t\t\"top\": event.clientY,\n\t\t\t\"width\": 0,\n\t\t\t\"height\": 0\n\t\t});\n\n\t\tif (options.autoRefresh) {\n\t\t\tthis.refresh();\n\t\t}\n\n\t\tthis.selectees.filter('.ui-selected').each(function() {\n\t\t\tvar selectee = $.data(this, \"selectable-item\");\n\t\t\tselectee.startselected = true;\n\t\t\tif (!event.metaKey && !event.ctrlKey) {\n\t\t\t\tselectee.$element.removeClass('ui-selected');\n\t\t\t\tselectee.selected = false;\n\t\t\t\tselectee.$element.addClass('ui-unselecting');\n\t\t\t\tselectee.unselecting = true;\n\t\t\t\t// selectable UNSELECTING callback\n\t\t\t\tself._trigger(\"unselecting\", event, {\n\t\t\t\t\tunselecting: selectee.element\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\t$(event.target).parents().andSelf().each(function() {\n\t\t\tvar selectee = $.data(this, \"selectable-item\");\n\t\t\tif (selectee) {\n\t\t\t\tvar doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected');\n\t\t\t\tselectee.$element\n\t\t\t\t\t.removeClass(doSelect ? \"ui-unselecting\" : \"ui-selected\")\n\t\t\t\t\t.addClass(doSelect ? \"ui-selecting\" : \"ui-unselecting\");\n\t\t\t\tselectee.unselecting = !doSelect;\n\t\t\t\tselectee.selecting = doSelect;\n\t\t\t\tselectee.selected = doSelect;\n\t\t\t\t// selectable (UN)SELECTING callback\n\t\t\t\tif (doSelect) {\n\t\t\t\t\tself._trigger(\"selecting\", event, {\n\t\t\t\t\t\tselecting: selectee.element\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tself._trigger(\"unselecting\", event, {\n\t\t\t\t\t\tunselecting: selectee.element\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\n\t},\n\n\t_mouseDrag: function(event) {\n\t\tvar self = this;\n\t\tthis.dragged = true;\n\n\t\tif (this.options.disabled)\n\t\t\treturn;\n\n\t\tvar options = this.options;\n\n\t\tvar x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY;\n\t\tif (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }\n\t\tif (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }\n\t\tthis.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});\n\n\t\tthis.selectees.each(function() {\n\t\t\tvar selectee = $.data(this, \"selectable-item\");\n\t\t\t//prevent helper from being selected if appendTo: selectable\n\t\t\tif (!selectee || selectee.element == self.element[0])\n\t\t\t\treturn;\n\t\t\tvar hit = false;\n\t\t\tif (options.tolerance == 'touch') {\n\t\t\t\thit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );\n\t\t\t} else if (options.tolerance == 'fit') {\n\t\t\t\thit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);\n\t\t\t}\n\n\t\t\tif (hit) {\n\t\t\t\t// SELECT\n\t\t\t\tif (selectee.selected) {\n\t\t\t\t\tselectee.$element.removeClass('ui-selected');\n\t\t\t\t\tselectee.selected = false;\n\t\t\t\t}\n\t\t\t\tif (selectee.unselecting) {\n\t\t\t\t\tselectee.$element.removeClass('ui-unselecting');\n\t\t\t\t\tselectee.unselecting = false;\n\t\t\t\t}\n\t\t\t\tif (!selectee.selecting) {\n\t\t\t\t\tselectee.$element.addClass('ui-selecting');\n\t\t\t\t\tselectee.selecting = true;\n\t\t\t\t\t// selectable SELECTING callback\n\t\t\t\t\tself._trigger(\"selecting\", event, {\n\t\t\t\t\t\tselecting: selectee.element\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// UNSELECT\n\t\t\t\tif (selectee.selecting) {\n\t\t\t\t\tif ((event.metaKey || event.ctrlKey) && selectee.startselected) {\n\t\t\t\t\t\tselectee.$element.removeClass('ui-selecting');\n\t\t\t\t\t\tselectee.selecting = false;\n\t\t\t\t\t\tselectee.$element.addClass('ui-selected');\n\t\t\t\t\t\tselectee.selected = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tselectee.$element.removeClass('ui-selecting');\n\t\t\t\t\t\tselectee.selecting = false;\n\t\t\t\t\t\tif (selectee.startselected) {\n\t\t\t\t\t\t\tselectee.$element.addClass('ui-unselecting');\n\t\t\t\t\t\t\tselectee.unselecting = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// selectable UNSELECTING callback\n\t\t\t\t\t\tself._trigger(\"unselecting\", event, {\n\t\t\t\t\t\t\tunselecting: selectee.element\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (selectee.selected) {\n\t\t\t\t\tif (!event.metaKey && !event.ctrlKey && !selectee.startselected) {\n\t\t\t\t\t\tselectee.$element.removeClass('ui-selected');\n\t\t\t\t\t\tselectee.selected = false;\n\n\t\t\t\t\t\tselectee.$element.addClass('ui-unselecting');\n\t\t\t\t\t\tselectee.unselecting = true;\n\t\t\t\t\t\t// selectable UNSELECTING callback\n\t\t\t\t\t\tself._trigger(\"unselecting\", event, {\n\t\t\t\t\t\t\tunselecting: selectee.element\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn false;\n\t},\n\n\t_mouseStop: function(event) {\n\t\tvar self = this;\n\n\t\tthis.dragged = false;\n\n\t\tvar options = this.options;\n\n\t\t$('.ui-unselecting', this.element[0]).each(function() {\n\t\t\tvar selectee = $.data(this, \"selectable-item\");\n\t\t\tselectee.$element.removeClass('ui-unselecting');\n\t\t\tselectee.unselecting = false;\n\t\t\tselectee.startselected = false;\n\t\t\tself._trigger(\"unselected\", event, {\n\t\t\t\tunselected: selectee.element\n\t\t\t});\n\t\t});\n\t\t$('.ui-selecting', this.element[0]).each(function() {\n\t\t\tvar selectee = $.data(this, \"selectable-item\");\n\t\t\tselectee.$element.removeClass('ui-selecting').addClass('ui-selected');\n\t\t\tselectee.selecting = false;\n\t\t\tselectee.selected = true;\n\t\t\tselectee.startselected = true;\n\t\t\tself._trigger(\"selected\", event, {\n\t\t\t\tselected: selectee.element\n\t\t\t});\n\t\t});\n\t\tthis._trigger(\"stop\", event);\n\n\t\tthis.helper.remove();\n\n\t\treturn false;\n\t}\n\n});\n\n$.extend($.ui.selectable, {\n\tversion: \"1.8.22\"\n});\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.widget(\"ui.sortable\", $.ui.mouse, {\n\twidgetEventPrefix: \"sort\",\n\tready: false,\n\toptions: {\n\t\tappendTo: \"parent\",\n\t\taxis: false,\n\t\tconnectWith: false,\n\t\tcontainment: false,\n\t\tcursor: 'auto',\n\t\tcursorAt: false,\n\t\tdropOnEmpty: true,\n\t\tforcePlaceholderSize: false,\n\t\tforceHelperSize: false,\n\t\tgrid: false,\n\t\thandle: false,\n\t\thelper: \"original\",\n\t\titems: '> *',\n\t\topacity: false,\n\t\tplaceholder: false,\n\t\trevert: false,\n\t\tscroll: true,\n\t\tscrollSensitivity: 20,\n\t\tscrollSpeed: 20,\n\t\tscope: \"default\",\n\t\ttolerance: \"intersect\",\n\t\tzIndex: 1000\n\t},\n\t_create: function() {\n\n\t\tvar o = this.options;\n\t\tthis.containerCache = {};\n\t\tthis.element.addClass(\"ui-sortable\");\n\n\t\t//Get the items\n\t\tthis.refresh();\n\n\t\t//Let's determine if the items are being displayed horizontally\n\t\tthis.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;\n\n\t\t//Let's determine the parent's offset\n\t\tthis.offset = this.element.offset();\n\n\t\t//Initialize mouse events for interaction\n\t\tthis._mouseInit();\n\t\t\n\t\t//We're ready to go\n\t\tthis.ready = true\n\n\t},\n\n\tdestroy: function() {\n\t\t$.Widget.prototype.destroy.call( this );\n\t\tthis.element\n\t\t\t.removeClass(\"ui-sortable ui-sortable-disabled\");\n\t\tthis._mouseDestroy();\n\n\t\tfor ( var i = this.items.length - 1; i >= 0; i-- )\n\t\t\tthis.items[i].item.removeData(this.widgetName + \"-item\");\n\n\t\treturn this;\n\t},\n\n\t_setOption: function(key, value){\n\t\tif ( key === \"disabled\" ) {\n\t\t\tthis.options[ key ] = value;\n\t\n\t\t\tthis.widget()\n\t\t\t\t[ value ? \"addClass\" : \"removeClass\"]( \"ui-sortable-disabled\" );\n\t\t} else {\n\t\t\t// Don't call widget base _setOption for disable as it adds ui-state-disabled class\n\t\t\t$.Widget.prototype._setOption.apply(this, arguments);\n\t\t}\n\t},\n\n\t_mouseCapture: function(event, overrideHandle) {\n\t\tvar that = this;\n\n\t\tif (this.reverting) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif(this.options.disabled || this.options.type == 'static') return false;\n\n\t\t//We have to refresh the items data once first\n\t\tthis._refreshItems(event);\n\n\t\t//Find out if the clicked node (or one of its parents) is a actual item in this.items\n\t\tvar currentItem = null, self = this, nodes = $(event.target).parents().each(function() {\n\t\t\tif($.data(this, that.widgetName + '-item') == self) {\n\t\t\t\tcurrentItem = $(this);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tif($.data(event.target, that.widgetName + '-item') == self) currentItem = $(event.target);\n\n\t\tif(!currentItem) return false;\n\t\tif(this.options.handle && !overrideHandle) {\n\t\t\tvar validHandle = false;\n\n\t\t\t$(this.options.handle, currentItem).find(\"*\").andSelf().each(function() { if(this == event.target) validHandle = true; });\n\t\t\tif(!validHandle) return false;\n\t\t}\n\n\t\tthis.currentItem = currentItem;\n\t\tthis._removeCurrentsFromItems();\n\t\treturn true;\n\n\t},\n\n\t_mouseStart: function(event, overrideHandle, noActivation) {\n\n\t\tvar o = this.options, self = this;\n\t\tthis.currentContainer = this;\n\n\t\t//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture\n\t\tthis.refreshPositions();\n\n\t\t//Create and append the visible helper\n\t\tthis.helper = this._createHelper(event);\n\n\t\t//Cache the helper size\n\t\tthis._cacheHelperProportions();\n\n\t\t/*\n\t\t * - Position generation -\n\t\t * This block generates everything position related - it's the core of draggables.\n\t\t */\n\n\t\t//Cache the margins of the original element\n\t\tthis._cacheMargins();\n\n\t\t//Get the next scrolling parent\n\t\tthis.scrollParent = this.helper.scrollParent();\n\n\t\t//The element's absolute position on the page minus margins\n\t\tthis.offset = this.currentItem.offset();\n\t\tthis.offset = {\n\t\t\ttop: this.offset.top - this.margins.top,\n\t\t\tleft: this.offset.left - this.margins.left\n\t\t};\n\n\t\t$.extend(this.offset, {\n\t\t\tclick: { //Where the click happened, relative to the element\n\t\t\t\tleft: event.pageX - this.offset.left,\n\t\t\t\ttop: event.pageY - this.offset.top\n\t\t\t},\n\t\t\tparent: this._getParentOffset(),\n\t\t\trelative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper\n\t\t});\n\n\t\t// Only after we got the offset, we can change the helper's position to absolute\n\t\t// TODO: Still need to figure out a way to make relative sorting possible\n\t\tthis.helper.css(\"position\", \"absolute\");\n\t\tthis.cssPosition = this.helper.css(\"position\");\n\t\t\n\t\t//Generate the original position\n\t\tthis.originalPosition = this._generatePosition(event);\n\t\tthis.originalPageX = event.pageX;\n\t\tthis.originalPageY = event.pageY;\n\n\t\t//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied\n\t\t(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));\n\n\t\t//Cache the former DOM position\n\t\tthis.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };\n\n\t\t//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way\n\t\tif(this.helper[0] != this.currentItem[0]) {\n\t\t\tthis.currentItem.hide();\n\t\t}\n\n\t\t//Create the placeholder\n\t\tthis._createPlaceholder();\n\n\t\t//Set a containment if given in the options\n\t\tif(o.containment)\n\t\t\tthis._setContainment();\n\n\t\tif(o.cursor) { // cursor option\n\t\t\tif ($('body').css(\"cursor\")) this._storedCursor = $('body').css(\"cursor\");\n\t\t\t$('body').css(\"cursor\", o.cursor);\n\t\t}\n\n\t\tif(o.opacity) { // opacity option\n\t\t\tif (this.helper.css(\"opacity\")) this._storedOpacity = this.helper.css(\"opacity\");\n\t\t\tthis.helper.css(\"opacity\", o.opacity);\n\t\t}\n\n\t\tif(o.zIndex) { // zIndex option\n\t\t\tif (this.helper.css(\"zIndex\")) this._storedZIndex = this.helper.css(\"zIndex\");\n\t\t\tthis.helper.css(\"zIndex\", o.zIndex);\n\t\t}\n\n\t\t//Prepare scrolling\n\t\tif(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')\n\t\t\tthis.overflowOffset = this.scrollParent.offset();\n\n\t\t//Call callbacks\n\t\tthis._trigger(\"start\", event, this._uiHash());\n\n\t\t//Recache the helper size\n\t\tif(!this._preserveHelperProportions)\n\t\t\tthis._cacheHelperProportions();\n\n\n\t\t//Post 'activate' events to possible containers\n\t\tif(!noActivation) {\n\t\t\t for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger(\"activate\", event, self._uiHash(this)); }\n\t\t}\n\n\t\t//Prepare possible droppables\n\t\tif($.ui.ddmanager)\n\t\t\t$.ui.ddmanager.current = this;\n\n\t\tif ($.ui.ddmanager && !o.dropBehaviour)\n\t\t\t$.ui.ddmanager.prepareOffsets(this, event);\n\n\t\tthis.dragging = true;\n\n\t\tthis.helper.addClass(\"ui-sortable-helper\");\n\t\tthis._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position\n\t\treturn true;\n\n\t},\n\n\t_mouseDrag: function(event) {\n\n\t\t//Compute the helpers position\n\t\tthis.position = this._generatePosition(event);\n\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\n\n\t\tif (!this.lastPositionAbs) {\n\t\t\tthis.lastPositionAbs = this.positionAbs;\n\t\t}\n\n\t\t//Do scrolling\n\t\tif(this.options.scroll) {\n\t\t\tvar o = this.options, scrolled = false;\n\t\t\tif(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {\n\n\t\t\t\tif((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;\n\t\t\t\telse if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;\n\n\t\t\t\tif((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;\n\t\t\t\telse if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;\n\n\t\t\t} else {\n\n\t\t\t\tif(event.pageY - $(document).scrollTop() < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);\n\t\t\t\telse if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);\n\n\t\t\t\tif(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);\n\t\t\t\telse if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);\n\n\t\t\t}\n\n\t\t\tif(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)\n\t\t\t\t$.ui.ddmanager.prepareOffsets(this, event);\n\t\t}\n\n\t\t//Regenerate the absolute position used for position checks\n\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\n\n\t\t//Set the helper position\n\t\tif(!this.options.axis || this.options.axis != \"y\") this.helper[0].style.left = this.position.left+'px';\n\t\tif(!this.options.axis || this.options.axis != \"x\") this.helper[0].style.top = this.position.top+'px';\n\n\t\t//Rearrange\n\t\tfor (var i = this.items.length - 1; i >= 0; i--) {\n\n\t\t\t//Cache variables and intersection, continue if no intersection\n\t\t\tvar item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);\n\t\t\tif (!intersection) continue;\n\n\t\t\tif(itemElement != this.currentItem[0] //cannot intersect with itself\n\t\t\t\t&&\tthis.placeholder[intersection == 1 ? \"next\" : \"prev\"]()[0] != itemElement //no useless actions that have been done before\n\t\t\t\t&&\t!$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked\n\t\t\t\t&& (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true)\n\t\t\t\t//&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container\n\t\t\t) {\n\n\t\t\t\tthis.direction = intersection == 1 ? \"down\" : \"up\";\n\n\t\t\t\tif (this.options.tolerance == \"pointer\" || this._intersectsWithSides(item)) {\n\t\t\t\t\tthis._rearrange(event, item);\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthis._trigger(\"change\", event, this._uiHash());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t//Post events to containers\n\t\tthis._contactContainers(event);\n\n\t\t//Interconnect with droppables\n\t\tif($.ui.ddmanager) $.ui.ddmanager.drag(this, event);\n\n\t\t//Call callbacks\n\t\tthis._trigger('sort', event, this._uiHash());\n\n\t\tthis.lastPositionAbs = this.positionAbs;\n\t\treturn false;\n\n\t},\n\n\t_mouseStop: function(event, noPropagation) {\n\n\t\tif(!event) return;\n\n\t\t//If we are using droppables, inform the manager about the drop\n\t\tif ($.ui.ddmanager && !this.options.dropBehaviour)\n\t\t\t$.ui.ddmanager.drop(this, event);\n\n\t\tif(this.options.revert) {\n\t\t\tvar self = this;\n\t\t\tvar cur = self.placeholder.offset();\n\n\t\t\tself.reverting = true;\n\n\t\t\t$(this.helper).animate({\n\t\t\t\tleft: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),\n\t\t\t\ttop: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)\n\t\t\t}, parseInt(this.options.revert, 10) || 500, function() {\n\t\t\t\tself._clear(event);\n\t\t\t});\n\t\t} else {\n\t\t\tthis._clear(event, noPropagation);\n\t\t}\n\n\t\treturn false;\n\n\t},\n\n\tcancel: function() {\n\n\t\tvar self = this;\n\n\t\tif(this.dragging) {\n\n\t\t\tthis._mouseUp({ target: null });\n\n\t\t\tif(this.options.helper == \"original\")\n\t\t\t\tthis.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\");\n\t\t\telse\n\t\t\t\tthis.currentItem.show();\n\n\t\t\t//Post deactivating events to containers\n\t\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\t\tthis.containers[i]._trigger(\"deactivate\", null, self._uiHash(this));\n\t\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\t\tthis.containers[i]._trigger(\"out\", null, self._uiHash(this));\n\t\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (this.placeholder) {\n\t\t\t//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!\n\t\t\tif(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n\t\t\tif(this.options.helper != \"original\" && this.helper && this.helper[0].parentNode) this.helper.remove();\n\n\t\t\t$.extend(this, {\n\t\t\t\thelper: null,\n\t\t\t\tdragging: false,\n\t\t\t\treverting: false,\n\t\t\t\t_noFinalSort: null\n\t\t\t});\n\n\t\t\tif(this.domPosition.prev) {\n\t\t\t\t$(this.domPosition.prev).after(this.currentItem);\n\t\t\t} else {\n\t\t\t\t$(this.domPosition.parent).prepend(this.currentItem);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\n\t},\n\n\tserialize: function(o) {\n\n\t\tvar items = this._getItemsAsjQuery(o && o.connected);\n\t\tvar str = []; o = o || {};\n\n\t\t$(items).each(function() {\n\t\t\tvar res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));\n\t\t\tif(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));\n\t\t});\n\n\t\tif(!str.length && o.key) {\n\t\t\tstr.push(o.key + '=');\n\t\t}\n\n\t\treturn str.join('&');\n\n\t},\n\n\ttoArray: function(o) {\n\n\t\tvar items = this._getItemsAsjQuery(o && o.connected);\n\t\tvar ret = []; o = o || {};\n\n\t\titems.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });\n\t\treturn ret;\n\n\t},\n\n\t/* Be careful with the following core functions */\n\t_intersectsWith: function(item) {\n\n\t\tvar x1 = this.positionAbs.left,\n\t\t\tx2 = x1 + this.helperProportions.width,\n\t\t\ty1 = this.positionAbs.top,\n\t\t\ty2 = y1 + this.helperProportions.height;\n\n\t\tvar l = item.left,\n\t\t\tr = l + item.width,\n\t\t\tt = item.top,\n\t\t\tb = t + item.height;\n\n\t\tvar dyClick = this.offset.click.top,\n\t\t\tdxClick = this.offset.click.left;\n\n\t\tvar isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;\n\n\t\tif(\t   this.options.tolerance == \"pointer\"\n\t\t\t|| this.options.forcePointerForContainers\n\t\t\t|| (this.options.tolerance != \"pointer\" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])\n\t\t) {\n\t\t\treturn isOverElement;\n\t\t} else {\n\n\t\t\treturn (l < x1 + (this.helperProportions.width / 2) // Right Half\n\t\t\t\t&& x2 - (this.helperProportions.width / 2) < r // Left Half\n\t\t\t\t&& t < y1 + (this.helperProportions.height / 2) // Bottom Half\n\t\t\t\t&& y2 - (this.helperProportions.height / 2) < b ); // Top Half\n\n\t\t}\n\t},\n\n\t_intersectsWithPointer: function(item) {\n\n\t\tvar isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),\n\t\t\tisOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),\n\t\t\tisOverElement = isOverElementHeight && isOverElementWidth,\n\t\t\tverticalDirection = this._getDragVerticalDirection(),\n\t\t\thorizontalDirection = this._getDragHorizontalDirection();\n\n\t\tif (!isOverElement)\n\t\t\treturn false;\n\n\t\treturn this.floating ?\n\t\t\t( ((horizontalDirection && horizontalDirection == \"right\") || verticalDirection == \"down\") ? 2 : 1 )\n\t\t\t: ( verticalDirection && (verticalDirection == \"down\" ? 2 : 1) );\n\n\t},\n\n\t_intersectsWithSides: function(item) {\n\n\t\tvar isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),\n\t\t\tisOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),\n\t\t\tverticalDirection = this._getDragVerticalDirection(),\n\t\t\thorizontalDirection = this._getDragHorizontalDirection();\n\n\t\tif (this.floating && horizontalDirection) {\n\t\t\treturn ((horizontalDirection == \"right\" && isOverRightHalf) || (horizontalDirection == \"left\" && !isOverRightHalf));\n\t\t} else {\n\t\t\treturn verticalDirection && ((verticalDirection == \"down\" && isOverBottomHalf) || (verticalDirection == \"up\" && !isOverBottomHalf));\n\t\t}\n\n\t},\n\n\t_getDragVerticalDirection: function() {\n\t\tvar delta = this.positionAbs.top - this.lastPositionAbs.top;\n\t\treturn delta != 0 && (delta > 0 ? \"down\" : \"up\");\n\t},\n\n\t_getDragHorizontalDirection: function() {\n\t\tvar delta = this.positionAbs.left - this.lastPositionAbs.left;\n\t\treturn delta != 0 && (delta > 0 ? \"right\" : \"left\");\n\t},\n\n\trefresh: function(event) {\n\t\tthis._refreshItems(event);\n\t\tthis.refreshPositions();\n\t\treturn this;\n\t},\n\n\t_connectWith: function() {\n\t\tvar options = this.options;\n\t\treturn options.connectWith.constructor == String\n\t\t\t? [options.connectWith]\n\t\t\t: options.connectWith;\n\t},\n\t\n\t_getItemsAsjQuery: function(connected) {\n\n\t\tvar self = this;\n\t\tvar items = [];\n\t\tvar queries = [];\n\t\tvar connectWith = this._connectWith();\n\n\t\tif(connectWith && connected) {\n\t\t\tfor (var i = connectWith.length - 1; i >= 0; i--){\n\t\t\t\tvar cur = $(connectWith[i]);\n\t\t\t\tfor (var j = cur.length - 1; j >= 0; j--){\n\t\t\t\t\tvar inst = $.data(cur[j], this.widgetName);\n\t\t\t\t\tif(inst && inst != this && !inst.options.disabled) {\n\t\t\t\t\t\tqueries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(\".ui-sortable-helper\").not('.ui-sortable-placeholder'), inst]);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\tqueries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(\".ui-sortable-helper\").not('.ui-sortable-placeholder'), this]);\n\n\t\tfor (var i = queries.length - 1; i >= 0; i--){\n\t\t\tqueries[i][0].each(function() {\n\t\t\t\titems.push(this);\n\t\t\t});\n\t\t};\n\n\t\treturn $(items);\n\n\t},\n\n\t_removeCurrentsFromItems: function() {\n\n\t\tvar list = this.currentItem.find(\":data(\" + this.widgetName + \"-item)\");\n\n\t\tfor (var i=0; i < this.items.length; i++) {\n\n\t\t\tfor (var j=0; j < list.length; j++) {\n\t\t\t\tif(list[j] == this.items[i].item[0])\n\t\t\t\t\tthis.items.splice(i,1);\n\t\t\t};\n\n\t\t};\n\n\t},\n\n\t_refreshItems: function(event) {\n\n\t\tthis.items = [];\n\t\tthis.containers = [this];\n\t\tvar items = this.items;\n\t\tvar self = this;\n\t\tvar queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];\n\t\tvar connectWith = this._connectWith();\n\n\t\tif(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down\n\t\t\tfor (var i = connectWith.length - 1; i >= 0; i--){\n\t\t\t\tvar cur = $(connectWith[i]);\n\t\t\t\tfor (var j = cur.length - 1; j >= 0; j--){\n\t\t\t\t\tvar inst = $.data(cur[j], this.widgetName);\n\t\t\t\t\tif(inst && inst != this && !inst.options.disabled) {\n\t\t\t\t\t\tqueries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);\n\t\t\t\t\t\tthis.containers.push(inst);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\tfor (var i = queries.length - 1; i >= 0; i--) {\n\t\t\tvar targetData = queries[i][1];\n\t\t\tvar _queries = queries[i][0];\n\n\t\t\tfor (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {\n\t\t\t\tvar item = $(_queries[j]);\n\n\t\t\t\titem.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager)\n\n\t\t\t\titems.push({\n\t\t\t\t\titem: item,\n\t\t\t\t\tinstance: targetData,\n\t\t\t\t\twidth: 0, height: 0,\n\t\t\t\t\tleft: 0, top: 0\n\t\t\t\t});\n\t\t\t};\n\t\t};\n\n\t},\n\n\trefreshPositions: function(fast) {\n\n\t\t//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change\n\t\tif(this.offsetParent && this.helper) {\n\t\t\tthis.offset.parent = this._getParentOffset();\n\t\t}\n\n\t\tfor (var i = this.items.length - 1; i >= 0; i--){\n\t\t\tvar item = this.items[i];\n\n\t\t\t//We ignore calculating positions of all connected containers when we're not over them\n\t\t\tif(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])\n\t\t\t\tcontinue;\n\n\t\t\tvar t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;\n\n\t\t\tif (!fast) {\n\t\t\t\titem.width = t.outerWidth();\n\t\t\t\titem.height = t.outerHeight();\n\t\t\t}\n\n\t\t\tvar p = t.offset();\n\t\t\titem.left = p.left;\n\t\t\titem.top = p.top;\n\t\t};\n\n\t\tif(this.options.custom && this.options.custom.refreshContainers) {\n\t\t\tthis.options.custom.refreshContainers.call(this);\n\t\t} else {\n\t\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\t\tvar p = this.containers[i].element.offset();\n\t\t\t\tthis.containers[i].containerCache.left = p.left;\n\t\t\t\tthis.containers[i].containerCache.top = p.top;\n\t\t\t\tthis.containers[i].containerCache.width\t= this.containers[i].element.outerWidth();\n\t\t\t\tthis.containers[i].containerCache.height = this.containers[i].element.outerHeight();\n\t\t\t};\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_createPlaceholder: function(that) {\n\n\t\tvar self = that || this, o = self.options;\n\n\t\tif(!o.placeholder || o.placeholder.constructor == String) {\n\t\t\tvar className = o.placeholder;\n\t\t\to.placeholder = {\n\t\t\t\telement: function() {\n\n\t\t\t\t\tvar el = $(document.createElement(self.currentItem[0].nodeName))\n\t\t\t\t\t\t.addClass(className || self.currentItem[0].className+\" ui-sortable-placeholder\")\n\t\t\t\t\t\t.removeClass(\"ui-sortable-helper\")[0];\n\n\t\t\t\t\tif(!className)\n\t\t\t\t\t\tel.style.visibility = \"hidden\";\n\n\t\t\t\t\treturn el;\n\t\t\t\t},\n\t\t\t\tupdate: function(container, p) {\n\n\t\t\t\t\t// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that\n\t\t\t\t\t// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified\n\t\t\t\t\tif(className && !o.forcePlaceholderSize) return;\n\n\t\t\t\t\t//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item\n\t\t\t\t\tif(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); };\n\t\t\t\t\tif(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); };\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t//Create the placeholder\n\t\tself.placeholder = $(o.placeholder.element.call(self.element, self.currentItem));\n\n\t\t//Append it after the actual current item\n\t\tself.currentItem.after(self.placeholder);\n\n\t\t//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)\n\t\to.placeholder.update(self, self.placeholder);\n\n\t},\n\n\t_contactContainers: function(event) {\n\t\t\n\t\t// get innermost container that intersects with item \n\t\tvar innermostContainer = null, innermostIndex = null;\t\t\n\t\t\n\t\t\n\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\n\t\t\t// never consider a container that's located within the item itself \n\t\t\tif($.ui.contains(this.currentItem[0], this.containers[i].element[0]))\n\t\t\t\tcontinue;\n\n\t\t\tif(this._intersectsWith(this.containers[i].containerCache)) {\n\n\t\t\t\t// if we've already found a container and it's more \"inner\" than this, then continue \n\t\t\t\tif(innermostContainer && $.ui.contains(this.containers[i].element[0], innermostContainer.element[0]))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tinnermostContainer = this.containers[i]; \n\t\t\t\tinnermostIndex = i;\n\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// container doesn't intersect. trigger \"out\" event if necessary \n\t\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\t\tthis.containers[i]._trigger(\"out\", event, this._uiHash(this));\n\t\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\n\t\t// if no intersecting containers found, return \n\t\tif(!innermostContainer) return; \n\n\t\t// move the item into the container if it's not there already\n\t\tif(this.containers.length === 1) {\n\t\t\tthis.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\t\t\tthis.containers[innermostIndex].containerCache.over = 1;\n\t\t} else if(this.currentContainer != this.containers[innermostIndex]) {\n\n\t\t\t//When entering a new container, we will find the item with the least distance and append our item near it\n\t\t\tvar dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top'];\n\t\t\tfor (var j = this.items.length - 1; j >= 0; j--) {\n\t\t\t\tif(!$.ui.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;\n\t\t\t\tvar cur = this.containers[innermostIndex].floating ? this.items[j].item.offset().left : this.items[j].item.offset().top;\n\t\t\t\tif(Math.abs(cur - base) < dist) {\n\t\t\t\t\tdist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];\n\t\t\t\t\tthis.direction = (cur - base > 0) ? 'down' : 'up';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled\n\t\t\t\treturn;\n\n\t\t\tthis.currentContainer = this.containers[innermostIndex];\n\t\t\titemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);\n\t\t\tthis._trigger(\"change\", event, this._uiHash());\n\t\t\tthis.containers[innermostIndex]._trigger(\"change\", event, this._uiHash(this));\n\n\t\t\t//Update the placeholder\n\t\t\tthis.options.placeholder.update(this.currentContainer, this.placeholder);\n\n\t\t\tthis.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\t\t\tthis.containers[innermostIndex].containerCache.over = 1;\n\t\t} \n\t\n\t\t\n\t},\n\n\t_createHelper: function(event) {\n\n\t\tvar o = this.options;\n\t\tvar helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);\n\n\t\tif(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already\n\t\t\t$(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);\n\n\t\tif(helper[0] == this.currentItem[0])\n\t\t\tthis._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css(\"position\"), top: this.currentItem.css(\"top\"), left: this.currentItem.css(\"left\") };\n\n\t\tif(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());\n\t\tif(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());\n\n\t\treturn helper;\n\n\t},\n\n\t_adjustOffsetFromHelper: function(obj) {\n\t\tif (typeof obj == 'string') {\n\t\t\tobj = obj.split(' ');\n\t\t}\n\t\tif ($.isArray(obj)) {\n\t\t\tobj = {left: +obj[0], top: +obj[1] || 0};\n\t\t}\n\t\tif ('left' in obj) {\n\t\t\tthis.offset.click.left = obj.left + this.margins.left;\n\t\t}\n\t\tif ('right' in obj) {\n\t\t\tthis.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;\n\t\t}\n\t\tif ('top' in obj) {\n\t\t\tthis.offset.click.top = obj.top + this.margins.top;\n\t\t}\n\t\tif ('bottom' in obj) {\n\t\t\tthis.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;\n\t\t}\n\t},\n\n\t_getParentOffset: function() {\n\n\n\t\t//Get the offsetParent and cache its position\n\t\tthis.offsetParent = this.helper.offsetParent();\n\t\tvar po = this.offsetParent.offset();\n\n\t\t// This is a special case where we need to modify a offset calculated on start, since the following happened:\n\t\t// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent\n\t\t// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that\n\t\t//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag\n\t\tif(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {\n\t\t\tpo.left += this.scrollParent.scrollLeft();\n\t\t\tpo.top += this.scrollParent.scrollTop();\n\t\t}\n\n\t\tif((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information\n\t\t|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix\n\t\t\tpo = { top: 0, left: 0 };\n\n\t\treturn {\n\t\t\ttop: po.top + (parseInt(this.offsetParent.css(\"borderTopWidth\"),10) || 0),\n\t\t\tleft: po.left + (parseInt(this.offsetParent.css(\"borderLeftWidth\"),10) || 0)\n\t\t};\n\n\t},\n\n\t_getRelativeOffset: function() {\n\n\t\tif(this.cssPosition == \"relative\") {\n\t\t\tvar p = this.currentItem.position();\n\t\t\treturn {\n\t\t\t\ttop: p.top - (parseInt(this.helper.css(\"top\"),10) || 0) + this.scrollParent.scrollTop(),\n\t\t\t\tleft: p.left - (parseInt(this.helper.css(\"left\"),10) || 0) + this.scrollParent.scrollLeft()\n\t\t\t};\n\t\t} else {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t},\n\n\t_cacheMargins: function() {\n\t\tthis.margins = {\n\t\t\tleft: (parseInt(this.currentItem.css(\"marginLeft\"),10) || 0),\n\t\t\ttop: (parseInt(this.currentItem.css(\"marginTop\"),10) || 0)\n\t\t};\n\t},\n\n\t_cacheHelperProportions: function() {\n\t\tthis.helperProportions = {\n\t\t\twidth: this.helper.outerWidth(),\n\t\t\theight: this.helper.outerHeight()\n\t\t};\n\t},\n\n\t_setContainment: function() {\n\n\t\tvar o = this.options;\n\t\tif(o.containment == 'parent') o.containment = this.helper[0].parentNode;\n\t\tif(o.containment == 'document' || o.containment == 'window') this.containment = [\n\t\t\t0 - this.offset.relative.left - this.offset.parent.left,\n\t\t\t0 - this.offset.relative.top - this.offset.parent.top,\n\t\t\t$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,\n\t\t\t($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top\n\t\t];\n\n\t\tif(!(/^(document|window|parent)$/).test(o.containment)) {\n\t\t\tvar ce = $(o.containment)[0];\n\t\t\tvar co = $(o.containment).offset();\n\t\t\tvar over = ($(ce).css(\"overflow\") != 'hidden');\n\n\t\t\tthis.containment = [\n\t\t\t\tco.left + (parseInt($(ce).css(\"borderLeftWidth\"),10) || 0) + (parseInt($(ce).css(\"paddingLeft\"),10) || 0) - this.margins.left,\n\t\t\t\tco.top + (parseInt($(ce).css(\"borderTopWidth\"),10) || 0) + (parseInt($(ce).css(\"paddingTop\"),10) || 0) - this.margins.top,\n\t\t\t\tco.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css(\"borderLeftWidth\"),10) || 0) - (parseInt($(ce).css(\"paddingRight\"),10) || 0) - this.helperProportions.width - this.margins.left,\n\t\t\t\tco.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css(\"borderTopWidth\"),10) || 0) - (parseInt($(ce).css(\"paddingBottom\"),10) || 0) - this.helperProportions.height - this.margins.top\n\t\t\t];\n\t\t}\n\n\t},\n\n\t_convertPositionTo: function(d, pos) {\n\n\t\tif(!pos) pos = this.position;\n\t\tvar mod = d == \"absolute\" ? 1 : -1;\n\t\tvar o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);\n\n\t\treturn {\n\t\t\ttop: (\n\t\t\t\tpos.top\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t+ this.offset.relative.top * mod\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t+ this.offset.parent.top * mod\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t- ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)\n\t\t\t),\n\t\t\tleft: (\n\t\t\t\tpos.left\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t+ this.offset.relative.left * mod\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t+ this.offset.parent.left * mod\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t- ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)\n\t\t\t)\n\t\t};\n\n\t},\n\n\t_generatePosition: function(event) {\n\n\t\tvar o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);\n\n\t\t// This is another very weird special case that only happens for relative elements:\n\t\t// 1. If the css position is relative\n\t\t// 2. and the scroll parent is the document or similar to the offset parent\n\t\t// we have to refresh the relative offset during the scroll so there are no jumps\n\t\tif(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {\n\t\t\tthis.offset.relative = this._getRelativeOffset();\n\t\t}\n\n\t\tvar pageX = event.pageX;\n\t\tvar pageY = event.pageY;\n\n\t\t/*\n\t\t * - Position constraining -\n\t\t * Constrain the position to a mix of grid, containment.\n\t\t */\n\n\t\tif(this.originalPosition) { //If we are not dragging yet, we won't check for options\n\n\t\t\tif(this.containment) {\n\t\t\t\tif(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;\n\t\t\t\tif(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;\n\t\t\t\tif(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;\n\t\t\t\tif(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;\n\t\t\t}\n\n\t\t\tif(o.grid) {\n\t\t\t\tvar top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];\n\t\t\t\tpageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;\n\n\t\t\t\tvar left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];\n\t\t\t\tpageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\t\t\ttop: (\n\t\t\t\tpageY\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t- this.offset.click.top\t\t\t\t\t\t\t\t\t\t\t\t\t// Click offset (relative to the element)\n\t\t\t\t- this.offset.relative.top\t\t\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t- this.offset.parent.top\t\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))\n\t\t\t),\n\t\t\tleft: (\n\t\t\t\tpageX\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t- this.offset.click.left\t\t\t\t\t\t\t\t\t\t\t\t// Click offset (relative to the element)\n\t\t\t\t- this.offset.relative.left\t\t\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t- this.offset.parent.left\t\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))\n\t\t\t)\n\t\t};\n\n\t},\n\n\t_rearrange: function(event, i, a, hardRefresh) {\n\n\t\ta ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));\n\n\t\t//Various things done here to improve the performance:\n\t\t// 1. we create a setTimeout, that calls refreshPositions\n\t\t// 2. on the instance, we have a counter variable, that get's higher after every append\n\t\t// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same\n\t\t// 4. this lets only the last addition to the timeout stack through\n\t\tthis.counter = this.counter ? ++this.counter : 1;\n\t\tvar self = this, counter = this.counter;\n\n\t\twindow.setTimeout(function() {\n\t\t\tif(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove\n\t\t},0);\n\n\t},\n\n\t_clear: function(event, noPropagation) {\n\n\t\tthis.reverting = false;\n\t\t// We delay all events that have to be triggered to after the point where the placeholder has been removed and\n\t\t// everything else normalized again\n\t\tvar delayedTriggers = [], self = this;\n\n\t\t// We first have to update the dom position of the actual currentItem\n\t\t// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)\n\t\tif(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);\n\t\tthis._noFinalSort = null;\n\n\t\tif(this.helper[0] == this.currentItem[0]) {\n\t\t\tfor(var i in this._storedCSS) {\n\t\t\t\tif(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';\n\t\t\t}\n\t\t\tthis.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\");\n\t\t} else {\n\t\t\tthis.currentItem.show();\n\t\t}\n\n\t\tif(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger(\"receive\", event, this._uiHash(this.fromOutside)); });\n\t\tif((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(\".ui-sortable-helper\")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger(\"update\", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed\n\t\tif(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element\n\t\t\tif(!noPropagation) delayedTriggers.push(function(event) { this._trigger(\"remove\", event, this._uiHash()); });\n\t\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\t\tif($.ui.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) {\n\t\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"receive\", event, this._uiHash(this)); };  }).call(this, this.containers[i]));\n\t\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"update\", event, this._uiHash(this));  }; }).call(this, this.containers[i]));\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\n\t\t//Post events to containers\n\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\tif(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger(\"deactivate\", event, this._uiHash(this)); };  }).call(this, this.containers[i]));\n\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"out\", event, this._uiHash(this)); };  }).call(this, this.containers[i]));\n\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t}\n\t\t}\n\n\t\t//Do what was originally in plugins\n\t\tif(this._storedCursor) $('body').css(\"cursor\", this._storedCursor); //Reset cursor\n\t\tif(this._storedOpacity) this.helper.css(\"opacity\", this._storedOpacity); //Reset opacity\n\t\tif(this._storedZIndex) this.helper.css(\"zIndex\", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index\n\n\t\tthis.dragging = false;\n\t\tif(this.cancelHelperRemoval) {\n\t\t\tif(!noPropagation) {\n\t\t\t\tthis._trigger(\"beforeStop\", event, this._uiHash());\n\t\t\t\tfor (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events\n\t\t\t\tthis._trigger(\"stop\", event, this._uiHash());\n\t\t\t}\n\n\t\t\tthis.fromOutside = false;\n\t\t\treturn false;\n\t\t}\n\n\t\tif(!noPropagation) this._trigger(\"beforeStop\", event, this._uiHash());\n\n\t\t//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!\n\t\tthis.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n\n\t\tif(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;\n\n\t\tif(!noPropagation) {\n\t\t\tfor (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events\n\t\t\tthis._trigger(\"stop\", event, this._uiHash());\n\t\t}\n\n\t\tthis.fromOutside = false;\n\t\treturn true;\n\n\t},\n\n\t_trigger: function() {\n\t\tif ($.Widget.prototype._trigger.apply(this, arguments) === false) {\n\t\t\tthis.cancel();\n\t\t}\n\t},\n\n\t_uiHash: function(inst) {\n\t\tvar self = inst || this;\n\t\treturn {\n\t\t\thelper: self.helper,\n\t\t\tplaceholder: self.placeholder || $([]),\n\t\t\tposition: self.position,\n\t\t\toriginalPosition: self.originalPosition,\n\t\t\toffset: self.positionAbs,\n\t\t\titem: self.currentItem,\n\t\t\tsender: inst ? inst.element : null\n\t\t};\n\t}\n\n});\n\n$.extend($.ui.sortable, {\n\tversion: \"1.8.22\"\n});\n\n})(jQuery);\n\n;jQuery.effects || (function($, undefined) {\n\n$.effects = {};\n\n\n\n/******************************************************************************/\n/****************************** COLOR ANIMATIONS ******************************/\n/******************************************************************************/\n\n// override the animation for color styles\n$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor',\n\t'borderRightColor', 'borderTopColor', 'borderColor', 'color', 'outlineColor'],\nfunction(i, attr) {\n\t$.fx.step[attr] = function(fx) {\n\t\tif (!fx.colorInit) {\n\t\t\tfx.start = getColor(fx.elem, attr);\n\t\t\tfx.end = getRGB(fx.end);\n\t\t\tfx.colorInit = true;\n\t\t}\n\n\t\tfx.elem.style[attr] = 'rgb(' +\n\t\t\tMath.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + ',' +\n\t\t\tMath.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + ',' +\n\t\t\tMath.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ')';\n\t};\n});\n\n// Color Conversion functions from highlightFade\n// By Blair Mitchelmore\n// http://jquery.offput.ca/highlightFade/\n\n// Parse strings looking for color tuples [255,255,255]\nfunction getRGB(color) {\n\t\tvar result;\n\n\t\t// Check if we're already dealing with an array of colors\n\t\tif ( color && color.constructor == Array && color.length == 3 )\n\t\t\t\treturn color;\n\n\t\t// Look for rgb(num,num,num)\n\t\tif (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\n\t\t\t\treturn [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];\n\n\t\t// Look for rgb(num%,num%,num%)\n\t\tif (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\n\t\t\t\treturn [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];\n\n\t\t// Look for #a0b1c2\n\t\tif (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\n\t\t\t\treturn [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];\n\n\t\t// Look for #fff\n\t\tif (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n\t\t\t\treturn [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];\n\n\t\t// Look for rgba(0, 0, 0, 0) == transparent in Safari 3\n\t\tif (result = /rgba\\(0, 0, 0, 0\\)/.exec(color))\n\t\t\t\treturn colors['transparent'];\n\n\t\t// Otherwise, we're most likely dealing with a named color\n\t\treturn colors[$.trim(color).toLowerCase()];\n}\n\nfunction getColor(elem, attr) {\n\t\tvar color;\n\n\t\tdo {\n\t\t\t\t// jQuery <1.4.3 uses curCSS, in 1.4.3 - 1.7.2 curCSS = css, 1.8+ only has css\n\t\t\t\tcolor = ($.curCSS || $.css)(elem, attr);\n\n\t\t\t\t// Keep going until we find an element that has color, or we hit the body\n\t\t\t\tif ( color != '' && color != 'transparent' || $.nodeName(elem, \"body\") )\n\t\t\t\t\t\tbreak;\n\n\t\t\t\tattr = \"backgroundColor\";\n\t\t} while ( elem = elem.parentNode );\n\n\t\treturn getRGB(color);\n};\n\n// Some named colors to work with\n// From Interface by Stefan Petre\n// http://interface.eyecon.ro/\n\nvar colors = {\n\taqua:[0,255,255],\n\tazure:[240,255,255],\n\tbeige:[245,245,220],\n\tblack:[0,0,0],\n\tblue:[0,0,255],\n\tbrown:[165,42,42],\n\tcyan:[0,255,255],\n\tdarkblue:[0,0,139],\n\tdarkcyan:[0,139,139],\n\tdarkgrey:[169,169,169],\n\tdarkgreen:[0,100,0],\n\tdarkkhaki:[189,183,107],\n\tdarkmagenta:[139,0,139],\n\tdarkolivegreen:[85,107,47],\n\tdarkorange:[255,140,0],\n\tdarkorchid:[153,50,204],\n\tdarkred:[139,0,0],\n\tdarksalmon:[233,150,122],\n\tdarkviolet:[148,0,211],\n\tfuchsia:[255,0,255],\n\tgold:[255,215,0],\n\tgreen:[0,128,0],\n\tindigo:[75,0,130],\n\tkhaki:[240,230,140],\n\tlightblue:[173,216,230],\n\tlightcyan:[224,255,255],\n\tlightgreen:[144,238,144],\n\tlightgrey:[211,211,211],\n\tlightpink:[255,182,193],\n\tlightyellow:[255,255,224],\n\tlime:[0,255,0],\n\tmagenta:[255,0,255],\n\tmaroon:[128,0,0],\n\tnavy:[0,0,128],\n\tolive:[128,128,0],\n\torange:[255,165,0],\n\tpink:[255,192,203],\n\tpurple:[128,0,128],\n\tviolet:[128,0,128],\n\tred:[255,0,0],\n\tsilver:[192,192,192],\n\twhite:[255,255,255],\n\tyellow:[255,255,0],\n\ttransparent: [255,255,255]\n};\n\n\n\n/******************************************************************************/\n/****************************** CLASS ANIMATIONS ******************************/\n/******************************************************************************/\n\nvar classAnimationActions = ['add', 'remove', 'toggle'],\n\tshorthandStyles = {\n\t\tborder: 1,\n\t\tborderBottom: 1,\n\t\tborderColor: 1,\n\t\tborderLeft: 1,\n\t\tborderRight: 1,\n\t\tborderTop: 1,\n\t\tborderWidth: 1,\n\t\tmargin: 1,\n\t\tpadding: 1\n\t};\n\nfunction getElementStyles() {\n\tvar style = document.defaultView\n\t\t\t? document.defaultView.getComputedStyle(this, null)\n\t\t\t: this.currentStyle,\n\t\tnewStyle = {},\n\t\tkey,\n\t\tcamelCase;\n\n\t// webkit enumerates style porperties\n\tif (style && style.length && style[0] && style[style[0]]) {\n\t\tvar len = style.length;\n\t\twhile (len--) {\n\t\t\tkey = style[len];\n\t\t\tif (typeof style[key] == 'string') {\n\t\t\t\tcamelCase = key.replace(/\\-(\\w)/g, function(all, letter){\n\t\t\t\t\treturn letter.toUpperCase();\n\t\t\t\t});\n\t\t\t\tnewStyle[camelCase] = style[key];\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor (key in style) {\n\t\t\tif (typeof style[key] === 'string') {\n\t\t\t\tnewStyle[key] = style[key];\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn newStyle;\n}\n\nfunction filterStyles(styles) {\n\tvar name, value;\n\tfor (name in styles) {\n\t\tvalue = styles[name];\n\t\tif (\n\t\t\t// ignore null and undefined values\n\t\t\tvalue == null ||\n\t\t\t// ignore functions (when does this occur?)\n\t\t\t$.isFunction(value) ||\n\t\t\t// shorthand styles that need to be expanded\n\t\t\tname in shorthandStyles ||\n\t\t\t// ignore scrollbars (break in IE)\n\t\t\t(/scrollbar/).test(name) ||\n\n\t\t\t// only colors or values that can be converted to numbers\n\t\t\t(!(/color/i).test(name) && isNaN(parseFloat(value)))\n\t\t) {\n\t\t\tdelete styles[name];\n\t\t}\n\t}\n\t\n\treturn styles;\n}\n\nfunction styleDifference(oldStyle, newStyle) {\n\tvar diff = { _: 0 }, // http://dev.jquery.com/ticket/5459\n\t\tname;\n\n\tfor (name in newStyle) {\n\t\tif (oldStyle[name] != newStyle[name]) {\n\t\t\tdiff[name] = newStyle[name];\n\t\t}\n\t}\n\n\treturn diff;\n}\n\n$.effects.animateClass = function(value, duration, easing, callback) {\n\tif ($.isFunction(easing)) {\n\t\tcallback = easing;\n\t\teasing = null;\n\t}\n\n\treturn this.queue(function() {\n\t\tvar that = $(this),\n\t\t\toriginalStyleAttr = that.attr('style') || ' ',\n\t\t\toriginalStyle = filterStyles(getElementStyles.call(this)),\n\t\t\tnewStyle,\n\t\t\tclassName = that.attr('class') || \"\";\n\n\t\t$.each(classAnimationActions, function(i, action) {\n\t\t\tif (value[action]) {\n\t\t\t\tthat[action + 'Class'](value[action]);\n\t\t\t}\n\t\t});\n\t\tnewStyle = filterStyles(getElementStyles.call(this));\n\t\tthat.attr('class', className);\n\n\t\tthat.animate(styleDifference(originalStyle, newStyle), {\n\t\t\tqueue: false,\n\t\t\tduration: duration,\n\t\t\teasing: easing,\n\t\t\tcomplete: function() {\n\t\t\t\t$.each(classAnimationActions, function(i, action) {\n\t\t\t\t\tif (value[action]) { that[action + 'Class'](value[action]); }\n\t\t\t\t});\n\t\t\t\t// work around bug in IE by clearing the cssText before setting it\n\t\t\t\tif (typeof that.attr('style') == 'object') {\n\t\t\t\t\tthat.attr('style').cssText = '';\n\t\t\t\t\tthat.attr('style').cssText = originalStyleAttr;\n\t\t\t\t} else {\n\t\t\t\t\tthat.attr('style', originalStyleAttr);\n\t\t\t\t}\n\t\t\t\tif (callback) { callback.apply(this, arguments); }\n\t\t\t\t$.dequeue( this );\n\t\t\t}\n\t\t});\n\t});\n};\n\n$.fn.extend({\n\t_addClass: $.fn.addClass,\n\taddClass: function(classNames, speed, easing, callback) {\n\t\treturn speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);\n\t},\n\n\t_removeClass: $.fn.removeClass,\n\tremoveClass: function(classNames,speed,easing,callback) {\n\t\treturn speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);\n\t},\n\n\t_toggleClass: $.fn.toggleClass,\n\ttoggleClass: function(classNames, force, speed, easing, callback) {\n\t\tif ( typeof force == \"boolean\" || force === undefined ) {\n\t\t\tif ( !speed ) {\n\t\t\t\t// without speed parameter;\n\t\t\t\treturn this._toggleClass(classNames, force);\n\t\t\t} else {\n\t\t\t\treturn $.effects.animateClass.apply(this, [(force?{add:classNames}:{remove:classNames}),speed,easing,callback]);\n\t\t\t}\n\t\t} else {\n\t\t\t// without switch parameter;\n\t\t\treturn $.effects.animateClass.apply(this, [{ toggle: classNames },force,speed,easing]);\n\t\t}\n\t},\n\n\tswitchClass: function(remove,add,speed,easing,callback) {\n\t\treturn $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);\n\t}\n});\n\n\n\n/******************************************************************************/\n/*********************************** EFFECTS **********************************/\n/******************************************************************************/\n\n$.extend($.effects, {\n\tversion: \"1.8.22\",\n\n\t// Saves a set of properties in a data storage\n\tsave: function(element, set) {\n\t\tfor(var i=0; i < set.length; i++) {\n\t\t\tif(set[i] !== null) element.data(\"ec.storage.\"+set[i], element[0].style[set[i]]);\n\t\t}\n\t},\n\n\t// Restores a set of previously saved properties from a data storage\n\trestore: function(element, set) {\n\t\tfor(var i=0; i < set.length; i++) {\n\t\t\tif(set[i] !== null) element.css(set[i], element.data(\"ec.storage.\"+set[i]));\n\t\t}\n\t},\n\n\tsetMode: function(el, mode) {\n\t\tif (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle\n\t\treturn mode;\n\t},\n\n\tgetBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value\n\t\t// this should be a little more flexible in the future to handle a string & hash\n\t\tvar y, x;\n\t\tswitch (origin[0]) {\n\t\t\tcase 'top': y = 0; break;\n\t\t\tcase 'middle': y = 0.5; break;\n\t\t\tcase 'bottom': y = 1; break;\n\t\t\tdefault: y = origin[0] / original.height;\n\t\t};\n\t\tswitch (origin[1]) {\n\t\t\tcase 'left': x = 0; break;\n\t\t\tcase 'center': x = 0.5; break;\n\t\t\tcase 'right': x = 1; break;\n\t\t\tdefault: x = origin[1] / original.width;\n\t\t};\n\t\treturn {x: x, y: y};\n\t},\n\n\t// Wraps the element around a wrapper that copies position properties\n\tcreateWrapper: function(element) {\n\n\t\t// if the element is already wrapped, return it\n\t\tif (element.parent().is('.ui-effects-wrapper')) {\n\t\t\treturn element.parent();\n\t\t}\n\n\t\t// wrap the element\n\t\tvar props = {\n\t\t\t\twidth: element.outerWidth(true),\n\t\t\t\theight: element.outerHeight(true),\n\t\t\t\t'float': element.css('float')\n\t\t\t},\n\t\t\twrapper = $('<div></div>')\n\t\t\t\t.addClass('ui-effects-wrapper')\n\t\t\t\t.css({\n\t\t\t\t\tfontSize: '100%',\n\t\t\t\t\tbackground: 'transparent',\n\t\t\t\t\tborder: 'none',\n\t\t\t\t\tmargin: 0,\n\t\t\t\t\tpadding: 0\n\t\t\t\t}),\n\t\t\tactive = document.activeElement;\n\n\t\t// support: Firefox\n\t\t// Firefox incorrectly exposes anonymous content\n\t\t// https://bugzilla.mozilla.org/show_bug.cgi?id=561664\n\t\ttry {\n\t\t\tactive.id;\n\t\t} catch( e ) {\n\t\t\tactive = document.body;\n\t\t}\n\n\t\telement.wrap( wrapper );\n\n\t\t// Fixes #7595 - Elements lose focus when wrapped.\n\t\tif ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {\n\t\t\t$( active ).focus();\n\t\t}\n\t\t\n\t\twrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element\n\n\t\t// transfer positioning properties to the wrapper\n\t\tif (element.css('position') == 'static') {\n\t\t\twrapper.css({ position: 'relative' });\n\t\t\telement.css({ position: 'relative' });\n\t\t} else {\n\t\t\t$.extend(props, {\n\t\t\t\tposition: element.css('position'),\n\t\t\t\tzIndex: element.css('z-index')\n\t\t\t});\n\t\t\t$.each(['top', 'left', 'bottom', 'right'], function(i, pos) {\n\t\t\t\tprops[pos] = element.css(pos);\n\t\t\t\tif (isNaN(parseInt(props[pos], 10))) {\n\t\t\t\t\tprops[pos] = 'auto';\n\t\t\t\t}\n\t\t\t});\n\t\t\telement.css({position: 'relative', top: 0, left: 0, right: 'auto', bottom: 'auto' });\n\t\t}\n\n\t\treturn wrapper.css(props).show();\n\t},\n\n\tremoveWrapper: function(element) {\n\t\tvar parent,\n\t\t\tactive = document.activeElement;\n\t\t\n\t\tif (element.parent().is('.ui-effects-wrapper')) {\n\t\t\tparent = element.parent().replaceWith(element);\n\t\t\t// Fixes #7595 - Elements lose focus when wrapped.\n\t\t\tif ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {\n\t\t\t\t$( active ).focus();\n\t\t\t}\n\t\t\treturn parent;\n\t\t}\n\t\t\t\n\t\treturn element;\n\t},\n\n\tsetTransition: function(element, list, factor, value) {\n\t\tvalue = value || {};\n\t\t$.each(list, function(i, x){\n\t\t\tvar unit = element.cssUnit(x);\n\t\t\tif (unit[0] > 0) value[x] = unit[0] * factor + unit[1];\n\t\t});\n\t\treturn value;\n\t}\n});\n\n\nfunction _normalizeArguments(effect, options, speed, callback) {\n\t// shift params for method overloading\n\tif (typeof effect == 'object') {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = effect;\n\t\teffect = options.effect;\n\t}\n\tif ($.isFunction(options)) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n        if (typeof options == 'number' || $.fx.speeds[options]) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\tif ($.isFunction(speed)) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\toptions = options || {};\n\n\tspeed = speed || options.duration;\n\tspeed = $.fx.off ? 0 : typeof speed == 'number'\n\t\t? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default;\n\n\tcallback = callback || options.complete;\n\n\treturn [effect, options, speed, callback];\n}\n\nfunction standardSpeed( speed ) {\n\t// valid standard speeds\n\tif ( !speed || typeof speed === \"number\" || $.fx.speeds[ speed ] ) {\n\t\treturn true;\n\t}\n\t\n\t// invalid strings - treat as \"normal\" speed\n\tif ( typeof speed === \"string\" && !$.effects[ speed ] ) {\n\t\treturn true;\n\t}\n\t\n\treturn false;\n}\n\n$.fn.extend({\n\teffect: function(effect, options, speed, callback) {\n\t\tvar args = _normalizeArguments.apply(this, arguments),\n\t\t\t// TODO: make effects take actual parameters instead of a hash\n\t\t\targs2 = {\n\t\t\t\toptions: args[1],\n\t\t\t\tduration: args[2],\n\t\t\t\tcallback: args[3]\n\t\t\t},\n\t\t\tmode = args2.options.mode,\n\t\t\teffectMethod = $.effects[effect];\n\t\t\n\t\tif ( $.fx.off || !effectMethod ) {\n\t\t\t// delegate to the original method (e.g., .show()) if possible\n\t\t\tif ( mode ) {\n\t\t\t\treturn this[ mode ]( args2.duration, args2.callback );\n\t\t\t} else {\n\t\t\t\treturn this.each(function() {\n\t\t\t\t\tif ( args2.callback ) {\n\t\t\t\t\t\targs2.callback.call( this );\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn effectMethod.call(this, args2);\n\t},\n\n\t_show: $.fn.show,\n\tshow: function(speed) {\n\t\tif ( standardSpeed( speed ) ) {\n\t\t\treturn this._show.apply(this, arguments);\n\t\t} else {\n\t\t\tvar args = _normalizeArguments.apply(this, arguments);\n\t\t\targs[1].mode = 'show';\n\t\t\treturn this.effect.apply(this, args);\n\t\t}\n\t},\n\n\t_hide: $.fn.hide,\n\thide: function(speed) {\n\t\tif ( standardSpeed( speed ) ) {\n\t\t\treturn this._hide.apply(this, arguments);\n\t\t} else {\n\t\t\tvar args = _normalizeArguments.apply(this, arguments);\n\t\t\targs[1].mode = 'hide';\n\t\t\treturn this.effect.apply(this, args);\n\t\t}\n\t},\n\n\t// jQuery core overloads toggle and creates _toggle\n\t__toggle: $.fn.toggle,\n\ttoggle: function(speed) {\n\t\tif ( standardSpeed( speed ) || typeof speed === \"boolean\" || $.isFunction( speed ) ) {\n\t\t\treturn this.__toggle.apply(this, arguments);\n\t\t} else {\n\t\t\tvar args = _normalizeArguments.apply(this, arguments);\n\t\t\targs[1].mode = 'toggle';\n\t\t\treturn this.effect.apply(this, args);\n\t\t}\n\t},\n\n\t// helper functions\n\tcssUnit: function(key) {\n\t\tvar style = this.css(key), val = [];\n\t\t$.each( ['em','px','%','pt'], function(i, unit){\n\t\t\tif(style.indexOf(unit) > 0)\n\t\t\t\tval = [parseFloat(style), unit];\n\t\t});\n\t\treturn val;\n\t}\n});\n\n\n\n/******************************************************************************/\n/*********************************** EASING ***********************************/\n/******************************************************************************/\n\n/*\n * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/\n *\n * Uses the built in easing capabilities added In jQuery 1.1\n * to offer multiple easing options\n *\n * TERMS OF USE - jQuery Easing\n *\n * Open source under the BSD License.\n *\n * Copyright 2008 George McGinley Smith\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * Neither the name of the author nor the names of contributors may be used to endorse\n * or promote products derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n*/\n\n// t: current time, b: begInnIng value, c: change In value, d: duration\n$.easing.jswing = $.easing.swing;\n\n$.extend($.easing,\n{\n\tdef: 'easeOutQuad',\n\tswing: function (x, t, b, c, d) {\n\t\t//alert($.easing.default);\n\t\treturn $.easing[$.easing.def](x, t, b, c, d);\n\t},\n\teaseInQuad: function (x, t, b, c, d) {\n\t\treturn c*(t/=d)*t + b;\n\t},\n\teaseOutQuad: function (x, t, b, c, d) {\n\t\treturn -c *(t/=d)*(t-2) + b;\n\t},\n\teaseInOutQuad: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return c/2*t*t + b;\n\t\treturn -c/2 * ((--t)*(t-2) - 1) + b;\n\t},\n\teaseInCubic: function (x, t, b, c, d) {\n\t\treturn c*(t/=d)*t*t + b;\n\t},\n\teaseOutCubic: function (x, t, b, c, d) {\n\t\treturn c*((t=t/d-1)*t*t + 1) + b;\n\t},\n\teaseInOutCubic: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return c/2*t*t*t + b;\n\t\treturn c/2*((t-=2)*t*t + 2) + b;\n\t},\n\teaseInQuart: function (x, t, b, c, d) {\n\t\treturn c*(t/=d)*t*t*t + b;\n\t},\n\teaseOutQuart: function (x, t, b, c, d) {\n\t\treturn -c * ((t=t/d-1)*t*t*t - 1) + b;\n\t},\n\teaseInOutQuart: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return c/2*t*t*t*t + b;\n\t\treturn -c/2 * ((t-=2)*t*t*t - 2) + b;\n\t},\n\teaseInQuint: function (x, t, b, c, d) {\n\t\treturn c*(t/=d)*t*t*t*t + b;\n\t},\n\teaseOutQuint: function (x, t, b, c, d) {\n\t\treturn c*((t=t/d-1)*t*t*t*t + 1) + b;\n\t},\n\teaseInOutQuint: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;\n\t\treturn c/2*((t-=2)*t*t*t*t + 2) + b;\n\t},\n\teaseInSine: function (x, t, b, c, d) {\n\t\treturn -c * Math.cos(t/d * (Math.PI/2)) + c + b;\n\t},\n\teaseOutSine: function (x, t, b, c, d) {\n\t\treturn c * Math.sin(t/d * (Math.PI/2)) + b;\n\t},\n\teaseInOutSine: function (x, t, b, c, d) {\n\t\treturn -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;\n\t},\n\teaseInExpo: function (x, t, b, c, d) {\n\t\treturn (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;\n\t},\n\teaseOutExpo: function (x, t, b, c, d) {\n\t\treturn (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;\n\t},\n\teaseInOutExpo: function (x, t, b, c, d) {\n\t\tif (t==0) return b;\n\t\tif (t==d) return b+c;\n\t\tif ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;\n\t\treturn c/2 * (-Math.pow(2, -10 * --t) + 2) + b;\n\t},\n\teaseInCirc: function (x, t, b, c, d) {\n\t\treturn -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;\n\t},\n\teaseOutCirc: function (x, t, b, c, d) {\n\t\treturn c * Math.sqrt(1 - (t=t/d-1)*t) + b;\n\t},\n\teaseInOutCirc: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;\n\t\treturn c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;\n\t},\n\teaseInElastic: function (x, t, b, c, d) {\n\t\tvar s=1.70158;var p=0;var a=c;\n\t\tif (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;\n\t\tif (a < Math.abs(c)) { a=c; var s=p/4; }\n\t\telse var s = p/(2*Math.PI) * Math.asin (c/a);\n\t\treturn -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;\n\t},\n\teaseOutElastic: function (x, t, b, c, d) {\n\t\tvar s=1.70158;var p=0;var a=c;\n\t\tif (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;\n\t\tif (a < Math.abs(c)) { a=c; var s=p/4; }\n\t\telse var s = p/(2*Math.PI) * Math.asin (c/a);\n\t\treturn a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;\n\t},\n\teaseInOutElastic: function (x, t, b, c, d) {\n\t\tvar s=1.70158;var p=0;var a=c;\n\t\tif (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);\n\t\tif (a < Math.abs(c)) { a=c; var s=p/4; }\n\t\telse var s = p/(2*Math.PI) * Math.asin (c/a);\n\t\tif (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;\n\t\treturn a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;\n\t},\n\teaseInBack: function (x, t, b, c, d, s) {\n\t\tif (s == undefined) s = 1.70158;\n\t\treturn c*(t/=d)*t*((s+1)*t - s) + b;\n\t},\n\teaseOutBack: function (x, t, b, c, d, s) {\n\t\tif (s == undefined) s = 1.70158;\n\t\treturn c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;\n\t},\n\teaseInOutBack: function (x, t, b, c, d, s) {\n\t\tif (s == undefined) s = 1.70158;\n\t\tif ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;\n\t\treturn c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;\n\t},\n\teaseInBounce: function (x, t, b, c, d) {\n\t\treturn c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;\n\t},\n\teaseOutBounce: function (x, t, b, c, d) {\n\t\tif ((t/=d) < (1/2.75)) {\n\t\t\treturn c*(7.5625*t*t) + b;\n\t\t} else if (t < (2/2.75)) {\n\t\t\treturn c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;\n\t\t} else if (t < (2.5/2.75)) {\n\t\t\treturn c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;\n\t\t} else {\n\t\t\treturn c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;\n\t\t}\n\t},\n\teaseInOutBounce: function (x, t, b, c, d) {\n\t\tif (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;\n\t\treturn $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;\n\t}\n});\n\n/*\n *\n * TERMS OF USE - EASING EQUATIONS\n *\n * Open source under the BSD License.\n *\n * Copyright 2001 Robert Penner\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * Neither the name of the author nor the names of contributors may be used to endorse\n * or promote products derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n */\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.effects.blind = function(o) {\n\n\treturn this.queue(function() {\n\n\t\t// Create element\n\t\tvar el = $(this), props = ['position','top','bottom','left','right'];\n\n\t\t// Set options\n\t\tvar mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode\n\t\tvar direction = o.options.direction || 'vertical'; // Default direction\n\n\t\t// Adjust\n\t\t$.effects.save(el, props); el.show(); // Save & Show\n\t\tvar wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper\n\t\tvar ref = (direction == 'vertical') ? 'height' : 'width';\n\t\tvar distance = (direction == 'vertical') ? wrapper.height() : wrapper.width();\n\t\tif(mode == 'show') wrapper.css(ref, 0); // Shift\n\n\t\t// Animation\n\t\tvar animation = {};\n\t\tanimation[ref] = mode == 'show' ? distance : 0;\n\n\t\t// Animate\n\t\twrapper.animate(animation, o.duration, o.options.easing, function() {\n\t\t\tif(mode == 'hide') el.hide(); // Hide\n\t\t\t$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore\n\t\t\tif(o.callback) o.callback.apply(el[0], arguments); // Callback\n\t\t\tel.dequeue();\n\t\t});\n\n\t});\n\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.effects.bounce = function(o) {\n\n\treturn this.queue(function() {\n\n\t\t// Create element\n\t\tvar el = $(this), props = ['position','top','bottom','left','right'];\n\n\t\t// Set options\n\t\tvar mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode\n\t\tvar direction = o.options.direction || 'up'; // Default direction\n\t\tvar distance = o.options.distance || 20; // Default distance\n\t\tvar times = o.options.times || 5; // Default # of times\n\t\tvar speed = o.duration || 250; // Default speed per bounce\n\t\tif (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE\n\n\t\t// Adjust\n\t\t$.effects.save(el, props); el.show(); // Save & Show\n\t\t$.effects.createWrapper(el); // Create Wrapper\n\t\tvar ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';\n\t\tvar motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';\n\t\tvar distance = o.options.distance || (ref == 'top' ? el.outerHeight(true) / 3 : el.outerWidth(true) / 3);\n\t\tif (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift\n\t\tif (mode == 'hide') distance = distance / (times * 2);\n\t\tif (mode != 'hide') times--;\n\n\t\t// Animate\n\t\tif (mode == 'show') { // Show Bounce\n\t\t\tvar animation = {opacity: 1};\n\t\t\tanimation[ref] = (motion == 'pos' ? '+=' : '-=') + distance;\n\t\t\tel.animate(animation, speed / 2, o.options.easing);\n\t\t\tdistance = distance / 2;\n\t\t\ttimes--;\n\t\t};\n\t\tfor (var i = 0; i < times; i++) { // Bounces\n\t\t\tvar animation1 = {}, animation2 = {};\n\t\t\tanimation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;\n\t\t\tanimation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;\n\t\t\tel.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing);\n\t\t\tdistance = (mode == 'hide') ? distance * 2 : distance / 2;\n\t\t};\n\t\tif (mode == 'hide') { // Last Bounce\n\t\t\tvar animation = {opacity: 0};\n\t\t\tanimation[ref] = (motion == 'pos' ? '-=' : '+=')  + distance;\n\t\t\tel.animate(animation, speed / 2, o.options.easing, function(){\n\t\t\t\tel.hide(); // Hide\n\t\t\t\t$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore\n\t\t\t\tif(o.callback) o.callback.apply(this, arguments); // Callback\n\t\t\t});\n\t\t} else {\n\t\t\tvar animation1 = {}, animation2 = {};\n\t\t\tanimation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;\n\t\t\tanimation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;\n\t\t\tel.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){\n\t\t\t\t$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore\n\t\t\t\tif(o.callback) o.callback.apply(this, arguments); // Callback\n\t\t\t});\n\t\t};\n\t\tel.queue('fx', function() { el.dequeue(); });\n\t\tel.dequeue();\n\t});\n\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.effects.clip = function(o) {\n\n\treturn this.queue(function() {\n\n\t\t// Create element\n\t\tvar el = $(this), props = ['position','top','bottom','left','right','height','width'];\n\n\t\t// Set options\n\t\tvar mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode\n\t\tvar direction = o.options.direction || 'vertical'; // Default direction\n\n\t\t// Adjust\n\t\t$.effects.save(el, props); el.show(); // Save & Show\n\t\tvar wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper\n\t\tvar animate = el[0].tagName == 'IMG' ? wrapper : el;\n\t\tvar ref = {\n\t\t\tsize: (direction == 'vertical') ? 'height' : 'width',\n\t\t\tposition: (direction == 'vertical') ? 'top' : 'left'\n\t\t};\n\t\tvar distance = (direction == 'vertical') ? animate.height() : animate.width();\n\t\tif(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift\n\n\t\t// Animation\n\t\tvar animation = {};\n\t\tanimation[ref.size] = mode == 'show' ? distance : 0;\n\t\tanimation[ref.position] = mode == 'show' ? 0 : distance / 2;\n\n\t\t// Animate\n\t\tanimate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {\n\t\t\tif(mode == 'hide') el.hide(); // Hide\n\t\t\t$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore\n\t\t\tif(o.callback) o.callback.apply(el[0], arguments); // Callback\n\t\t\tel.dequeue();\n\t\t}});\n\n\t});\n\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.effects.drop = function(o) {\n\n\treturn this.queue(function() {\n\n\t\t// Create element\n\t\tvar el = $(this), props = ['position','top','bottom','left','right','opacity'];\n\n\t\t// Set options\n\t\tvar mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode\n\t\tvar direction = o.options.direction || 'left'; // Default Direction\n\n\t\t// Adjust\n\t\t$.effects.save(el, props); el.show(); // Save & Show\n\t\t$.effects.createWrapper(el); // Create Wrapper\n\t\tvar ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';\n\t\tvar motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';\n\t\tvar distance = o.options.distance || (ref == 'top' ? el.outerHeight( true ) / 2 : el.outerWidth( true ) / 2);\n\t\tif (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift\n\n\t\t// Animation\n\t\tvar animation = {opacity: mode == 'show' ? 1 : 0};\n\t\tanimation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;\n\n\t\t// Animate\n\t\tel.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {\n\t\t\tif(mode == 'hide') el.hide(); // Hide\n\t\t\t$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore\n\t\t\tif(o.callback) o.callback.apply(this, arguments); // Callback\n\t\t\tel.dequeue();\n\t\t}});\n\n\t});\n\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.effects.explode = function(o) {\n\n\treturn this.queue(function() {\n\n\tvar rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;\n\tvar cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;\n\n\to.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode;\n\tvar el = $(this).show().css('visibility', 'hidden');\n\tvar offset = el.offset();\n\n\t//Substract the margins - not fixing the problem yet.\n\toffset.top -= parseInt(el.css(\"marginTop\"),10) || 0;\n\toffset.left -= parseInt(el.css(\"marginLeft\"),10) || 0;\n\n\tvar width = el.outerWidth(true);\n\tvar height = el.outerHeight(true);\n\n\tfor(var i=0;i<rows;i++) { // =\n\t\tfor(var j=0;j<cells;j++) { // ||\n\t\t\tel\n\t\t\t\t.clone()\n\t\t\t\t.appendTo('body')\n\t\t\t\t.wrap('<div></div>')\n\t\t\t\t.css({\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tvisibility: 'visible',\n\t\t\t\t\tleft: -j*(width/cells),\n\t\t\t\t\ttop: -i*(height/rows)\n\t\t\t\t})\n\t\t\t\t.parent()\n\t\t\t\t.addClass('ui-effects-explode')\n\t\t\t\t.css({\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\twidth: width/cells,\n\t\t\t\t\theight: height/rows,\n\t\t\t\t\tleft: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0),\n\t\t\t\t\ttop: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0),\n\t\t\t\t\topacity: o.options.mode == 'show' ? 0 : 1\n\t\t\t\t}).animate({\n\t\t\t\t\tleft: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)),\n\t\t\t\t\ttop: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)),\n\t\t\t\t\topacity: o.options.mode == 'show' ? 1 : 0\n\t\t\t\t}, o.duration || 500);\n\t\t}\n\t}\n\n\t// Set a timeout, to call the callback approx. when the other animations have finished\n\tsetTimeout(function() {\n\n\t\to.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide();\n\t\t\t\tif(o.callback) o.callback.apply(el[0]); // Callback\n\t\t\t\tel.dequeue();\n\n\t\t\t\t$('div.ui-effects-explode').remove();\n\n\t}, o.duration || 500);\n\n\n\t});\n\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.effects.fade = function(o) {\n\treturn this.queue(function() {\n\t\tvar elem = $(this),\n\t\t\tmode = $.effects.setMode(elem, o.options.mode || 'hide');\n\n\t\telem.animate({ opacity: mode }, {\n\t\t\tqueue: false,\n\t\t\tduration: o.duration,\n\t\t\teasing: o.options.easing,\n\t\t\tcomplete: function() {\n\t\t\t\t(o.callback && o.callback.apply(this, arguments));\n\t\t\t\telem.dequeue();\n\t\t\t}\n\t\t});\n\t});\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.effects.fold = function(o) {\n\n\treturn this.queue(function() {\n\n\t\t// Create element\n\t\tvar el = $(this), props = ['position','top','bottom','left','right'];\n\n\t\t// Set options\n\t\tvar mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode\n\t\tvar size = o.options.size || 15; // Default fold size\n\t\tvar horizFirst = !(!o.options.horizFirst); // Ensure a boolean value\n\t\tvar duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;\n\n\t\t// Adjust\n\t\t$.effects.save(el, props); el.show(); // Save & Show\n\t\tvar wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper\n\t\tvar widthFirst = ((mode == 'show') != horizFirst);\n\t\tvar ref = widthFirst ? ['width', 'height'] : ['height', 'width'];\n\t\tvar distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()];\n\t\tvar percent = /([0-9]+)%/.exec(size);\n\t\tif(percent) size = parseInt(percent[1],10) / 100 * distance[mode == 'hide' ? 0 : 1];\n\t\tif(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift\n\n\t\t// Animation\n\t\tvar animation1 = {}, animation2 = {};\n\t\tanimation1[ref[0]] = mode == 'show' ? distance[0] : size;\n\t\tanimation2[ref[1]] = mode == 'show' ? distance[1] : 0;\n\n\t\t// Animate\n\t\twrapper.animate(animation1, duration, o.options.easing)\n\t\t.animate(animation2, duration, o.options.easing, function() {\n\t\t\tif(mode == 'hide') el.hide(); // Hide\n\t\t\t$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore\n\t\t\tif(o.callback) o.callback.apply(el[0], arguments); // Callback\n\t\t\tel.dequeue();\n\t\t});\n\n\t});\n\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.effects.highlight = function(o) {\n\treturn this.queue(function() {\n\t\tvar elem = $(this),\n\t\t\tprops = ['backgroundImage', 'backgroundColor', 'opacity'],\n\t\t\tmode = $.effects.setMode(elem, o.options.mode || 'show'),\n\t\t\tanimation = {\n\t\t\t\tbackgroundColor: elem.css('backgroundColor')\n\t\t\t};\n\n\t\tif (mode == 'hide') {\n\t\t\tanimation.opacity = 0;\n\t\t}\n\n\t\t$.effects.save(elem, props);\n\t\telem\n\t\t\t.show()\n\t\t\t.css({\n\t\t\t\tbackgroundImage: 'none',\n\t\t\t\tbackgroundColor: o.options.color || '#ffff99'\n\t\t\t})\n\t\t\t.animate(animation, {\n\t\t\t\tqueue: false,\n\t\t\t\tduration: o.duration,\n\t\t\t\teasing: o.options.easing,\n\t\t\t\tcomplete: function() {\n\t\t\t\t\t(mode == 'hide' && elem.hide());\n\t\t\t\t\t$.effects.restore(elem, props);\n\t\t\t\t\t(mode == 'show' && !$.support.opacity && this.style.removeAttribute('filter'));\n\t\t\t\t\t(o.callback && o.callback.apply(this, arguments));\n\t\t\t\t\telem.dequeue();\n\t\t\t\t}\n\t\t\t});\n\t});\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.effects.pulsate = function(o) {\n\treturn this.queue(function() {\n\t\tvar elem = $(this),\n\t\t\tmode = $.effects.setMode(elem, o.options.mode || 'show'),\n\t\t\ttimes = ((o.options.times || 5) * 2) - 1,\n\t\t\tduration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2,\n\t\t\tisVisible = elem.is(':visible'),\n\t\t\tanimateTo = 0;\n\n\t\tif (!isVisible) {\n\t\t\telem.css('opacity', 0).show();\n\t\t\tanimateTo = 1;\n\t\t}\n\n\t\tif ((mode == 'hide' && isVisible) || (mode == 'show' && !isVisible)) {\n\t\t\ttimes--;\n\t\t}\n\n\t\tfor (var i = 0; i < times; i++) {\n\t\t\telem.animate({ opacity: animateTo }, duration, o.options.easing);\n\t\t\tanimateTo = (animateTo + 1) % 2;\n\t\t}\n\n\t\telem.animate({ opacity: animateTo }, duration, o.options.easing, function() {\n\t\t\tif (animateTo == 0) {\n\t\t\t\telem.hide();\n\t\t\t}\n\t\t\t(o.callback && o.callback.apply(this, arguments));\n\t\t});\n\n\t\telem\n\t\t\t.queue('fx', function() { elem.dequeue(); })\n\t\t\t.dequeue();\n\t});\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.effects.puff = function(o) {\n\treturn this.queue(function() {\n\t\tvar elem = $(this),\n\t\t\tmode = $.effects.setMode(elem, o.options.mode || 'hide'),\n\t\t\tpercent = parseInt(o.options.percent, 10) || 150,\n\t\t\tfactor = percent / 100,\n\t\t\toriginal = { height: elem.height(), width: elem.width() };\n\n\t\t$.extend(o.options, {\n\t\t\tfade: true,\n\t\t\tmode: mode,\n\t\t\tpercent: mode == 'hide' ? percent : 100,\n\t\t\tfrom: mode == 'hide'\n\t\t\t\t? original\n\t\t\t\t: {\n\t\t\t\t\theight: original.height * factor,\n\t\t\t\t\twidth: original.width * factor\n\t\t\t\t}\n\t\t});\n\n\t\telem.effect('scale', o.options, o.duration, o.callback);\n\t\telem.dequeue();\n\t});\n};\n\n$.effects.scale = function(o) {\n\n\treturn this.queue(function() {\n\n\t\t// Create element\n\t\tvar el = $(this);\n\n\t\t// Set options\n\t\tvar options = $.extend(true, {}, o.options);\n\t\tvar mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode\n\t\tvar percent = parseInt(o.options.percent,10) || (parseInt(o.options.percent,10) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent\n\t\tvar direction = o.options.direction || 'both'; // Set default axis\n\t\tvar origin = o.options.origin; // The origin of the scaling\n\t\tif (mode != 'effect') { // Set default origin and restore for show/hide\n\t\t\toptions.origin = origin || ['middle','center'];\n\t\t\toptions.restore = true;\n\t\t}\n\t\tvar original = {height: el.height(), width: el.width()}; // Save original\n\t\tel.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state\n\n\t\t// Adjust\n\t\tvar factor = { // Set scaling factor\n\t\t\ty: direction != 'horizontal' ? (percent / 100) : 1,\n\t\t\tx: direction != 'vertical' ? (percent / 100) : 1\n\t\t};\n\t\tel.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state\n\n\t\tif (o.options.fade) { // Fade option to support puff\n\t\t\tif (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;};\n\t\t\tif (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;};\n\t\t};\n\n\t\t// Animation\n\t\toptions.from = el.from; options.to = el.to; options.mode = mode;\n\n\t\t// Animate\n\t\tel.effect('size', options, o.duration, o.callback);\n\t\tel.dequeue();\n\t});\n\n};\n\n$.effects.size = function(o) {\n\n\treturn this.queue(function() {\n\n\t\t// Create element\n\t\tvar el = $(this), props = ['position','top','bottom','left','right','width','height','overflow','opacity'];\n\t\tvar props1 = ['position','top','bottom','left','right','overflow','opacity']; // Always restore\n\t\tvar props2 = ['width','height','overflow']; // Copy for children\n\t\tvar cProps = ['fontSize'];\n\t\tvar vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom'];\n\t\tvar hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight'];\n\n\t\t// Set options\n\t\tvar mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode\n\t\tvar restore = o.options.restore || false; // Default restore\n\t\tvar scale = o.options.scale || 'both'; // Default scale mode\n\t\tvar origin = o.options.origin; // The origin of the sizing\n\t\tvar original = {height: el.height(), width: el.width()}; // Save original\n\t\tel.from = o.options.from || original; // Default from state\n\t\tel.to = o.options.to || original; // Default to state\n\t\t// Adjust\n\t\tif (origin) { // Calculate baseline shifts\n\t\t\tvar baseline = $.effects.getBaseline(origin, original);\n\t\t\tel.from.top = (original.height - el.from.height) * baseline.y;\n\t\t\tel.from.left = (original.width - el.from.width) * baseline.x;\n\t\t\tel.to.top = (original.height - el.to.height) * baseline.y;\n\t\t\tel.to.left = (original.width - el.to.width) * baseline.x;\n\t\t};\n\t\tvar factor = { // Set scaling factor\n\t\t\tfrom: {y: el.from.height / original.height, x: el.from.width / original.width},\n\t\t\tto: {y: el.to.height / original.height, x: el.to.width / original.width}\n\t\t};\n\t\tif (scale == 'box' || scale == 'both') { // Scale the css box\n\t\t\tif (factor.from.y != factor.to.y) { // Vertical props scaling\n\t\t\t\tprops = props.concat(vProps);\n\t\t\t\tel.from = $.effects.setTransition(el, vProps, factor.from.y, el.from);\n\t\t\t\tel.to = $.effects.setTransition(el, vProps, factor.to.y, el.to);\n\t\t\t};\n\t\t\tif (factor.from.x != factor.to.x) { // Horizontal props scaling\n\t\t\t\tprops = props.concat(hProps);\n\t\t\t\tel.from = $.effects.setTransition(el, hProps, factor.from.x, el.from);\n\t\t\t\tel.to = $.effects.setTransition(el, hProps, factor.to.x, el.to);\n\t\t\t};\n\t\t};\n\t\tif (scale == 'content' || scale == 'both') { // Scale the content\n\t\t\tif (factor.from.y != factor.to.y) { // Vertical props scaling\n\t\t\t\tprops = props.concat(cProps);\n\t\t\t\tel.from = $.effects.setTransition(el, cProps, factor.from.y, el.from);\n\t\t\t\tel.to = $.effects.setTransition(el, cProps, factor.to.y, el.to);\n\t\t\t};\n\t\t};\n\t\t$.effects.save(el, restore ? props : props1); el.show(); // Save & Show\n\t\t$.effects.createWrapper(el); // Create Wrapper\n\t\tel.css('overflow','hidden').css(el.from); // Shift\n\n\t\t// Animate\n\t\tif (scale == 'content' || scale == 'both') { // Scale the children\n\t\t\tvProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size\n\t\t\thProps = hProps.concat(['marginLeft','marginRight']); // Add margins\n\t\t\tprops2 = props.concat(vProps).concat(hProps); // Concat\n\t\t\tel.find(\"*[width]\").each(function(){\n\t\t\t\tvar child = $(this);\n\t\t\t\tif (restore) $.effects.save(child, props2);\n\t\t\t\tvar c_original = {height: child.height(), width: child.width()}; // Save original\n\t\t\t\tchild.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x};\n\t\t\t\tchild.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x};\n\t\t\t\tif (factor.from.y != factor.to.y) { // Vertical props scaling\n\t\t\t\t\tchild.from = $.effects.setTransition(child, vProps, factor.from.y, child.from);\n\t\t\t\t\tchild.to = $.effects.setTransition(child, vProps, factor.to.y, child.to);\n\t\t\t\t};\n\t\t\t\tif (factor.from.x != factor.to.x) { // Horizontal props scaling\n\t\t\t\t\tchild.from = $.effects.setTransition(child, hProps, factor.from.x, child.from);\n\t\t\t\t\tchild.to = $.effects.setTransition(child, hProps, factor.to.x, child.to);\n\t\t\t\t};\n\t\t\t\tchild.css(child.from); // Shift children\n\t\t\t\tchild.animate(child.to, o.duration, o.options.easing, function(){\n\t\t\t\t\tif (restore) $.effects.restore(child, props2); // Restore children\n\t\t\t\t}); // Animate children\n\t\t\t});\n\t\t};\n\n\t\t// Animate\n\t\tel.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {\n\t\t\tif (el.to.opacity === 0) {\n\t\t\t\tel.css('opacity', el.from.opacity);\n\t\t\t}\n\t\t\tif(mode == 'hide') el.hide(); // Hide\n\t\t\t$.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore\n\t\t\tif(o.callback) o.callback.apply(this, arguments); // Callback\n\t\t\tel.dequeue();\n\t\t}});\n\n\t});\n\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.effects.shake = function(o) {\n\n\treturn this.queue(function() {\n\n\t\t// Create element\n\t\tvar el = $(this), props = ['position','top','bottom','left','right'];\n\n\t\t// Set options\n\t\tvar mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode\n\t\tvar direction = o.options.direction || 'left'; // Default direction\n\t\tvar distance = o.options.distance || 20; // Default distance\n\t\tvar times = o.options.times || 3; // Default # of times\n\t\tvar speed = o.duration || o.options.duration || 140; // Default speed per shake\n\n\t\t// Adjust\n\t\t$.effects.save(el, props); el.show(); // Save & Show\n\t\t$.effects.createWrapper(el); // Create Wrapper\n\t\tvar ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';\n\t\tvar motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';\n\n\t\t// Animation\n\t\tvar animation = {}, animation1 = {}, animation2 = {};\n\t\tanimation[ref] = (motion == 'pos' ? '-=' : '+=')  + distance;\n\t\tanimation1[ref] = (motion == 'pos' ? '+=' : '-=')  + distance * 2;\n\t\tanimation2[ref] = (motion == 'pos' ? '-=' : '+=')  + distance * 2;\n\n\t\t// Animate\n\t\tel.animate(animation, speed, o.options.easing);\n\t\tfor (var i = 1; i < times; i++) { // Shakes\n\t\t\tel.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing);\n\t\t};\n\t\tel.animate(animation1, speed, o.options.easing).\n\t\tanimate(animation, speed / 2, o.options.easing, function(){ // Last shake\n\t\t\t$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore\n\t\t\tif(o.callback) o.callback.apply(this, arguments); // Callback\n\t\t});\n\t\tel.queue('fx', function() { el.dequeue(); });\n\t\tel.dequeue();\n\t});\n\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.effects.slide = function(o) {\n\n\treturn this.queue(function() {\n\n\t\t// Create element\n\t\tvar el = $(this), props = ['position','top','bottom','left','right'];\n\n\t\t// Set options\n\t\tvar mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode\n\t\tvar direction = o.options.direction || 'left'; // Default Direction\n\n\t\t// Adjust\n\t\t$.effects.save(el, props); el.show(); // Save & Show\n\t\t$.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper\n\t\tvar ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';\n\t\tvar motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';\n\t\tvar distance = o.options.distance || (ref == 'top' ? el.outerHeight( true ) : el.outerWidth( true ));\n\t\tif (mode == 'show') el.css(ref, motion == 'pos' ? (isNaN(distance) ? \"-\" + distance : -distance) : distance); // Shift\n\n\t\t// Animation\n\t\tvar animation = {};\n\t\tanimation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;\n\n\t\t// Animate\n\t\tel.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {\n\t\t\tif(mode == 'hide') el.hide(); // Hide\n\t\t\t$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore\n\t\t\tif(o.callback) o.callback.apply(this, arguments); // Callback\n\t\t\tel.dequeue();\n\t\t}});\n\n\t});\n\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.effects.transfer = function(o) {\n\treturn this.queue(function() {\n\t\tvar elem = $(this),\n\t\t\ttarget = $(o.options.to),\n\t\t\tendPosition = target.offset(),\n\t\t\tanimation = {\n\t\t\t\ttop: endPosition.top,\n\t\t\t\tleft: endPosition.left,\n\t\t\t\theight: target.innerHeight(),\n\t\t\t\twidth: target.innerWidth()\n\t\t\t},\n\t\t\tstartPosition = elem.offset(),\n\t\t\ttransfer = $('<div class=\"ui-effects-transfer\"></div>')\n\t\t\t\t.appendTo(document.body)\n\t\t\t\t.addClass(o.options.className)\n\t\t\t\t.css({\n\t\t\t\t\ttop: startPosition.top,\n\t\t\t\t\tleft: startPosition.left,\n\t\t\t\t\theight: elem.innerHeight(),\n\t\t\t\t\twidth: elem.innerWidth(),\n\t\t\t\t\tposition: 'absolute'\n\t\t\t\t})\n\t\t\t\t.animate(animation, o.duration, o.options.easing, function() {\n\t\t\t\t\ttransfer.remove();\n\t\t\t\t\t(o.callback && o.callback.apply(elem[0], arguments));\n\t\t\t\t\telem.dequeue();\n\t\t\t\t});\n\t});\n};\n\n})(jQuery);\n\n(function( $, undefined ) {\n\n$.widget( \"ui.accordion\", {\n\toptions: {\n\t\tactive: 0,\n\t\tanimated: \"slide\",\n\t\tautoHeight: true,\n\t\tclearStyle: false,\n\t\tcollapsible: false,\n\t\tevent: \"click\",\n\t\tfillSpace: false,\n\t\theader: \"> li > :first-child,> :not(li):even\",\n\t\ticons: {\n\t\t\theader: \"ui-icon-triangle-1-e\",\n\t\t\theaderSelected: \"ui-icon-triangle-1-s\"\n\t\t},\n\t\tnavigation: false,\n\t\tnavigationFilter: function() {\n\t\t\treturn this.href.toLowerCase() === location.href.toLowerCase();\n\t\t}\n\t},\n\n\t_create: function() {\n\t\tvar self = this,\n\t\t\toptions = self.options;\n\n\t\tself.running = 0;\n\n\t\tself.element\n\t\t\t.addClass( \"ui-accordion ui-widget ui-helper-reset\" )\n\t\t\t// in lack of child-selectors in CSS\n\t\t\t// we need to mark top-LIs in a UL-accordion for some IE-fix\n\t\t\t.children( \"li\" )\n\t\t\t\t.addClass( \"ui-accordion-li-fix\" );\n\n\t\tself.headers = self.element.find( options.header )\n\t\t\t.addClass( \"ui-accordion-header ui-helper-reset ui-state-default ui-corner-all\" )\n\t\t\t.bind( \"mouseenter.accordion\", function() {\n\t\t\t\tif ( options.disabled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$( this ).addClass( \"ui-state-hover\" );\n\t\t\t})\n\t\t\t.bind( \"mouseleave.accordion\", function() {\n\t\t\t\tif ( options.disabled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$( this ).removeClass( \"ui-state-hover\" );\n\t\t\t})\n\t\t\t.bind( \"focus.accordion\", function() {\n\t\t\t\tif ( options.disabled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$( this ).addClass( \"ui-state-focus\" );\n\t\t\t})\n\t\t\t.bind( \"blur.accordion\", function() {\n\t\t\t\tif ( options.disabled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$( this ).removeClass( \"ui-state-focus\" );\n\t\t\t});\n\n\t\tself.headers.next()\n\t\t\t.addClass( \"ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom\" );\n\n\t\tif ( options.navigation ) {\n\t\t\tvar current = self.element.find( \"a\" ).filter( options.navigationFilter ).eq( 0 );\n\t\t\tif ( current.length ) {\n\t\t\t\tvar header = current.closest( \".ui-accordion-header\" );\n\t\t\t\tif ( header.length ) {\n\t\t\t\t\t// anchor within header\n\t\t\t\t\tself.active = header;\n\t\t\t\t} else {\n\t\t\t\t\t// anchor within content\n\t\t\t\t\tself.active = current.closest( \".ui-accordion-content\" ).prev();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tself.active = self._findActive( self.active || options.active )\n\t\t\t.addClass( \"ui-state-default ui-state-active\" )\n\t\t\t.toggleClass( \"ui-corner-all\" )\n\t\t\t.toggleClass( \"ui-corner-top\" );\n\t\tself.active.next().addClass( \"ui-accordion-content-active\" );\n\n\t\tself._createIcons();\n\t\tself.resize();\n\t\t\n\t\t// ARIA\n\t\tself.element.attr( \"role\", \"tablist\" );\n\n\t\tself.headers\n\t\t\t.attr( \"role\", \"tab\" )\n\t\t\t.bind( \"keydown.accordion\", function( event ) {\n\t\t\t\treturn self._keydown( event );\n\t\t\t})\n\t\t\t.next()\n\t\t\t\t.attr( \"role\", \"tabpanel\" );\n\n\t\tself.headers\n\t\t\t.not( self.active || \"\" )\n\t\t\t.attr({\n\t\t\t\t\"aria-expanded\": \"false\",\n\t\t\t\t\"aria-selected\": \"false\",\n\t\t\t\ttabIndex: -1\n\t\t\t})\n\t\t\t.next()\n\t\t\t\t.hide();\n\n\t\t// make sure at least one header is in the tab order\n\t\tif ( !self.active.length ) {\n\t\t\tself.headers.eq( 0 ).attr( \"tabIndex\", 0 );\n\t\t} else {\n\t\t\tself.active\n\t\t\t\t.attr({\n\t\t\t\t\t\"aria-expanded\": \"true\",\n\t\t\t\t\t\"aria-selected\": \"true\",\n\t\t\t\t\ttabIndex: 0\n\t\t\t\t});\n\t\t}\n\n\t\t// only need links in tab order for Safari\n\t\tif ( !$.browser.safari ) {\n\t\t\tself.headers.find( \"a\" ).attr( \"tabIndex\", -1 );\n\t\t}\n\n\t\tif ( options.event ) {\n\t\t\tself.headers.bind( options.event.split(\" \").join(\".accordion \") + \".accordion\", function(event) {\n\t\t\t\tself._clickHandler.call( self, event, this );\n\t\t\t\tevent.preventDefault();\n\t\t\t});\n\t\t}\n\t},\n\n\t_createIcons: function() {\n\t\tvar options = this.options;\n\t\tif ( options.icons ) {\n\t\t\t$( \"<span></span>\" )\n\t\t\t\t.addClass( \"ui-icon \" + options.icons.header )\n\t\t\t\t.prependTo( this.headers );\n\t\t\tthis.active.children( \".ui-icon\" )\n\t\t\t\t.toggleClass(options.icons.header)\n\t\t\t\t.toggleClass(options.icons.headerSelected);\n\t\t\tthis.element.addClass( \"ui-accordion-icons\" );\n\t\t}\n\t},\n\n\t_destroyIcons: function() {\n\t\tthis.headers.children( \".ui-icon\" ).remove();\n\t\tthis.element.removeClass( \"ui-accordion-icons\" );\n\t},\n\n\tdestroy: function() {\n\t\tvar options = this.options;\n\n\t\tthis.element\n\t\t\t.removeClass( \"ui-accordion ui-widget ui-helper-reset\" )\n\t\t\t.removeAttr( \"role\" );\n\n\t\tthis.headers\n\t\t\t.unbind( \".accordion\" )\n\t\t\t.removeClass( \"ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top\" )\n\t\t\t.removeAttr( \"role\" )\n\t\t\t.removeAttr( \"aria-expanded\" )\n\t\t\t.removeAttr( \"aria-selected\" )\n\t\t\t.removeAttr( \"tabIndex\" );\n\n\t\tthis.headers.find( \"a\" ).removeAttr( \"tabIndex\" );\n\t\tthis._destroyIcons();\n\t\tvar contents = this.headers.next()\n\t\t\t.css( \"display\", \"\" )\n\t\t\t.removeAttr( \"role\" )\n\t\t\t.removeClass( \"ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled\" );\n\t\tif ( options.autoHeight || options.fillHeight ) {\n\t\t\tcontents.css( \"height\", \"\" );\n\t\t}\n\n\t\treturn $.Widget.prototype.destroy.call( this );\n\t},\n\n\t_setOption: function( key, value ) {\n\t\t$.Widget.prototype._setOption.apply( this, arguments );\n\t\t\t\n\t\tif ( key == \"active\" ) {\n\t\t\tthis.activate( value );\n\t\t}\n\t\tif ( key == \"icons\" ) {\n\t\t\tthis._destroyIcons();\n\t\t\tif ( value ) {\n\t\t\t\tthis._createIcons();\n\t\t\t}\n\t\t}\n\t\t// #5332 - opacity doesn't cascade to positioned elements in IE\n\t\t// so we need to add the disabled class to the headers and panels\n\t\tif ( key == \"disabled\" ) {\n\t\t\tthis.headers.add(this.headers.next())\n\t\t\t\t[ value ? \"addClass\" : \"removeClass\" ](\n\t\t\t\t\t\"ui-accordion-disabled ui-state-disabled\" );\n\t\t}\n\t},\n\n\t_keydown: function( event ) {\n\t\tif ( this.options.disabled || event.altKey || event.ctrlKey ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar keyCode = $.ui.keyCode,\n\t\t\tlength = this.headers.length,\n\t\t\tcurrentIndex = this.headers.index( event.target ),\n\t\t\ttoFocus = false;\n\n\t\tswitch ( event.keyCode ) {\n\t\t\tcase keyCode.RIGHT:\n\t\t\tcase keyCode.DOWN:\n\t\t\t\ttoFocus = this.headers[ ( currentIndex + 1 ) % length ];\n\t\t\t\tbreak;\n\t\t\tcase keyCode.LEFT:\n\t\t\tcase keyCode.UP:\n\t\t\t\ttoFocus = this.headers[ ( currentIndex - 1 + length ) % length ];\n\t\t\t\tbreak;\n\t\t\tcase keyCode.SPACE:\n\t\t\tcase keyCode.ENTER:\n\t\t\t\tthis._clickHandler( { target: event.target }, event.target );\n\t\t\t\tevent.preventDefault();\n\t\t}\n\n\t\tif ( toFocus ) {\n\t\t\t$( event.target ).attr( \"tabIndex\", -1 );\n\t\t\t$( toFocus ).attr( \"tabIndex\", 0 );\n\t\t\ttoFocus.focus();\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\n\tresize: function() {\n\t\tvar options = this.options,\n\t\t\tmaxHeight;\n\n\t\tif ( options.fillSpace ) {\n\t\t\tif ( $.browser.msie ) {\n\t\t\t\tvar defOverflow = this.element.parent().css( \"overflow\" );\n\t\t\t\tthis.element.parent().css( \"overflow\", \"hidden\");\n\t\t\t}\n\t\t\tmaxHeight = this.element.parent().height();\n\t\t\tif ($.browser.msie) {\n\t\t\t\tthis.element.parent().css( \"overflow\", defOverflow );\n\t\t\t}\n\n\t\t\tthis.headers.each(function() {\n\t\t\t\tmaxHeight -= $( this ).outerHeight( true );\n\t\t\t});\n\n\t\t\tthis.headers.next()\n\t\t\t\t.each(function() {\n\t\t\t\t\t$( this ).height( Math.max( 0, maxHeight -\n\t\t\t\t\t\t$( this ).innerHeight() + $( this ).height() ) );\n\t\t\t\t})\n\t\t\t\t.css( \"overflow\", \"auto\" );\n\t\t} else if ( options.autoHeight ) {\n\t\t\tmaxHeight = 0;\n\t\t\tthis.headers.next()\n\t\t\t\t.each(function() {\n\t\t\t\t\tmaxHeight = Math.max( maxHeight, $( this ).height( \"\" ).height() );\n\t\t\t\t})\n\t\t\t\t.height( maxHeight );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tactivate: function( index ) {\n\t\t// TODO this gets called on init, changing the option without an explicit call for that\n\t\tthis.options.active = index;\n\t\t// call clickHandler with custom event\n\t\tvar active = this._findActive( index )[ 0 ];\n\t\tthis._clickHandler( { target: active }, active );\n\n\t\treturn this;\n\t},\n\n\t_findActive: function( selector ) {\n\t\treturn selector\n\t\t\t? typeof selector === \"number\"\n\t\t\t\t? this.headers.filter( \":eq(\" + selector + \")\" )\n\t\t\t\t: this.headers.not( this.headers.not( selector ) )\n\t\t\t: selector === false\n\t\t\t\t? $( [] )\n\t\t\t\t: this.headers.filter( \":eq(0)\" );\n\t},\n\n\t// TODO isn't event.target enough? why the separate target argument?\n\t_clickHandler: function( event, target ) {\n\t\tvar options = this.options;\n\t\tif ( options.disabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// called only when using activate(false) to close all parts programmatically\n\t\tif ( !event.target ) {\n\t\t\tif ( !options.collapsible ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.active\n\t\t\t\t.removeClass( \"ui-state-active ui-corner-top\" )\n\t\t\t\t.addClass( \"ui-state-default ui-corner-all\" )\n\t\t\t\t.children( \".ui-icon\" )\n\t\t\t\t\t.removeClass( options.icons.headerSelected )\n\t\t\t\t\t.addClass( options.icons.header );\n\t\t\tthis.active.next().addClass( \"ui-accordion-content-active\" );\n\t\t\tvar toHide = this.active.next(),\n\t\t\t\tdata = {\n\t\t\t\t\toptions: options,\n\t\t\t\t\tnewHeader: $( [] ),\n\t\t\t\t\toldHeader: options.active,\n\t\t\t\t\tnewContent: $( [] ),\n\t\t\t\t\toldContent: toHide\n\t\t\t\t},\n\t\t\t\ttoShow = ( this.active = $( [] ) );\n\t\t\tthis._toggle( toShow, toHide, data );\n\t\t\treturn;\n\t\t}\n\n\t\t// get the click target\n\t\tvar clicked = $( event.currentTarget || target ),\n\t\t\tclickedIsActive = clicked[0] === this.active[0];\n\n\t\t// TODO the option is changed, is that correct?\n\t\t// TODO if it is correct, shouldn't that happen after determining that the click is valid?\n\t\toptions.active = options.collapsible && clickedIsActive ?\n\t\t\tfalse :\n\t\t\tthis.headers.index( clicked );\n\n\t\t// if animations are still active, or the active header is the target, ignore click\n\t\tif ( this.running || ( !options.collapsible && clickedIsActive ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// find elements to show and hide\n\t\tvar active = this.active,\n\t\t\ttoShow = clicked.next(),\n\t\t\ttoHide = this.active.next(),\n\t\t\tdata = {\n\t\t\t\toptions: options,\n\t\t\t\tnewHeader: clickedIsActive && options.collapsible ? $([]) : clicked,\n\t\t\t\toldHeader: this.active,\n\t\t\t\tnewContent: clickedIsActive && options.collapsible ? $([]) : toShow,\n\t\t\t\toldContent: toHide\n\t\t\t},\n\t\t\tdown = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );\n\n\t\t// when the call to ._toggle() comes after the class changes\n\t\t// it causes a very odd bug in IE 8 (see #6720)\n\t\tthis.active = clickedIsActive ? $([]) : clicked;\n\t\tthis._toggle( toShow, toHide, data, clickedIsActive, down );\n\n\t\t// switch classes\n\t\tactive\n\t\t\t.removeClass( \"ui-state-active ui-corner-top\" )\n\t\t\t.addClass( \"ui-state-default ui-corner-all\" )\n\t\t\t.children( \".ui-icon\" )\n\t\t\t\t.removeClass( options.icons.headerSelected )\n\t\t\t\t.addClass( options.icons.header );\n\t\tif ( !clickedIsActive ) {\n\t\t\tclicked\n\t\t\t\t.removeClass( \"ui-state-default ui-corner-all\" )\n\t\t\t\t.addClass( \"ui-state-active ui-corner-top\" )\n\t\t\t\t.children( \".ui-icon\" )\n\t\t\t\t\t.removeClass( options.icons.header )\n\t\t\t\t\t.addClass( options.icons.headerSelected );\n\t\t\tclicked\n\t\t\t\t.next()\n\t\t\t\t.addClass( \"ui-accordion-content-active\" );\n\t\t}\n\n\t\treturn;\n\t},\n\n\t_toggle: function( toShow, toHide, data, clickedIsActive, down ) {\n\t\tvar self = this,\n\t\t\toptions = self.options;\n\n\t\tself.toShow = toShow;\n\t\tself.toHide = toHide;\n\t\tself.data = data;\n\n\t\tvar complete = function() {\n\t\t\tif ( !self ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn self._completed.apply( self, arguments );\n\t\t};\n\n\t\t// trigger changestart event\n\t\tself._trigger( \"changestart\", null, self.data );\n\n\t\t// count elements to animate\n\t\tself.running = toHide.size() === 0 ? toShow.size() : toHide.size();\n\n\t\tif ( options.animated ) {\n\t\t\tvar animOptions = {};\n\n\t\t\tif ( options.collapsible && clickedIsActive ) {\n\t\t\t\tanimOptions = {\n\t\t\t\t\ttoShow: $( [] ),\n\t\t\t\t\ttoHide: toHide,\n\t\t\t\t\tcomplete: complete,\n\t\t\t\t\tdown: down,\n\t\t\t\t\tautoHeight: options.autoHeight || options.fillSpace\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tanimOptions = {\n\t\t\t\t\ttoShow: toShow,\n\t\t\t\t\ttoHide: toHide,\n\t\t\t\t\tcomplete: complete,\n\t\t\t\t\tdown: down,\n\t\t\t\t\tautoHeight: options.autoHeight || options.fillSpace\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( !options.proxied ) {\n\t\t\t\toptions.proxied = options.animated;\n\t\t\t}\n\n\t\t\tif ( !options.proxiedDuration ) {\n\t\t\t\toptions.proxiedDuration = options.duration;\n\t\t\t}\n\n\t\t\toptions.animated = $.isFunction( options.proxied ) ?\n\t\t\t\toptions.proxied( animOptions ) :\n\t\t\t\toptions.proxied;\n\n\t\t\toptions.duration = $.isFunction( options.proxiedDuration ) ?\n\t\t\t\toptions.proxiedDuration( animOptions ) :\n\t\t\t\toptions.proxiedDuration;\n\n\t\t\tvar animations = $.ui.accordion.animations,\n\t\t\t\tduration = options.duration,\n\t\t\t\teasing = options.animated;\n\n\t\t\tif ( easing && !animations[ easing ] && !$.easing[ easing ] ) {\n\t\t\t\teasing = \"slide\";\n\t\t\t}\n\t\t\tif ( !animations[ easing ] ) {\n\t\t\t\tanimations[ easing ] = function( options ) {\n\t\t\t\t\tthis.slide( options, {\n\t\t\t\t\t\teasing: easing,\n\t\t\t\t\t\tduration: duration || 700\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tanimations[ easing ]( animOptions );\n\t\t} else {\n\t\t\tif ( options.collapsible && clickedIsActive ) {\n\t\t\t\ttoShow.toggle();\n\t\t\t} else {\n\t\t\t\ttoHide.hide();\n\t\t\t\ttoShow.show();\n\t\t\t}\n\n\t\t\tcomplete( true );\n\t\t}\n\n\t\t// TODO assert that the blur and focus triggers are really necessary, remove otherwise\n\t\ttoHide.prev()\n\t\t\t.attr({\n\t\t\t\t\"aria-expanded\": \"false\",\n\t\t\t\t\"aria-selected\": \"false\",\n\t\t\t\ttabIndex: -1\n\t\t\t})\n\t\t\t.blur();\n\t\ttoShow.prev()\n\t\t\t.attr({\n\t\t\t\t\"aria-expanded\": \"true\",\n\t\t\t\t\"aria-selected\": \"true\",\n\t\t\t\ttabIndex: 0\n\t\t\t})\n\t\t\t.focus();\n\t},\n\n\t_completed: function( cancel ) {\n\t\tthis.running = cancel ? 0 : --this.running;\n\t\tif ( this.running ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.clearStyle ) {\n\t\t\tthis.toShow.add( this.toHide ).css({\n\t\t\t\theight: \"\",\n\t\t\t\toverflow: \"\"\n\t\t\t});\n\t\t}\n\n\t\t// other classes are removed before the animation; this one needs to stay until completed\n\t\tthis.toHide.removeClass( \"ui-accordion-content-active\" );\n\t\t// Work around for rendering bug in IE (#5421)\n\t\tif ( this.toHide.length ) {\n\t\t\tthis.toHide.parent()[0].className = this.toHide.parent()[0].className;\n\t\t}\n\n\t\tthis._trigger( \"change\", null, this.data );\n\t}\n});\n\n$.extend( $.ui.accordion, {\n\tversion: \"1.8.22\",\n\tanimations: {\n\t\tslide: function( options, additions ) {\n\t\t\toptions = $.extend({\n\t\t\t\teasing: \"swing\",\n\t\t\t\tduration: 300\n\t\t\t}, options, additions );\n\t\t\tif ( !options.toHide.size() ) {\n\t\t\t\toptions.toShow.animate({\n\t\t\t\t\theight: \"show\",\n\t\t\t\t\tpaddingTop: \"show\",\n\t\t\t\t\tpaddingBottom: \"show\"\n\t\t\t\t}, options );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( !options.toShow.size() ) {\n\t\t\t\toptions.toHide.animate({\n\t\t\t\t\theight: \"hide\",\n\t\t\t\t\tpaddingTop: \"hide\",\n\t\t\t\t\tpaddingBottom: \"hide\"\n\t\t\t\t}, options );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar overflow = options.toShow.css( \"overflow\" ),\n\t\t\t\tpercentDone = 0,\n\t\t\t\tshowProps = {},\n\t\t\t\thideProps = {},\n\t\t\t\tfxAttrs = [ \"height\", \"paddingTop\", \"paddingBottom\" ],\n\t\t\t\toriginalWidth;\n\t\t\t// fix width before calculating height of hidden element\n\t\t\tvar s = options.toShow;\n\t\t\toriginalWidth = s[0].style.width;\n\t\t\ts.width( s.parent().width()\n\t\t\t\t- parseFloat( s.css( \"paddingLeft\" ) )\n\t\t\t\t- parseFloat( s.css( \"paddingRight\" ) )\n\t\t\t\t- ( parseFloat( s.css( \"borderLeftWidth\" ) ) || 0 )\n\t\t\t\t- ( parseFloat( s.css( \"borderRightWidth\" ) ) || 0 ) );\n\n\t\t\t$.each( fxAttrs, function( i, prop ) {\n\t\t\t\thideProps[ prop ] = \"hide\";\n\n\t\t\t\tvar parts = ( \"\" + $.css( options.toShow[0], prop ) ).match( /^([\\d+-.]+)(.*)$/ );\n\t\t\t\tshowProps[ prop ] = {\n\t\t\t\t\tvalue: parts[ 1 ],\n\t\t\t\t\tunit: parts[ 2 ] || \"px\"\n\t\t\t\t};\n\t\t\t});\n\t\t\toptions.toShow.css({ height: 0, overflow: \"hidden\" }).show();\n\t\t\toptions.toHide\n\t\t\t\t.filter( \":hidden\" )\n\t\t\t\t\t.each( options.complete )\n\t\t\t\t.end()\n\t\t\t\t.filter( \":visible\" )\n\t\t\t\t.animate( hideProps, {\n\t\t\t\tstep: function( now, settings ) {\n\t\t\t\t\t// only calculate the percent when animating height\n\t\t\t\t\t// IE gets very inconsistent results when animating elements\n\t\t\t\t\t// with small values, which is common for padding\n\t\t\t\t\tif ( settings.prop == \"height\" ) {\n\t\t\t\t\t\tpercentDone = ( settings.end - settings.start === 0 ) ? 0 :\n\t\t\t\t\t\t\t( settings.now - settings.start ) / ( settings.end - settings.start );\n\t\t\t\t\t}\n\n\t\t\t\t\toptions.toShow[ 0 ].style[ settings.prop ] =\n\t\t\t\t\t\t( percentDone * showProps[ settings.prop ].value )\n\t\t\t\t\t\t+ showProps[ settings.prop ].unit;\n\t\t\t\t},\n\t\t\t\tduration: options.duration,\n\t\t\t\teasing: options.easing,\n\t\t\t\tcomplete: function() {\n\t\t\t\t\tif ( !options.autoHeight ) {\n\t\t\t\t\t\toptions.toShow.css( \"height\", \"\" );\n\t\t\t\t\t}\n\t\t\t\t\toptions.toShow.css({\n\t\t\t\t\t\twidth: originalWidth,\n\t\t\t\t\t\toverflow: overflow\n\t\t\t\t\t});\n\t\t\t\t\toptions.complete();\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tbounceslide: function( options ) {\n\t\t\tthis.slide( options, {\n\t\t\t\teasing: options.down ? \"easeOutBounce\" : \"swing\",\n\t\t\t\tduration: options.down ? 1000 : 200\n\t\t\t});\n\t\t}\n\t}\n});\n\n})( jQuery );\n\n(function( $, undefined ) {\n\n// used to prevent race conditions with remote data sources\nvar requestIndex = 0;\n\n$.widget( \"ui.autocomplete\", {\n\toptions: {\n\t\tappendTo: \"body\",\n\t\tautoFocus: false,\n\t\tdelay: 300,\n\t\tminLength: 1,\n\t\tposition: {\n\t\t\tmy: \"left top\",\n\t\t\tat: \"left bottom\",\n\t\t\tcollision: \"none\"\n\t\t},\n\t\tsource: null\n\t},\n\n\tpending: 0,\n\n\t_create: function() {\n\t\tvar self = this,\n\t\t\tdoc = this.element[ 0 ].ownerDocument,\n\t\t\tsuppressKeyPress;\n\t\tthis.isMultiLine = this.element.is( \"textarea\" );\n\n\t\tthis.element\n\t\t\t.addClass( \"ui-autocomplete-input\" )\n\t\t\t.attr( \"autocomplete\", \"off\" )\n\t\t\t// TODO verify these actually work as intended\n\t\t\t.attr({\n\t\t\t\trole: \"textbox\",\n\t\t\t\t\"aria-autocomplete\": \"list\",\n\t\t\t\t\"aria-haspopup\": \"true\"\n\t\t\t})\n\t\t\t.bind( \"keydown.autocomplete\", function( event ) {\n\t\t\t\tif ( self.options.disabled || self.element.propAttr( \"readOnly\" ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsuppressKeyPress = false;\n\t\t\t\tvar keyCode = $.ui.keyCode;\n\t\t\t\tswitch( event.keyCode ) {\n\t\t\t\tcase keyCode.PAGE_UP:\n\t\t\t\t\tself._move( \"previousPage\", event );\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.PAGE_DOWN:\n\t\t\t\t\tself._move( \"nextPage\", event );\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.UP:\n\t\t\t\t\tself._keyEvent( \"previous\", event );\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.DOWN:\n\t\t\t\t\tself._keyEvent( \"next\", event );\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.ENTER:\n\t\t\t\tcase keyCode.NUMPAD_ENTER:\n\t\t\t\t\t// when menu is open and has focus\n\t\t\t\t\tif ( self.menu.active ) {\n\t\t\t\t\t\t// #6055 - Opera still allows the keypress to occur\n\t\t\t\t\t\t// which causes forms to submit\n\t\t\t\t\t\tsuppressKeyPress = true;\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t\t//passthrough - ENTER and TAB both select the current element\n\t\t\t\tcase keyCode.TAB:\n\t\t\t\t\tif ( !self.menu.active ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tself.menu.select( event );\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.ESCAPE:\n\t\t\t\t\tself.element.val( self.term );\n\t\t\t\t\tself.close( event );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// keypress is triggered before the input value is changed\n\t\t\t\t\tclearTimeout( self.searching );\n\t\t\t\t\tself.searching = setTimeout(function() {\n\t\t\t\t\t\t// only search if the value has changed\n\t\t\t\t\t\tif ( self.term != self.element.val() ) {\n\t\t\t\t\t\t\tself.selectedItem = null;\n\t\t\t\t\t\t\tself.search( null, event );\n\t\t\t\t\t\t}\n\t\t\t\t\t}, self.options.delay );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.bind( \"keypress.autocomplete\", function( event ) {\n\t\t\t\tif ( suppressKeyPress ) {\n\t\t\t\t\tsuppressKeyPress = false;\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t})\n\t\t\t.bind( \"focus.autocomplete\", function() {\n\t\t\t\tif ( self.options.disabled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tself.selectedItem = null;\n\t\t\t\tself.previous = self.element.val();\n\t\t\t})\n\t\t\t.bind( \"blur.autocomplete\", function( event ) {\n\t\t\t\tif ( self.options.disabled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tclearTimeout( self.searching );\n\t\t\t\t// clicks on the menu (or a button to trigger a search) will cause a blur event\n\t\t\t\tself.closing = setTimeout(function() {\n\t\t\t\t\tself.close( event );\n\t\t\t\t\tself._change( event );\n\t\t\t\t}, 150 );\n\t\t\t});\n\t\tthis._initSource();\n\t\tthis.menu = $( \"<ul></ul>\" )\n\t\t\t.addClass( \"ui-autocomplete\" )\n\t\t\t.appendTo( $( this.options.appendTo || \"body\", doc )[0] )\n\t\t\t// prevent the close-on-blur in case of a \"slow\" click on the menu (long mousedown)\n\t\t\t.mousedown(function( event ) {\n\t\t\t\t// clicking on the scrollbar causes focus to shift to the body\n\t\t\t\t// but we can't detect a mouseup or a click immediately afterward\n\t\t\t\t// so we have to track the next mousedown and close the menu if\n\t\t\t\t// the user clicks somewhere outside of the autocomplete\n\t\t\t\tvar menuElement = self.menu.element[ 0 ];\n\t\t\t\tif ( !$( event.target ).closest( \".ui-menu-item\" ).length ) {\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t$( document ).one( 'mousedown', function( event ) {\n\t\t\t\t\t\t\tif ( event.target !== self.element[ 0 ] &&\n\t\t\t\t\t\t\t\tevent.target !== menuElement &&\n\t\t\t\t\t\t\t\t!$.ui.contains( menuElement, event.target ) ) {\n\t\t\t\t\t\t\t\tself.close();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}, 1 );\n\t\t\t\t}\n\n\t\t\t\t// use another timeout to make sure the blur-event-handler on the input was already triggered\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tclearTimeout( self.closing );\n\t\t\t\t}, 13);\n\t\t\t})\n\t\t\t.menu({\n\t\t\t\tfocus: function( event, ui ) {\n\t\t\t\t\tvar item = ui.item.data( \"item.autocomplete\" );\n\t\t\t\t\tif ( false !== self._trigger( \"focus\", event, { item: item } ) ) {\n\t\t\t\t\t\t// use value to match what will end up in the input, if it was a key event\n\t\t\t\t\t\tif ( /^key/.test(event.originalEvent.type) ) {\n\t\t\t\t\t\t\tself.element.val( item.value );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tselected: function( event, ui ) {\n\t\t\t\t\tvar item = ui.item.data( \"item.autocomplete\" ),\n\t\t\t\t\t\tprevious = self.previous;\n\n\t\t\t\t\t// only trigger when focus was lost (click on menu)\n\t\t\t\t\tif ( self.element[0] !== doc.activeElement ) {\n\t\t\t\t\t\tself.element.focus();\n\t\t\t\t\t\tself.previous = previous;\n\t\t\t\t\t\t// #6109 - IE triggers two focus events and the second\n\t\t\t\t\t\t// is asynchronous, so we need to reset the previous\n\t\t\t\t\t\t// term synchronously and asynchronously :-(\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\tself.previous = previous;\n\t\t\t\t\t\t\tself.selectedItem = item;\n\t\t\t\t\t\t}, 1);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( false !== self._trigger( \"select\", event, { item: item } ) ) {\n\t\t\t\t\t\tself.element.val( item.value );\n\t\t\t\t\t}\n\t\t\t\t\t// reset the term after the select event\n\t\t\t\t\t// this allows custom select handling to work properly\n\t\t\t\t\tself.term = self.element.val();\n\n\t\t\t\t\tself.close( event );\n\t\t\t\t\tself.selectedItem = item;\n\t\t\t\t},\n\t\t\t\tblur: function( event, ui ) {\n\t\t\t\t\t// don't set the value of the text field if it's already correct\n\t\t\t\t\t// this prevents moving the cursor unnecessarily\n\t\t\t\t\tif ( self.menu.element.is(\":visible\") &&\n\t\t\t\t\t\t( self.element.val() !== self.term ) ) {\n\t\t\t\t\t\tself.element.val( self.term );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t\t.zIndex( this.element.zIndex() + 1 )\n\t\t\t// workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781\n\t\t\t.css({ top: 0, left: 0 })\n\t\t\t.hide()\n\t\t\t.data( \"menu\" );\n\t\tif ( $.fn.bgiframe ) {\n\t\t\t this.menu.element.bgiframe();\n\t\t}\n\t\t// turning off autocomplete prevents the browser from remembering the\n\t\t// value when navigating through history, so we re-enable autocomplete\n\t\t// if the page is unloaded before the widget is destroyed. #7790\n\t\tself.beforeunloadHandler = function() {\n\t\t\tself.element.removeAttr( \"autocomplete\" );\n\t\t};\n\t\t$( window ).bind( \"beforeunload\", self.beforeunloadHandler );\n\t},\n\n\tdestroy: function() {\n\t\tthis.element\n\t\t\t.removeClass( \"ui-autocomplete-input\" )\n\t\t\t.removeAttr( \"autocomplete\" )\n\t\t\t.removeAttr( \"role\" )\n\t\t\t.removeAttr( \"aria-autocomplete\" )\n\t\t\t.removeAttr( \"aria-haspopup\" );\n\t\tthis.menu.element.remove();\n\t\t$( window ).unbind( \"beforeunload\", this.beforeunloadHandler );\n\t\t$.Widget.prototype.destroy.call( this );\n\t},\n\n\t_setOption: function( key, value ) {\n\t\t$.Widget.prototype._setOption.apply( this, arguments );\n\t\tif ( key === \"source\" ) {\n\t\t\tthis._initSource();\n\t\t}\n\t\tif ( key === \"appendTo\" ) {\n\t\t\tthis.menu.element.appendTo( $( value || \"body\", this.element[0].ownerDocument )[0] )\n\t\t}\n\t\tif ( key === \"disabled\" && value && this.xhr ) {\n\t\t\tthis.xhr.abort();\n\t\t}\n\t},\n\n\t_initSource: function() {\n\t\tvar self = this,\n\t\t\tarray,\n\t\t\turl;\n\t\tif ( $.isArray(this.options.source) ) {\n\t\t\tarray = this.options.source;\n\t\t\tthis.source = function( request, response ) {\n\t\t\t\tresponse( $.ui.autocomplete.filter(array, request.term) );\n\t\t\t};\n\t\t} else if ( typeof this.options.source === \"string\" ) {\n\t\t\turl = this.options.source;\n\t\t\tthis.source = function( request, response ) {\n\t\t\t\tif ( self.xhr ) {\n\t\t\t\t\tself.xhr.abort();\n\t\t\t\t}\n\t\t\t\tself.xhr = $.ajax({\n\t\t\t\t\turl: url,\n\t\t\t\t\tdata: request,\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\tsuccess: function( data, status ) {\n\t\t\t\t\t\tresponse( data );\n\t\t\t\t\t},\n\t\t\t\t\terror: function() {\n\t\t\t\t\t\tresponse( [] );\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\t\t} else {\n\t\t\tthis.source = this.options.source;\n\t\t}\n\t},\n\n\tsearch: function( value, event ) {\n\t\tvalue = value != null ? value : this.element.val();\n\n\t\t// always save the actual value, not the one passed as an argument\n\t\tthis.term = this.element.val();\n\n\t\tif ( value.length < this.options.minLength ) {\n\t\t\treturn this.close( event );\n\t\t}\n\n\t\tclearTimeout( this.closing );\n\t\tif ( this._trigger( \"search\", event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this._search( value );\n\t},\n\n\t_search: function( value ) {\n\t\tthis.pending++;\n\t\tthis.element.addClass( \"ui-autocomplete-loading\" );\n\n\t\tthis.source( { term: value }, this._response() );\n\t},\n\n\t_response: function() {\n\t\tvar that = this,\n\t\t\tindex = ++requestIndex;\n\n\t\treturn function( content ) {\n\t\t\tif ( index === requestIndex ) {\n\t\t\t\tthat.__response( content );\n\t\t\t}\n\n\t\t\tthat.pending--;\n\t\t\tif ( !that.pending ) {\n\t\t\t\tthat.element.removeClass( \"ui-autocomplete-loading\" );\n\t\t\t}\n\t\t};\n\t},\n\n\t__response: function( content ) {\n\t\tif ( !this.options.disabled && content && content.length ) {\n\t\t\tcontent = this._normalize( content );\n\t\t\tthis._suggest( content );\n\t\t\tthis._trigger( \"open\" );\n\t\t} else {\n\t\t\tthis.close();\n\t\t}\n\t},\n\n\tclose: function( event ) {\n\t\tclearTimeout( this.closing );\n\t\tif ( this.menu.element.is(\":visible\") ) {\n\t\t\tthis.menu.element.hide();\n\t\t\tthis.menu.deactivate();\n\t\t\tthis._trigger( \"close\", event );\n\t\t}\n\t},\n\t\n\t_change: function( event ) {\n\t\tif ( this.previous !== this.element.val() ) {\n\t\t\tthis._trigger( \"change\", event, { item: this.selectedItem } );\n\t\t}\n\t},\n\n\t_normalize: function( items ) {\n\t\t// assume all items have the right format when the first item is complete\n\t\tif ( items.length && items[0].label && items[0].value ) {\n\t\t\treturn items;\n\t\t}\n\t\treturn $.map( items, function(item) {\n\t\t\tif ( typeof item === \"string\" ) {\n\t\t\t\treturn {\n\t\t\t\t\tlabel: item,\n\t\t\t\t\tvalue: item\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn $.extend({\n\t\t\t\tlabel: item.label || item.value,\n\t\t\t\tvalue: item.value || item.label\n\t\t\t}, item );\n\t\t});\n\t},\n\n\t_suggest: function( items ) {\n\t\tvar ul = this.menu.element\n\t\t\t.empty()\n\t\t\t.zIndex( this.element.zIndex() + 1 );\n\t\tthis._renderMenu( ul, items );\n\t\t// TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate\n\t\tthis.menu.deactivate();\n\t\tthis.menu.refresh();\n\n\t\t// size and position menu\n\t\tul.show();\n\t\tthis._resizeMenu();\n\t\tul.position( $.extend({\n\t\t\tof: this.element\n\t\t}, this.options.position ));\n\n\t\tif ( this.options.autoFocus ) {\n\t\t\tthis.menu.next( new $.Event(\"mouseover\") );\n\t\t}\n\t},\n\n\t_resizeMenu: function() {\n\t\tvar ul = this.menu.element;\n\t\tul.outerWidth( Math.max(\n\t\t\t// Firefox wraps long text (possibly a rounding bug)\n\t\t\t// so we add 1px to avoid the wrapping (#7513)\n\t\t\tul.width( \"\" ).outerWidth() + 1,\n\t\t\tthis.element.outerWidth()\n\t\t) );\n\t},\n\n\t_renderMenu: function( ul, items ) {\n\t\tvar self = this;\n\t\t$.each( items, function( index, item ) {\n\t\t\tself._renderItem( ul, item );\n\t\t});\n\t},\n\n\t_renderItem: function( ul, item) {\n\t\treturn $( \"<li></li>\" )\n\t\t\t.data( \"item.autocomplete\", item )\n\t\t\t.append( $( \"<a></a>\" ).text( item.label ) )\n\t\t\t.appendTo( ul );\n\t},\n\n\t_move: function( direction, event ) {\n\t\tif ( !this.menu.element.is(\":visible\") ) {\n\t\t\tthis.search( null, event );\n\t\t\treturn;\n\t\t}\n\t\tif ( this.menu.first() && /^previous/.test(direction) ||\n\t\t\t\tthis.menu.last() && /^next/.test(direction) ) {\n\t\t\tthis.element.val( this.term );\n\t\t\tthis.menu.deactivate();\n\t\t\treturn;\n\t\t}\n\t\tthis.menu[ direction ]( event );\n\t},\n\n\twidget: function() {\n\t\treturn this.menu.element;\n\t},\n\t_keyEvent: function( keyEvent, event ) {\n\t\tif ( !this.isMultiLine || this.menu.element.is( \":visible\" ) ) {\n\t\t\tthis._move( keyEvent, event );\n\n\t\t\t// prevents moving cursor to beginning/end of the text field in some browsers\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n});\n\n$.extend( $.ui.autocomplete, {\n\tescapeRegex: function( value ) {\n\t\treturn value.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, \"\\\\$&\");\n\t},\n\tfilter: function(array, term) {\n\t\tvar matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), \"i\" );\n\t\treturn $.grep( array, function(value) {\n\t\t\treturn matcher.test( value.label || value.value || value );\n\t\t});\n\t}\n});\n\n}( jQuery ));\n\n/*\n * jQuery UI Menu (not officially released)\n * \n * This widget isn't yet finished and the API is subject to change. We plan to finish\n * it for the next release. You're welcome to give it a try anyway and give us feedback,\n * as long as you're okay with migrating your code later on. We can help with that, too.\n *\n * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Menu\n *\n * Depends:\n *\tjquery.ui.core.js\n *  jquery.ui.widget.js\n */\n(function($) {\n\n$.widget(\"ui.menu\", {\n\t_create: function() {\n\t\tvar self = this;\n\t\tthis.element\n\t\t\t.addClass(\"ui-menu ui-widget ui-widget-content ui-corner-all\")\n\t\t\t.attr({\n\t\t\t\trole: \"listbox\",\n\t\t\t\t\"aria-activedescendant\": \"ui-active-menuitem\"\n\t\t\t})\n\t\t\t.click(function( event ) {\n\t\t\t\tif ( !$( event.target ).closest( \".ui-menu-item a\" ).length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// temporary\n\t\t\t\tevent.preventDefault();\n\t\t\t\tself.select( event );\n\t\t\t});\n\t\tthis.refresh();\n\t},\n\t\n\trefresh: function() {\n\t\tvar self = this;\n\n\t\t// don't refresh list items that are already adapted\n\t\tvar items = this.element.children(\"li:not(.ui-menu-item):has(a)\")\n\t\t\t.addClass(\"ui-menu-item\")\n\t\t\t.attr(\"role\", \"menuitem\");\n\t\t\n\t\titems.children(\"a\")\n\t\t\t.addClass(\"ui-corner-all\")\n\t\t\t.attr(\"tabindex\", -1)\n\t\t\t// mouseenter doesn't work with event delegation\n\t\t\t.mouseenter(function( event ) {\n\t\t\t\tself.activate( event, $(this).parent() );\n\t\t\t})\n\t\t\t.mouseleave(function() {\n\t\t\t\tself.deactivate();\n\t\t\t});\n\t},\n\n\tactivate: function( event, item ) {\n\t\tthis.deactivate();\n\t\tif (this.hasScroll()) {\n\t\t\tvar offset = item.offset().top - this.element.offset().top,\n\t\t\t\tscroll = this.element.scrollTop(),\n\t\t\t\telementHeight = this.element.height();\n\t\t\tif (offset < 0) {\n\t\t\t\tthis.element.scrollTop( scroll + offset);\n\t\t\t} else if (offset >= elementHeight) {\n\t\t\t\tthis.element.scrollTop( scroll + offset - elementHeight + item.height());\n\t\t\t}\n\t\t}\n\t\tthis.active = item.eq(0)\n\t\t\t.children(\"a\")\n\t\t\t\t.addClass(\"ui-state-hover\")\n\t\t\t\t.attr(\"id\", \"ui-active-menuitem\")\n\t\t\t.end();\n\t\tthis._trigger(\"focus\", event, { item: item });\n\t},\n\n\tdeactivate: function() {\n\t\tif (!this.active) { return; }\n\n\t\tthis.active.children(\"a\")\n\t\t\t.removeClass(\"ui-state-hover\")\n\t\t\t.removeAttr(\"id\");\n\t\tthis._trigger(\"blur\");\n\t\tthis.active = null;\n\t},\n\n\tnext: function(event) {\n\t\tthis.move(\"next\", \".ui-menu-item:first\", event);\n\t},\n\n\tprevious: function(event) {\n\t\tthis.move(\"prev\", \".ui-menu-item:last\", event);\n\t},\n\n\tfirst: function() {\n\t\treturn this.active && !this.active.prevAll(\".ui-menu-item\").length;\n\t},\n\n\tlast: function() {\n\t\treturn this.active && !this.active.nextAll(\".ui-menu-item\").length;\n\t},\n\n\tmove: function(direction, edge, event) {\n\t\tif (!this.active) {\n\t\t\tthis.activate(event, this.element.children(edge));\n\t\t\treturn;\n\t\t}\n\t\tvar next = this.active[direction + \"All\"](\".ui-menu-item\").eq(0);\n\t\tif (next.length) {\n\t\t\tthis.activate(event, next);\n\t\t} else {\n\t\t\tthis.activate(event, this.element.children(edge));\n\t\t}\n\t},\n\n\t// TODO merge with previousPage\n\tnextPage: function(event) {\n\t\tif (this.hasScroll()) {\n\t\t\t// TODO merge with no-scroll-else\n\t\t\tif (!this.active || this.last()) {\n\t\t\t\tthis.activate(event, this.element.children(\".ui-menu-item:first\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar base = this.active.offset().top,\n\t\t\t\theight = this.element.height(),\n\t\t\t\tresult = this.element.children(\".ui-menu-item\").filter(function() {\n\t\t\t\t\tvar close = $(this).offset().top - base - height + $(this).height();\n\t\t\t\t\t// TODO improve approximation\n\t\t\t\t\treturn close < 10 && close > -10;\n\t\t\t\t});\n\n\t\t\t// TODO try to catch this earlier when scrollTop indicates the last page anyway\n\t\t\tif (!result.length) {\n\t\t\t\tresult = this.element.children(\".ui-menu-item:last\");\n\t\t\t}\n\t\t\tthis.activate(event, result);\n\t\t} else {\n\t\t\tthis.activate(event, this.element.children(\".ui-menu-item\")\n\t\t\t\t.filter(!this.active || this.last() ? \":first\" : \":last\"));\n\t\t}\n\t},\n\n\t// TODO merge with nextPage\n\tpreviousPage: function(event) {\n\t\tif (this.hasScroll()) {\n\t\t\t// TODO merge with no-scroll-else\n\t\t\tif (!this.active || this.first()) {\n\t\t\t\tthis.activate(event, this.element.children(\".ui-menu-item:last\"));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar base = this.active.offset().top,\n\t\t\t\theight = this.element.height(),\n\t\t\t\tresult = this.element.children(\".ui-menu-item\").filter(function() {\n\t\t\t\t\tvar close = $(this).offset().top - base + height - $(this).height();\n\t\t\t\t\t// TODO improve approximation\n\t\t\t\t\treturn close < 10 && close > -10;\n\t\t\t\t});\n\n\t\t\t// TODO try to catch this earlier when scrollTop indicates the last page anyway\n\t\t\tif (!result.length) {\n\t\t\t\tresult = this.element.children(\".ui-menu-item:first\");\n\t\t\t}\n\t\t\tthis.activate(event, result);\n\t\t} else {\n\t\t\tthis.activate(event, this.element.children(\".ui-menu-item\")\n\t\t\t\t.filter(!this.active || this.first() ? \":last\" : \":first\"));\n\t\t}\n\t},\n\n\thasScroll: function() {\n\t\treturn this.element.height() < this.element[ $.fn.prop ? \"prop\" : \"attr\" ](\"scrollHeight\");\n\t},\n\n\tselect: function( event ) {\n\t\tthis._trigger(\"selected\", event, { item: this.active });\n\t}\n});\n\n}(jQuery));\n\n(function( $, undefined ) {\n\nvar lastActive, startXPos, startYPos, clickDragged,\n\tbaseClasses = \"ui-button ui-widget ui-state-default ui-corner-all\",\n\tstateClasses = \"ui-state-hover ui-state-active \",\n\ttypeClasses = \"ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only\",\n\tformResetHandler = function() {\n\t\tvar buttons = $( this ).find( \":ui-button\" );\n\t\tsetTimeout(function() {\n\t\t\tbuttons.button( \"refresh\" );\n\t\t}, 1 );\n\t},\n\tradioGroup = function( radio ) {\n\t\tvar name = radio.name,\n\t\t\tform = radio.form,\n\t\t\tradios = $( [] );\n\t\tif ( name ) {\n\t\t\tif ( form ) {\n\t\t\t\tradios = $( form ).find( \"[name='\" + name + \"']\" );\n\t\t\t} else {\n\t\t\t\tradios = $( \"[name='\" + name + \"']\", radio.ownerDocument )\n\t\t\t\t\t.filter(function() {\n\t\t\t\t\t\treturn !this.form;\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn radios;\n\t};\n\n$.widget( \"ui.button\", {\n\toptions: {\n\t\tdisabled: null,\n\t\ttext: true,\n\t\tlabel: null,\n\t\ticons: {\n\t\t\tprimary: null,\n\t\t\tsecondary: null\n\t\t}\n\t},\n\t_create: function() {\n\t\tthis.element.closest( \"form\" )\n\t\t\t.unbind( \"reset.button\" )\n\t\t\t.bind( \"reset.button\", formResetHandler );\n\n\t\tif ( typeof this.options.disabled !== \"boolean\" ) {\n\t\t\tthis.options.disabled = !!this.element.propAttr( \"disabled\" );\n\t\t} else {\n\t\t\tthis.element.propAttr( \"disabled\", this.options.disabled );\n\t\t}\n\n\t\tthis._determineButtonType();\n\t\tthis.hasTitle = !!this.buttonElement.attr( \"title\" );\n\n\t\tvar self = this,\n\t\t\toptions = this.options,\n\t\t\ttoggleButton = this.type === \"checkbox\" || this.type === \"radio\",\n\t\t\thoverClass = \"ui-state-hover\" + ( !toggleButton ? \" ui-state-active\" : \"\" ),\n\t\t\tfocusClass = \"ui-state-focus\";\n\n\t\tif ( options.label === null ) {\n\t\t\toptions.label = this.buttonElement.html();\n\t\t}\n\n\t\tthis.buttonElement\n\t\t\t.addClass( baseClasses )\n\t\t\t.attr( \"role\", \"button\" )\n\t\t\t.bind( \"mouseenter.button\", function() {\n\t\t\t\tif ( options.disabled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$( this ).addClass( \"ui-state-hover\" );\n\t\t\t\tif ( this === lastActive ) {\n\t\t\t\t\t$( this ).addClass( \"ui-state-active\" );\n\t\t\t\t}\n\t\t\t})\n\t\t\t.bind( \"mouseleave.button\", function() {\n\t\t\t\tif ( options.disabled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$( this ).removeClass( hoverClass );\n\t\t\t})\n\t\t\t.bind( \"click.button\", function( event ) {\n\t\t\t\tif ( options.disabled ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t}\n\t\t\t});\n\n\t\tthis.element\n\t\t\t.bind( \"focus.button\", function() {\n\t\t\t\t// no need to check disabled, focus won't be triggered anyway\n\t\t\t\tself.buttonElement.addClass( focusClass );\n\t\t\t})\n\t\t\t.bind( \"blur.button\", function() {\n\t\t\t\tself.buttonElement.removeClass( focusClass );\n\t\t\t});\n\n\t\tif ( toggleButton ) {\n\t\t\tthis.element.bind( \"change.button\", function() {\n\t\t\t\tif ( clickDragged ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tself.refresh();\n\t\t\t});\n\t\t\t// if mouse moves between mousedown and mouseup (drag) set clickDragged flag\n\t\t\t// prevents issue where button state changes but checkbox/radio checked state\n\t\t\t// does not in Firefox (see ticket #6970)\n\t\t\tthis.buttonElement\n\t\t\t\t.bind( \"mousedown.button\", function( event ) {\n\t\t\t\t\tif ( options.disabled ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tclickDragged = false;\n\t\t\t\t\tstartXPos = event.pageX;\n\t\t\t\t\tstartYPos = event.pageY;\n\t\t\t\t})\n\t\t\t\t.bind( \"mouseup.button\", function( event ) {\n\t\t\t\t\tif ( options.disabled ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif ( startXPos !== event.pageX || startYPos !== event.pageY ) {\n\t\t\t\t\t\tclickDragged = true;\n\t\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif ( this.type === \"checkbox\" ) {\n\t\t\tthis.buttonElement.bind( \"click.button\", function() {\n\t\t\t\tif ( options.disabled || clickDragged ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$( this ).toggleClass( \"ui-state-active\" );\n\t\t\t\tself.buttonElement.attr( \"aria-pressed\", self.element[0].checked );\n\t\t\t});\n\t\t} else if ( this.type === \"radio\" ) {\n\t\t\tthis.buttonElement.bind( \"click.button\", function() {\n\t\t\t\tif ( options.disabled || clickDragged ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$( this ).addClass( \"ui-state-active\" );\n\t\t\t\tself.buttonElement.attr( \"aria-pressed\", \"true\" );\n\n\t\t\t\tvar radio = self.element[ 0 ];\n\t\t\t\tradioGroup( radio )\n\t\t\t\t\t.not( radio )\n\t\t\t\t\t.map(function() {\n\t\t\t\t\t\treturn $( this ).button( \"widget\" )[ 0 ];\n\t\t\t\t\t})\n\t\t\t\t\t.removeClass( \"ui-state-active\" )\n\t\t\t\t\t.attr( \"aria-pressed\", \"false\" );\n\t\t\t});\n\t\t} else {\n\t\t\tthis.buttonElement\n\t\t\t\t.bind( \"mousedown.button\", function() {\n\t\t\t\t\tif ( options.disabled ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$( this ).addClass( \"ui-state-active\" );\n\t\t\t\t\tlastActive = this;\n\t\t\t\t\t$( document ).one( \"mouseup\", function() {\n\t\t\t\t\t\tlastActive = null;\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.bind( \"mouseup.button\", function() {\n\t\t\t\t\tif ( options.disabled ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$( this ).removeClass( \"ui-state-active\" );\n\t\t\t\t})\n\t\t\t\t.bind( \"keydown.button\", function(event) {\n\t\t\t\t\tif ( options.disabled ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) {\n\t\t\t\t\t\t$( this ).addClass( \"ui-state-active\" );\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.bind( \"keyup.button\", function() {\n\t\t\t\t\t$( this ).removeClass( \"ui-state-active\" );\n\t\t\t\t});\n\n\t\t\tif ( this.buttonElement.is(\"a\") ) {\n\t\t\t\tthis.buttonElement.keyup(function(event) {\n\t\t\t\t\tif ( event.keyCode === $.ui.keyCode.SPACE ) {\n\t\t\t\t\t\t// TODO pass through original event correctly (just as 2nd argument doesn't work)\n\t\t\t\t\t\t$( this ).click();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// TODO: pull out $.Widget's handling for the disabled option into\n\t\t// $.Widget.prototype._setOptionDisabled so it's easy to proxy and can\n\t\t// be overridden by individual plugins\n\t\tthis._setOption( \"disabled\", options.disabled );\n\t\tthis._resetButton();\n\t},\n\n\t_determineButtonType: function() {\n\n\t\tif ( this.element.is(\":checkbox\") ) {\n\t\t\tthis.type = \"checkbox\";\n\t\t} else if ( this.element.is(\":radio\") ) {\n\t\t\tthis.type = \"radio\";\n\t\t} else if ( this.element.is(\"input\") ) {\n\t\t\tthis.type = \"input\";\n\t\t} else {\n\t\t\tthis.type = \"button\";\n\t\t}\n\n\t\tif ( this.type === \"checkbox\" || this.type === \"radio\" ) {\n\t\t\t// we don't search against the document in case the element\n\t\t\t// is disconnected from the DOM\n\t\t\tvar ancestor = this.element.parents().filter(\":last\"),\n\t\t\t\tlabelSelector = \"label[for='\" + this.element.attr(\"id\") + \"']\";\n\t\t\tthis.buttonElement = ancestor.find( labelSelector );\n\t\t\tif ( !this.buttonElement.length ) {\n\t\t\t\tancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();\n\t\t\t\tthis.buttonElement = ancestor.filter( labelSelector );\n\t\t\t\tif ( !this.buttonElement.length ) {\n\t\t\t\t\tthis.buttonElement = ancestor.find( labelSelector );\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.element.addClass( \"ui-helper-hidden-accessible\" );\n\n\t\t\tvar checked = this.element.is( \":checked\" );\n\t\t\tif ( checked ) {\n\t\t\t\tthis.buttonElement.addClass( \"ui-state-active\" );\n\t\t\t}\n\t\t\tthis.buttonElement.attr( \"aria-pressed\", checked );\n\t\t} else {\n\t\t\tthis.buttonElement = this.element;\n\t\t}\n\t},\n\n\twidget: function() {\n\t\treturn this.buttonElement;\n\t},\n\n\tdestroy: function() {\n\t\tthis.element\n\t\t\t.removeClass( \"ui-helper-hidden-accessible\" );\n\t\tthis.buttonElement\n\t\t\t.removeClass( baseClasses + \" \" + stateClasses + \" \" + typeClasses )\n\t\t\t.removeAttr( \"role\" )\n\t\t\t.removeAttr( \"aria-pressed\" )\n\t\t\t.html( this.buttonElement.find(\".ui-button-text\").html() );\n\n\t\tif ( !this.hasTitle ) {\n\t\t\tthis.buttonElement.removeAttr( \"title\" );\n\t\t}\n\n\t\t$.Widget.prototype.destroy.call( this );\n\t},\n\n\t_setOption: function( key, value ) {\n\t\t$.Widget.prototype._setOption.apply( this, arguments );\n\t\tif ( key === \"disabled\" ) {\n\t\t\tif ( value ) {\n\t\t\t\tthis.element.propAttr( \"disabled\", true );\n\t\t\t} else {\n\t\t\t\tthis.element.propAttr( \"disabled\", false );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthis._resetButton();\n\t},\n\n\trefresh: function() {\n\t\tvar isDisabled = this.element.is( \":disabled\" );\n\t\tif ( isDisabled !== this.options.disabled ) {\n\t\t\tthis._setOption( \"disabled\", isDisabled );\n\t\t}\n\t\tif ( this.type === \"radio\" ) {\n\t\t\tradioGroup( this.element[0] ).each(function() {\n\t\t\t\tif ( $( this ).is( \":checked\" ) ) {\n\t\t\t\t\t$( this ).button( \"widget\" )\n\t\t\t\t\t\t.addClass( \"ui-state-active\" )\n\t\t\t\t\t\t.attr( \"aria-pressed\", \"true\" );\n\t\t\t\t} else {\n\t\t\t\t\t$( this ).button( \"widget\" )\n\t\t\t\t\t\t.removeClass( \"ui-state-active\" )\n\t\t\t\t\t\t.attr( \"aria-pressed\", \"false\" );\n\t\t\t\t}\n\t\t\t});\n\t\t} else if ( this.type === \"checkbox\" ) {\n\t\t\tif ( this.element.is( \":checked\" ) ) {\n\t\t\t\tthis.buttonElement\n\t\t\t\t\t.addClass( \"ui-state-active\" )\n\t\t\t\t\t.attr( \"aria-pressed\", \"true\" );\n\t\t\t} else {\n\t\t\t\tthis.buttonElement\n\t\t\t\t\t.removeClass( \"ui-state-active\" )\n\t\t\t\t\t.attr( \"aria-pressed\", \"false\" );\n\t\t\t}\n\t\t}\n\t},\n\n\t_resetButton: function() {\n\t\tif ( this.type === \"input\" ) {\n\t\t\tif ( this.options.label ) {\n\t\t\t\tthis.element.val( this.options.label );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tvar buttonElement = this.buttonElement.removeClass( typeClasses ),\n\t\t\tbuttonText = $( \"<span></span>\", this.element[0].ownerDocument )\n\t\t\t\t.addClass( \"ui-button-text\" )\n\t\t\t\t.html( this.options.label )\n\t\t\t\t.appendTo( buttonElement.empty() )\n\t\t\t\t.text(),\n\t\t\ticons = this.options.icons,\n\t\t\tmultipleIcons = icons.primary && icons.secondary,\n\t\t\tbuttonClasses = [];  \n\n\t\tif ( icons.primary || icons.secondary ) {\n\t\t\tif ( this.options.text ) {\n\t\t\t\tbuttonClasses.push( \"ui-button-text-icon\" + ( multipleIcons ? \"s\" : ( icons.primary ? \"-primary\" : \"-secondary\" ) ) );\n\t\t\t}\n\n\t\t\tif ( icons.primary ) {\n\t\t\t\tbuttonElement.prepend( \"<span class='ui-button-icon-primary ui-icon \" + icons.primary + \"'></span>\" );\n\t\t\t}\n\n\t\t\tif ( icons.secondary ) {\n\t\t\t\tbuttonElement.append( \"<span class='ui-button-icon-secondary ui-icon \" + icons.secondary + \"'></span>\" );\n\t\t\t}\n\n\t\t\tif ( !this.options.text ) {\n\t\t\t\tbuttonClasses.push( multipleIcons ? \"ui-button-icons-only\" : \"ui-button-icon-only\" );\n\n\t\t\t\tif ( !this.hasTitle ) {\n\t\t\t\t\tbuttonElement.attr( \"title\", buttonText );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tbuttonClasses.push( \"ui-button-text-only\" );\n\t\t}\n\t\tbuttonElement.addClass( buttonClasses.join( \" \" ) );\n\t}\n});\n\n$.widget( \"ui.buttonset\", {\n\toptions: {\n\t\titems: \":button, :submit, :reset, :checkbox, :radio, a, :data(button)\"\n\t},\n\n\t_create: function() {\n\t\tthis.element.addClass( \"ui-buttonset\" );\n\t},\n\t\n\t_init: function() {\n\t\tthis.refresh();\n\t},\n\n\t_setOption: function( key, value ) {\n\t\tif ( key === \"disabled\" ) {\n\t\t\tthis.buttons.button( \"option\", key, value );\n\t\t}\n\n\t\t$.Widget.prototype._setOption.apply( this, arguments );\n\t},\n\t\n\trefresh: function() {\n\t\tvar rtl = this.element.css( \"direction\" ) === \"rtl\";\n\t\t\n\t\tthis.buttons = this.element.find( this.options.items )\n\t\t\t.filter( \":ui-button\" )\n\t\t\t\t.button( \"refresh\" )\n\t\t\t.end()\n\t\t\t.not( \":ui-button\" )\n\t\t\t\t.button()\n\t\t\t.end()\n\t\t\t.map(function() {\n\t\t\t\treturn $( this ).button( \"widget\" )[ 0 ];\n\t\t\t})\n\t\t\t\t.removeClass( \"ui-corner-all ui-corner-left ui-corner-right\" )\n\t\t\t\t.filter( \":first\" )\n\t\t\t\t\t.addClass( rtl ? \"ui-corner-right\" : \"ui-corner-left\" )\n\t\t\t\t.end()\n\t\t\t\t.filter( \":last\" )\n\t\t\t\t\t.addClass( rtl ? \"ui-corner-left\" : \"ui-corner-right\" )\n\t\t\t\t.end()\n\t\t\t.end();\n\t},\n\n\tdestroy: function() {\n\t\tthis.element.removeClass( \"ui-buttonset\" );\n\t\tthis.buttons\n\t\t\t.map(function() {\n\t\t\t\treturn $( this ).button( \"widget\" )[ 0 ];\n\t\t\t})\n\t\t\t\t.removeClass( \"ui-corner-left ui-corner-right\" )\n\t\t\t.end()\n\t\t\t.button( \"destroy\" );\n\n\t\t$.Widget.prototype.destroy.call( this );\n\t}\n});\n\n}( jQuery ) );\n\n(function( $, undefined ) {\n\n$.extend($.ui, { datepicker: { version: \"1.8.22\" } });\n\nvar PROP_NAME = 'datepicker';\nvar dpuuid = new Date().getTime();\nvar instActive;\n\n/* Date picker manager.\n   Use the singleton instance of this class, $.datepicker, to interact with the date picker.\n   Settings for (groups of) date pickers are maintained in an instance object,\n   allowing multiple different settings on the same page. */\n\nfunction Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}\n\n$.extend(Datepicker.prototype, {\n\t/* Class name added to elements to indicate already configured with a date picker. */\n\tmarkerClassName: 'hasDatepicker',\n\t\n\t//Keep track of the maximum number of rows displayed (see #7043)\n\tmaxRows: 4,\n\n\t/* Debug logging (if enabled). */\n\tlog: function () {\n\t\tif (this.debug)\n\t\t\tconsole.log.apply('', arguments);\n\t},\n\t\n\t// TODO rename to \"widget\" when switching to widget factory\n\t_widgetDatepicker: function() {\n\t\treturn this.dpDiv;\n\t},\n\n\t/* Override the default settings for all instances of the date picker.\n\t   @param  settings  object - the new settings to use as defaults (anonymous object)\n\t   @return the manager object */\n\tsetDefaults: function(settings) {\n\t\textendRemove(this._defaults, settings || {});\n\t\treturn this;\n\t},\n\n\t/* Attach the date picker to a jQuery selection.\n\t   @param  target    element - the target input field or division or span\n\t   @param  settings  object - the new settings to use for this date picker instance (anonymous) */\n\t_attachDatepicker: function(target, settings) {\n\t\t// check for settings on the control itself - in namespace 'date:'\n\t\tvar inlineSettings = null;\n\t\tfor (var attrName in this._defaults) {\n\t\t\tvar attrValue = target.getAttribute('date:' + attrName);\n\t\t\tif (attrValue) {\n\t\t\t\tinlineSettings = inlineSettings || {};\n\t\t\t\ttry {\n\t\t\t\t\tinlineSettings[attrName] = eval(attrValue);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tinlineSettings[attrName] = attrValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvar nodeName = target.nodeName.toLowerCase();\n\t\tvar inline = (nodeName == 'div' || nodeName == 'span');\n\t\tif (!target.id) {\n\t\t\tthis.uuid += 1;\n\t\t\ttarget.id = 'dp' + this.uuid;\n\t\t}\n\t\tvar inst = this._newInst($(target), inline);\n\t\tinst.settings = $.extend({}, settings || {}, inlineSettings || {});\n\t\tif (nodeName == 'input') {\n\t\t\tthis._connectDatepicker(target, inst);\n\t\t} else if (inline) {\n\t\t\tthis._inlineDatepicker(target, inst);\n\t\t}\n\t},\n\n\t/* Create a new instance object. */\n\t_newInst: function(target, inline) {\n\t\tvar id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\\\\\$1'); // escape jQuery meta chars\n\t\treturn {id: id, input: target, // associated target\n\t\t\tselectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection\n\t\t\tdrawMonth: 0, drawYear: 0, // month being drawn\n\t\t\tinline: inline, // is datepicker inline or not\n\t\t\tdpDiv: (!inline ? this.dpDiv : // presentation div\n\t\t\tbindHover($('<div class=\"' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>')))};\n\t},\n\n\t/* Attach the date picker to an input field. */\n\t_connectDatepicker: function(target, inst) {\n\t\tvar input = $(target);\n\t\tinst.append = $([]);\n\t\tinst.trigger = $([]);\n\t\tif (input.hasClass(this.markerClassName))\n\t\t\treturn;\n\t\tthis._attachments(input, inst);\n\t\tinput.addClass(this.markerClassName).keydown(this._doKeyDown).\n\t\t\tkeypress(this._doKeyPress).keyup(this._doKeyUp).\n\t\t\tbind(\"setData.datepicker\", function(event, key, value) {\n\t\t\t\tinst.settings[key] = value;\n\t\t\t}).bind(\"getData.datepicker\", function(event, key) {\n\t\t\t\treturn this._get(inst, key);\n\t\t\t});\n\t\tthis._autoSize(inst);\n\t\t$.data(target, PROP_NAME, inst);\n\t\t//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)\n\t\tif( inst.settings.disabled ) {\n\t\t\tthis._disableDatepicker( target );\n\t\t}\n\t},\n\n\t/* Make attachments based on settings. */\n\t_attachments: function(input, inst) {\n\t\tvar appendText = this._get(inst, 'appendText');\n\t\tvar isRTL = this._get(inst, 'isRTL');\n\t\tif (inst.append)\n\t\t\tinst.append.remove();\n\t\tif (appendText) {\n\t\t\tinst.append = $('<span class=\"' + this._appendClass + '\">' + appendText + '</span>');\n\t\t\tinput[isRTL ? 'before' : 'after'](inst.append);\n\t\t}\n\t\tinput.unbind('focus', this._showDatepicker);\n\t\tif (inst.trigger)\n\t\t\tinst.trigger.remove();\n\t\tvar showOn = this._get(inst, 'showOn');\n\t\tif (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field\n\t\t\tinput.focus(this._showDatepicker);\n\t\tif (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked\n\t\t\tvar buttonText = this._get(inst, 'buttonText');\n\t\t\tvar buttonImage = this._get(inst, 'buttonImage');\n\t\t\tinst.trigger = $(this._get(inst, 'buttonImageOnly') ?\n\t\t\t\t$('<img/>').addClass(this._triggerClass).\n\t\t\t\t\tattr({ src: buttonImage, alt: buttonText, title: buttonText }) :\n\t\t\t\t$('<button type=\"button\"></button>').addClass(this._triggerClass).\n\t\t\t\t\thtml(buttonImage == '' ? buttonText : $('<img/>').attr(\n\t\t\t\t\t{ src:buttonImage, alt:buttonText, title:buttonText })));\n\t\t\tinput[isRTL ? 'before' : 'after'](inst.trigger);\n\t\t\tinst.trigger.click(function() {\n\t\t\t\tif ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0])\n\t\t\t\t\t$.datepicker._hideDatepicker();\n\t\t\t\telse if ($.datepicker._datepickerShowing && $.datepicker._lastInput != input[0]) {\n\t\t\t\t\t$.datepicker._hideDatepicker(); \n\t\t\t\t\t$.datepicker._showDatepicker(input[0]);\n\t\t\t\t} else\n\t\t\t\t\t$.datepicker._showDatepicker(input[0]);\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\t},\n\n\t/* Apply the maximum length for the date format. */\n\t_autoSize: function(inst) {\n\t\tif (this._get(inst, 'autoSize') && !inst.inline) {\n\t\t\tvar date = new Date(2009, 12 - 1, 20); // Ensure double digits\n\t\t\tvar dateFormat = this._get(inst, 'dateFormat');\n\t\t\tif (dateFormat.match(/[DM]/)) {\n\t\t\t\tvar findMax = function(names) {\n\t\t\t\t\tvar max = 0;\n\t\t\t\t\tvar maxI = 0;\n\t\t\t\t\tfor (var i = 0; i < names.length; i++) {\n\t\t\t\t\t\tif (names[i].length > max) {\n\t\t\t\t\t\t\tmax = names[i].length;\n\t\t\t\t\t\t\tmaxI = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn maxI;\n\t\t\t\t};\n\t\t\t\tdate.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?\n\t\t\t\t\t'monthNames' : 'monthNamesShort'))));\n\t\t\t\tdate.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?\n\t\t\t\t\t'dayNames' : 'dayNamesShort'))) + 20 - date.getDay());\n\t\t\t}\n\t\t\tinst.input.attr('size', this._formatDate(inst, date).length);\n\t\t}\n\t},\n\n\t/* Attach an inline date picker to a div. */\n\t_inlineDatepicker: function(target, inst) {\n\t\tvar divSpan = $(target);\n\t\tif (divSpan.hasClass(this.markerClassName))\n\t\t\treturn;\n\t\tdivSpan.addClass(this.markerClassName).append(inst.dpDiv).\n\t\t\tbind(\"setData.datepicker\", function(event, key, value){\n\t\t\t\tinst.settings[key] = value;\n\t\t\t}).bind(\"getData.datepicker\", function(event, key){\n\t\t\t\treturn this._get(inst, key);\n\t\t\t});\n\t\t$.data(target, PROP_NAME, inst);\n\t\tthis._setDate(inst, this._getDefaultDate(inst), true);\n\t\tthis._updateDatepicker(inst);\n\t\tthis._updateAlternate(inst);\n\t\t//If disabled option is true, disable the datepicker before showing it (see ticket #5665)\n\t\tif( inst.settings.disabled ) {\n\t\t\tthis._disableDatepicker( target );\n\t\t}\n\t\t// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements\n\t\t// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height\n\t\tinst.dpDiv.css( \"display\", \"block\" );\n\t},\n\n\t/* Pop-up the date picker in a \"dialog\" box.\n\t   @param  input     element - ignored\n\t   @param  date      string or Date - the initial date to display\n\t   @param  onSelect  function - the function to call when a date is selected\n\t   @param  settings  object - update the dialog date picker instance's settings (anonymous object)\n\t   @param  pos       int[2] - coordinates for the dialog's position within the screen or\n\t                     event - with x/y coordinates or\n\t                     leave empty for default (screen centre)\n\t   @return the manager object */\n\t_dialogDatepicker: function(input, date, onSelect, settings, pos) {\n\t\tvar inst = this._dialogInst; // internal instance\n\t\tif (!inst) {\n\t\t\tthis.uuid += 1;\n\t\t\tvar id = 'dp' + this.uuid;\n\t\t\tthis._dialogInput = $('<input type=\"text\" id=\"' + id +\n\t\t\t\t'\" style=\"position: absolute; top: -100px; width: 0px;\"/>');\n\t\t\tthis._dialogInput.keydown(this._doKeyDown);\n\t\t\t$('body').append(this._dialogInput);\n\t\t\tinst = this._dialogInst = this._newInst(this._dialogInput, false);\n\t\t\tinst.settings = {};\n\t\t\t$.data(this._dialogInput[0], PROP_NAME, inst);\n\t\t}\n\t\textendRemove(inst.settings, settings || {});\n\t\tdate = (date && date.constructor == Date ? this._formatDate(inst, date) : date);\n\t\tthis._dialogInput.val(date);\n\n\t\tthis._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);\n\t\tif (!this._pos) {\n\t\t\tvar browserWidth = document.documentElement.clientWidth;\n\t\t\tvar browserHeight = document.documentElement.clientHeight;\n\t\t\tvar scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;\n\t\t\tvar scrollY = document.documentElement.scrollTop || document.body.scrollTop;\n\t\t\tthis._pos = // should use actual width/height below\n\t\t\t\t[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];\n\t\t}\n\n\t\t// move input on screen for focus, but hidden behind dialog\n\t\tthis._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px');\n\t\tinst.settings.onSelect = onSelect;\n\t\tthis._inDialog = true;\n\t\tthis.dpDiv.addClass(this._dialogClass);\n\t\tthis._showDatepicker(this._dialogInput[0]);\n\t\tif ($.blockUI)\n\t\t\t$.blockUI(this.dpDiv);\n\t\t$.data(this._dialogInput[0], PROP_NAME, inst);\n\t\treturn this;\n\t},\n\n\t/* Detach a datepicker from its control.\n\t   @param  target    element - the target input field or division or span */\n\t_destroyDatepicker: function(target) {\n\t\tvar $target = $(target);\n\t\tvar inst = $.data(target, PROP_NAME);\n\t\tif (!$target.hasClass(this.markerClassName)) {\n\t\t\treturn;\n\t\t}\n\t\tvar nodeName = target.nodeName.toLowerCase();\n\t\t$.removeData(target, PROP_NAME);\n\t\tif (nodeName == 'input') {\n\t\t\tinst.append.remove();\n\t\t\tinst.trigger.remove();\n\t\t\t$target.removeClass(this.markerClassName).\n\t\t\t\tunbind('focus', this._showDatepicker).\n\t\t\t\tunbind('keydown', this._doKeyDown).\n\t\t\t\tunbind('keypress', this._doKeyPress).\n\t\t\t\tunbind('keyup', this._doKeyUp);\n\t\t} else if (nodeName == 'div' || nodeName == 'span')\n\t\t\t$target.removeClass(this.markerClassName).empty();\n\t},\n\n\t/* Enable the date picker to a jQuery selection.\n\t   @param  target    element - the target input field or division or span */\n\t_enableDatepicker: function(target) {\n\t\tvar $target = $(target);\n\t\tvar inst = $.data(target, PROP_NAME);\n\t\tif (!$target.hasClass(this.markerClassName)) {\n\t\t\treturn;\n\t\t}\n\t\tvar nodeName = target.nodeName.toLowerCase();\n\t\tif (nodeName == 'input') {\n\t\t\ttarget.disabled = false;\n\t\t\tinst.trigger.filter('button').\n\t\t\t\teach(function() { this.disabled = false; }).end().\n\t\t\t\tfilter('img').css({opacity: '1.0', cursor: ''});\n\t\t}\n\t\telse if (nodeName == 'div' || nodeName == 'span') {\n\t\t\tvar inline = $target.children('.' + this._inlineClass);\n\t\t\tinline.children().removeClass('ui-state-disabled');\n\t\t\tinline.find(\"select.ui-datepicker-month, select.ui-datepicker-year\").\n\t\t\t\tremoveAttr(\"disabled\");\n\t\t}\n\t\tthis._disabledInputs = $.map(this._disabledInputs,\n\t\t\tfunction(value) { return (value == target ? null : value); }); // delete entry\n\t},\n\n\t/* Disable the date picker to a jQuery selection.\n\t   @param  target    element - the target input field or division or span */\n\t_disableDatepicker: function(target) {\n\t\tvar $target = $(target);\n\t\tvar inst = $.data(target, PROP_NAME);\n\t\tif (!$target.hasClass(this.markerClassName)) {\n\t\t\treturn;\n\t\t}\n\t\tvar nodeName = target.nodeName.toLowerCase();\n\t\tif (nodeName == 'input') {\n\t\t\ttarget.disabled = true;\n\t\t\tinst.trigger.filter('button').\n\t\t\t\teach(function() { this.disabled = true; }).end().\n\t\t\t\tfilter('img').css({opacity: '0.5', cursor: 'default'});\n\t\t}\n\t\telse if (nodeName == 'div' || nodeName == 'span') {\n\t\t\tvar inline = $target.children('.' + this._inlineClass);\n\t\t\tinline.children().addClass('ui-state-disabled');\n\t\t\tinline.find(\"select.ui-datepicker-month, select.ui-datepicker-year\").\n\t\t\t\tattr(\"disabled\", \"disabled\");\n\t\t}\n\t\tthis._disabledInputs = $.map(this._disabledInputs,\n\t\t\tfunction(value) { return (value == target ? null : value); }); // delete entry\n\t\tthis._disabledInputs[this._disabledInputs.length] = target;\n\t},\n\n\t/* Is the first field in a jQuery collection disabled as a datepicker?\n\t   @param  target    element - the target input field or division or span\n\t   @return boolean - true if disabled, false if enabled */\n\t_isDisabledDatepicker: function(target) {\n\t\tif (!target) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (var i = 0; i < this._disabledInputs.length; i++) {\n\t\t\tif (this._disabledInputs[i] == target)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t},\n\n\t/* Retrieve the instance data for the target control.\n\t   @param  target  element - the target input field or division or span\n\t   @return  object - the associated instance data\n\t   @throws  error if a jQuery problem getting data */\n\t_getInst: function(target) {\n\t\ttry {\n\t\t\treturn $.data(target, PROP_NAME);\n\t\t}\n\t\tcatch (err) {\n\t\t\tthrow 'Missing instance data for this datepicker';\n\t\t}\n\t},\n\n\t/* Update or retrieve the settings for a date picker attached to an input field or division.\n\t   @param  target  element - the target input field or division or span\n\t   @param  name    object - the new settings to update or\n\t                   string - the name of the setting to change or retrieve,\n\t                   when retrieving also 'all' for all instance settings or\n\t                   'defaults' for all global defaults\n\t   @param  value   any - the new value for the setting\n\t                   (omit if above is an object or to retrieve a value) */\n\t_optionDatepicker: function(target, name, value) {\n\t\tvar inst = this._getInst(target);\n\t\tif (arguments.length == 2 && typeof name == 'string') {\n\t\t\treturn (name == 'defaults' ? $.extend({}, $.datepicker._defaults) :\n\t\t\t\t(inst ? (name == 'all' ? $.extend({}, inst.settings) :\n\t\t\t\tthis._get(inst, name)) : null));\n\t\t}\n\t\tvar settings = name || {};\n\t\tif (typeof name == 'string') {\n\t\t\tsettings = {};\n\t\t\tsettings[name] = value;\n\t\t}\n\t\tif (inst) {\n\t\t\tif (this._curInst == inst) {\n\t\t\t\tthis._hideDatepicker();\n\t\t\t}\n\t\t\tvar date = this._getDateDatepicker(target, true);\n\t\t\tvar minDate = this._getMinMaxDate(inst, 'min');\n\t\t\tvar maxDate = this._getMinMaxDate(inst, 'max');\n\t\t\textendRemove(inst.settings, settings);\n\t\t\t// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided\n\t\t\tif (minDate !== null && settings['dateFormat'] !== undefined && settings['minDate'] === undefined)\n\t\t\t\tinst.settings.minDate = this._formatDate(inst, minDate);\n\t\t\tif (maxDate !== null && settings['dateFormat'] !== undefined && settings['maxDate'] === undefined)\n\t\t\t\tinst.settings.maxDate = this._formatDate(inst, maxDate);\n\t\t\tthis._attachments($(target), inst);\n\t\t\tthis._autoSize(inst);\n\t\t\tthis._setDate(inst, date);\n\t\t\tthis._updateAlternate(inst);\n\t\t\tthis._updateDatepicker(inst);\n\t\t}\n\t},\n\n\t// change method deprecated\n\t_changeDatepicker: function(target, name, value) {\n\t\tthis._optionDatepicker(target, name, value);\n\t},\n\n\t/* Redraw the date picker attached to an input field or division.\n\t   @param  target  element - the target input field or division or span */\n\t_refreshDatepicker: function(target) {\n\t\tvar inst = this._getInst(target);\n\t\tif (inst) {\n\t\t\tthis._updateDatepicker(inst);\n\t\t}\n\t},\n\n\t/* Set the dates for a jQuery selection.\n\t   @param  target   element - the target input field or division or span\n\t   @param  date     Date - the new date */\n\t_setDateDatepicker: function(target, date) {\n\t\tvar inst = this._getInst(target);\n\t\tif (inst) {\n\t\t\tthis._setDate(inst, date);\n\t\t\tthis._updateDatepicker(inst);\n\t\t\tthis._updateAlternate(inst);\n\t\t}\n\t},\n\n\t/* Get the date(s) for the first entry in a jQuery selection.\n\t   @param  target     element - the target input field or division or span\n\t   @param  noDefault  boolean - true if no default date is to be used\n\t   @return Date - the current date */\n\t_getDateDatepicker: function(target, noDefault) {\n\t\tvar inst = this._getInst(target);\n\t\tif (inst && !inst.inline)\n\t\t\tthis._setDateFromField(inst, noDefault);\n\t\treturn (inst ? this._getDate(inst) : null);\n\t},\n\n\t/* Handle keystrokes. */\n\t_doKeyDown: function(event) {\n\t\tvar inst = $.datepicker._getInst(event.target);\n\t\tvar handled = true;\n\t\tvar isRTL = inst.dpDiv.is('.ui-datepicker-rtl');\n\t\tinst._keyEvent = true;\n\t\tif ($.datepicker._datepickerShowing)\n\t\t\tswitch (event.keyCode) {\n\t\t\t\tcase 9: $.datepicker._hideDatepicker();\n\t\t\t\t\t\thandled = false;\n\t\t\t\t\t\tbreak; // hide on tab out\n\t\t\t\tcase 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' + \n\t\t\t\t\t\t\t\t\t$.datepicker._currentClass + ')', inst.dpDiv);\n\t\t\t\t\t\tif (sel[0])\n\t\t\t\t\t\t\t$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);\n\t\t\t\t\t\t\tvar onSelect = $.datepicker._get(inst, 'onSelect');\n\t\t\t\t\t\t\tif (onSelect) {\n\t\t\t\t\t\t\t\tvar dateStr = $.datepicker._formatDate(inst);\n\n\t\t\t\t\t\t\t\t// trigger custom callback\n\t\t\t\t\t\t\t\tonSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$.datepicker._hideDatepicker();\n\t\t\t\t\t\treturn false; // don't submit the form\n\t\t\t\t\t\tbreak; // select the value on enter\n\t\t\t\tcase 27: $.datepicker._hideDatepicker();\n\t\t\t\t\t\tbreak; // hide on escape\n\t\t\t\tcase 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?\n\t\t\t\t\t\t\t-$.datepicker._get(inst, 'stepBigMonths') :\n\t\t\t\t\t\t\t-$.datepicker._get(inst, 'stepMonths')), 'M');\n\t\t\t\t\t\tbreak; // previous month/year on page up/+ ctrl\n\t\t\t\tcase 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?\n\t\t\t\t\t\t\t+$.datepicker._get(inst, 'stepBigMonths') :\n\t\t\t\t\t\t\t+$.datepicker._get(inst, 'stepMonths')), 'M');\n\t\t\t\t\t\tbreak; // next month/year on page down/+ ctrl\n\t\t\t\tcase 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target);\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\n\t\t\t\t\t\tbreak; // clear on ctrl or command +end\n\t\t\t\tcase 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target);\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\n\t\t\t\t\t\tbreak; // current on ctrl or command +home\n\t\t\t\tcase 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D');\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\n\t\t\t\t\t\t// -1 day on ctrl or command +left\n\t\t\t\t\t\tif (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?\n\t\t\t\t\t\t\t\t\t-$.datepicker._get(inst, 'stepBigMonths') :\n\t\t\t\t\t\t\t\t\t-$.datepicker._get(inst, 'stepMonths')), 'M');\n\t\t\t\t\t\t// next month/year on alt +left on Mac\n\t\t\t\t\t\tbreak;\n\t\t\t\tcase 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D');\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\n\t\t\t\t\t\tbreak; // -1 week on ctrl or command +up\n\t\t\t\tcase 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D');\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\n\t\t\t\t\t\t// +1 day on ctrl or command +right\n\t\t\t\t\t\tif (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?\n\t\t\t\t\t\t\t\t\t+$.datepicker._get(inst, 'stepBigMonths') :\n\t\t\t\t\t\t\t\t\t+$.datepicker._get(inst, 'stepMonths')), 'M');\n\t\t\t\t\t\t// next month/year on alt +right\n\t\t\t\t\t\tbreak;\n\t\t\t\tcase 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D');\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\n\t\t\t\t\t\tbreak; // +1 week on ctrl or command +down\n\t\t\t\tdefault: handled = false;\n\t\t\t}\n\t\telse if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home\n\t\t\t$.datepicker._showDatepicker(this);\n\t\telse {\n\t\t\thandled = false;\n\t\t}\n\t\tif (handled) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t}\n\t},\n\n\t/* Filter entered characters - based on date format. */\n\t_doKeyPress: function(event) {\n\t\tvar inst = $.datepicker._getInst(event.target);\n\t\tif ($.datepicker._get(inst, 'constrainInput')) {\n\t\t\tvar chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat'));\n\t\t\tvar chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode);\n\t\t\treturn event.ctrlKey || event.metaKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);\n\t\t}\n\t},\n\n\t/* Synchronise manual entry and field/alternate field. */\n\t_doKeyUp: function(event) {\n\t\tvar inst = $.datepicker._getInst(event.target);\n\t\tif (inst.input.val() != inst.lastVal) {\n\t\t\ttry {\n\t\t\t\tvar date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),\n\t\t\t\t\t(inst.input ? inst.input.val() : null),\n\t\t\t\t\t$.datepicker._getFormatConfig(inst));\n\t\t\t\tif (date) { // only if valid\n\t\t\t\t\t$.datepicker._setDateFromField(inst);\n\t\t\t\t\t$.datepicker._updateAlternate(inst);\n\t\t\t\t\t$.datepicker._updateDatepicker(inst);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (err) {\n\t\t\t\t$.datepicker.log(err);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t},\n\n\t/* Pop-up the date picker for a given input field.\n       If false returned from beforeShow event handler do not show. \n\t   @param  input  element - the input field attached to the date picker or\n\t                  event - if triggered by focus */\n\t_showDatepicker: function(input) {\n\t\tinput = input.target || input;\n\t\tif (input.nodeName.toLowerCase() != 'input') // find from button/image trigger\n\t\t\tinput = $('input', input.parentNode)[0];\n\t\tif ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here\n\t\t\treturn;\n\t\tvar inst = $.datepicker._getInst(input);\n\t\tif ($.datepicker._curInst && $.datepicker._curInst != inst) {\n\t\t\t$.datepicker._curInst.dpDiv.stop(true, true);\n\t\t\tif ( inst && $.datepicker._datepickerShowing ) {\n\t\t\t\t$.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );\n\t\t\t}\n\t\t}\n\t\tvar beforeShow = $.datepicker._get(inst, 'beforeShow');\n\t\tvar beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};\n\t\tif(beforeShowSettings === false){\n            //false\n\t\t\treturn;\n\t\t}\n\t\textendRemove(inst.settings, beforeShowSettings);\n\t\tinst.lastVal = null;\n\t\t$.datepicker._lastInput = input;\n\t\t$.datepicker._setDateFromField(inst);\n\t\tif ($.datepicker._inDialog) // hide cursor\n\t\t\tinput.value = '';\n\t\tif (!$.datepicker._pos) { // position below input\n\t\t\t$.datepicker._pos = $.datepicker._findPos(input);\n\t\t\t$.datepicker._pos[1] += input.offsetHeight; // add the height\n\t\t}\n\t\tvar isFixed = false;\n\t\t$(input).parents().each(function() {\n\t\t\tisFixed |= $(this).css('position') == 'fixed';\n\t\t\treturn !isFixed;\n\t\t});\n\t\tif (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled\n\t\t\t$.datepicker._pos[0] -= document.documentElement.scrollLeft;\n\t\t\t$.datepicker._pos[1] -= document.documentElement.scrollTop;\n\t\t}\n\t\tvar offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};\n\t\t$.datepicker._pos = null;\n\t\t//to avoid flashes on Firefox\n\t\tinst.dpDiv.empty();\n\t\t// determine sizing offscreen\n\t\tinst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'});\n\t\t$.datepicker._updateDatepicker(inst);\n\t\t// fix width for dynamic number of date pickers\n\t\t// and adjust position before showing\n\t\toffset = $.datepicker._checkOffset(inst, offset, isFixed);\n\t\tinst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?\n\t\t\t'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',\n\t\t\tleft: offset.left + 'px', top: offset.top + 'px'});\n\t\tif (!inst.inline) {\n\t\t\tvar showAnim = $.datepicker._get(inst, 'showAnim');\n\t\t\tvar duration = $.datepicker._get(inst, 'duration');\n\t\t\tvar postProcess = function() {\n\t\t\t\tvar cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only\n\t\t\t\tif( !! cover.length ){\n\t\t\t\t\tvar borders = $.datepicker._getBorders(inst.dpDiv);\n\t\t\t\t\tcover.css({left: -borders[0], top: -borders[1],\n\t\t\t\t\t\twidth: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()});\n\t\t\t\t}\n\t\t\t};\n\t\t\tinst.dpDiv.zIndex($(input).zIndex()+1);\n\t\t\t$.datepicker._datepickerShowing = true;\n\t\t\tif ($.effects && $.effects[showAnim])\n\t\t\t\tinst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);\n\t\t\telse\n\t\t\t\tinst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess);\n\t\t\tif (!showAnim || !duration)\n\t\t\t\tpostProcess();\n\t\t\tif (inst.input.is(':visible') && !inst.input.is(':disabled'))\n\t\t\t\tinst.input.focus();\n\t\t\t$.datepicker._curInst = inst;\n\t\t}\n\t},\n\n\t/* Generate the date picker content. */\n\t_updateDatepicker: function(inst) {\n\t\tvar self = this;\n\t\tself.maxRows = 4; //Reset the max number of rows being displayed (see #7043)\n\t\tvar borders = $.datepicker._getBorders(inst.dpDiv);\n\t\tinstActive = inst; // for delegate hover events\n\t\tinst.dpDiv.empty().append(this._generateHTML(inst));\n\t\tthis._attachHandlers(inst);\n\t\tvar cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only\n\t\tif( !!cover.length ){ //avoid call to outerXXXX() when not in IE6\n\t\t\tcover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()})\n\t\t}\n\t\tinst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover();\n\t\tvar numMonths = this._getNumberOfMonths(inst);\n\t\tvar cols = numMonths[1];\n\t\tvar width = 17;\n\t\tinst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');\n\t\tif (cols > 1)\n\t\t\tinst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em');\n\t\tinst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +\n\t\t\t'Class']('ui-datepicker-multi');\n\t\tinst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +\n\t\t\t'Class']('ui-datepicker-rtl');\n\t\tif (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&\n\t\t\t\t// #6694 - don't focus the input if it's already focused\n\t\t\t\t// this breaks the change event in IE\n\t\t\t\tinst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement)\n\t\t\tinst.input.focus();\n\t\t// deffered render of the years select (to avoid flashes on Firefox) \n\t\tif( inst.yearshtml ){\n\t\t\tvar origyearshtml = inst.yearshtml;\n\t\t\tsetTimeout(function(){\n\t\t\t\t//assure that inst.yearshtml didn't change.\n\t\t\t\tif( origyearshtml === inst.yearshtml && inst.yearshtml ){\n\t\t\t\t\tinst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml);\n\t\t\t\t}\n\t\t\t\torigyearshtml = inst.yearshtml = null;\n\t\t\t}, 0);\n\t\t}\n\t},\n\n\t/* Retrieve the size of left and top borders for an element.\n\t   @param  elem  (jQuery object) the element of interest\n\t   @return  (number[2]) the left and top borders */\n\t_getBorders: function(elem) {\n\t\tvar convert = function(value) {\n\t\t\treturn {thin: 1, medium: 2, thick: 3}[value] || value;\n\t\t};\n\t\treturn [parseFloat(convert(elem.css('border-left-width'))),\n\t\t\tparseFloat(convert(elem.css('border-top-width')))];\n\t},\n\n\t/* Check positioning to remain on screen. */\n\t_checkOffset: function(inst, offset, isFixed) {\n\t\tvar dpWidth = inst.dpDiv.outerWidth();\n\t\tvar dpHeight = inst.dpDiv.outerHeight();\n\t\tvar inputWidth = inst.input ? inst.input.outerWidth() : 0;\n\t\tvar inputHeight = inst.input ? inst.input.outerHeight() : 0;\n\t\tvar viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft());\n\t\tvar viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());\n\n\t\toffset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0);\n\t\toffset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;\n\t\toffset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;\n\n\t\t// now check if datepicker is showing outside window viewport - move to a better place if so.\n\t\toffset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?\n\t\t\tMath.abs(offset.left + dpWidth - viewWidth) : 0);\n\t\toffset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?\n\t\t\tMath.abs(dpHeight + inputHeight) : 0);\n\n\t\treturn offset;\n\t},\n\n\t/* Find an object's position on the screen. */\n\t_findPos: function(obj) {\n\t\tvar inst = this._getInst(obj);\n\t\tvar isRTL = this._get(inst, 'isRTL');\n        while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) {\n            obj = obj[isRTL ? 'previousSibling' : 'nextSibling'];\n        }\n        var position = $(obj).offset();\n\t    return [position.left, position.top];\n\t},\n\n\t/* Hide the date picker from view.\n\t   @param  input  element - the input field attached to the date picker */\n\t_hideDatepicker: function(input) {\n\t\tvar inst = this._curInst;\n\t\tif (!inst || (input && inst != $.data(input, PROP_NAME)))\n\t\t\treturn;\n\t\tif (this._datepickerShowing) {\n\t\t\tvar showAnim = this._get(inst, 'showAnim');\n\t\t\tvar duration = this._get(inst, 'duration');\n\t\t\tvar postProcess = function() {\n\t\t\t\t$.datepicker._tidyDialog(inst);\n\t\t\t};\n\t\t\tif ($.effects && $.effects[showAnim])\n\t\t\t\tinst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);\n\t\t\telse\n\t\t\t\tinst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' :\n\t\t\t\t\t(showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess);\n\t\t\tif (!showAnim)\n\t\t\t\tpostProcess();\n\t\t\tthis._datepickerShowing = false;\n\t\t\tvar onClose = this._get(inst, 'onClose');\n\t\t\tif (onClose)\n\t\t\t\tonClose.apply((inst.input ? inst.input[0] : null),\n\t\t\t\t\t[(inst.input ? inst.input.val() : ''), inst]);\n\t\t\tthis._lastInput = null;\n\t\t\tif (this._inDialog) {\n\t\t\t\tthis._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });\n\t\t\t\tif ($.blockUI) {\n\t\t\t\t\t$.unblockUI();\n\t\t\t\t\t$('body').append(this.dpDiv);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._inDialog = false;\n\t\t}\n\t},\n\n\t/* Tidy up after a dialog display. */\n\t_tidyDialog: function(inst) {\n\t\tinst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar');\n\t},\n\n\t/* Close date picker if clicked elsewhere. */\n\t_checkExternalClick: function(event) {\n\t\tif (!$.datepicker._curInst)\n\t\t\treturn;\n\n\t\tvar $target = $(event.target),\n\t\t\tinst = $.datepicker._getInst($target[0]);\n\n\t\tif ( ( ( $target[0].id != $.datepicker._mainDivId &&\n\t\t\t\t$target.parents('#' + $.datepicker._mainDivId).length == 0 &&\n\t\t\t\t!$target.hasClass($.datepicker.markerClassName) &&\n\t\t\t\t!$target.closest(\".\" + $.datepicker._triggerClass).length &&\n\t\t\t\t$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||\n\t\t\t( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != inst ) )\n\t\t\t$.datepicker._hideDatepicker();\n\t},\n\n\t/* Adjust one of the date sub-fields. */\n\t_adjustDate: function(id, offset, period) {\n\t\tvar target = $(id);\n\t\tvar inst = this._getInst(target[0]);\n\t\tif (this._isDisabledDatepicker(target[0])) {\n\t\t\treturn;\n\t\t}\n\t\tthis._adjustInstDate(inst, offset +\n\t\t\t(period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning\n\t\t\tperiod);\n\t\tthis._updateDatepicker(inst);\n\t},\n\n\t/* Action for current link. */\n\t_gotoToday: function(id) {\n\t\tvar target = $(id);\n\t\tvar inst = this._getInst(target[0]);\n\t\tif (this._get(inst, 'gotoCurrent') && inst.currentDay) {\n\t\t\tinst.selectedDay = inst.currentDay;\n\t\t\tinst.drawMonth = inst.selectedMonth = inst.currentMonth;\n\t\t\tinst.drawYear = inst.selectedYear = inst.currentYear;\n\t\t}\n\t\telse {\n\t\t\tvar date = new Date();\n\t\t\tinst.selectedDay = date.getDate();\n\t\t\tinst.drawMonth = inst.selectedMonth = date.getMonth();\n\t\t\tinst.drawYear = inst.selectedYear = date.getFullYear();\n\t\t}\n\t\tthis._notifyChange(inst);\n\t\tthis._adjustDate(target);\n\t},\n\n\t/* Action for selecting a new month/year. */\n\t_selectMonthYear: function(id, select, period) {\n\t\tvar target = $(id);\n\t\tvar inst = this._getInst(target[0]);\n\t\tinst['selected' + (period == 'M' ? 'Month' : 'Year')] =\n\t\tinst['draw' + (period == 'M' ? 'Month' : 'Year')] =\n\t\t\tparseInt(select.options[select.selectedIndex].value,10);\n\t\tthis._notifyChange(inst);\n\t\tthis._adjustDate(target);\n\t},\n\n\t/* Action for selecting a day. */\n\t_selectDay: function(id, month, year, td) {\n\t\tvar target = $(id);\n\t\tif ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {\n\t\t\treturn;\n\t\t}\n\t\tvar inst = this._getInst(target[0]);\n\t\tinst.selectedDay = inst.currentDay = $('a', td).html();\n\t\tinst.selectedMonth = inst.currentMonth = month;\n\t\tinst.selectedYear = inst.currentYear = year;\n\t\tthis._selectDate(id, this._formatDate(inst,\n\t\t\tinst.currentDay, inst.currentMonth, inst.currentYear));\n\t},\n\n\t/* Erase the input field and hide the date picker. */\n\t_clearDate: function(id) {\n\t\tvar target = $(id);\n\t\tvar inst = this._getInst(target[0]);\n\t\tthis._selectDate(target, '');\n\t},\n\n\t/* Update the input field with the selected date. */\n\t_selectDate: function(id, dateStr) {\n\t\tvar target = $(id);\n\t\tvar inst = this._getInst(target[0]);\n\t\tdateStr = (dateStr != null ? dateStr : this._formatDate(inst));\n\t\tif (inst.input)\n\t\t\tinst.input.val(dateStr);\n\t\tthis._updateAlternate(inst);\n\t\tvar onSelect = this._get(inst, 'onSelect');\n\t\tif (onSelect)\n\t\t\tonSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback\n\t\telse if (inst.input)\n\t\t\tinst.input.trigger('change'); // fire the change event\n\t\tif (inst.inline)\n\t\t\tthis._updateDatepicker(inst);\n\t\telse {\n\t\t\tthis._hideDatepicker();\n\t\t\tthis._lastInput = inst.input[0];\n\t\t\tif (typeof(inst.input[0]) != 'object')\n\t\t\t\tinst.input.focus(); // restore focus\n\t\t\tthis._lastInput = null;\n\t\t}\n\t},\n\n\t/* Update any alternate field to synchronise with the main field. */\n\t_updateAlternate: function(inst) {\n\t\tvar altField = this._get(inst, 'altField');\n\t\tif (altField) { // update alternate field too\n\t\t\tvar altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat');\n\t\t\tvar date = this._getDate(inst);\n\t\t\tvar dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));\n\t\t\t$(altField).each(function() { $(this).val(dateStr); });\n\t\t}\n\t},\n\n\t/* Set as beforeShowDay function to prevent selection of weekends.\n\t   @param  date  Date - the date to customise\n\t   @return [boolean, string] - is this date selectable?, what is its CSS class? */\n\tnoWeekends: function(date) {\n\t\tvar day = date.getDay();\n\t\treturn [(day > 0 && day < 6), ''];\n\t},\n\n\t/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.\n\t   @param  date  Date - the date to get the week for\n\t   @return  number - the number of the week within the year that contains this date */\n\tiso8601Week: function(date) {\n\t\tvar checkDate = new Date(date.getTime());\n\t\t// Find Thursday of this week starting on Monday\n\t\tcheckDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));\n\t\tvar time = checkDate.getTime();\n\t\tcheckDate.setMonth(0); // Compare with Jan 1\n\t\tcheckDate.setDate(1);\n\t\treturn Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;\n\t},\n\n\t/* Parse a string value into a date object.\n\t   See formatDate below for the possible formats.\n\n\t   @param  format    string - the expected format of the date\n\t   @param  value     string - the date in the above format\n\t   @param  settings  Object - attributes include:\n\t                     shortYearCutoff  number - the cutoff year for determining the century (optional)\n\t                     dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)\n\t                     dayNames         string[7] - names of the days from Sunday (optional)\n\t                     monthNamesShort  string[12] - abbreviated names of the months (optional)\n\t                     monthNames       string[12] - names of the months (optional)\n\t   @return  Date - the extracted date value or null if value is blank */\n\tparseDate: function (format, value, settings) {\n\t\tif (format == null || value == null)\n\t\t\tthrow 'Invalid arguments';\n\t\tvalue = (typeof value == 'object' ? value.toString() : value + '');\n\t\tif (value == '')\n\t\t\treturn null;\n\t\tvar shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;\n\t\tshortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :\n\t\t\t\tnew Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));\n\t\tvar dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;\n\t\tvar dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;\n\t\tvar monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;\n\t\tvar monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;\n\t\tvar year = -1;\n\t\tvar month = -1;\n\t\tvar day = -1;\n\t\tvar doy = -1;\n\t\tvar literal = false;\n\t\t// Check whether a format character is doubled\n\t\tvar lookAhead = function(match) {\n\t\t\tvar matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);\n\t\t\tif (matches)\n\t\t\t\tiFormat++;\n\t\t\treturn matches;\n\t\t};\n\t\t// Extract a number from the string value\n\t\tvar getNumber = function(match) {\n\t\t\tvar isDoubled = lookAhead(match);\n\t\t\tvar size = (match == '@' ? 14 : (match == '!' ? 20 :\n\t\t\t\t(match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2))));\n\t\t\tvar digits = new RegExp('^\\\\d{1,' + size + '}');\n\t\t\tvar num = value.substring(iValue).match(digits);\n\t\t\tif (!num)\n\t\t\t\tthrow 'Missing number at position ' + iValue;\n\t\t\tiValue += num[0].length;\n\t\t\treturn parseInt(num[0], 10);\n\t\t};\n\t\t// Extract a name from the string value and convert to an index\n\t\tvar getName = function(match, shortNames, longNames) {\n\t\t\tvar names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {\n\t\t\t\treturn [ [k, v] ];\n\t\t\t}).sort(function (a, b) {\n\t\t\t\treturn -(a[1].length - b[1].length);\n\t\t\t});\n\t\t\tvar index = -1;\n\t\t\t$.each(names, function (i, pair) {\n\t\t\t\tvar name = pair[1];\n\t\t\t\tif (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) {\n\t\t\t\t\tindex = pair[0];\n\t\t\t\t\tiValue += name.length;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (index != -1)\n\t\t\t\treturn index + 1;\n\t\t\telse\n\t\t\t\tthrow 'Unknown name at position ' + iValue;\n\t\t};\n\t\t// Confirm that a literal character matches the string value\n\t\tvar checkLiteral = function() {\n\t\t\tif (value.charAt(iValue) != format.charAt(iFormat))\n\t\t\t\tthrow 'Unexpected literal at position ' + iValue;\n\t\t\tiValue++;\n\t\t};\n\t\tvar iValue = 0;\n\t\tfor (var iFormat = 0; iFormat < format.length; iFormat++) {\n\t\t\tif (literal)\n\t\t\t\tif (format.charAt(iFormat) == \"'\" && !lookAhead(\"'\"))\n\t\t\t\t\tliteral = false;\n\t\t\t\telse\n\t\t\t\t\tcheckLiteral();\n\t\t\telse\n\t\t\t\tswitch (format.charAt(iFormat)) {\n\t\t\t\t\tcase 'd':\n\t\t\t\t\t\tday = getNumber('d');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'D':\n\t\t\t\t\t\tgetName('D', dayNamesShort, dayNames);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'o':\n\t\t\t\t\t\tdoy = getNumber('o');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'm':\n\t\t\t\t\t\tmonth = getNumber('m');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'M':\n\t\t\t\t\t\tmonth = getName('M', monthNamesShort, monthNames);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'y':\n\t\t\t\t\t\tyear = getNumber('y');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '@':\n\t\t\t\t\t\tvar date = new Date(getNumber('@'));\n\t\t\t\t\t\tyear = date.getFullYear();\n\t\t\t\t\t\tmonth = date.getMonth() + 1;\n\t\t\t\t\t\tday = date.getDate();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '!':\n\t\t\t\t\t\tvar date = new Date((getNumber('!') - this._ticksTo1970) / 10000);\n\t\t\t\t\t\tyear = date.getFullYear();\n\t\t\t\t\t\tmonth = date.getMonth() + 1;\n\t\t\t\t\t\tday = date.getDate();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"'\":\n\t\t\t\t\t\tif (lookAhead(\"'\"))\n\t\t\t\t\t\t\tcheckLiteral();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tliteral = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcheckLiteral();\n\t\t\t\t}\n\t\t}\n\t\tif (iValue < value.length){\n\t\t\tthrow \"Extra/unparsed characters found in date: \" + value.substring(iValue);\n\t\t}\n\t\tif (year == -1)\n\t\t\tyear = new Date().getFullYear();\n\t\telse if (year < 100)\n\t\t\tyear += new Date().getFullYear() - new Date().getFullYear() % 100 +\n\t\t\t\t(year <= shortYearCutoff ? 0 : -100);\n\t\tif (doy > -1) {\n\t\t\tmonth = 1;\n\t\t\tday = doy;\n\t\t\tdo {\n\t\t\t\tvar dim = this._getDaysInMonth(year, month - 1);\n\t\t\t\tif (day <= dim)\n\t\t\t\t\tbreak;\n\t\t\t\tmonth++;\n\t\t\t\tday -= dim;\n\t\t\t} while (true);\n\t\t}\n\t\tvar date = this._daylightSavingAdjust(new Date(year, month - 1, day));\n\t\tif (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day)\n\t\t\tthrow 'Invalid date'; // E.g. 31/02/00\n\t\treturn date;\n\t},\n\n\t/* Standard date formats. */\n\tATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601)\n\tCOOKIE: 'D, dd M yy',\n\tISO_8601: 'yy-mm-dd',\n\tRFC_822: 'D, d M y',\n\tRFC_850: 'DD, dd-M-y',\n\tRFC_1036: 'D, d M y',\n\tRFC_1123: 'D, d M yy',\n\tRFC_2822: 'D, d M yy',\n\tRSS: 'D, d M y', // RFC 822\n\tTICKS: '!',\n\tTIMESTAMP: '@',\n\tW3C: 'yy-mm-dd', // ISO 8601\n\n\t_ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +\n\t\tMath.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),\n\n\t/* Format a date object into a string value.\n\t   The format can be combinations of the following:\n\t   d  - day of month (no leading zero)\n\t   dd - day of month (two digit)\n\t   o  - day of year (no leading zeros)\n\t   oo - day of year (three digit)\n\t   D  - day name short\n\t   DD - day name long\n\t   m  - month of year (no leading zero)\n\t   mm - month of year (two digit)\n\t   M  - month name short\n\t   MM - month name long\n\t   y  - year (two digit)\n\t   yy - year (four digit)\n\t   @ - Unix timestamp (ms since 01/01/1970)\n\t   ! - Windows ticks (100ns since 01/01/0001)\n\t   '...' - literal text\n\t   '' - single quote\n\n\t   @param  format    string - the desired format of the date\n\t   @param  date      Date - the date value to format\n\t   @param  settings  Object - attributes include:\n\t                     dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)\n\t                     dayNames         string[7] - names of the days from Sunday (optional)\n\t                     monthNamesShort  string[12] - abbreviated names of the months (optional)\n\t                     monthNames       string[12] - names of the months (optional)\n\t   @return  string - the date in the above format */\n\tformatDate: function (format, date, settings) {\n\t\tif (!date)\n\t\t\treturn '';\n\t\tvar dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;\n\t\tvar dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;\n\t\tvar monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;\n\t\tvar monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;\n\t\t// Check whether a format character is doubled\n\t\tvar lookAhead = function(match) {\n\t\t\tvar matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);\n\t\t\tif (matches)\n\t\t\t\tiFormat++;\n\t\t\treturn matches;\n\t\t};\n\t\t// Format a number, with leading zero if necessary\n\t\tvar formatNumber = function(match, value, len) {\n\t\t\tvar num = '' + value;\n\t\t\tif (lookAhead(match))\n\t\t\t\twhile (num.length < len)\n\t\t\t\t\tnum = '0' + num;\n\t\t\treturn num;\n\t\t};\n\t\t// Format a name, short or long as requested\n\t\tvar formatName = function(match, value, shortNames, longNames) {\n\t\t\treturn (lookAhead(match) ? longNames[value] : shortNames[value]);\n\t\t};\n\t\tvar output = '';\n\t\tvar literal = false;\n\t\tif (date)\n\t\t\tfor (var iFormat = 0; iFormat < format.length; iFormat++) {\n\t\t\t\tif (literal)\n\t\t\t\t\tif (format.charAt(iFormat) == \"'\" && !lookAhead(\"'\"))\n\t\t\t\t\t\tliteral = false;\n\t\t\t\t\telse\n\t\t\t\t\t\toutput += format.charAt(iFormat);\n\t\t\t\telse\n\t\t\t\t\tswitch (format.charAt(iFormat)) {\n\t\t\t\t\t\tcase 'd':\n\t\t\t\t\t\t\toutput += formatNumber('d', date.getDate(), 2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'D':\n\t\t\t\t\t\t\toutput += formatName('D', date.getDay(), dayNamesShort, dayNames);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'o':\n\t\t\t\t\t\t\toutput += formatNumber('o',\n\t\t\t\t\t\t\t\tMath.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'm':\n\t\t\t\t\t\t\toutput += formatNumber('m', date.getMonth() + 1, 2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'M':\n\t\t\t\t\t\t\toutput += formatName('M', date.getMonth(), monthNamesShort, monthNames);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'y':\n\t\t\t\t\t\t\toutput += (lookAhead('y') ? date.getFullYear() :\n\t\t\t\t\t\t\t\t(date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '@':\n\t\t\t\t\t\t\toutput += date.getTime();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '!':\n\t\t\t\t\t\t\toutput += date.getTime() * 10000 + this._ticksTo1970;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"'\":\n\t\t\t\t\t\t\tif (lookAhead(\"'\"))\n\t\t\t\t\t\t\t\toutput += \"'\";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tliteral = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\toutput += format.charAt(iFormat);\n\t\t\t\t\t}\n\t\t\t}\n\t\treturn output;\n\t},\n\n\t/* Extract all possible characters from the date format. */\n\t_possibleChars: function (format) {\n\t\tvar chars = '';\n\t\tvar literal = false;\n\t\t// Check whether a format character is doubled\n\t\tvar lookAhead = function(match) {\n\t\t\tvar matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);\n\t\t\tif (matches)\n\t\t\t\tiFormat++;\n\t\t\treturn matches;\n\t\t};\n\t\tfor (var iFormat = 0; iFormat < format.length; iFormat++)\n\t\t\tif (literal)\n\t\t\t\tif (format.charAt(iFormat) == \"'\" && !lookAhead(\"'\"))\n\t\t\t\t\tliteral = false;\n\t\t\t\telse\n\t\t\t\t\tchars += format.charAt(iFormat);\n\t\t\telse\n\t\t\t\tswitch (format.charAt(iFormat)) {\n\t\t\t\t\tcase 'd': case 'm': case 'y': case '@':\n\t\t\t\t\t\tchars += '0123456789';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'D': case 'M':\n\t\t\t\t\t\treturn null; // Accept anything\n\t\t\t\t\tcase \"'\":\n\t\t\t\t\t\tif (lookAhead(\"'\"))\n\t\t\t\t\t\t\tchars += \"'\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tliteral = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tchars += format.charAt(iFormat);\n\t\t\t\t}\n\t\treturn chars;\n\t},\n\n\t/* Get a setting value, defaulting if necessary. */\n\t_get: function(inst, name) {\n\t\treturn inst.settings[name] !== undefined ?\n\t\t\tinst.settings[name] : this._defaults[name];\n\t},\n\n\t/* Parse existing date and initialise date picker. */\n\t_setDateFromField: function(inst, noDefault) {\n\t\tif (inst.input.val() == inst.lastVal) {\n\t\t\treturn;\n\t\t}\n\t\tvar dateFormat = this._get(inst, 'dateFormat');\n\t\tvar dates = inst.lastVal = inst.input ? inst.input.val() : null;\n\t\tvar date, defaultDate;\n\t\tdate = defaultDate = this._getDefaultDate(inst);\n\t\tvar settings = this._getFormatConfig(inst);\n\t\ttry {\n\t\t\tdate = this.parseDate(dateFormat, dates, settings) || defaultDate;\n\t\t} catch (event) {\n\t\t\tthis.log(event);\n\t\t\tdates = (noDefault ? '' : dates);\n\t\t}\n\t\tinst.selectedDay = date.getDate();\n\t\tinst.drawMonth = inst.selectedMonth = date.getMonth();\n\t\tinst.drawYear = inst.selectedYear = date.getFullYear();\n\t\tinst.currentDay = (dates ? date.getDate() : 0);\n\t\tinst.currentMonth = (dates ? date.getMonth() : 0);\n\t\tinst.currentYear = (dates ? date.getFullYear() : 0);\n\t\tthis._adjustInstDate(inst);\n\t},\n\n\t/* Retrieve the default date shown on opening. */\n\t_getDefaultDate: function(inst) {\n\t\treturn this._restrictMinMax(inst,\n\t\t\tthis._determineDate(inst, this._get(inst, 'defaultDate'), new Date()));\n\t},\n\n\t/* A date may be specified as an exact value or a relative one. */\n\t_determineDate: function(inst, date, defaultDate) {\n\t\tvar offsetNumeric = function(offset) {\n\t\t\tvar date = new Date();\n\t\t\tdate.setDate(date.getDate() + offset);\n\t\t\treturn date;\n\t\t};\n\t\tvar offsetString = function(offset) {\n\t\t\ttry {\n\t\t\t\treturn $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),\n\t\t\t\t\toffset, $.datepicker._getFormatConfig(inst));\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\t// Ignore\n\t\t\t}\n\t\t\tvar date = (offset.toLowerCase().match(/^c/) ?\n\t\t\t\t$.datepicker._getDate(inst) : null) || new Date();\n\t\t\tvar year = date.getFullYear();\n\t\t\tvar month = date.getMonth();\n\t\t\tvar day = date.getDate();\n\t\t\tvar pattern = /([+-]?[0-9]+)\\s*(d|D|w|W|m|M|y|Y)?/g;\n\t\t\tvar matches = pattern.exec(offset);\n\t\t\twhile (matches) {\n\t\t\t\tswitch (matches[2] || 'd') {\n\t\t\t\t\tcase 'd' : case 'D' :\n\t\t\t\t\t\tday += parseInt(matches[1],10); break;\n\t\t\t\t\tcase 'w' : case 'W' :\n\t\t\t\t\t\tday += parseInt(matches[1],10) * 7; break;\n\t\t\t\t\tcase 'm' : case 'M' :\n\t\t\t\t\t\tmonth += parseInt(matches[1],10);\n\t\t\t\t\t\tday = Math.min(day, $.datepicker._getDaysInMonth(year, month));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'y': case 'Y' :\n\t\t\t\t\t\tyear += parseInt(matches[1],10);\n\t\t\t\t\t\tday = Math.min(day, $.datepicker._getDaysInMonth(year, month));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tmatches = pattern.exec(offset);\n\t\t\t}\n\t\t\treturn new Date(year, month, day);\n\t\t};\n\t\tvar newDate = (date == null || date === '' ? defaultDate : (typeof date == 'string' ? offsetString(date) :\n\t\t\t(typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));\n\t\tnewDate = (newDate && newDate.toString() == 'Invalid Date' ? defaultDate : newDate);\n\t\tif (newDate) {\n\t\t\tnewDate.setHours(0);\n\t\t\tnewDate.setMinutes(0);\n\t\t\tnewDate.setSeconds(0);\n\t\t\tnewDate.setMilliseconds(0);\n\t\t}\n\t\treturn this._daylightSavingAdjust(newDate);\n\t},\n\n\t/* Handle switch to/from daylight saving.\n\t   Hours may be non-zero on daylight saving cut-over:\n\t   > 12 when midnight changeover, but then cannot generate\n\t   midnight datetime, so jump to 1AM, otherwise reset.\n\t   @param  date  (Date) the date to check\n\t   @return  (Date) the corrected date */\n\t_daylightSavingAdjust: function(date) {\n\t\tif (!date) return null;\n\t\tdate.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);\n\t\treturn date;\n\t},\n\n\t/* Set the date(s) directly. */\n\t_setDate: function(inst, date, noChange) {\n\t\tvar clear = !date;\n\t\tvar origMonth = inst.selectedMonth;\n\t\tvar origYear = inst.selectedYear;\n\t\tvar newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));\n\t\tinst.selectedDay = inst.currentDay = newDate.getDate();\n\t\tinst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();\n\t\tinst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();\n\t\tif ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange)\n\t\t\tthis._notifyChange(inst);\n\t\tthis._adjustInstDate(inst);\n\t\tif (inst.input) {\n\t\t\tinst.input.val(clear ? '' : this._formatDate(inst));\n\t\t}\n\t},\n\n\t/* Retrieve the date(s) directly. */\n\t_getDate: function(inst) {\n\t\tvar startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null :\n\t\t\tthis._daylightSavingAdjust(new Date(\n\t\t\tinst.currentYear, inst.currentMonth, inst.currentDay)));\n\t\t\treturn startDate;\n\t},\n\n\t/* Attach the onxxx handlers.  These are declared statically so\n\t * they work with static code transformers like Caja.\n\t */\n\t_attachHandlers: function(inst) {\n\t\tvar stepMonths = this._get(inst, 'stepMonths');\n\t\tvar id = '#' + inst.id;\n\t\tinst.dpDiv.find('[data-handler]').map(function () {\n\t\t\tvar handler = {\n\t\t\t\tprev: function () {\n\t\t\t\t\twindow['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, -stepMonths, 'M');\n\t\t\t\t},\n\t\t\t\tnext: function () {\n\t\t\t\t\twindow['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, +stepMonths, 'M');\n\t\t\t\t},\n\t\t\t\thide: function () {\n\t\t\t\t\twindow['DP_jQuery_' + dpuuid].datepicker._hideDatepicker();\n\t\t\t\t},\n\t\t\t\ttoday: function () {\n\t\t\t\t\twindow['DP_jQuery_' + dpuuid].datepicker._gotoToday(id);\n\t\t\t\t},\n\t\t\t\tselectDay: function () {\n\t\t\t\t\twindow['DP_jQuery_' + dpuuid].datepicker._selectDay(id, +this.getAttribute('data-month'), +this.getAttribute('data-year'), this);\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t\tselectMonth: function () {\n\t\t\t\t\twindow['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'M');\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t\tselectYear: function () {\n\t\t\t\t\twindow['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'Y');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t};\n\t\t\t$(this).bind(this.getAttribute('data-event'), handler[this.getAttribute('data-handler')]);\n\t\t});\n\t},\n\t\n\t/* Generate the HTML for the current state of the date picker. */\n\t_generateHTML: function(inst) {\n\t\tvar today = new Date();\n\t\ttoday = this._daylightSavingAdjust(\n\t\t\tnew Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time\n\t\tvar isRTL = this._get(inst, 'isRTL');\n\t\tvar showButtonPanel = this._get(inst, 'showButtonPanel');\n\t\tvar hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext');\n\t\tvar navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat');\n\t\tvar numMonths = this._getNumberOfMonths(inst);\n\t\tvar showCurrentAtPos = this._get(inst, 'showCurrentAtPos');\n\t\tvar stepMonths = this._get(inst, 'stepMonths');\n\t\tvar isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);\n\t\tvar currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :\n\t\t\tnew Date(inst.currentYear, inst.currentMonth, inst.currentDay)));\n\t\tvar minDate = this._getMinMaxDate(inst, 'min');\n\t\tvar maxDate = this._getMinMaxDate(inst, 'max');\n\t\tvar drawMonth = inst.drawMonth - showCurrentAtPos;\n\t\tvar drawYear = inst.drawYear;\n\t\tif (drawMonth < 0) {\n\t\t\tdrawMonth += 12;\n\t\t\tdrawYear--;\n\t\t}\n\t\tif (maxDate) {\n\t\t\tvar maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),\n\t\t\t\tmaxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));\n\t\t\tmaxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);\n\t\t\twhile (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {\n\t\t\t\tdrawMonth--;\n\t\t\t\tif (drawMonth < 0) {\n\t\t\t\t\tdrawMonth = 11;\n\t\t\t\t\tdrawYear--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tinst.drawMonth = drawMonth;\n\t\tinst.drawYear = drawYear;\n\t\tvar prevText = this._get(inst, 'prevText');\n\t\tprevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,\n\t\t\tthis._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),\n\t\t\tthis._getFormatConfig(inst)));\n\t\tvar prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?\n\t\t\t'<a class=\"ui-datepicker-prev ui-corner-all\" data-handler=\"prev\" data-event=\"click\"' +\n\t\t\t' title=\"' + prevText + '\"><span class=\"ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '\">' + prevText + '</span></a>' :\n\t\t\t(hideIfNoPrevNext ? '' : '<a class=\"ui-datepicker-prev ui-corner-all ui-state-disabled\" title=\"'+ prevText +'\"><span class=\"ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '\">' + prevText + '</span></a>'));\n\t\tvar nextText = this._get(inst, 'nextText');\n\t\tnextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,\n\t\t\tthis._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),\n\t\t\tthis._getFormatConfig(inst)));\n\t\tvar next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?\n\t\t\t'<a class=\"ui-datepicker-next ui-corner-all\" data-handler=\"next\" data-event=\"click\"' +\n\t\t\t' title=\"' + nextText + '\"><span class=\"ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '\">' + nextText + '</span></a>' :\n\t\t\t(hideIfNoPrevNext ? '' : '<a class=\"ui-datepicker-next ui-corner-all ui-state-disabled\" title=\"'+ nextText + '\"><span class=\"ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '\">' + nextText + '</span></a>'));\n\t\tvar currentText = this._get(inst, 'currentText');\n\t\tvar gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today);\n\t\tcurrentText = (!navigationAsDateFormat ? currentText :\n\t\t\tthis.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));\n\t\tvar controls = (!inst.inline ? '<button type=\"button\" class=\"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all\" data-handler=\"hide\" data-event=\"click\">' +\n\t\t\tthis._get(inst, 'closeText') + '</button>' : '');\n\t\tvar buttonPanel = (showButtonPanel) ? '<div class=\"ui-datepicker-buttonpane ui-widget-content\">' + (isRTL ? controls : '') +\n\t\t\t(this._isInRange(inst, gotoDate) ? '<button type=\"button\" class=\"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all\" data-handler=\"today\" data-event=\"click\"' +\n\t\t\t'>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : '';\n\t\tvar firstDay = parseInt(this._get(inst, 'firstDay'),10);\n\t\tfirstDay = (isNaN(firstDay) ? 0 : firstDay);\n\t\tvar showWeek = this._get(inst, 'showWeek');\n\t\tvar dayNames = this._get(inst, 'dayNames');\n\t\tvar dayNamesShort = this._get(inst, 'dayNamesShort');\n\t\tvar dayNamesMin = this._get(inst, 'dayNamesMin');\n\t\tvar monthNames = this._get(inst, 'monthNames');\n\t\tvar monthNamesShort = this._get(inst, 'monthNamesShort');\n\t\tvar beforeShowDay = this._get(inst, 'beforeShowDay');\n\t\tvar showOtherMonths = this._get(inst, 'showOtherMonths');\n\t\tvar selectOtherMonths = this._get(inst, 'selectOtherMonths');\n\t\tvar calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week;\n\t\tvar defaultDate = this._getDefaultDate(inst);\n\t\tvar html = '';\n\t\tfor (var row = 0; row < numMonths[0]; row++) {\n\t\t\tvar group = '';\n\t\t\tthis.maxRows = 4;\n\t\t\tfor (var col = 0; col < numMonths[1]; col++) {\n\t\t\t\tvar selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));\n\t\t\t\tvar cornerClass = ' ui-corner-all';\n\t\t\t\tvar calender = '';\n\t\t\t\tif (isMultiMonth) {\n\t\t\t\t\tcalender += '<div class=\"ui-datepicker-group';\n\t\t\t\t\tif (numMonths[1] > 1)\n\t\t\t\t\t\tswitch (col) {\n\t\t\t\t\t\t\tcase 0: calender += ' ui-datepicker-group-first';\n\t\t\t\t\t\t\t\tcornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break;\n\t\t\t\t\t\t\tcase numMonths[1]-1: calender += ' ui-datepicker-group-last';\n\t\t\t\t\t\t\t\tcornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break;\n\t\t\t\t\t\t\tdefault: calender += ' ui-datepicker-group-middle'; cornerClass = ''; break;\n\t\t\t\t\t\t}\n\t\t\t\t\tcalender += '\">';\n\t\t\t\t}\n\t\t\t\tcalender += '<div class=\"ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '\">' +\n\t\t\t\t\t(/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') +\n\t\t\t\t\t(/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') +\n\t\t\t\t\tthis._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,\n\t\t\t\t\trow > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers\n\t\t\t\t\t'</div><table class=\"ui-datepicker-calendar\"><thead>' +\n\t\t\t\t\t'<tr>';\n\t\t\t\tvar thead = (showWeek ? '<th class=\"ui-datepicker-week-col\">' + this._get(inst, 'weekHeader') + '</th>' : '');\n\t\t\t\tfor (var dow = 0; dow < 7; dow++) { // days of the week\n\t\t\t\t\tvar day = (dow + firstDay) % 7;\n\t\t\t\t\tthead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class=\"ui-datepicker-week-end\"' : '') + '>' +\n\t\t\t\t\t\t'<span title=\"' + dayNames[day] + '\">' + dayNamesMin[day] + '</span></th>';\n\t\t\t\t}\n\t\t\t\tcalender += thead + '</tr></thead><tbody>';\n\t\t\t\tvar daysInMonth = this._getDaysInMonth(drawYear, drawMonth);\n\t\t\t\tif (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth)\n\t\t\t\t\tinst.selectedDay = Math.min(inst.selectedDay, daysInMonth);\n\t\t\t\tvar leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;\n\t\t\t\tvar curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate\n\t\t\t\tvar numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)\n\t\t\t\tthis.maxRows = numRows;\n\t\t\t\tvar printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));\n\t\t\t\tfor (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows\n\t\t\t\t\tcalender += '<tr>';\n\t\t\t\t\tvar tbody = (!showWeek ? '' : '<td class=\"ui-datepicker-week-col\">' +\n\t\t\t\t\t\tthis._get(inst, 'calculateWeek')(printDate) + '</td>');\n\t\t\t\t\tfor (var dow = 0; dow < 7; dow++) { // create date picker days\n\t\t\t\t\t\tvar daySettings = (beforeShowDay ?\n\t\t\t\t\t\t\tbeforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']);\n\t\t\t\t\t\tvar otherMonth = (printDate.getMonth() != drawMonth);\n\t\t\t\t\t\tvar unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||\n\t\t\t\t\t\t\t(minDate && printDate < minDate) || (maxDate && printDate > maxDate);\n\t\t\t\t\t\ttbody += '<td class=\"' +\n\t\t\t\t\t\t\t((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends\n\t\t\t\t\t\t\t(otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months\n\t\t\t\t\t\t\t((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || // user pressed key\n\t\t\t\t\t\t\t(defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ?\n\t\t\t\t\t\t\t// or defaultDate is current printedDate and defaultDate is selectedDate\n\t\t\t\t\t\t\t' ' + this._dayOverClass : '') + // highlight selected day\n\t\t\t\t\t\t\t(unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') +  // highlight unselectable days\n\t\t\t\t\t\t\t(otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates\n\t\t\t\t\t\t\t(printDate.getTime() == currentDate.getTime() ? ' ' + this._currentClass : '') + // highlight selected day\n\t\t\t\t\t\t\t(printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '\"' + // highlight today (if different)\n\t\t\t\t\t\t\t((!otherMonth || showOtherMonths) && daySettings[2] ? ' title=\"' + daySettings[2] + '\"' : '') + // cell title\n\t\t\t\t\t\t\t(unselectable ? '' : ' data-handler=\"selectDay\" data-event=\"click\" data-month=\"' + printDate.getMonth() + '\" data-year=\"' + printDate.getFullYear() + '\"') + '>' + // actions\n\t\t\t\t\t\t\t(otherMonth && !showOtherMonths ? '&#xa0;' : // display for other months\n\t\t\t\t\t\t\t(unselectable ? '<span class=\"ui-state-default\">' + printDate.getDate() + '</span>' : '<a class=\"ui-state-default' +\n\t\t\t\t\t\t\t(printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') +\n\t\t\t\t\t\t\t(printDate.getTime() == currentDate.getTime() ? ' ui-state-active' : '') + // highlight selected day\n\t\t\t\t\t\t\t(otherMonth ? ' ui-priority-secondary' : '') + // distinguish dates from other months\n\t\t\t\t\t\t\t'\" href=\"#\">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date\n\t\t\t\t\t\tprintDate.setDate(printDate.getDate() + 1);\n\t\t\t\t\t\tprintDate = this._daylightSavingAdjust(printDate);\n\t\t\t\t\t}\n\t\t\t\t\tcalender += tbody + '</tr>';\n\t\t\t\t}\n\t\t\t\tdrawMonth++;\n\t\t\t\tif (drawMonth > 11) {\n\t\t\t\t\tdrawMonth = 0;\n\t\t\t\t\tdrawYear++;\n\t\t\t\t}\n\t\t\t\tcalender += '</tbody></table>' + (isMultiMonth ? '</div>' + \n\t\t\t\t\t\t\t((numMonths[0] > 0 && col == numMonths[1]-1) ? '<div class=\"ui-datepicker-row-break\"></div>' : '') : '');\n\t\t\t\tgroup += calender;\n\t\t\t}\n\t\t\thtml += group;\n\t\t}\n\t\thtml += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ?\n\t\t\t'<iframe src=\"javascript:false;\" class=\"ui-datepicker-cover\" frameborder=\"0\"></iframe>' : '');\n\t\tinst._keyEvent = false;\n\t\treturn html;\n\t},\n\n\t/* Generate the month and year header. */\n\t_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,\n\t\t\tsecondary, monthNames, monthNamesShort) {\n\t\tvar changeMonth = this._get(inst, 'changeMonth');\n\t\tvar changeYear = this._get(inst, 'changeYear');\n\t\tvar showMonthAfterYear = this._get(inst, 'showMonthAfterYear');\n\t\tvar html = '<div class=\"ui-datepicker-title\">';\n\t\tvar monthHtml = '';\n\t\t// month selection\n\t\tif (secondary || !changeMonth)\n\t\t\tmonthHtml += '<span class=\"ui-datepicker-month\">' + monthNames[drawMonth] + '</span>';\n\t\telse {\n\t\t\tvar inMinYear = (minDate && minDate.getFullYear() == drawYear);\n\t\t\tvar inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);\n\t\t\tmonthHtml += '<select class=\"ui-datepicker-month\" data-handler=\"selectMonth\" data-event=\"change\">';\n\t\t\tfor (var month = 0; month < 12; month++) {\n\t\t\t\tif ((!inMinYear || month >= minDate.getMonth()) &&\n\t\t\t\t\t\t(!inMaxYear || month <= maxDate.getMonth()))\n\t\t\t\t\tmonthHtml += '<option value=\"' + month + '\"' +\n\t\t\t\t\t\t(month == drawMonth ? ' selected=\"selected\"' : '') +\n\t\t\t\t\t\t'>' + monthNamesShort[month] + '</option>';\n\t\t\t}\n\t\t\tmonthHtml += '</select>';\n\t\t}\n\t\tif (!showMonthAfterYear)\n\t\t\thtml += monthHtml + (secondary || !(changeMonth && changeYear) ? '&#xa0;' : '');\n\t\t// year selection\n\t\tif ( !inst.yearshtml ) {\n\t\t\tinst.yearshtml = '';\n\t\t\tif (secondary || !changeYear)\n\t\t\t\thtml += '<span class=\"ui-datepicker-year\">' + drawYear + '</span>';\n\t\t\telse {\n\t\t\t\t// determine range of years to display\n\t\t\t\tvar years = this._get(inst, 'yearRange').split(':');\n\t\t\t\tvar thisYear = new Date().getFullYear();\n\t\t\t\tvar determineYear = function(value) {\n\t\t\t\t\tvar year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) :\n\t\t\t\t\t\t(value.match(/[+-].*/) ? thisYear + parseInt(value, 10) :\n\t\t\t\t\t\tparseInt(value, 10)));\n\t\t\t\t\treturn (isNaN(year) ? thisYear : year);\n\t\t\t\t};\n\t\t\t\tvar year = determineYear(years[0]);\n\t\t\t\tvar endYear = Math.max(year, determineYear(years[1] || ''));\n\t\t\t\tyear = (minDate ? Math.max(year, minDate.getFullYear()) : year);\n\t\t\t\tendYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);\n\t\t\t\tinst.yearshtml += '<select class=\"ui-datepicker-year\" data-handler=\"selectYear\" data-event=\"change\">';\n\t\t\t\tfor (; year <= endYear; year++) {\n\t\t\t\t\tinst.yearshtml += '<option value=\"' + year + '\"' +\n\t\t\t\t\t\t(year == drawYear ? ' selected=\"selected\"' : '') +\n\t\t\t\t\t\t'>' + year + '</option>';\n\t\t\t\t}\n\t\t\t\tinst.yearshtml += '</select>';\n\t\t\t\t\n\t\t\t\thtml += inst.yearshtml;\n\t\t\t\tinst.yearshtml = null;\n\t\t\t}\n\t\t}\n\t\thtml += this._get(inst, 'yearSuffix');\n\t\tif (showMonthAfterYear)\n\t\t\thtml += (secondary || !(changeMonth && changeYear) ? '&#xa0;' : '') + monthHtml;\n\t\thtml += '</div>'; // Close datepicker_header\n\t\treturn html;\n\t},\n\n\t/* Adjust one of the date sub-fields. */\n\t_adjustInstDate: function(inst, offset, period) {\n\t\tvar year = inst.drawYear + (period == 'Y' ? offset : 0);\n\t\tvar month = inst.drawMonth + (period == 'M' ? offset : 0);\n\t\tvar day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) +\n\t\t\t(period == 'D' ? offset : 0);\n\t\tvar date = this._restrictMinMax(inst,\n\t\t\tthis._daylightSavingAdjust(new Date(year, month, day)));\n\t\tinst.selectedDay = date.getDate();\n\t\tinst.drawMonth = inst.selectedMonth = date.getMonth();\n\t\tinst.drawYear = inst.selectedYear = date.getFullYear();\n\t\tif (period == 'M' || period == 'Y')\n\t\t\tthis._notifyChange(inst);\n\t},\n\n\t/* Ensure a date is within any min/max bounds. */\n\t_restrictMinMax: function(inst, date) {\n\t\tvar minDate = this._getMinMaxDate(inst, 'min');\n\t\tvar maxDate = this._getMinMaxDate(inst, 'max');\n\t\tvar newDate = (minDate && date < minDate ? minDate : date);\n\t\tnewDate = (maxDate && newDate > maxDate ? maxDate : newDate);\n\t\treturn newDate;\n\t},\n\n\t/* Notify change of month/year. */\n\t_notifyChange: function(inst) {\n\t\tvar onChange = this._get(inst, 'onChangeMonthYear');\n\t\tif (onChange)\n\t\t\tonChange.apply((inst.input ? inst.input[0] : null),\n\t\t\t\t[inst.selectedYear, inst.selectedMonth + 1, inst]);\n\t},\n\n\t/* Determine the number of months to show. */\n\t_getNumberOfMonths: function(inst) {\n\t\tvar numMonths = this._get(inst, 'numberOfMonths');\n\t\treturn (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));\n\t},\n\n\t/* Determine the current maximum date - ensure no time components are set. */\n\t_getMinMaxDate: function(inst, minMax) {\n\t\treturn this._determineDate(inst, this._get(inst, minMax + 'Date'), null);\n\t},\n\n\t/* Find the number of days in a given month. */\n\t_getDaysInMonth: function(year, month) {\n\t\treturn 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();\n\t},\n\n\t/* Find the day of the week of the first of a month. */\n\t_getFirstDayOfMonth: function(year, month) {\n\t\treturn new Date(year, month, 1).getDay();\n\t},\n\n\t/* Determines if we should allow a \"next/prev\" month display change. */\n\t_canAdjustMonth: function(inst, offset, curYear, curMonth) {\n\t\tvar numMonths = this._getNumberOfMonths(inst);\n\t\tvar date = this._daylightSavingAdjust(new Date(curYear,\n\t\t\tcurMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));\n\t\tif (offset < 0)\n\t\t\tdate.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));\n\t\treturn this._isInRange(inst, date);\n\t},\n\n\t/* Is the given date in the accepted range? */\n\t_isInRange: function(inst, date) {\n\t\tvar minDate = this._getMinMaxDate(inst, 'min');\n\t\tvar maxDate = this._getMinMaxDate(inst, 'max');\n\t\treturn ((!minDate || date.getTime() >= minDate.getTime()) &&\n\t\t\t(!maxDate || date.getTime() <= maxDate.getTime()));\n\t},\n\n\t/* Provide the configuration settings for formatting/parsing. */\n\t_getFormatConfig: function(inst) {\n\t\tvar shortYearCutoff = this._get(inst, 'shortYearCutoff');\n\t\tshortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :\n\t\t\tnew Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));\n\t\treturn {shortYearCutoff: shortYearCutoff,\n\t\t\tdayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'),\n\t\t\tmonthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')};\n\t},\n\n\t/* Format the given date for display. */\n\t_formatDate: function(inst, day, month, year) {\n\t\tif (!day) {\n\t\t\tinst.currentDay = inst.selectedDay;\n\t\t\tinst.currentMonth = inst.selectedMonth;\n\t\t\tinst.currentYear = inst.selectedYear;\n\t\t}\n\t\tvar date = (day ? (typeof day == 'object' ? day :\n\t\t\tthis._daylightSavingAdjust(new Date(year, month, day))) :\n\t\t\tthis._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));\n\t\treturn this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst));\n\t}\n});\n\n/*\n * Bind hover events for datepicker elements.\n * Done via delegate so the binding only occurs once in the lifetime of the parent div.\n * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.\n */ \nfunction bindHover(dpDiv) {\n\tvar selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a';\n\treturn dpDiv.bind('mouseout', function(event) {\n\t\t\tvar elem = $( event.target ).closest( selector );\n\t\t\tif ( !elem.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telem.removeClass( \"ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover\" );\n\t\t})\n\t\t.bind('mouseover', function(event) {\n\t\t\tvar elem = $( event.target ).closest( selector );\n\t\t\tif ($.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0]) ||\n\t\t\t\t\t!elem.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telem.parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');\n\t\t\telem.addClass('ui-state-hover');\n\t\t\tif (elem.hasClass('ui-datepicker-prev')) elem.addClass('ui-datepicker-prev-hover');\n\t\t\tif (elem.hasClass('ui-datepicker-next')) elem.addClass('ui-datepicker-next-hover');\n\t\t});\n}\n\n/* jQuery extend now ignores nulls! */\nfunction extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n};\n\n/* Determine whether an object is an array. */\nfunction isArray(a) {\n\treturn (a && (($.browser.safari && typeof a == 'object' && a.length) ||\n\t\t(a.constructor && a.constructor.toString().match(/\\Array\\(\\)/))));\n};\n\n/* Invoke the datepicker functionality.\n   @param  options  string - a command, optionally followed by additional parameters or\n                    Object - settings for attaching new datepicker functionality\n   @return  jQuery object */\n$.fn.datepicker = function(options){\n\t\n\t/* Verify an empty collection wasn't passed - Fixes #6976 */\n\tif ( !this.length ) {\n\t\treturn this;\n\t}\n\t\n\t/* Initialise the date picker. */\n\tif (!$.datepicker.initialized) {\n\t\t$(document).mousedown($.datepicker._checkExternalClick).\n\t\t\tfind('body').append($.datepicker.dpDiv);\n\t\t$.datepicker.initialized = true;\n\t}\n\n\tvar otherArgs = Array.prototype.slice.call(arguments, 1);\n\tif (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget'))\n\t\treturn $.datepicker['_' + options + 'Datepicker'].\n\t\t\tapply($.datepicker, [this[0]].concat(otherArgs));\n\tif (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string')\n\t\treturn $.datepicker['_' + options + 'Datepicker'].\n\t\t\tapply($.datepicker, [this[0]].concat(otherArgs));\n\treturn this.each(function() {\n\t\ttypeof options == 'string' ?\n\t\t\t$.datepicker['_' + options + 'Datepicker'].\n\t\t\t\tapply($.datepicker, [this].concat(otherArgs)) :\n\t\t\t$.datepicker._attachDatepicker(this, options);\n\t});\n};\n\n$.datepicker = new Datepicker(); // singleton instance\n$.datepicker.initialized = false;\n$.datepicker.uuid = new Date().getTime();\n$.datepicker.version = \"1.8.22\";\n\n// Workaround for #4055\n// Add another global to avoid noConflict issues with inline event handlers\nwindow['DP_jQuery_' + dpuuid] = $;\n\n})(jQuery);\n\n(function( $, undefined ) {\n\nvar uiDialogClasses =\n\t\t'ui-dialog ' +\n\t\t'ui-widget ' +\n\t\t'ui-widget-content ' +\n\t\t'ui-corner-all ',\n\tsizeRelatedOptions = {\n\t\tbuttons: true,\n\t\theight: true,\n\t\tmaxHeight: true,\n\t\tmaxWidth: true,\n\t\tminHeight: true,\n\t\tminWidth: true,\n\t\twidth: true\n\t},\n\tresizableRelatedOptions = {\n\t\tmaxHeight: true,\n\t\tmaxWidth: true,\n\t\tminHeight: true,\n\t\tminWidth: true\n\t},\n\t// support for jQuery 1.3.2 - handle common attrFn methods for dialog\n\tattrFn = $.attrFn || {\n\t\tval: true,\n\t\tcss: true,\n\t\thtml: true,\n\t\ttext: true,\n\t\tdata: true,\n\t\twidth: true,\n\t\theight: true,\n\t\toffset: true,\n\t\tclick: true\n\t};\n\n$.widget(\"ui.dialog\", {\n\toptions: {\n\t\tautoOpen: true,\n\t\tbuttons: {},\n\t\tcloseOnEscape: true,\n\t\tcloseText: 'close',\n\t\tdialogClass: '',\n\t\tdraggable: true,\n\t\thide: null,\n\t\theight: 'auto',\n\t\tmaxHeight: false,\n\t\tmaxWidth: false,\n\t\tminHeight: 150,\n\t\tminWidth: 150,\n\t\tmodal: false,\n\t\tposition: {\n\t\t\tmy: 'center',\n\t\t\tat: 'center',\n\t\t\tcollision: 'fit',\n\t\t\t// ensure that the titlebar is never outside the document\n\t\t\tusing: function(pos) {\n\t\t\t\tvar topOffset = $(this).css(pos).offset().top;\n\t\t\t\tif (topOffset < 0) {\n\t\t\t\t\t$(this).css('top', pos.top - topOffset);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tresizable: true,\n\t\tshow: null,\n\t\tstack: true,\n\t\ttitle: '',\n\t\twidth: 300,\n\t\tzIndex: 1000\n\t},\n\n\t_create: function() {\n\t\tthis.originalTitle = this.element.attr('title');\n\t\t// #5742 - .attr() might return a DOMElement\n\t\tif ( typeof this.originalTitle !== \"string\" ) {\n\t\t\tthis.originalTitle = \"\";\n\t\t}\n\n\t\tthis.options.title = this.options.title || this.originalTitle;\n\t\tvar self = this,\n\t\t\toptions = self.options,\n\n\t\t\ttitle = options.title || '&#160;',\n\t\t\ttitleId = $.ui.dialog.getTitleId(self.element),\n\n\t\t\tuiDialog = (self.uiDialog = $('<div></div>'))\n\t\t\t\t.appendTo(document.body)\n\t\t\t\t.hide()\n\t\t\t\t.addClass(uiDialogClasses + options.dialogClass)\n\t\t\t\t.css({\n\t\t\t\t\tzIndex: options.zIndex\n\t\t\t\t})\n\t\t\t\t// setting tabIndex makes the div focusable\n\t\t\t\t// setting outline to 0 prevents a border on focus in Mozilla\n\t\t\t\t.attr('tabIndex', -1).css('outline', 0).keydown(function(event) {\n\t\t\t\t\tif (options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&\n\t\t\t\t\t\tevent.keyCode === $.ui.keyCode.ESCAPE) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tself.close(event);\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.attr({\n\t\t\t\t\trole: 'dialog',\n\t\t\t\t\t'aria-labelledby': titleId\n\t\t\t\t})\n\t\t\t\t.mousedown(function(event) {\n\t\t\t\t\tself.moveToTop(false, event);\n\t\t\t\t}),\n\n\t\t\tuiDialogContent = self.element\n\t\t\t\t.show()\n\t\t\t\t.removeAttr('title')\n\t\t\t\t.addClass(\n\t\t\t\t\t'ui-dialog-content ' +\n\t\t\t\t\t'ui-widget-content')\n\t\t\t\t.appendTo(uiDialog),\n\n\t\t\tuiDialogTitlebar = (self.uiDialogTitlebar = $('<div></div>'))\n\t\t\t\t.addClass(\n\t\t\t\t\t'ui-dialog-titlebar ' +\n\t\t\t\t\t'ui-widget-header ' +\n\t\t\t\t\t'ui-corner-all ' +\n\t\t\t\t\t'ui-helper-clearfix'\n\t\t\t\t)\n\t\t\t\t.prependTo(uiDialog),\n\n\t\t\tuiDialogTitlebarClose = $('<a href=\"#\"></a>')\n\t\t\t\t.addClass(\n\t\t\t\t\t'ui-dialog-titlebar-close ' +\n\t\t\t\t\t'ui-corner-all'\n\t\t\t\t)\n\t\t\t\t.attr('role', 'button')\n\t\t\t\t.hover(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tuiDialogTitlebarClose.addClass('ui-state-hover');\n\t\t\t\t\t},\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tuiDialogTitlebarClose.removeClass('ui-state-hover');\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t\t.focus(function() {\n\t\t\t\t\tuiDialogTitlebarClose.addClass('ui-state-focus');\n\t\t\t\t})\n\t\t\t\t.blur(function() {\n\t\t\t\t\tuiDialogTitlebarClose.removeClass('ui-state-focus');\n\t\t\t\t})\n\t\t\t\t.click(function(event) {\n\t\t\t\t\tself.close(event);\n\t\t\t\t\treturn false;\n\t\t\t\t})\n\t\t\t\t.appendTo(uiDialogTitlebar),\n\n\t\t\tuiDialogTitlebarCloseText = (self.uiDialogTitlebarCloseText = $('<span></span>'))\n\t\t\t\t.addClass(\n\t\t\t\t\t'ui-icon ' +\n\t\t\t\t\t'ui-icon-closethick'\n\t\t\t\t)\n\t\t\t\t.text(options.closeText)\n\t\t\t\t.appendTo(uiDialogTitlebarClose),\n\n\t\t\tuiDialogTitle = $('<span></span>')\n\t\t\t\t.addClass('ui-dialog-title')\n\t\t\t\t.attr('id', titleId)\n\t\t\t\t.html(title)\n\t\t\t\t.prependTo(uiDialogTitlebar);\n\n\t\t//handling of deprecated beforeclose (vs beforeClose) option\n\t\t//Ticket #4669 http://dev.jqueryui.com/ticket/4669\n\t\t//TODO: remove in 1.9pre\n\t\tif ($.isFunction(options.beforeclose) && !$.isFunction(options.beforeClose)) {\n\t\t\toptions.beforeClose = options.beforeclose;\n\t\t}\n\n\t\tuiDialogTitlebar.find(\"*\").add(uiDialogTitlebar).disableSelection();\n\n\t\tif (options.draggable && $.fn.draggable) {\n\t\t\tself._makeDraggable();\n\t\t}\n\t\tif (options.resizable && $.fn.resizable) {\n\t\t\tself._makeResizable();\n\t\t}\n\n\t\tself._createButtons(options.buttons);\n\t\tself._isOpen = false;\n\n\t\tif ($.fn.bgiframe) {\n\t\t\tuiDialog.bgiframe();\n\t\t}\n\t},\n\n\t_init: function() {\n\t\tif ( this.options.autoOpen ) {\n\t\t\tthis.open();\n\t\t}\n\t},\n\n\tdestroy: function() {\n\t\tvar self = this;\n\t\t\n\t\tif (self.overlay) {\n\t\t\tself.overlay.destroy();\n\t\t}\n\t\tself.uiDialog.hide();\n\t\tself.element\n\t\t\t.unbind('.dialog')\n\t\t\t.removeData('dialog')\n\t\t\t.removeClass('ui-dialog-content ui-widget-content')\n\t\t\t.hide().appendTo('body');\n\t\tself.uiDialog.remove();\n\n\t\tif (self.originalTitle) {\n\t\t\tself.element.attr('title', self.originalTitle);\n\t\t}\n\n\t\treturn self;\n\t},\n\n\twidget: function() {\n\t\treturn this.uiDialog;\n\t},\n\n\tclose: function(event) {\n\t\tvar self = this,\n\t\t\tmaxZ, thisZ;\n\t\t\n\t\tif (false === self._trigger('beforeClose', event)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (self.overlay) {\n\t\t\tself.overlay.destroy();\n\t\t}\n\t\tself.uiDialog.unbind('keypress.ui-dialog');\n\n\t\tself._isOpen = false;\n\n\t\tif (self.options.hide) {\n\t\t\tself.uiDialog.hide(self.options.hide, function() {\n\t\t\t\tself._trigger('close', event);\n\t\t\t});\n\t\t} else {\n\t\t\tself.uiDialog.hide();\n\t\t\tself._trigger('close', event);\n\t\t}\n\n\t\t$.ui.dialog.overlay.resize();\n\n\t\t// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)\n\t\tif (self.options.modal) {\n\t\t\tmaxZ = 0;\n\t\t\t$('.ui-dialog').each(function() {\n\t\t\t\tif (this !== self.uiDialog[0]) {\n\t\t\t\t\tthisZ = $(this).css('z-index');\n\t\t\t\t\tif(!isNaN(thisZ)) {\n\t\t\t\t\t\tmaxZ = Math.max(maxZ, thisZ);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\t$.ui.dialog.maxZ = maxZ;\n\t\t}\n\n\t\treturn self;\n\t},\n\n\tisOpen: function() {\n\t\treturn this._isOpen;\n\t},\n\n\t// the force parameter allows us to move modal dialogs to their correct\n\t// position on open\n\tmoveToTop: function(force, event) {\n\t\tvar self = this,\n\t\t\toptions = self.options,\n\t\t\tsaveScroll;\n\n\t\tif ((options.modal && !force) ||\n\t\t\t(!options.stack && !options.modal)) {\n\t\t\treturn self._trigger('focus', event);\n\t\t}\n\n\t\tif (options.zIndex > $.ui.dialog.maxZ) {\n\t\t\t$.ui.dialog.maxZ = options.zIndex;\n\t\t}\n\t\tif (self.overlay) {\n\t\t\t$.ui.dialog.maxZ += 1;\n\t\t\tself.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ);\n\t\t}\n\n\t\t//Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.\n\t\t//  http://ui.jquery.com/bugs/ticket/3193\n\t\tsaveScroll = { scrollTop: self.element.scrollTop(), scrollLeft: self.element.scrollLeft() };\n\t\t$.ui.dialog.maxZ += 1;\n\t\tself.uiDialog.css('z-index', $.ui.dialog.maxZ);\n\t\tself.element.attr(saveScroll);\n\t\tself._trigger('focus', event);\n\n\t\treturn self;\n\t},\n\n\topen: function() {\n\t\tif (this._isOpen) { return; }\n\n\t\tvar self = this,\n\t\t\toptions = self.options,\n\t\t\tuiDialog = self.uiDialog;\n\n\t\tself.overlay = options.modal ? new $.ui.dialog.overlay(self) : null;\n\t\tself._size();\n\t\tself._position(options.position);\n\t\tuiDialog.show(options.show);\n\t\tself.moveToTop(true);\n\n\t\t// prevent tabbing out of modal dialogs\n\t\tif ( options.modal ) {\n\t\t\tuiDialog.bind( \"keydown.ui-dialog\", function( event ) {\n\t\t\t\tif ( event.keyCode !== $.ui.keyCode.TAB ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar tabbables = $(':tabbable', this),\n\t\t\t\t\tfirst = tabbables.filter(':first'),\n\t\t\t\t\tlast  = tabbables.filter(':last');\n\n\t\t\t\tif (event.target === last[0] && !event.shiftKey) {\n\t\t\t\t\tfirst.focus(1);\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (event.target === first[0] && event.shiftKey) {\n\t\t\t\t\tlast.focus(1);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// set focus to the first tabbable element in the content area or the first button\n\t\t// if there are no tabbable elements, set focus on the dialog itself\n\t\t$(self.element.find(':tabbable').get().concat(\n\t\t\tuiDialog.find('.ui-dialog-buttonpane :tabbable').get().concat(\n\t\t\t\tuiDialog.get()))).eq(0).focus();\n\n\t\tself._isOpen = true;\n\t\tself._trigger('open');\n\n\t\treturn self;\n\t},\n\n\t_createButtons: function(buttons) {\n\t\tvar self = this,\n\t\t\thasButtons = false,\n\t\t\tuiDialogButtonPane = $('<div></div>')\n\t\t\t\t.addClass(\n\t\t\t\t\t'ui-dialog-buttonpane ' +\n\t\t\t\t\t'ui-widget-content ' +\n\t\t\t\t\t'ui-helper-clearfix'\n\t\t\t\t),\n\t\t\tuiButtonSet = $( \"<div></div>\" )\n\t\t\t\t.addClass( \"ui-dialog-buttonset\" )\n\t\t\t\t.appendTo( uiDialogButtonPane );\n\n\t\t// if we already have a button pane, remove it\n\t\tself.uiDialog.find('.ui-dialog-buttonpane').remove();\n\n\t\tif (typeof buttons === 'object' && buttons !== null) {\n\t\t\t$.each(buttons, function() {\n\t\t\t\treturn !(hasButtons = true);\n\t\t\t});\n\t\t}\n\t\tif (hasButtons) {\n\t\t\t$.each(buttons, function(name, props) {\n\t\t\t\tprops = $.isFunction( props ) ?\n\t\t\t\t\t{ click: props, text: name } :\n\t\t\t\t\tprops;\n\t\t\t\tvar button = $('<button type=\"button\"></button>')\n\t\t\t\t\t.click(function() {\n\t\t\t\t\t\tprops.click.apply(self.element[0], arguments);\n\t\t\t\t\t})\n\t\t\t\t\t.appendTo(uiButtonSet);\n\t\t\t\t// can't use .attr( props, true ) with jQuery 1.3.2.\n\t\t\t\t$.each( props, function( key, value ) {\n\t\t\t\t\tif ( key === \"click\" ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif ( key in attrFn ) {\n\t\t\t\t\t\tbutton[ key ]( value );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbutton.attr( key, value );\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif ($.fn.button) {\n\t\t\t\t\tbutton.button();\n\t\t\t\t}\n\t\t\t});\n\t\t\tuiDialogButtonPane.appendTo(self.uiDialog);\n\t\t}\n\t},\n\n\t_makeDraggable: function() {\n\t\tvar self = this,\n\t\t\toptions = self.options,\n\t\t\tdoc = $(document),\n\t\t\theightBeforeDrag;\n\n\t\tfunction filteredUi(ui) {\n\t\t\treturn {\n\t\t\t\tposition: ui.position,\n\t\t\t\toffset: ui.offset\n\t\t\t};\n\t\t}\n\n\t\tself.uiDialog.draggable({\n\t\t\tcancel: '.ui-dialog-content, .ui-dialog-titlebar-close',\n\t\t\thandle: '.ui-dialog-titlebar',\n\t\t\tcontainment: 'document',\n\t\t\tstart: function(event, ui) {\n\t\t\t\theightBeforeDrag = options.height === \"auto\" ? \"auto\" : $(this).height();\n\t\t\t\t$(this).height($(this).height()).addClass(\"ui-dialog-dragging\");\n\t\t\t\tself._trigger('dragStart', event, filteredUi(ui));\n\t\t\t},\n\t\t\tdrag: function(event, ui) {\n\t\t\t\tself._trigger('drag', event, filteredUi(ui));\n\t\t\t},\n\t\t\tstop: function(event, ui) {\n\t\t\t\toptions.position = [ui.position.left - doc.scrollLeft(),\n\t\t\t\t\tui.position.top - doc.scrollTop()];\n\t\t\t\t$(this).removeClass(\"ui-dialog-dragging\").height(heightBeforeDrag);\n\t\t\t\tself._trigger('dragStop', event, filteredUi(ui));\n\t\t\t\t$.ui.dialog.overlay.resize();\n\t\t\t}\n\t\t});\n\t},\n\n\t_makeResizable: function(handles) {\n\t\thandles = (handles === undefined ? this.options.resizable : handles);\n\t\tvar self = this,\n\t\t\toptions = self.options,\n\t\t\t// .ui-resizable has position: relative defined in the stylesheet\n\t\t\t// but dialogs have to use absolute or fixed positioning\n\t\t\tposition = self.uiDialog.css('position'),\n\t\t\tresizeHandles = (typeof handles === 'string' ?\n\t\t\t\thandles\t:\n\t\t\t\t'n,e,s,w,se,sw,ne,nw'\n\t\t\t);\n\n\t\tfunction filteredUi(ui) {\n\t\t\treturn {\n\t\t\t\toriginalPosition: ui.originalPosition,\n\t\t\t\toriginalSize: ui.originalSize,\n\t\t\t\tposition: ui.position,\n\t\t\t\tsize: ui.size\n\t\t\t};\n\t\t}\n\n\t\tself.uiDialog.resizable({\n\t\t\tcancel: '.ui-dialog-content',\n\t\t\tcontainment: 'document',\n\t\t\talsoResize: self.element,\n\t\t\tmaxWidth: options.maxWidth,\n\t\t\tmaxHeight: options.maxHeight,\n\t\t\tminWidth: options.minWidth,\n\t\t\tminHeight: self._minHeight(),\n\t\t\thandles: resizeHandles,\n\t\t\tstart: function(event, ui) {\n\t\t\t\t$(this).addClass(\"ui-dialog-resizing\");\n\t\t\t\tself._trigger('resizeStart', event, filteredUi(ui));\n\t\t\t},\n\t\t\tresize: function(event, ui) {\n\t\t\t\tself._trigger('resize', event, filteredUi(ui));\n\t\t\t},\n\t\t\tstop: function(event, ui) {\n\t\t\t\t$(this).removeClass(\"ui-dialog-resizing\");\n\t\t\t\toptions.height = $(this).height();\n\t\t\t\toptions.width = $(this).width();\n\t\t\t\tself._trigger('resizeStop', event, filteredUi(ui));\n\t\t\t\t$.ui.dialog.overlay.resize();\n\t\t\t}\n\t\t})\n\t\t.css('position', position)\n\t\t.find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');\n\t},\n\n\t_minHeight: function() {\n\t\tvar options = this.options;\n\n\t\tif (options.height === 'auto') {\n\t\t\treturn options.minHeight;\n\t\t} else {\n\t\t\treturn Math.min(options.minHeight, options.height);\n\t\t}\n\t},\n\n\t_position: function(position) {\n\t\tvar myAt = [],\n\t\t\toffset = [0, 0],\n\t\t\tisVisible;\n\n\t\tif (position) {\n\t\t\t// deep extending converts arrays to objects in jQuery <= 1.3.2 :-(\n\t//\t\tif (typeof position == 'string' || $.isArray(position)) {\n\t//\t\t\tmyAt = $.isArray(position) ? position : position.split(' ');\n\n\t\t\tif (typeof position === 'string' || (typeof position === 'object' && '0' in position)) {\n\t\t\t\tmyAt = position.split ? position.split(' ') : [position[0], position[1]];\n\t\t\t\tif (myAt.length === 1) {\n\t\t\t\t\tmyAt[1] = myAt[0];\n\t\t\t\t}\n\n\t\t\t\t$.each(['left', 'top'], function(i, offsetPosition) {\n\t\t\t\t\tif (+myAt[i] === myAt[i]) {\n\t\t\t\t\t\toffset[i] = myAt[i];\n\t\t\t\t\t\tmyAt[i] = offsetPosition;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tposition = {\n\t\t\t\t\tmy: myAt.join(\" \"),\n\t\t\t\t\tat: myAt.join(\" \"),\n\t\t\t\t\toffset: offset.join(\" \")\n\t\t\t\t};\n\t\t\t} \n\n\t\t\tposition = $.extend({}, $.ui.dialog.prototype.options.position, position);\n\t\t} else {\n\t\t\tposition = $.ui.dialog.prototype.options.position;\n\t\t}\n\n\t\t// need to show the dialog to get the actual offset in the position plugin\n\t\tisVisible = this.uiDialog.is(':visible');\n\t\tif (!isVisible) {\n\t\t\tthis.uiDialog.show();\n\t\t}\n\t\tthis.uiDialog\n\t\t\t// workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781\n\t\t\t.css({ top: 0, left: 0 })\n\t\t\t.position($.extend({ of: window }, position));\n\t\tif (!isVisible) {\n\t\t\tthis.uiDialog.hide();\n\t\t}\n\t},\n\n\t_setOptions: function( options ) {\n\t\tvar self = this,\n\t\t\tresizableOptions = {},\n\t\t\tresize = false;\n\n\t\t$.each( options, function( key, value ) {\n\t\t\tself._setOption( key, value );\n\t\t\t\n\t\t\tif ( key in sizeRelatedOptions ) {\n\t\t\t\tresize = true;\n\t\t\t}\n\t\t\tif ( key in resizableRelatedOptions ) {\n\t\t\t\tresizableOptions[ key ] = value;\n\t\t\t}\n\t\t});\n\n\t\tif ( resize ) {\n\t\t\tthis._size();\n\t\t}\n\t\tif ( this.uiDialog.is( \":data(resizable)\" ) ) {\n\t\t\tthis.uiDialog.resizable( \"option\", resizableOptions );\n\t\t}\n\t},\n\n\t_setOption: function(key, value){\n\t\tvar self = this,\n\t\t\tuiDialog = self.uiDialog;\n\n\t\tswitch (key) {\n\t\t\t//handling of deprecated beforeclose (vs beforeClose) option\n\t\t\t//Ticket #4669 http://dev.jqueryui.com/ticket/4669\n\t\t\t//TODO: remove in 1.9pre\n\t\t\tcase \"beforeclose\":\n\t\t\t\tkey = \"beforeClose\";\n\t\t\t\tbreak;\n\t\t\tcase \"buttons\":\n\t\t\t\tself._createButtons(value);\n\t\t\t\tbreak;\n\t\t\tcase \"closeText\":\n\t\t\t\t// ensure that we always pass a string\n\t\t\t\tself.uiDialogTitlebarCloseText.text(\"\" + value);\n\t\t\t\tbreak;\n\t\t\tcase \"dialogClass\":\n\t\t\t\tuiDialog\n\t\t\t\t\t.removeClass(self.options.dialogClass)\n\t\t\t\t\t.addClass(uiDialogClasses + value);\n\t\t\t\tbreak;\n\t\t\tcase \"disabled\":\n\t\t\t\tif (value) {\n\t\t\t\t\tuiDialog.addClass('ui-dialog-disabled');\n\t\t\t\t} else {\n\t\t\t\t\tuiDialog.removeClass('ui-dialog-disabled');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"draggable\":\n\t\t\t\tvar isDraggable = uiDialog.is( \":data(draggable)\" );\n\t\t\t\tif ( isDraggable && !value ) {\n\t\t\t\t\tuiDialog.draggable( \"destroy\" );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( !isDraggable && value ) {\n\t\t\t\t\tself._makeDraggable();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"position\":\n\t\t\t\tself._position(value);\n\t\t\t\tbreak;\n\t\t\tcase \"resizable\":\n\t\t\t\t// currently resizable, becoming non-resizable\n\t\t\t\tvar isResizable = uiDialog.is( \":data(resizable)\" );\n\t\t\t\tif (isResizable && !value) {\n\t\t\t\t\tuiDialog.resizable('destroy');\n\t\t\t\t}\n\n\t\t\t\t// currently resizable, changing handles\n\t\t\t\tif (isResizable && typeof value === 'string') {\n\t\t\t\t\tuiDialog.resizable('option', 'handles', value);\n\t\t\t\t}\n\n\t\t\t\t// currently non-resizable, becoming resizable\n\t\t\t\tif (!isResizable && value !== false) {\n\t\t\t\t\tself._makeResizable(value);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"title\":\n\t\t\t\t// convert whatever was passed in o a string, for html() to not throw up\n\t\t\t\t$(\".ui-dialog-title\", self.uiDialogTitlebar).html(\"\" + (value || '&#160;'));\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$.Widget.prototype._setOption.apply(self, arguments);\n\t},\n\n\t_size: function() {\n\t\t/* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content\n\t\t * divs will both have width and height set, so we need to reset them\n\t\t */\n\t\tvar options = this.options,\n\t\t\tnonContentHeight,\n\t\t\tminContentHeight,\n\t\t\tisVisible = this.uiDialog.is( \":visible\" );\n\n\t\t// reset content sizing\n\t\tthis.element.show().css({\n\t\t\twidth: 'auto',\n\t\t\tminHeight: 0,\n\t\t\theight: 0\n\t\t});\n\n\t\tif (options.minWidth > options.width) {\n\t\t\toptions.width = options.minWidth;\n\t\t}\n\n\t\t// reset wrapper sizing\n\t\t// determine the height of all the non-content elements\n\t\tnonContentHeight = this.uiDialog.css({\n\t\t\t\theight: 'auto',\n\t\t\t\twidth: options.width\n\t\t\t})\n\t\t\t.height();\n\t\tminContentHeight = Math.max( 0, options.minHeight - nonContentHeight );\n\t\t\n\t\tif ( options.height === \"auto\" ) {\n\t\t\t// only needed for IE6 support\n\t\t\tif ( $.support.minHeight ) {\n\t\t\t\tthis.element.css({\n\t\t\t\t\tminHeight: minContentHeight,\n\t\t\t\t\theight: \"auto\"\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.uiDialog.show();\n\t\t\t\tvar autoHeight = this.element.css( \"height\", \"auto\" ).height();\n\t\t\t\tif ( !isVisible ) {\n\t\t\t\t\tthis.uiDialog.hide();\n\t\t\t\t}\n\t\t\t\tthis.element.height( Math.max( autoHeight, minContentHeight ) );\n\t\t\t}\n\t\t} else {\n\t\t\tthis.element.height( Math.max( options.height - nonContentHeight, 0 ) );\n\t\t}\n\n\t\tif (this.uiDialog.is(':data(resizable)')) {\n\t\t\tthis.uiDialog.resizable('option', 'minHeight', this._minHeight());\n\t\t}\n\t}\n});\n\n$.extend($.ui.dialog, {\n\tversion: \"1.8.22\",\n\n\tuuid: 0,\n\tmaxZ: 0,\n\n\tgetTitleId: function($el) {\n\t\tvar id = $el.attr('id');\n\t\tif (!id) {\n\t\t\tthis.uuid += 1;\n\t\t\tid = this.uuid;\n\t\t}\n\t\treturn 'ui-dialog-title-' + id;\n\t},\n\n\toverlay: function(dialog) {\n\t\tthis.$el = $.ui.dialog.overlay.create(dialog);\n\t}\n});\n\n$.extend($.ui.dialog.overlay, {\n\tinstances: [],\n\t// reuse old instances due to IE memory leak with alpha transparency (see #5185)\n\toldInstances: [],\n\tmaxZ: 0,\n\tevents: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),\n\t\tfunction(event) { return event + '.dialog-overlay'; }).join(' '),\n\tcreate: function(dialog) {\n\t\tif (this.instances.length === 0) {\n\t\t\t// prevent use of anchors and inputs\n\t\t\t// we use a setTimeout in case the overlay is created from an\n\t\t\t// event that we're going to be cancelling (see #2804)\n\t\t\tsetTimeout(function() {\n\t\t\t\t// handle $(el).dialog().dialog('close') (see #4065)\n\t\t\t\tif ($.ui.dialog.overlay.instances.length) {\n\t\t\t\t\t$(document).bind($.ui.dialog.overlay.events, function(event) {\n\t\t\t\t\t\t// stop events if the z-index of the target is < the z-index of the overlay\n\t\t\t\t\t\t// we cannot return true when we don't want to cancel the event (#3523)\n\t\t\t\t\t\tif ($(event.target).zIndex() < $.ui.dialog.overlay.maxZ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}, 1);\n\n\t\t\t// allow closing by pressing the escape key\n\t\t\t$(document).bind('keydown.dialog-overlay', function(event) {\n\t\t\t\tif (dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&\n\t\t\t\t\tevent.keyCode === $.ui.keyCode.ESCAPE) {\n\t\t\t\t\t\n\t\t\t\t\tdialog.close(event);\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// handle window resize\n\t\t\t$(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);\n\t\t}\n\n\t\tvar $el = (this.oldInstances.pop() || $('<div></div>').addClass('ui-widget-overlay'))\n\t\t\t.appendTo(document.body)\n\t\t\t.css({\n\t\t\t\twidth: this.width(),\n\t\t\t\theight: this.height()\n\t\t\t});\n\n\t\tif ($.fn.bgiframe) {\n\t\t\t$el.bgiframe();\n\t\t}\n\n\t\tthis.instances.push($el);\n\t\treturn $el;\n\t},\n\n\tdestroy: function($el) {\n\t\tvar indexOf = $.inArray($el, this.instances);\n\t\tif (indexOf != -1){\n\t\t\tthis.oldInstances.push(this.instances.splice(indexOf, 1)[0]);\n\t\t}\n\n\t\tif (this.instances.length === 0) {\n\t\t\t$([document, window]).unbind('.dialog-overlay');\n\t\t}\n\n\t\t$el.remove();\n\t\t\n\t\t// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)\n\t\tvar maxZ = 0;\n\t\t$.each(this.instances, function() {\n\t\t\tmaxZ = Math.max(maxZ, this.css('z-index'));\n\t\t});\n\t\tthis.maxZ = maxZ;\n\t},\n\n\theight: function() {\n\t\tvar scrollHeight,\n\t\t\toffsetHeight;\n\t\t// handle IE 6\n\t\tif ($.browser.msie && $.browser.version < 7) {\n\t\t\tscrollHeight = Math.max(\n\t\t\t\tdocument.documentElement.scrollHeight,\n\t\t\t\tdocument.body.scrollHeight\n\t\t\t);\n\t\t\toffsetHeight = Math.max(\n\t\t\t\tdocument.documentElement.offsetHeight,\n\t\t\t\tdocument.body.offsetHeight\n\t\t\t);\n\n\t\t\tif (scrollHeight < offsetHeight) {\n\t\t\t\treturn $(window).height() + 'px';\n\t\t\t} else {\n\t\t\t\treturn scrollHeight + 'px';\n\t\t\t}\n\t\t// handle \"good\" browsers\n\t\t} else {\n\t\t\treturn $(document).height() + 'px';\n\t\t}\n\t},\n\n\twidth: function() {\n\t\tvar scrollWidth,\n\t\t\toffsetWidth;\n\t\t// handle IE\n\t\tif ( $.browser.msie ) {\n\t\t\tscrollWidth = Math.max(\n\t\t\t\tdocument.documentElement.scrollWidth,\n\t\t\t\tdocument.body.scrollWidth\n\t\t\t);\n\t\t\toffsetWidth = Math.max(\n\t\t\t\tdocument.documentElement.offsetWidth,\n\t\t\t\tdocument.body.offsetWidth\n\t\t\t);\n\n\t\t\tif (scrollWidth < offsetWidth) {\n\t\t\t\treturn $(window).width() + 'px';\n\t\t\t} else {\n\t\t\t\treturn scrollWidth + 'px';\n\t\t\t}\n\t\t// handle \"good\" browsers\n\t\t} else {\n\t\t\treturn $(document).width() + 'px';\n\t\t}\n\t},\n\n\tresize: function() {\n\t\t/* If the dialog is draggable and the user drags it past the\n\t\t * right edge of the window, the document becomes wider so we\n\t\t * need to stretch the overlay. If the user then drags the\n\t\t * dialog back to the left, the document will become narrower,\n\t\t * so we need to shrink the overlay to the appropriate size.\n\t\t * This is handled by shrinking the overlay before setting it\n\t\t * to the full document size.\n\t\t */\n\t\tvar $overlays = $([]);\n\t\t$.each($.ui.dialog.overlay.instances, function() {\n\t\t\t$overlays = $overlays.add(this);\n\t\t});\n\n\t\t$overlays.css({\n\t\t\twidth: 0,\n\t\t\theight: 0\n\t\t}).css({\n\t\t\twidth: $.ui.dialog.overlay.width(),\n\t\t\theight: $.ui.dialog.overlay.height()\n\t\t});\n\t}\n});\n\n$.extend($.ui.dialog.overlay.prototype, {\n\tdestroy: function() {\n\t\t$.ui.dialog.overlay.destroy(this.$el);\n\t}\n});\n\n}(jQuery));\n\n(function( $, undefined ) {\n\n$.ui = $.ui || {};\n\nvar horizontalPositions = /left|center|right/,\n\tverticalPositions = /top|center|bottom/,\n\tcenter = \"center\",\n\tsupport = {},\n\t_position = $.fn.position,\n\t_offset = $.fn.offset;\n\n$.fn.position = function( options ) {\n\tif ( !options || !options.of ) {\n\t\treturn _position.apply( this, arguments );\n\t}\n\n\t// make a copy, we don't want to modify arguments\n\toptions = $.extend( {}, options );\n\n\tvar target = $( options.of ),\n\t\ttargetElem = target[0],\n\t\tcollision = ( options.collision || \"flip\" ).split( \" \" ),\n\t\toffset = options.offset ? options.offset.split( \" \" ) : [ 0, 0 ],\n\t\ttargetWidth,\n\t\ttargetHeight,\n\t\tbasePosition;\n\n\tif ( targetElem.nodeType === 9 ) {\n\t\ttargetWidth = target.width();\n\t\ttargetHeight = target.height();\n\t\tbasePosition = { top: 0, left: 0 };\n\t// TODO: use $.isWindow() in 1.9\n\t} else if ( targetElem.setTimeout ) {\n\t\ttargetWidth = target.width();\n\t\ttargetHeight = target.height();\n\t\tbasePosition = { top: target.scrollTop(), left: target.scrollLeft() };\n\t} else if ( targetElem.preventDefault ) {\n\t\t// force left top to allow flipping\n\t\toptions.at = \"left top\";\n\t\ttargetWidth = targetHeight = 0;\n\t\tbasePosition = { top: options.of.pageY, left: options.of.pageX };\n\t} else {\n\t\ttargetWidth = target.outerWidth();\n\t\ttargetHeight = target.outerHeight();\n\t\tbasePosition = target.offset();\n\t}\n\n\t// force my and at to have valid horizontal and veritcal positions\n\t// if a value is missing or invalid, it will be converted to center \n\t$.each( [ \"my\", \"at\" ], function() {\n\t\tvar pos = ( options[this] || \"\" ).split( \" \" );\n\t\tif ( pos.length === 1) {\n\t\t\tpos = horizontalPositions.test( pos[0] ) ?\n\t\t\t\tpos.concat( [center] ) :\n\t\t\t\tverticalPositions.test( pos[0] ) ?\n\t\t\t\t\t[ center ].concat( pos ) :\n\t\t\t\t\t[ center, center ];\n\t\t}\n\t\tpos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center;\n\t\tpos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center;\n\t\toptions[ this ] = pos;\n\t});\n\n\t// normalize collision option\n\tif ( collision.length === 1 ) {\n\t\tcollision[ 1 ] = collision[ 0 ];\n\t}\n\n\t// normalize offset option\n\toffset[ 0 ] = parseInt( offset[0], 10 ) || 0;\n\tif ( offset.length === 1 ) {\n\t\toffset[ 1 ] = offset[ 0 ];\n\t}\n\toffset[ 1 ] = parseInt( offset[1], 10 ) || 0;\n\n\tif ( options.at[0] === \"right\" ) {\n\t\tbasePosition.left += targetWidth;\n\t} else if ( options.at[0] === center ) {\n\t\tbasePosition.left += targetWidth / 2;\n\t}\n\n\tif ( options.at[1] === \"bottom\" ) {\n\t\tbasePosition.top += targetHeight;\n\t} else if ( options.at[1] === center ) {\n\t\tbasePosition.top += targetHeight / 2;\n\t}\n\n\tbasePosition.left += offset[ 0 ];\n\tbasePosition.top += offset[ 1 ];\n\n\treturn this.each(function() {\n\t\tvar elem = $( this ),\n\t\t\telemWidth = elem.outerWidth(),\n\t\t\telemHeight = elem.outerHeight(),\n\t\t\tmarginLeft = parseInt( $.curCSS( this, \"marginLeft\", true ) ) || 0,\n\t\t\tmarginTop = parseInt( $.curCSS( this, \"marginTop\", true ) ) || 0,\n\t\t\tcollisionWidth = elemWidth + marginLeft +\n\t\t\t\t( parseInt( $.curCSS( this, \"marginRight\", true ) ) || 0 ),\n\t\t\tcollisionHeight = elemHeight + marginTop +\n\t\t\t\t( parseInt( $.curCSS( this, \"marginBottom\", true ) ) || 0 ),\n\t\t\tposition = $.extend( {}, basePosition ),\n\t\t\tcollisionPosition;\n\n\t\tif ( options.my[0] === \"right\" ) {\n\t\t\tposition.left -= elemWidth;\n\t\t} else if ( options.my[0] === center ) {\n\t\t\tposition.left -= elemWidth / 2;\n\t\t}\n\n\t\tif ( options.my[1] === \"bottom\" ) {\n\t\t\tposition.top -= elemHeight;\n\t\t} else if ( options.my[1] === center ) {\n\t\t\tposition.top -= elemHeight / 2;\n\t\t}\n\n\t\t// prevent fractions if jQuery version doesn't support them (see #5280)\n\t\tif ( !support.fractions ) {\n\t\t\tposition.left = Math.round( position.left );\n\t\t\tposition.top = Math.round( position.top );\n\t\t}\n\n\t\tcollisionPosition = {\n\t\t\tleft: position.left - marginLeft,\n\t\t\ttop: position.top - marginTop\n\t\t};\n\n\t\t$.each( [ \"left\", \"top\" ], function( i, dir ) {\n\t\t\tif ( $.ui.position[ collision[i] ] ) {\n\t\t\t\t$.ui.position[ collision[i] ][ dir ]( position, {\n\t\t\t\t\ttargetWidth: targetWidth,\n\t\t\t\t\ttargetHeight: targetHeight,\n\t\t\t\t\telemWidth: elemWidth,\n\t\t\t\t\telemHeight: elemHeight,\n\t\t\t\t\tcollisionPosition: collisionPosition,\n\t\t\t\t\tcollisionWidth: collisionWidth,\n\t\t\t\t\tcollisionHeight: collisionHeight,\n\t\t\t\t\toffset: offset,\n\t\t\t\t\tmy: options.my,\n\t\t\t\t\tat: options.at\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tif ( $.fn.bgiframe ) {\n\t\t\telem.bgiframe();\n\t\t}\n\t\telem.offset( $.extend( position, { using: options.using } ) );\n\t});\n};\n\n$.ui.position = {\n\tfit: {\n\t\tleft: function( position, data ) {\n\t\t\tvar win = $( window ),\n\t\t\t\tover = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft();\n\t\t\tposition.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left );\n\t\t},\n\t\ttop: function( position, data ) {\n\t\t\tvar win = $( window ),\n\t\t\t\tover = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop();\n\t\t\tposition.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top );\n\t\t}\n\t},\n\n\tflip: {\n\t\tleft: function( position, data ) {\n\t\t\tif ( data.at[0] === center ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar win = $( window ),\n\t\t\t\tover = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(),\n\t\t\t\tmyOffset = data.my[ 0 ] === \"left\" ?\n\t\t\t\t\t-data.elemWidth :\n\t\t\t\t\tdata.my[ 0 ] === \"right\" ?\n\t\t\t\t\t\tdata.elemWidth :\n\t\t\t\t\t\t0,\n\t\t\t\tatOffset = data.at[ 0 ] === \"left\" ?\n\t\t\t\t\tdata.targetWidth :\n\t\t\t\t\t-data.targetWidth,\n\t\t\t\toffset = -2 * data.offset[ 0 ];\n\t\t\tposition.left += data.collisionPosition.left < 0 ?\n\t\t\t\tmyOffset + atOffset + offset :\n\t\t\t\tover > 0 ?\n\t\t\t\t\tmyOffset + atOffset + offset :\n\t\t\t\t\t0;\n\t\t},\n\t\ttop: function( position, data ) {\n\t\t\tif ( data.at[1] === center ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar win = $( window ),\n\t\t\t\tover = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(),\n\t\t\t\tmyOffset = data.my[ 1 ] === \"top\" ?\n\t\t\t\t\t-data.elemHeight :\n\t\t\t\t\tdata.my[ 1 ] === \"bottom\" ?\n\t\t\t\t\t\tdata.elemHeight :\n\t\t\t\t\t\t0,\n\t\t\t\tatOffset = data.at[ 1 ] === \"top\" ?\n\t\t\t\t\tdata.targetHeight :\n\t\t\t\t\t-data.targetHeight,\n\t\t\t\toffset = -2 * data.offset[ 1 ];\n\t\t\tposition.top += data.collisionPosition.top < 0 ?\n\t\t\t\tmyOffset + atOffset + offset :\n\t\t\t\tover > 0 ?\n\t\t\t\t\tmyOffset + atOffset + offset :\n\t\t\t\t\t0;\n\t\t}\n\t}\n};\n\n// offset setter from jQuery 1.4\nif ( !$.offset.setOffset ) {\n\t$.offset.setOffset = function( elem, options ) {\n\t\t// set position first, in-case top/left are set even on static elem\n\t\tif ( /static/.test( $.curCSS( elem, \"position\" ) ) ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\t\tvar curElem   = $( elem ),\n\t\t\tcurOffset = curElem.offset(),\n\t\t\tcurTop    = parseInt( $.curCSS( elem, \"top\",  true ), 10 ) || 0,\n\t\t\tcurLeft   = parseInt( $.curCSS( elem, \"left\", true ), 10)  || 0,\n\t\t\tprops     = {\n\t\t\t\ttop:  (options.top  - curOffset.top)  + curTop,\n\t\t\t\tleft: (options.left - curOffset.left) + curLeft\n\t\t\t};\n\t\t\n\t\tif ( 'using' in options ) {\n\t\t\toptions.using.call( elem, props );\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t};\n\n\t$.fn.offset = function( options ) {\n\t\tvar elem = this[ 0 ];\n\t\tif ( !elem || !elem.ownerDocument ) { return null; }\n\t\tif ( options ) {\n\t\t\tif ( $.isFunction( options ) ) {\n\t\t\t\treturn this.each(function( i ) {\n\t\t\t\t\t$( this ).offset( options.call( this, i, $( this ).offset() ) );\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn this.each(function() {\n\t\t\t\t$.offset.setOffset( this, options );\n\t\t\t});\n\t\t}\n\t\treturn _offset.call( this );\n\t};\n}\n\n// fraction support test (older versions of jQuery don't support fractions)\n(function () {\n\tvar body = document.getElementsByTagName( \"body\" )[ 0 ], \n\t\tdiv = document.createElement( \"div\" ),\n\t\ttestElement, testElementParent, testElementStyle, offset, offsetTotal;\n\n\t//Create a \"fake body\" for testing based on method used in jQuery.support\n\ttestElement = document.createElement( body ? \"div\" : \"body\" );\n\ttestElementStyle = {\n\t\tvisibility: \"hidden\",\n\t\twidth: 0,\n\t\theight: 0,\n\t\tborder: 0,\n\t\tmargin: 0,\n\t\tbackground: \"none\"\n\t};\n\tif ( body ) {\n\t\t$.extend( testElementStyle, {\n\t\t\tposition: \"absolute\",\n\t\t\tleft: \"-1000px\",\n\t\t\ttop: \"-1000px\"\n\t\t});\n\t}\n\tfor ( var i in testElementStyle ) {\n\t\ttestElement.style[ i ] = testElementStyle[ i ];\n\t}\n\ttestElement.appendChild( div );\n\ttestElementParent = body || document.documentElement;\n\ttestElementParent.insertBefore( testElement, testElementParent.firstChild );\n\n\tdiv.style.cssText = \"position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;\";\n\n\toffset = $( div ).offset( function( _, offset ) {\n\t\treturn offset;\n\t}).offset();\n\n\ttestElement.innerHTML = \"\";\n\ttestElementParent.removeChild( testElement );\n\n\toffsetTotal = offset.top + offset.left + ( body ? 2000 : 0 );\n\tsupport.fractions = offsetTotal > 21 && offsetTotal < 22;\n})();\n\n}( jQuery ));\n\n(function( $, undefined ) {\n\n$.widget( \"ui.progressbar\", {\n\toptions: {\n\t\tvalue: 0,\n\t\tmax: 100\n\t},\n\n\tmin: 0,\n\n\t_create: function() {\n\t\tthis.element\n\t\t\t.addClass( \"ui-progressbar ui-widget ui-widget-content ui-corner-all\" )\n\t\t\t.attr({\n\t\t\t\trole: \"progressbar\",\n\t\t\t\t\"aria-valuemin\": this.min,\n\t\t\t\t\"aria-valuemax\": this.options.max,\n\t\t\t\t\"aria-valuenow\": this._value()\n\t\t\t});\n\n\t\tthis.valueDiv = $( \"<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>\" )\n\t\t\t.appendTo( this.element );\n\n\t\tthis.oldValue = this._value();\n\t\tthis._refreshValue();\n\t},\n\n\tdestroy: function() {\n\t\tthis.element\n\t\t\t.removeClass( \"ui-progressbar ui-widget ui-widget-content ui-corner-all\" )\n\t\t\t.removeAttr( \"role\" )\n\t\t\t.removeAttr( \"aria-valuemin\" )\n\t\t\t.removeAttr( \"aria-valuemax\" )\n\t\t\t.removeAttr( \"aria-valuenow\" );\n\n\t\tthis.valueDiv.remove();\n\n\t\t$.Widget.prototype.destroy.apply( this, arguments );\n\t},\n\n\tvalue: function( newValue ) {\n\t\tif ( newValue === undefined ) {\n\t\t\treturn this._value();\n\t\t}\n\n\t\tthis._setOption( \"value\", newValue );\n\t\treturn this;\n\t},\n\n\t_setOption: function( key, value ) {\n\t\tif ( key === \"value\" ) {\n\t\t\tthis.options.value = value;\n\t\t\tthis._refreshValue();\n\t\t\tif ( this._value() === this.options.max ) {\n\t\t\t\tthis._trigger( \"complete\" );\n\t\t\t}\n\t\t}\n\n\t\t$.Widget.prototype._setOption.apply( this, arguments );\n\t},\n\n\t_value: function() {\n\t\tvar val = this.options.value;\n\t\t// normalize invalid value\n\t\tif ( typeof val !== \"number\" ) {\n\t\t\tval = 0;\n\t\t}\n\t\treturn Math.min( this.options.max, Math.max( this.min, val ) );\n\t},\n\n\t_percentage: function() {\n\t\treturn 100 * this._value() / this.options.max;\n\t},\n\n\t_refreshValue: function() {\n\t\tvar value = this.value();\n\t\tvar percentage = this._percentage();\n\n\t\tif ( this.oldValue !== value ) {\n\t\t\tthis.oldValue = value;\n\t\t\tthis._trigger( \"change\" );\n\t\t}\n\n\t\tthis.valueDiv\n\t\t\t.toggle( value > this.min )\n\t\t\t.toggleClass( \"ui-corner-right\", value === this.options.max )\n\t\t\t.width( percentage.toFixed(0) + \"%\" );\n\t\tthis.element.attr( \"aria-valuenow\", value );\n\t}\n});\n\n$.extend( $.ui.progressbar, {\n\tversion: \"1.8.22\"\n});\n\n})( jQuery );\n\n(function( $, undefined ) {\n\n// number of pages in a slider\n// (how many times can you page up/down to go through the whole range)\nvar numPages = 5;\n\n$.widget( \"ui.slider\", $.ui.mouse, {\n\n\twidgetEventPrefix: \"slide\",\n\n\toptions: {\n\t\tanimate: false,\n\t\tdistance: 0,\n\t\tmax: 100,\n\t\tmin: 0,\n\t\torientation: \"horizontal\",\n\t\trange: false,\n\t\tstep: 1,\n\t\tvalue: 0,\n\t\tvalues: null\n\t},\n\n\t_create: function() {\n\t\tvar self = this,\n\t\t\to = this.options,\n\t\t\texistingHandles = this.element.find( \".ui-slider-handle\" ).addClass( \"ui-state-default ui-corner-all\" ),\n\t\t\thandle = \"<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>\",\n\t\t\thandleCount = ( o.values && o.values.length ) || 1,\n\t\t\thandles = [];\n\n\t\tthis._keySliding = false;\n\t\tthis._mouseSliding = false;\n\t\tthis._animateOff = true;\n\t\tthis._handleIndex = null;\n\t\tthis._detectOrientation();\n\t\tthis._mouseInit();\n\n\t\tthis.element\n\t\t\t.addClass( \"ui-slider\" +\n\t\t\t\t\" ui-slider-\" + this.orientation +\n\t\t\t\t\" ui-widget\" +\n\t\t\t\t\" ui-widget-content\" +\n\t\t\t\t\" ui-corner-all\" +\n\t\t\t\t( o.disabled ? \" ui-slider-disabled ui-disabled\" : \"\" ) );\n\n\t\tthis.range = $([]);\n\n\t\tif ( o.range ) {\n\t\t\tif ( o.range === true ) {\n\t\t\t\tif ( !o.values ) {\n\t\t\t\t\to.values = [ this._valueMin(), this._valueMin() ];\n\t\t\t\t}\n\t\t\t\tif ( o.values.length && o.values.length !== 2 ) {\n\t\t\t\t\to.values = [ o.values[0], o.values[0] ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.range = $( \"<div></div>\" )\n\t\t\t\t.appendTo( this.element )\n\t\t\t\t.addClass( \"ui-slider-range\" +\n\t\t\t\t// note: this isn't the most fittingly semantic framework class for this element,\n\t\t\t\t// but worked best visually with a variety of themes\n\t\t\t\t\" ui-widget-header\" + \n\t\t\t\t( ( o.range === \"min\" || o.range === \"max\" ) ? \" ui-slider-range-\" + o.range : \"\" ) );\n\t\t}\n\n\t\tfor ( var i = existingHandles.length; i < handleCount; i += 1 ) {\n\t\t\thandles.push( handle );\n\t\t}\n\n\t\tthis.handles = existingHandles.add( $( handles.join( \"\" ) ).appendTo( self.element ) );\n\n\t\tthis.handle = this.handles.eq( 0 );\n\n\t\tthis.handles.add( this.range ).filter( \"a\" )\n\t\t\t.click(function( event ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t})\n\t\t\t.hover(function() {\n\t\t\t\tif ( !o.disabled ) {\n\t\t\t\t\t$( this ).addClass( \"ui-state-hover\" );\n\t\t\t\t}\n\t\t\t}, function() {\n\t\t\t\t$( this ).removeClass( \"ui-state-hover\" );\n\t\t\t})\n\t\t\t.focus(function() {\n\t\t\t\tif ( !o.disabled ) {\n\t\t\t\t\t$( \".ui-slider .ui-state-focus\" ).removeClass( \"ui-state-focus\" );\n\t\t\t\t\t$( this ).addClass( \"ui-state-focus\" );\n\t\t\t\t} else {\n\t\t\t\t\t$( this ).blur();\n\t\t\t\t}\n\t\t\t})\n\t\t\t.blur(function() {\n\t\t\t\t$( this ).removeClass( \"ui-state-focus\" );\n\t\t\t});\n\n\t\tthis.handles.each(function( i ) {\n\t\t\t$( this ).data( \"index.ui-slider-handle\", i );\n\t\t});\n\n\t\tthis.handles\n\t\t\t.keydown(function( event ) {\n\t\t\t\tvar index = $( this ).data( \"index.ui-slider-handle\" ),\n\t\t\t\t\tallowed,\n\t\t\t\t\tcurVal,\n\t\t\t\t\tnewVal,\n\t\t\t\t\tstep;\n\t\n\t\t\t\tif ( self.options.disabled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\n\t\t\t\tswitch ( event.keyCode ) {\n\t\t\t\t\tcase $.ui.keyCode.HOME:\n\t\t\t\t\tcase $.ui.keyCode.END:\n\t\t\t\t\tcase $.ui.keyCode.PAGE_UP:\n\t\t\t\t\tcase $.ui.keyCode.PAGE_DOWN:\n\t\t\t\t\tcase $.ui.keyCode.UP:\n\t\t\t\t\tcase $.ui.keyCode.RIGHT:\n\t\t\t\t\tcase $.ui.keyCode.DOWN:\n\t\t\t\t\tcase $.ui.keyCode.LEFT:\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tif ( !self._keySliding ) {\n\t\t\t\t\t\t\tself._keySliding = true;\n\t\t\t\t\t\t\t$( this ).addClass( \"ui-state-active\" );\n\t\t\t\t\t\t\tallowed = self._start( event, index );\n\t\t\t\t\t\t\tif ( allowed === false ) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\n\t\t\t\tstep = self.options.step;\n\t\t\t\tif ( self.options.values && self.options.values.length ) {\n\t\t\t\t\tcurVal = newVal = self.values( index );\n\t\t\t\t} else {\n\t\t\t\t\tcurVal = newVal = self.value();\n\t\t\t\t}\n\t\n\t\t\t\tswitch ( event.keyCode ) {\n\t\t\t\t\tcase $.ui.keyCode.HOME:\n\t\t\t\t\t\tnewVal = self._valueMin();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase $.ui.keyCode.END:\n\t\t\t\t\t\tnewVal = self._valueMax();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase $.ui.keyCode.PAGE_UP:\n\t\t\t\t\t\tnewVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase $.ui.keyCode.PAGE_DOWN:\n\t\t\t\t\t\tnewVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase $.ui.keyCode.UP:\n\t\t\t\t\tcase $.ui.keyCode.RIGHT:\n\t\t\t\t\t\tif ( curVal === self._valueMax() ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewVal = self._trimAlignValue( curVal + step );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase $.ui.keyCode.DOWN:\n\t\t\t\t\tcase $.ui.keyCode.LEFT:\n\t\t\t\t\t\tif ( curVal === self._valueMin() ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewVal = self._trimAlignValue( curVal - step );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\n\t\t\t\tself._slide( event, index, newVal );\n\t\t\t})\n\t\t\t.keyup(function( event ) {\n\t\t\t\tvar index = $( this ).data( \"index.ui-slider-handle\" );\n\t\n\t\t\t\tif ( self._keySliding ) {\n\t\t\t\t\tself._keySliding = false;\n\t\t\t\t\tself._stop( event, index );\n\t\t\t\t\tself._change( event, index );\n\t\t\t\t\t$( this ).removeClass( \"ui-state-active\" );\n\t\t\t\t}\n\t\n\t\t\t});\n\n\t\tthis._refreshValue();\n\n\t\tthis._animateOff = false;\n\t},\n\n\tdestroy: function() {\n\t\tthis.handles.remove();\n\t\tthis.range.remove();\n\n\t\tthis.element\n\t\t\t.removeClass( \"ui-slider\" +\n\t\t\t\t\" ui-slider-horizontal\" +\n\t\t\t\t\" ui-slider-vertical\" +\n\t\t\t\t\" ui-slider-disabled\" +\n\t\t\t\t\" ui-widget\" +\n\t\t\t\t\" ui-widget-content\" +\n\t\t\t\t\" ui-corner-all\" )\n\t\t\t.removeData( \"slider\" )\n\t\t\t.unbind( \".slider\" );\n\n\t\tthis._mouseDestroy();\n\n\t\treturn this;\n\t},\n\n\t_mouseCapture: function( event ) {\n\t\tvar o = this.options,\n\t\t\tposition,\n\t\t\tnormValue,\n\t\t\tdistance,\n\t\t\tclosestHandle,\n\t\t\tself,\n\t\t\tindex,\n\t\t\tallowed,\n\t\t\toffset,\n\t\t\tmouseOverHandle;\n\n\t\tif ( o.disabled ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.elementSize = {\n\t\t\twidth: this.element.outerWidth(),\n\t\t\theight: this.element.outerHeight()\n\t\t};\n\t\tthis.elementOffset = this.element.offset();\n\n\t\tposition = { x: event.pageX, y: event.pageY };\n\t\tnormValue = this._normValueFromMouse( position );\n\t\tdistance = this._valueMax() - this._valueMin() + 1;\n\t\tself = this;\n\t\tthis.handles.each(function( i ) {\n\t\t\tvar thisDistance = Math.abs( normValue - self.values(i) );\n\t\t\tif ( distance > thisDistance ) {\n\t\t\t\tdistance = thisDistance;\n\t\t\t\tclosestHandle = $( this );\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t});\n\n\t\t// workaround for bug #3736 (if both handles of a range are at 0,\n\t\t// the first is always used as the one with least distance,\n\t\t// and moving it is obviously prevented by preventing negative ranges)\n\t\tif( o.range === true && this.values(1) === o.min ) {\n\t\t\tindex += 1;\n\t\t\tclosestHandle = $( this.handles[index] );\n\t\t}\n\n\t\tallowed = this._start( event, index );\n\t\tif ( allowed === false ) {\n\t\t\treturn false;\n\t\t}\n\t\tthis._mouseSliding = true;\n\n\t\tself._handleIndex = index;\n\n\t\tclosestHandle\n\t\t\t.addClass( \"ui-state-active\" )\n\t\t\t.focus();\n\t\t\n\t\toffset = closestHandle.offset();\n\t\tmouseOverHandle = !$( event.target ).parents().andSelf().is( \".ui-slider-handle\" );\n\t\tthis._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {\n\t\t\tleft: event.pageX - offset.left - ( closestHandle.width() / 2 ),\n\t\t\ttop: event.pageY - offset.top -\n\t\t\t\t( closestHandle.height() / 2 ) -\n\t\t\t\t( parseInt( closestHandle.css(\"borderTopWidth\"), 10 ) || 0 ) -\n\t\t\t\t( parseInt( closestHandle.css(\"borderBottomWidth\"), 10 ) || 0) +\n\t\t\t\t( parseInt( closestHandle.css(\"marginTop\"), 10 ) || 0)\n\t\t};\n\n\t\tif ( !this.handles.hasClass( \"ui-state-hover\" ) ) {\n\t\t\tthis._slide( event, index, normValue );\n\t\t}\n\t\tthis._animateOff = true;\n\t\treturn true;\n\t},\n\n\t_mouseStart: function( event ) {\n\t\treturn true;\n\t},\n\n\t_mouseDrag: function( event ) {\n\t\tvar position = { x: event.pageX, y: event.pageY },\n\t\t\tnormValue = this._normValueFromMouse( position );\n\t\t\n\t\tthis._slide( event, this._handleIndex, normValue );\n\n\t\treturn false;\n\t},\n\n\t_mouseStop: function( event ) {\n\t\tthis.handles.removeClass( \"ui-state-active\" );\n\t\tthis._mouseSliding = false;\n\n\t\tthis._stop( event, this._handleIndex );\n\t\tthis._change( event, this._handleIndex );\n\n\t\tthis._handleIndex = null;\n\t\tthis._clickOffset = null;\n\t\tthis._animateOff = false;\n\n\t\treturn false;\n\t},\n\t\n\t_detectOrientation: function() {\n\t\tthis.orientation = ( this.options.orientation === \"vertical\" ) ? \"vertical\" : \"horizontal\";\n\t},\n\n\t_normValueFromMouse: function( position ) {\n\t\tvar pixelTotal,\n\t\t\tpixelMouse,\n\t\t\tpercentMouse,\n\t\t\tvalueTotal,\n\t\t\tvalueMouse;\n\n\t\tif ( this.orientation === \"horizontal\" ) {\n\t\t\tpixelTotal = this.elementSize.width;\n\t\t\tpixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );\n\t\t} else {\n\t\t\tpixelTotal = this.elementSize.height;\n\t\t\tpixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );\n\t\t}\n\n\t\tpercentMouse = ( pixelMouse / pixelTotal );\n\t\tif ( percentMouse > 1 ) {\n\t\t\tpercentMouse = 1;\n\t\t}\n\t\tif ( percentMouse < 0 ) {\n\t\t\tpercentMouse = 0;\n\t\t}\n\t\tif ( this.orientation === \"vertical\" ) {\n\t\t\tpercentMouse = 1 - percentMouse;\n\t\t}\n\n\t\tvalueTotal = this._valueMax() - this._valueMin();\n\t\tvalueMouse = this._valueMin() + percentMouse * valueTotal;\n\n\t\treturn this._trimAlignValue( valueMouse );\n\t},\n\n\t_start: function( event, index ) {\n\t\tvar uiHash = {\n\t\t\thandle: this.handles[ index ],\n\t\t\tvalue: this.value()\n\t\t};\n\t\tif ( this.options.values && this.options.values.length ) {\n\t\t\tuiHash.value = this.values( index );\n\t\t\tuiHash.values = this.values();\n\t\t}\n\t\treturn this._trigger( \"start\", event, uiHash );\n\t},\n\n\t_slide: function( event, index, newVal ) {\n\t\tvar otherVal,\n\t\t\tnewValues,\n\t\t\tallowed;\n\n\t\tif ( this.options.values && this.options.values.length ) {\n\t\t\totherVal = this.values( index ? 0 : 1 );\n\n\t\t\tif ( ( this.options.values.length === 2 && this.options.range === true ) && \n\t\t\t\t\t( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )\n\t\t\t\t) {\n\t\t\t\tnewVal = otherVal;\n\t\t\t}\n\n\t\t\tif ( newVal !== this.values( index ) ) {\n\t\t\t\tnewValues = this.values();\n\t\t\t\tnewValues[ index ] = newVal;\n\t\t\t\t// A slide can be canceled by returning false from the slide callback\n\t\t\t\tallowed = this._trigger( \"slide\", event, {\n\t\t\t\t\thandle: this.handles[ index ],\n\t\t\t\t\tvalue: newVal,\n\t\t\t\t\tvalues: newValues\n\t\t\t\t} );\n\t\t\t\totherVal = this.values( index ? 0 : 1 );\n\t\t\t\tif ( allowed !== false ) {\n\t\t\t\t\tthis.values( index, newVal, true );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif ( newVal !== this.value() ) {\n\t\t\t\t// A slide can be canceled by returning false from the slide callback\n\t\t\t\tallowed = this._trigger( \"slide\", event, {\n\t\t\t\t\thandle: this.handles[ index ],\n\t\t\t\t\tvalue: newVal\n\t\t\t\t} );\n\t\t\t\tif ( allowed !== false ) {\n\t\t\t\t\tthis.value( newVal );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t_stop: function( event, index ) {\n\t\tvar uiHash = {\n\t\t\thandle: this.handles[ index ],\n\t\t\tvalue: this.value()\n\t\t};\n\t\tif ( this.options.values && this.options.values.length ) {\n\t\t\tuiHash.value = this.values( index );\n\t\t\tuiHash.values = this.values();\n\t\t}\n\n\t\tthis._trigger( \"stop\", event, uiHash );\n\t},\n\n\t_change: function( event, index ) {\n\t\tif ( !this._keySliding && !this._mouseSliding ) {\n\t\t\tvar uiHash = {\n\t\t\t\thandle: this.handles[ index ],\n\t\t\t\tvalue: this.value()\n\t\t\t};\n\t\t\tif ( this.options.values && this.options.values.length ) {\n\t\t\t\tuiHash.value = this.values( index );\n\t\t\t\tuiHash.values = this.values();\n\t\t\t}\n\n\t\t\tthis._trigger( \"change\", event, uiHash );\n\t\t}\n\t},\n\n\tvalue: function( newValue ) {\n\t\tif ( arguments.length ) {\n\t\t\tthis.options.value = this._trimAlignValue( newValue );\n\t\t\tthis._refreshValue();\n\t\t\tthis._change( null, 0 );\n\t\t\treturn;\n\t\t}\n\n\t\treturn this._value();\n\t},\n\n\tvalues: function( index, newValue ) {\n\t\tvar vals,\n\t\t\tnewValues,\n\t\t\ti;\n\n\t\tif ( arguments.length > 1 ) {\n\t\t\tthis.options.values[ index ] = this._trimAlignValue( newValue );\n\t\t\tthis._refreshValue();\n\t\t\tthis._change( null, index );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( arguments.length ) {\n\t\t\tif ( $.isArray( arguments[ 0 ] ) ) {\n\t\t\t\tvals = this.options.values;\n\t\t\t\tnewValues = arguments[ 0 ];\n\t\t\t\tfor ( i = 0; i < vals.length; i += 1 ) {\n\t\t\t\t\tvals[ i ] = this._trimAlignValue( newValues[ i ] );\n\t\t\t\t\tthis._change( null, i );\n\t\t\t\t}\n\t\t\t\tthis._refreshValue();\n\t\t\t} else {\n\t\t\t\tif ( this.options.values && this.options.values.length ) {\n\t\t\t\t\treturn this._values( index );\n\t\t\t\t} else {\n\t\t\t\t\treturn this.value();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn this._values();\n\t\t}\n\t},\n\n\t_setOption: function( key, value ) {\n\t\tvar i,\n\t\t\tvalsLength = 0;\n\n\t\tif ( $.isArray( this.options.values ) ) {\n\t\t\tvalsLength = this.options.values.length;\n\t\t}\n\n\t\t$.Widget.prototype._setOption.apply( this, arguments );\n\n\t\tswitch ( key ) {\n\t\t\tcase \"disabled\":\n\t\t\t\tif ( value ) {\n\t\t\t\t\tthis.handles.filter( \".ui-state-focus\" ).blur();\n\t\t\t\t\tthis.handles.removeClass( \"ui-state-hover\" );\n\t\t\t\t\tthis.handles.propAttr( \"disabled\", true );\n\t\t\t\t\tthis.element.addClass( \"ui-disabled\" );\n\t\t\t\t} else {\n\t\t\t\t\tthis.handles.propAttr( \"disabled\", false );\n\t\t\t\t\tthis.element.removeClass( \"ui-disabled\" );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"orientation\":\n\t\t\t\tthis._detectOrientation();\n\t\t\t\tthis.element\n\t\t\t\t\t.removeClass( \"ui-slider-horizontal ui-slider-vertical\" )\n\t\t\t\t\t.addClass( \"ui-slider-\" + this.orientation );\n\t\t\t\tthis._refreshValue();\n\t\t\t\tbreak;\n\t\t\tcase \"value\":\n\t\t\t\tthis._animateOff = true;\n\t\t\t\tthis._refreshValue();\n\t\t\t\tthis._change( null, 0 );\n\t\t\t\tthis._animateOff = false;\n\t\t\t\tbreak;\n\t\t\tcase \"values\":\n\t\t\t\tthis._animateOff = true;\n\t\t\t\tthis._refreshValue();\n\t\t\t\tfor ( i = 0; i < valsLength; i += 1 ) {\n\t\t\t\t\tthis._change( null, i );\n\t\t\t\t}\n\t\t\t\tthis._animateOff = false;\n\t\t\t\tbreak;\n\t\t}\n\t},\n\n\t//internal value getter\n\t// _value() returns value trimmed by min and max, aligned by step\n\t_value: function() {\n\t\tvar val = this.options.value;\n\t\tval = this._trimAlignValue( val );\n\n\t\treturn val;\n\t},\n\n\t//internal values getter\n\t// _values() returns array of values trimmed by min and max, aligned by step\n\t// _values( index ) returns single value trimmed by min and max, aligned by step\n\t_values: function( index ) {\n\t\tvar val,\n\t\t\tvals,\n\t\t\ti;\n\n\t\tif ( arguments.length ) {\n\t\t\tval = this.options.values[ index ];\n\t\t\tval = this._trimAlignValue( val );\n\n\t\t\treturn val;\n\t\t} else {\n\t\t\t// .slice() creates a copy of the array\n\t\t\t// this copy gets trimmed by min and max and then returned\n\t\t\tvals = this.options.values.slice();\n\t\t\tfor ( i = 0; i < vals.length; i+= 1) {\n\t\t\t\tvals[ i ] = this._trimAlignValue( vals[ i ] );\n\t\t\t}\n\n\t\t\treturn vals;\n\t\t}\n\t},\n\t\n\t// returns the step-aligned value that val is closest to, between (inclusive) min and max\n\t_trimAlignValue: function( val ) {\n\t\tif ( val <= this._valueMin() ) {\n\t\t\treturn this._valueMin();\n\t\t}\n\t\tif ( val >= this._valueMax() ) {\n\t\t\treturn this._valueMax();\n\t\t}\n\t\tvar step = ( this.options.step > 0 ) ? this.options.step : 1,\n\t\t\tvalModStep = (val - this._valueMin()) % step,\n\t\t\talignValue = val - valModStep;\n\n\t\tif ( Math.abs(valModStep) * 2 >= step ) {\n\t\t\talignValue += ( valModStep > 0 ) ? step : ( -step );\n\t\t}\n\n\t\t// Since JavaScript has problems with large floats, round\n\t\t// the final value to 5 digits after the decimal point (see #4124)\n\t\treturn parseFloat( alignValue.toFixed(5) );\n\t},\n\n\t_valueMin: function() {\n\t\treturn this.options.min;\n\t},\n\n\t_valueMax: function() {\n\t\treturn this.options.max;\n\t},\n\t\n\t_refreshValue: function() {\n\t\tvar oRange = this.options.range,\n\t\t\to = this.options,\n\t\t\tself = this,\n\t\t\tanimate = ( !this._animateOff ) ? o.animate : false,\n\t\t\tvalPercent,\n\t\t\t_set = {},\n\t\t\tlastValPercent,\n\t\t\tvalue,\n\t\t\tvalueMin,\n\t\t\tvalueMax;\n\n\t\tif ( this.options.values && this.options.values.length ) {\n\t\t\tthis.handles.each(function( i, j ) {\n\t\t\t\tvalPercent = ( self.values(i) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100;\n\t\t\t\t_set[ self.orientation === \"horizontal\" ? \"left\" : \"bottom\" ] = valPercent + \"%\";\n\t\t\t\t$( this ).stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( _set, o.animate );\n\t\t\t\tif ( self.options.range === true ) {\n\t\t\t\t\tif ( self.orientation === \"horizontal\" ) {\n\t\t\t\t\t\tif ( i === 0 ) {\n\t\t\t\t\t\t\tself.range.stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( { left: valPercent + \"%\" }, o.animate );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( i === 1 ) {\n\t\t\t\t\t\t\tself.range[ animate ? \"animate\" : \"css\" ]( { width: ( valPercent - lastValPercent ) + \"%\" }, { queue: false, duration: o.animate } );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( i === 0 ) {\n\t\t\t\t\t\t\tself.range.stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( { bottom: ( valPercent ) + \"%\" }, o.animate );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( i === 1 ) {\n\t\t\t\t\t\t\tself.range[ animate ? \"animate\" : \"css\" ]( { height: ( valPercent - lastValPercent ) + \"%\" }, { queue: false, duration: o.animate } );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlastValPercent = valPercent;\n\t\t\t});\n\t\t} else {\n\t\t\tvalue = this.value();\n\t\t\tvalueMin = this._valueMin();\n\t\t\tvalueMax = this._valueMax();\n\t\t\tvalPercent = ( valueMax !== valueMin ) ?\n\t\t\t\t\t( value - valueMin ) / ( valueMax - valueMin ) * 100 :\n\t\t\t\t\t0;\n\t\t\t_set[ self.orientation === \"horizontal\" ? \"left\" : \"bottom\" ] = valPercent + \"%\";\n\t\t\tthis.handle.stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( _set, o.animate );\n\n\t\t\tif ( oRange === \"min\" && this.orientation === \"horizontal\" ) {\n\t\t\t\tthis.range.stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( { width: valPercent + \"%\" }, o.animate );\n\t\t\t}\n\t\t\tif ( oRange === \"max\" && this.orientation === \"horizontal\" ) {\n\t\t\t\tthis.range[ animate ? \"animate\" : \"css\" ]( { width: ( 100 - valPercent ) + \"%\" }, { queue: false, duration: o.animate } );\n\t\t\t}\n\t\t\tif ( oRange === \"min\" && this.orientation === \"vertical\" ) {\n\t\t\t\tthis.range.stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( { height: valPercent + \"%\" }, o.animate );\n\t\t\t}\n\t\t\tif ( oRange === \"max\" && this.orientation === \"vertical\" ) {\n\t\t\t\tthis.range[ animate ? \"animate\" : \"css\" ]( { height: ( 100 - valPercent ) + \"%\" }, { queue: false, duration: o.animate } );\n\t\t\t}\n\t\t}\n\t}\n\n});\n\n$.extend( $.ui.slider, {\n\tversion: \"1.8.22\"\n});\n\n}(jQuery));\n\n(function( $, undefined ) {\n\nvar tabId = 0,\n\tlistId = 0;\n\nfunction getNextTabId() {\n\treturn ++tabId;\n}\n\nfunction getNextListId() {\n\treturn ++listId;\n}\n\n$.widget( \"ui.tabs\", {\n\toptions: {\n\t\tadd: null,\n\t\tajaxOptions: null,\n\t\tcache: false,\n\t\tcookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }\n\t\tcollapsible: false,\n\t\tdisable: null,\n\t\tdisabled: [],\n\t\tenable: null,\n\t\tevent: \"click\",\n\t\tfx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }\n\t\tidPrefix: \"ui-tabs-\",\n\t\tload: null,\n\t\tpanelTemplate: \"<div></div>\",\n\t\tremove: null,\n\t\tselect: null,\n\t\tshow: null,\n\t\tspinner: \"<em>Loading&#8230;</em>\",\n\t\ttabTemplate: \"<li><a href='#{href}'><span>#{label}</span></a></li>\"\n\t},\n\n\t_create: function() {\n\t\tthis._tabify( true );\n\t},\n\n\t_setOption: function( key, value ) {\n\t\tif ( key == \"selected\" ) {\n\t\t\tif (this.options.collapsible && value == this.options.selected ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.select( value );\n\t\t} else {\n\t\t\tthis.options[ key ] = value;\n\t\t\tthis._tabify();\n\t\t}\n\t},\n\n\t_tabId: function( a ) {\n\t\treturn a.title && a.title.replace( /\\s/g, \"_\" ).replace( /[^\\w\\u00c0-\\uFFFF-]/g, \"\" ) ||\n\t\t\tthis.options.idPrefix + getNextTabId();\n\t},\n\n\t_sanitizeSelector: function( hash ) {\n\t\t// we need this because an id may contain a \":\"\n\t\treturn hash.replace( /:/g, \"\\\\:\" );\n\t},\n\n\t_cookie: function() {\n\t\tvar cookie = this.cookie ||\n\t\t\t( this.cookie = this.options.cookie.name || \"ui-tabs-\" + getNextListId() );\n\t\treturn $.cookie.apply( null, [ cookie ].concat( $.makeArray( arguments ) ) );\n\t},\n\n\t_ui: function( tab, panel ) {\n\t\treturn {\n\t\t\ttab: tab,\n\t\t\tpanel: panel,\n\t\t\tindex: this.anchors.index( tab )\n\t\t};\n\t},\n\n\t_cleanup: function() {\n\t\t// restore all former loading tabs labels\n\t\tthis.lis.filter( \".ui-state-processing\" )\n\t\t\t.removeClass( \"ui-state-processing\" )\n\t\t\t.find( \"span:data(label.tabs)\" )\n\t\t\t\t.each(function() {\n\t\t\t\t\tvar el = $( this );\n\t\t\t\t\tel.html( el.data( \"label.tabs\" ) ).removeData( \"label.tabs\" );\n\t\t\t\t});\n\t},\n\n\t_tabify: function( init ) {\n\t\tvar self = this,\n\t\t\to = this.options,\n\t\t\tfragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash\n\n\t\tthis.list = this.element.find( \"ol,ul\" ).eq( 0 );\n\t\tthis.lis = $( \" > li:has(a[href])\", this.list );\n\t\tthis.anchors = this.lis.map(function() {\n\t\t\treturn $( \"a\", this )[ 0 ];\n\t\t});\n\t\tthis.panels = $( [] );\n\n\t\tthis.anchors.each(function( i, a ) {\n\t\t\tvar href = $( a ).attr( \"href\" );\n\t\t\t// For dynamically created HTML that contains a hash as href IE < 8 expands\n\t\t\t// such href to the full page url with hash and then misinterprets tab as ajax.\n\t\t\t// Same consideration applies for an added tab with a fragment identifier\n\t\t\t// since a[href=#fragment-identifier] does unexpectedly not match.\n\t\t\t// Thus normalize href attribute...\n\t\t\tvar hrefBase = href.split( \"#\" )[ 0 ],\n\t\t\t\tbaseEl;\n\t\t\tif ( hrefBase && ( hrefBase === location.toString().split( \"#\" )[ 0 ] ||\n\t\t\t\t\t( baseEl = $( \"base\" )[ 0 ]) && hrefBase === baseEl.href ) ) {\n\t\t\t\thref = a.hash;\n\t\t\t\ta.href = href;\n\t\t\t}\n\n\t\t\t// inline tab\n\t\t\tif ( fragmentId.test( href ) ) {\n\t\t\t\tself.panels = self.panels.add( self.element.find( self._sanitizeSelector( href ) ) );\n\t\t\t// remote tab\n\t\t\t// prevent loading the page itself if href is just \"#\"\n\t\t\t} else if ( href && href !== \"#\" ) {\n\t\t\t\t// required for restore on destroy\n\t\t\t\t$.data( a, \"href.tabs\", href );\n\n\t\t\t\t// TODO until #3808 is fixed strip fragment identifier from url\n\t\t\t\t// (IE fails to load from such url)\n\t\t\t\t$.data( a, \"load.tabs\", href.replace( /#.*$/, \"\" ) );\n\n\t\t\t\tvar id = self._tabId( a );\n\t\t\t\ta.href = \"#\" + id;\n\t\t\t\tvar $panel = self.element.find( \"#\" + id );\n\t\t\t\tif ( !$panel.length ) {\n\t\t\t\t\t$panel = $( o.panelTemplate )\n\t\t\t\t\t\t.attr( \"id\", id )\n\t\t\t\t\t\t.addClass( \"ui-tabs-panel ui-widget-content ui-corner-bottom\" )\n\t\t\t\t\t\t.insertAfter( self.panels[ i - 1 ] || self.list );\n\t\t\t\t\t$panel.data( \"destroy.tabs\", true );\n\t\t\t\t}\n\t\t\t\tself.panels = self.panels.add( $panel );\n\t\t\t// invalid tab href\n\t\t\t} else {\n\t\t\t\to.disabled.push( i );\n\t\t\t}\n\t\t});\n\n\t\t// initialization from scratch\n\t\tif ( init ) {\n\t\t\t// attach necessary classes for styling\n\t\t\tthis.element.addClass( \"ui-tabs ui-widget ui-widget-content ui-corner-all\" );\n\t\t\tthis.list.addClass( \"ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all\" );\n\t\t\tthis.lis.addClass( \"ui-state-default ui-corner-top\" );\n\t\t\tthis.panels.addClass( \"ui-tabs-panel ui-widget-content ui-corner-bottom\" );\n\n\t\t\t// Selected tab\n\t\t\t// use \"selected\" option or try to retrieve:\n\t\t\t// 1. from fragment identifier in url\n\t\t\t// 2. from cookie\n\t\t\t// 3. from selected class attribute on <li>\n\t\t\tif ( o.selected === undefined ) {\n\t\t\t\tif ( location.hash ) {\n\t\t\t\t\tthis.anchors.each(function( i, a ) {\n\t\t\t\t\t\tif ( a.hash == location.hash ) {\n\t\t\t\t\t\t\to.selected = i;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif ( typeof o.selected !== \"number\" && o.cookie ) {\n\t\t\t\t\to.selected = parseInt( self._cookie(), 10 );\n\t\t\t\t}\n\t\t\t\tif ( typeof o.selected !== \"number\" && this.lis.filter( \".ui-tabs-selected\" ).length ) {\n\t\t\t\t\to.selected = this.lis.index( this.lis.filter( \".ui-tabs-selected\" ) );\n\t\t\t\t}\n\t\t\t\to.selected = o.selected || ( this.lis.length ? 0 : -1 );\n\t\t\t} else if ( o.selected === null ) { // usage of null is deprecated, TODO remove in next release\n\t\t\t\to.selected = -1;\n\t\t\t}\n\n\t\t\t// sanity check - default to first tab...\n\t\t\to.selected = ( ( o.selected >= 0 && this.anchors[ o.selected ] ) || o.selected < 0 )\n\t\t\t\t? o.selected\n\t\t\t\t: 0;\n\n\t\t\t// Take disabling tabs via class attribute from HTML\n\t\t\t// into account and update option properly.\n\t\t\t// A selected tab cannot become disabled.\n\t\t\to.disabled = $.unique( o.disabled.concat(\n\t\t\t\t$.map( this.lis.filter( \".ui-state-disabled\" ), function( n, i ) {\n\t\t\t\t\treturn self.lis.index( n );\n\t\t\t\t})\n\t\t\t) ).sort();\n\n\t\t\tif ( $.inArray( o.selected, o.disabled ) != -1 ) {\n\t\t\t\to.disabled.splice( $.inArray( o.selected, o.disabled ), 1 );\n\t\t\t}\n\n\t\t\t// highlight selected tab\n\t\t\tthis.panels.addClass( \"ui-tabs-hide\" );\n\t\t\tthis.lis.removeClass( \"ui-tabs-selected ui-state-active\" );\n\t\t\t// check for length avoids error when initializing empty list\n\t\t\tif ( o.selected >= 0 && this.anchors.length ) {\n\t\t\t\tself.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) ).removeClass( \"ui-tabs-hide\" );\n\t\t\t\tthis.lis.eq( o.selected ).addClass( \"ui-tabs-selected ui-state-active\" );\n\n\t\t\t\t// seems to be expected behavior that the show callback is fired\n\t\t\t\tself.element.queue( \"tabs\", function() {\n\t\t\t\t\tself._trigger( \"show\", null,\n\t\t\t\t\t\tself._ui( self.anchors[ o.selected ], self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) )[ 0 ] ) );\n\t\t\t\t});\n\n\t\t\t\tthis.load( o.selected );\n\t\t\t}\n\n\t\t\t// clean up to avoid memory leaks in certain versions of IE 6\n\t\t\t// TODO: namespace this event\n\t\t\t$( window ).bind( \"unload\", function() {\n\t\t\t\tself.lis.add( self.anchors ).unbind( \".tabs\" );\n\t\t\t\tself.lis = self.anchors = self.panels = null;\n\t\t\t});\n\t\t// update selected after add/remove\n\t\t} else {\n\t\t\to.selected = this.lis.index( this.lis.filter( \".ui-tabs-selected\" ) );\n\t\t}\n\n\t\t// update collapsible\n\t\t// TODO: use .toggleClass()\n\t\tthis.element[ o.collapsible ? \"addClass\" : \"removeClass\" ]( \"ui-tabs-collapsible\" );\n\n\t\t// set or update cookie after init and add/remove respectively\n\t\tif ( o.cookie ) {\n\t\t\tthis._cookie( o.selected, o.cookie );\n\t\t}\n\n\t\t// disable tabs\n\t\tfor ( var i = 0, li; ( li = this.lis[ i ] ); i++ ) {\n\t\t\t$( li )[ $.inArray( i, o.disabled ) != -1 &&\n\t\t\t\t// TODO: use .toggleClass()\n\t\t\t\t!$( li ).hasClass( \"ui-tabs-selected\" ) ? \"addClass\" : \"removeClass\" ]( \"ui-state-disabled\" );\n\t\t}\n\n\t\t// reset cache if switching from cached to not cached\n\t\tif ( o.cache === false ) {\n\t\t\tthis.anchors.removeData( \"cache.tabs\" );\n\t\t}\n\n\t\t// remove all handlers before, tabify may run on existing tabs after add or option change\n\t\tthis.lis.add( this.anchors ).unbind( \".tabs\" );\n\n\t\tif ( o.event !== \"mouseover\" ) {\n\t\t\tvar addState = function( state, el ) {\n\t\t\t\tif ( el.is( \":not(.ui-state-disabled)\" ) ) {\n\t\t\t\t\tel.addClass( \"ui-state-\" + state );\n\t\t\t\t}\n\t\t\t};\n\t\t\tvar removeState = function( state, el ) {\n\t\t\t\tel.removeClass( \"ui-state-\" + state );\n\t\t\t};\n\t\t\tthis.lis.bind( \"mouseover.tabs\" , function() {\n\t\t\t\taddState( \"hover\", $( this ) );\n\t\t\t});\n\t\t\tthis.lis.bind( \"mouseout.tabs\", function() {\n\t\t\t\tremoveState( \"hover\", $( this ) );\n\t\t\t});\n\t\t\tthis.anchors.bind( \"focus.tabs\", function() {\n\t\t\t\taddState( \"focus\", $( this ).closest( \"li\" ) );\n\t\t\t});\n\t\t\tthis.anchors.bind( \"blur.tabs\", function() {\n\t\t\t\tremoveState( \"focus\", $( this ).closest( \"li\" ) );\n\t\t\t});\n\t\t}\n\n\t\t// set up animations\n\t\tvar hideFx, showFx;\n\t\tif ( o.fx ) {\n\t\t\tif ( $.isArray( o.fx ) ) {\n\t\t\t\thideFx = o.fx[ 0 ];\n\t\t\t\tshowFx = o.fx[ 1 ];\n\t\t\t} else {\n\t\t\t\thideFx = showFx = o.fx;\n\t\t\t}\n\t\t}\n\n\t\t// Reset certain styles left over from animation\n\t\t// and prevent IE's ClearType bug...\n\t\tfunction resetStyle( $el, fx ) {\n\t\t\t$el.css( \"display\", \"\" );\n\t\t\tif ( !$.support.opacity && fx.opacity ) {\n\t\t\t\t$el[ 0 ].style.removeAttribute( \"filter\" );\n\t\t\t}\n\t\t}\n\n\t\t// Show a tab...\n\t\tvar showTab = showFx\n\t\t\t? function( clicked, $show ) {\n\t\t\t\t$( clicked ).closest( \"li\" ).addClass( \"ui-tabs-selected ui-state-active\" );\n\t\t\t\t$show.hide().removeClass( \"ui-tabs-hide\" ) // avoid flicker that way\n\t\t\t\t\t.animate( showFx, showFx.duration || \"normal\", function() {\n\t\t\t\t\t\tresetStyle( $show, showFx );\n\t\t\t\t\t\tself._trigger( \"show\", null, self._ui( clicked, $show[ 0 ] ) );\n\t\t\t\t\t});\n\t\t\t}\n\t\t\t: function( clicked, $show ) {\n\t\t\t\t$( clicked ).closest( \"li\" ).addClass( \"ui-tabs-selected ui-state-active\" );\n\t\t\t\t$show.removeClass( \"ui-tabs-hide\" );\n\t\t\t\tself._trigger( \"show\", null, self._ui( clicked, $show[ 0 ] ) );\n\t\t\t};\n\n\t\t// Hide a tab, $show is optional...\n\t\tvar hideTab = hideFx\n\t\t\t? function( clicked, $hide ) {\n\t\t\t\t$hide.animate( hideFx, hideFx.duration || \"normal\", function() {\n\t\t\t\t\tself.lis.removeClass( \"ui-tabs-selected ui-state-active\" );\n\t\t\t\t\t$hide.addClass( \"ui-tabs-hide\" );\n\t\t\t\t\tresetStyle( $hide, hideFx );\n\t\t\t\t\tself.element.dequeue( \"tabs\" );\n\t\t\t\t});\n\t\t\t}\n\t\t\t: function( clicked, $hide, $show ) {\n\t\t\t\tself.lis.removeClass( \"ui-tabs-selected ui-state-active\" );\n\t\t\t\t$hide.addClass( \"ui-tabs-hide\" );\n\t\t\t\tself.element.dequeue( \"tabs\" );\n\t\t\t};\n\n\t\t// attach tab event handler, unbind to avoid duplicates from former tabifying...\n\t\tthis.anchors.bind( o.event + \".tabs\", function() {\n\t\t\tvar el = this,\n\t\t\t\t$li = $(el).closest( \"li\" ),\n\t\t\t\t$hide = self.panels.filter( \":not(.ui-tabs-hide)\" ),\n\t\t\t\t$show = self.element.find( self._sanitizeSelector( el.hash ) );\n\n\t\t\t// If tab is already selected and not collapsible or tab disabled or\n\t\t\t// or is already loading or click callback returns false stop here.\n\t\t\t// Check if click handler returns false last so that it is not executed\n\t\t\t// for a disabled or loading tab!\n\t\t\tif ( ( $li.hasClass( \"ui-tabs-selected\" ) && !o.collapsible) ||\n\t\t\t\t$li.hasClass( \"ui-state-disabled\" ) ||\n\t\t\t\t$li.hasClass( \"ui-state-processing\" ) ||\n\t\t\t\tself.panels.filter( \":animated\" ).length ||\n\t\t\t\tself._trigger( \"select\", null, self._ui( this, $show[ 0 ] ) ) === false ) {\n\t\t\t\tthis.blur();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\to.selected = self.anchors.index( this );\n\n\t\t\tself.abort();\n\n\t\t\t// if tab may be closed\n\t\t\tif ( o.collapsible ) {\n\t\t\t\tif ( $li.hasClass( \"ui-tabs-selected\" ) ) {\n\t\t\t\t\to.selected = -1;\n\n\t\t\t\t\tif ( o.cookie ) {\n\t\t\t\t\t\tself._cookie( o.selected, o.cookie );\n\t\t\t\t\t}\n\n\t\t\t\t\tself.element.queue( \"tabs\", function() {\n\t\t\t\t\t\thideTab( el, $hide );\n\t\t\t\t\t}).dequeue( \"tabs\" );\n\n\t\t\t\t\tthis.blur();\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( !$hide.length ) {\n\t\t\t\t\tif ( o.cookie ) {\n\t\t\t\t\t\tself._cookie( o.selected, o.cookie );\n\t\t\t\t\t}\n\n\t\t\t\t\tself.element.queue( \"tabs\", function() {\n\t\t\t\t\t\tshowTab( el, $show );\n\t\t\t\t\t});\n\n\t\t\t\t\t// TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171\n\t\t\t\t\tself.load( self.anchors.index( this ) );\n\n\t\t\t\t\tthis.blur();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( o.cookie ) {\n\t\t\t\tself._cookie( o.selected, o.cookie );\n\t\t\t}\n\n\t\t\t// show new tab\n\t\t\tif ( $show.length ) {\n\t\t\t\tif ( $hide.length ) {\n\t\t\t\t\tself.element.queue( \"tabs\", function() {\n\t\t\t\t\t\thideTab( el, $hide );\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tself.element.queue( \"tabs\", function() {\n\t\t\t\t\tshowTab( el, $show );\n\t\t\t\t});\n\n\t\t\t\tself.load( self.anchors.index( this ) );\n\t\t\t} else {\n\t\t\t\tthrow \"jQuery UI Tabs: Mismatching fragment identifier.\";\n\t\t\t}\n\n\t\t\t// Prevent IE from keeping other link focussed when using the back button\n\t\t\t// and remove dotted border from clicked link. This is controlled via CSS\n\t\t\t// in modern browsers; blur() removes focus from address bar in Firefox\n\t\t\t// which can become a usability and annoying problem with tabs('rotate').\n\t\t\tif ( $.browser.msie ) {\n\t\t\t\tthis.blur();\n\t\t\t}\n\t\t});\n\n\t\t// disable click in any case\n\t\tthis.anchors.bind( \"click.tabs\", function(){\n\t\t\treturn false;\n\t\t});\n\t},\n\n    _getIndex: function( index ) {\n\t\t// meta-function to give users option to provide a href string instead of a numerical index.\n\t\t// also sanitizes numerical indexes to valid values.\n\t\tif ( typeof index == \"string\" ) {\n\t\t\tindex = this.anchors.index( this.anchors.filter( \"[href$='\" + index + \"']\" ) );\n\t\t}\n\n\t\treturn index;\n\t},\n\n\tdestroy: function() {\n\t\tvar o = this.options;\n\n\t\tthis.abort();\n\n\t\tthis.element\n\t\t\t.unbind( \".tabs\" )\n\t\t\t.removeClass( \"ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible\" )\n\t\t\t.removeData( \"tabs\" );\n\n\t\tthis.list.removeClass( \"ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all\" );\n\n\t\tthis.anchors.each(function() {\n\t\t\tvar href = $.data( this, \"href.tabs\" );\n\t\t\tif ( href ) {\n\t\t\t\tthis.href = href;\n\t\t\t}\n\t\t\tvar $this = $( this ).unbind( \".tabs\" );\n\t\t\t$.each( [ \"href\", \"load\", \"cache\" ], function( i, prefix ) {\n\t\t\t\t$this.removeData( prefix + \".tabs\" );\n\t\t\t});\n\t\t});\n\n\t\tthis.lis.unbind( \".tabs\" ).add( this.panels ).each(function() {\n\t\t\tif ( $.data( this, \"destroy.tabs\" ) ) {\n\t\t\t\t$( this ).remove();\n\t\t\t} else {\n\t\t\t\t$( this ).removeClass([\n\t\t\t\t\t\"ui-state-default\",\n\t\t\t\t\t\"ui-corner-top\",\n\t\t\t\t\t\"ui-tabs-selected\",\n\t\t\t\t\t\"ui-state-active\",\n\t\t\t\t\t\"ui-state-hover\",\n\t\t\t\t\t\"ui-state-focus\",\n\t\t\t\t\t\"ui-state-disabled\",\n\t\t\t\t\t\"ui-tabs-panel\",\n\t\t\t\t\t\"ui-widget-content\",\n\t\t\t\t\t\"ui-corner-bottom\",\n\t\t\t\t\t\"ui-tabs-hide\"\n\t\t\t\t].join( \" \" ) );\n\t\t\t}\n\t\t});\n\n\t\tif ( o.cookie ) {\n\t\t\tthis._cookie( null, o.cookie );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tadd: function( url, label, index ) {\n\t\tif ( index === undefined ) {\n\t\t\tindex = this.anchors.length;\n\t\t}\n\n\t\tvar self = this,\n\t\t\to = this.options,\n\t\t\t$li = $( o.tabTemplate.replace( /#\\{href\\}/g, url ).replace( /#\\{label\\}/g, label ) ),\n\t\t\tid = !url.indexOf( \"#\" ) ? url.replace( \"#\", \"\" ) : this._tabId( $( \"a\", $li )[ 0 ] );\n\n\t\t$li.addClass( \"ui-state-default ui-corner-top\" ).data( \"destroy.tabs\", true );\n\n\t\t// try to find an existing element before creating a new one\n\t\tvar $panel = self.element.find( \"#\" + id );\n\t\tif ( !$panel.length ) {\n\t\t\t$panel = $( o.panelTemplate )\n\t\t\t\t.attr( \"id\", id )\n\t\t\t\t.data( \"destroy.tabs\", true );\n\t\t}\n\t\t$panel.addClass( \"ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide\" );\n\n\t\tif ( index >= this.lis.length ) {\n\t\t\t$li.appendTo( this.list );\n\t\t\t$panel.appendTo( this.list[ 0 ].parentNode );\n\t\t} else {\n\t\t\t$li.insertBefore( this.lis[ index ] );\n\t\t\t$panel.insertBefore( this.panels[ index ] );\n\t\t}\n\n\t\to.disabled = $.map( o.disabled, function( n, i ) {\n\t\t\treturn n >= index ? ++n : n;\n\t\t});\n\n\t\tthis._tabify();\n\n\t\tif ( this.anchors.length == 1 ) {\n\t\t\to.selected = 0;\n\t\t\t$li.addClass( \"ui-tabs-selected ui-state-active\" );\n\t\t\t$panel.removeClass( \"ui-tabs-hide\" );\n\t\t\tthis.element.queue( \"tabs\", function() {\n\t\t\t\tself._trigger( \"show\", null, self._ui( self.anchors[ 0 ], self.panels[ 0 ] ) );\n\t\t\t});\n\n\t\t\tthis.load( 0 );\n\t\t}\n\n\t\tthis._trigger( \"add\", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );\n\t\treturn this;\n\t},\n\n\tremove: function( index ) {\n\t\tindex = this._getIndex( index );\n\t\tvar o = this.options,\n\t\t\t$li = this.lis.eq( index ).remove(),\n\t\t\t$panel = this.panels.eq( index ).remove();\n\n\t\t// If selected tab was removed focus tab to the right or\n\t\t// in case the last tab was removed the tab to the left.\n\t\tif ( $li.hasClass( \"ui-tabs-selected\" ) && this.anchors.length > 1) {\n\t\t\tthis.select( index + ( index + 1 < this.anchors.length ? 1 : -1 ) );\n\t\t}\n\n\t\to.disabled = $.map(\n\t\t\t$.grep( o.disabled, function(n, i) {\n\t\t\t\treturn n != index;\n\t\t\t}),\n\t\t\tfunction( n, i ) {\n\t\t\t\treturn n >= index ? --n : n;\n\t\t\t});\n\n\t\tthis._tabify();\n\n\t\tthis._trigger( \"remove\", null, this._ui( $li.find( \"a\" )[ 0 ], $panel[ 0 ] ) );\n\t\treturn this;\n\t},\n\n\tenable: function( index ) {\n\t\tindex = this._getIndex( index );\n\t\tvar o = this.options;\n\t\tif ( $.inArray( index, o.disabled ) == -1 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.lis.eq( index ).removeClass( \"ui-state-disabled\" );\n\t\to.disabled = $.grep( o.disabled, function( n, i ) {\n\t\t\treturn n != index;\n\t\t});\n\n\t\tthis._trigger( \"enable\", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );\n\t\treturn this;\n\t},\n\n\tdisable: function( index ) {\n\t\tindex = this._getIndex( index );\n\t\tvar self = this, o = this.options;\n\t\t// cannot disable already selected tab\n\t\tif ( index != o.selected ) {\n\t\t\tthis.lis.eq( index ).addClass( \"ui-state-disabled\" );\n\n\t\t\to.disabled.push( index );\n\t\t\to.disabled.sort();\n\n\t\t\tthis._trigger( \"disable\", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tselect: function( index ) {\n\t\tindex = this._getIndex( index );\n\t\tif ( index == -1 ) {\n\t\t\tif ( this.options.collapsible && this.options.selected != -1 ) {\n\t\t\t\tindex = this.options.selected;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.anchors.eq( index ).trigger( this.options.event + \".tabs\" );\n\t\treturn this;\n\t},\n\n\tload: function( index ) {\n\t\tindex = this._getIndex( index );\n\t\tvar self = this,\n\t\t\to = this.options,\n\t\t\ta = this.anchors.eq( index )[ 0 ],\n\t\t\turl = $.data( a, \"load.tabs\" );\n\n\t\tthis.abort();\n\n\t\t// not remote or from cache\n\t\tif ( !url || this.element.queue( \"tabs\" ).length !== 0 && $.data( a, \"cache.tabs\" ) ) {\n\t\t\tthis.element.dequeue( \"tabs\" );\n\t\t\treturn;\n\t\t}\n\n\t\t// load remote from here on\n\t\tthis.lis.eq( index ).addClass( \"ui-state-processing\" );\n\n\t\tif ( o.spinner ) {\n\t\t\tvar span = $( \"span\", a );\n\t\t\tspan.data( \"label.tabs\", span.html() ).html( o.spinner );\n\t\t}\n\n\t\tthis.xhr = $.ajax( $.extend( {}, o.ajaxOptions, {\n\t\t\turl: url,\n\t\t\tsuccess: function( r, s ) {\n\t\t\t\tself.element.find( self._sanitizeSelector( a.hash ) ).html( r );\n\n\t\t\t\t// take care of tab labels\n\t\t\t\tself._cleanup();\n\n\t\t\t\tif ( o.cache ) {\n\t\t\t\t\t$.data( a, \"cache.tabs\", true );\n\t\t\t\t}\n\n\t\t\t\tself._trigger( \"load\", null, self._ui( self.anchors[ index ], self.panels[ index ] ) );\n\t\t\t\ttry {\n\t\t\t\t\to.ajaxOptions.success( r, s );\n\t\t\t\t}\n\t\t\t\tcatch ( e ) {}\n\t\t\t},\n\t\t\terror: function( xhr, s, e ) {\n\t\t\t\t// take care of tab labels\n\t\t\t\tself._cleanup();\n\n\t\t\t\tself._trigger( \"load\", null, self._ui( self.anchors[ index ], self.panels[ index ] ) );\n\t\t\t\ttry {\n\t\t\t\t\t// Passing index avoid a race condition when this method is\n\t\t\t\t\t// called after the user has selected another tab.\n\t\t\t\t\t// Pass the anchor that initiated this request allows\n\t\t\t\t\t// loadError to manipulate the tab content panel via $(a.hash)\n\t\t\t\t\to.ajaxOptions.error( xhr, s, index, a );\n\t\t\t\t}\n\t\t\t\tcatch ( e ) {}\n\t\t\t}\n\t\t} ) );\n\n\t\t// last, so that load event is fired before show...\n\t\tself.element.dequeue( \"tabs\" );\n\n\t\treturn this;\n\t},\n\n\tabort: function() {\n\t\t// stop possibly running animations\n\t\tthis.element.queue( [] );\n\t\tthis.panels.stop( false, true );\n\n\t\t// \"tabs\" queue must not contain more than two elements,\n\t\t// which are the callbacks for the latest clicked tab...\n\t\tthis.element.queue( \"tabs\", this.element.queue( \"tabs\" ).splice( -2, 2 ) );\n\n\t\t// terminate pending requests from other tabs\n\t\tif ( this.xhr ) {\n\t\t\tthis.xhr.abort();\n\t\t\tdelete this.xhr;\n\t\t}\n\n\t\t// take care of tab labels\n\t\tthis._cleanup();\n\t\treturn this;\n\t},\n\n\turl: function( index, url ) {\n\t\tthis.anchors.eq( index ).removeData( \"cache.tabs\" ).data( \"load.tabs\", url );\n\t\treturn this;\n\t},\n\n\tlength: function() {\n\t\treturn this.anchors.length;\n\t}\n});\n\n$.extend( $.ui.tabs, {\n\tversion: \"1.8.22\"\n});\n\n/*\n * Tabs Extensions\n */\n\n/*\n * Rotate\n */\n$.extend( $.ui.tabs.prototype, {\n\trotation: null,\n\trotate: function( ms, continuing ) {\n\t\tvar self = this,\n\t\t\to = this.options;\n\n\t\tvar rotate = self._rotate || ( self._rotate = function( e ) {\n\t\t\tclearTimeout( self.rotation );\n\t\t\tself.rotation = setTimeout(function() {\n\t\t\t\tvar t = o.selected;\n\t\t\t\tself.select( ++t < self.anchors.length ? t : 0 );\n\t\t\t}, ms );\n\t\t\t\n\t\t\tif ( e ) {\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\n\t\tvar stop = self._unrotate || ( self._unrotate = !continuing\n\t\t\t? function(e) {\n\t\t\t\tif (e.clientX) { // in case of a true click\n\t\t\t\t\tself.rotate(null);\n\t\t\t\t}\n\t\t\t}\n\t\t\t: function( e ) {\n\t\t\t\trotate();\n\t\t\t});\n\n\t\t// start rotation\n\t\tif ( ms ) {\n\t\t\tthis.element.bind( \"tabsshow\", rotate );\n\t\t\tthis.anchors.bind( o.event + \".tabs\", stop );\n\t\t\trotate();\n\t\t// stop rotation\n\t\t} else {\n\t\t\tclearTimeout( self.rotation );\n\t\t\tthis.element.unbind( \"tabsshow\", rotate );\n\t\t\tthis.anchors.unbind( o.event + \".tabs\", stop );\n\t\t\tdelete this._rotate;\n\t\t\tdelete this._unrotate;\n\t\t}\n\n\t\treturn this;\n\t}\n});\n\n})( jQuery );\n"
  },
  {
    "path": "extensions/themes/silverblue/scripts/libraries/jquery.clickmenu.js",
    "content": "/* clickMenu - v0.1.6\r\n * Copyright (c) 2007 Roman Weich\r\n * http://p.sohei.org\r\n *\r\n * Changelog: \r\n * v 0.1.6 - 2007-09-06\r\n *\t-fix: having a link in the top-level menu would not open the menu but call the link instead\r\n * v 0.1.5 - 2007-07-07\r\n *\t-change/fix: menu opening/closing now through simple show() and hide() calls - before fadeIn and fadeOut were used for which extra functions to stop a already running animation were created -> they were \r\n *\t\t\tbuggy (not working with the interface plugin in jquery1.1.2 and not working with jquery1.1.3 at all) and now removed\r\n *\t-change: removed option: fadeTime\r\n *\t-change: now using the bgiframe plugin for adding iframes in ie6 when available\r\n * v 0.1.4 - 2007-03-20\r\n *\t-fix: the default options were overwritten by the context related options\r\n *\t-fix: hiding a submenu all hover- and click-events were unbound, even the ones not defined in this plugin - unbinding should work now\r\n * v 0.1.3 - 2007-03-13\r\n *\t-fix: some display problems ie had when no width was set on the submenu, so on ie the width for each submenu will be explicitely set\r\n *\t-fix: the fix to the ie-width-problem is a fix to the \"ie does not support css min-width stuff\" problem too which displayed some submenus too narrow (it looked just not right)\r\n *\t-fix: some bugs, when user the was too fast with the mouse\r\n * v 0.1.2 - 2007-03-11\r\n *\t-change: made a lot changes in the traversing routines to speed things up (having better memory usage now as well)\r\n *\t-change: added $.fn.clickMenu.setDefaults() for setting global defaults\r\n *\t-fix: hoverbug when a main menu item had no submenu\r\n *\t-fix: some bugs i found while rewriting most of the stuff\r\n * v 0.1.1 - 2007-03-04\r\n *\t-change: the width of the submenus is no longer fixed, its set in the plugin now\r\n *\t-change: the submenu-arrow is now an img, not the background-img of the list element - that allows better positioning, and background-changes on hover (you have to set the image through the arrowSrc option)\r\n *\t-fix: clicking on a clickMenu while another was already open, didn't close the open one\r\n *\t-change: clicking on the open main menu item will close it\r\n *\t-fix: on an open menu moving the mouse to a main menu item and moving it fastly elsewere hid the whole menu\r\n * v 0.1.0 - 2007-03-03\r\n */\r\n\r\n(function($)\r\n{\r\n\tvar defaults = {\r\n\t\tonClick: function(){\r\n\t\t\t$(this).find('>a').each(function(){\r\n\t\t\t\tif ( this.href )\r\n\t\t\t\t{\r\n\t\t\t\t\twindow.location = this.href;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t},\r\n\t\tarrowSrc: '',\r\n\t\tsubDelay: 300,\r\n\t\tmainDelay: 10\r\n\t};\r\n\r\n\t$.fn.clickMenu = function(options) \r\n\t{\r\n\t\tvar shown = false;\r\n\t\tvar liOffset = ( ($.browser.msie) ? 4 : 2 );\r\n\r\n\t\tvar settings = $.extend({}, defaults, options);\r\n\r\n\t\tvar hideDIV = function(div, delay)\r\n\t\t{\r\n\t\t\t//a timer running to show the div?\r\n\t\t\tif ( div.timer && !div.isVisible )\r\n\t\t\t{\r\n\t\t\t\tclearTimeout(div.timer);\r\n\t\t\t}\r\n\t\t\telse if (div.timer)\r\n\t\t\t{\r\n\t\t\t\treturn; //hide-timer already running\r\n\t\t\t}\r\n\t\t\tif ( div.isVisible )\r\n\t\t\t{\r\n\t\t\t\tdiv.timer = setTimeout(function()\r\n\t\t\t\t{\r\n\t\t\t\t\t//remove events\r\n\t\t\t\t\t$(getAllChilds(getOneChild(div, 'UL'), 'LI')).unbind('mouseover', liHoverIn).unbind('mouseout', liHoverOut).unbind('click', settings.onClick);\r\n\t\t\t\t\t//hide it\r\n\t\t\t\t\t$(div).hide();\r\n\t\t\t\t\tdiv.isVisible = false;\r\n\t\t\t\t\tdiv.timer = null;\r\n\t\t\t\t}, delay);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar showDIV = function(div, delay)\r\n\t\t{\r\n\t\t\tif ( div.timer )\r\n\t\t\t{\r\n\t\t\t\tclearTimeout(div.timer);\r\n\t\t\t}\r\n\t\t\tif ( !div.isVisible )\r\n\t\t\t{\r\n\t\t\t\tdiv.timer = setTimeout(function()\r\n\t\t\t\t{\r\n\t\t\t\t\t//check if the mouse is still over the parent item - if not dont show the submenu\r\n\t\t\t\t\tif ( !checkClass(div.parentNode, 'hover') )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//assign events to all div>ul>li-elements\r\n\t\t\t\t\t$(getAllChilds(getOneChild(div, 'UL'), 'LI')).mouseover(liHoverIn).mouseout(liHoverOut).click(settings.onClick);\r\n\t\t\t\t\t//positioning\r\n\t\t\t\t\tif ( !checkClass(div.parentNode, 'main') )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$(div).css('left', div.parentNode.offsetWidth - liOffset);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//show it\r\n\t\t\t\t\tdiv.isVisible = true; //we use this over :visible to speed up traversing\r\n\t\t\t\t\t$(div).show();\r\n\t\t\t\t\tif ( $.browser.msie ) //fixing a display-bug in ie6 and adding min-width\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar cW = $(getOneChild(div, 'UL')).width();\r\n\t\t\t\t\t\tif ( cW < 100 )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcW = 100;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$(div).css('width', cW);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdiv.timer = null;\r\n\t\t\t\t}, delay);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t//same as hover.handlehover in jquery - just can't use hover() directly - need the ability to unbind only the one hover event\r\n\t\tvar testHandleHover = function(e)\r\n\t\t{\r\n\t\t\t// Check if mouse(over|out) are still within the same parent element\r\n\t\t\tvar p = (e.type == \"mouseover\" ? e.fromElement : e.toElement) || e.relatedTarget;\r\n\t\t\t// Traverse up the tree\r\n\t\t\twhile ( p && p != this )\r\n\t\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{ \r\n\t\t\t\t\tp = p.parentNode;\r\n\t\t\t\t}\r\n\t\t\t\tcatch(e)\r\n\t\t\t\t{ \r\n\t\t\t\t\tp = this;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// If we actually just moused on to a sub-element, ignore it\r\n\t\t\tif ( p == this )\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t};\r\n\t\t\r\n\t\tvar mainHoverIn = function(e)\r\n\t\t{\r\n\t\t\t//no need to test e.target==this, as no child has the same event binded\r\n\t\t\t//its possible, that a main menu item still has hover (if it has no submenu) - thus remove it\r\n\t\t\tvar lis = getAllChilds(this.parentNode, 'LI');\r\n\t\t\tvar pattern = new RegExp(\"(^|\\\\s)hover(\\\\s|$)\");\r\n\t\t\tfor (var i = 0; i < lis.length; i++)\r\n\t\t\t{\r\n\t\t\t\tif ( pattern.test(lis[i].className) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$(lis[i]).removeClass('hover');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$(this).addClass('hover');\r\n\t\t\tif ( shown )\r\n\t\t\t{\r\n\t\t\t\thoverIn(this, settings.mainDelay);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar liHoverIn = function(e)\r\n\t\t{\r\n\t\t\tif ( !testHandleHover(e) )\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif ( e.target != this )\r\n\t\t\t{\r\n\t\t\t\t//look whether the target is a direct child of this (maybe an image)\r\n\t\t\t\tif ( !isChild(this, e.target) )\r\n\t\t\t\t{\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\thoverIn(this, settings.subDelay);\r\n\t\t};\r\n\r\n\t\tvar hoverIn = function(li, delay)\r\n\t\t{\r\n\t\t\tvar innerDiv = getOneChild(li, 'DIV');\r\n\t\t\t//stop running timers from the other menus on the same level - a little faster than $('>*>div', li.parentNode)\r\n\t\t\tvar n = li.parentNode.firstChild;\r\n\t\t\tfor ( ; n; n = n.nextSibling ) \r\n\t\t\t{\r\n\t\t\t\tif ( n.nodeType == 1 && n.nodeName.toUpperCase() == 'LI' )\r\n\t\t\t\t{\r\n\t\t\t\t\tvar div = getOneChild(n, 'DIV');\r\n\t\t\t\t\tif ( div && div.timer && !div.isVisible ) //clear show-div timer\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tclearTimeout(div.timer);\r\n\t\t\t\t\t\tdiv.timer = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//is there a timer running to hide one of the parent divs? stop it\r\n\t\t\tvar pNode = li.parentNode;\r\n\t\t\tfor ( ; pNode; pNode = pNode.parentNode ) \r\n\t\t\t{\r\n\t\t\t\tif ( pNode.nodeType == 1 && pNode.nodeName.toUpperCase() == 'DIV' )\r\n\t\t\t\t{\r\n\t\t\t\t\tif (pNode.timer)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tclearTimeout(pNode.timer);\r\n\t\t\t\t\t\tpNode.timer = null;\r\n\t\t\t\t\t\t$(pNode.parentNode).addClass('hover');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//highlight the current element\r\n\t\t\t$(li).addClass('hover');\r\n\t\t\t//is the submenu already visible?\r\n\t\t\tif ( innerDiv && innerDiv.isVisible )\r\n\t\t\t{\r\n\t\t\t\t//hide-timer running?\r\n\t\t\t\tif ( innerDiv.timer )\r\n\t\t\t\t{\r\n\t\t\t\t\tclearTimeout(innerDiv.timer);\r\n\t\t\t\t\tinnerDiv.timer = null;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//hide all open menus on the same level and below and unhighlight the li item (but not the current submenu!)\r\n\t\t\t$(li.parentNode.getElementsByTagName('DIV')).each(function(){\r\n\t\t\t\tif ( this != innerDiv && this.isVisible )\r\n\t\t\t\t{\r\n\t\t\t\t\thideDIV(this, delay);\r\n\t\t\t\t\t$(this.parentNode).removeClass('hover');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t//show the submenu, if there is one\r\n\t\t\tif ( innerDiv )\r\n\t\t\t{\r\n\t\t\t\tshowDIV(innerDiv, delay);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar liHoverOut = function(e)\r\n\t\t{\r\n\t\t\tif ( !testHandleHover(e) )\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif ( e.target != this )\r\n\t\t\t{\r\n\t\t\t\tif ( !isChild(this, e.target) ) //return only if the target is no direct child of this\r\n\t\t\t\t{\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//remove the hover from the submenu item, if the mouse is hovering out of the menu (this is only for the last open (levelwise) (sub-)menu)\r\n\t\t\tvar div = getOneChild(this, 'DIV');\r\n\t\t\tif ( !div )\r\n\t\t\t{\r\n\t\t\t\t$(this).removeClass('hover');\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tif ( !div.isVisible )\r\n\t\t\t\t{\r\n\t\t\t\t\t$(this).removeClass('hover');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar mainHoverOut = function(e)\r\n\t\t{\r\n\t\t\t//no need to test e.target==this, as no child has the same event binded\r\n\t\t\t//remove hover\r\n\t\t\tvar div = getOneChild(this, 'DIV');\r\n\t\t\tvar relTarget = e.relatedTarget || e.toElement; //this is undefined sometimes (e.g. when the mouse moves out of the window), so dont remove hover then\r\n\t\t\tvar p;\r\n\t\t\tif ( !shown )\r\n\t\t\t{\r\n\t\t\t\t$(this).removeClass('hover');\r\n\t\t\t}\r\n\t\t\telse if ( !div && relTarget ) //menuitem has no submenu, so dont remove the hover if the mouse goes outside the menu\r\n\t\t\t{\r\n\t\t\t\tp = findParentWithClass(e.target, 'UL', 'clickMenu');\r\n\t\t\t\tif ( p.contains(relTarget))\r\n\t\t\t\t{\r\n\t\t\t\t\t$(this).removeClass('hover');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ( relTarget )\r\n\t\t\t{\r\n\t\t\t\t//remove hover only when moving to anywhere inside the clickmenu\r\n\t\t\t\tp = findParentWithClass(e.target, 'UL', 'clickMenu');\r\n\t\t\t\tif ( !div.isVisible && (p.contains(relTarget)) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$(this).removeClass('hover');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar mainClick = function()\r\n\t\t{\r\n\t\t\tvar div = getOneChild(this, 'DIV');\r\n\t\t\tif ( div && div.isVisible ) //clicked on an open main-menu-item\r\n\t\t\t{\r\n\t\t\t\tclean();\r\n\t\t\t\t$(this).addClass('hover');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\thoverIn(this, settings.mainDelay);\r\n\t\t\t\tshown = true;\r\n\t\t\t\t$(document).bind('mousedown', checkMouse);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t};\r\n\r\n\t\tvar checkMouse = function(e)\r\n\t\t{\r\n\t\t\t//is the mouse inside a clickmenu? if yes, is it an open (the current) one?\r\n\t\t\tvar vis = false;\r\n\t\t\tvar cm = findParentWithClass(e.target, 'UL', 'clickMenu');\r\n\t\t\tif ( cm )\r\n\t\t\t{\r\n\t\t\t\t$(cm.getElementsByTagName('DIV')).each(function(){\r\n\t\t\t\t\tif ( this.isVisible )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvis = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif ( !vis )\r\n\t\t\t{\r\n\t\t\t\tclean();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar clean = function()\r\n\t\t{\r\n\t\t\t//remove timeout and hide the divs\r\n\t\t\t$('ul.clickMenu div.outerbox').each(function(){\r\n\t\t\t\tif ( this.timer )\r\n\t\t\t\t{\r\n\t\t\t\t\tclearTimeout(this.timer);\r\n\t\t\t\t\tthis.timer = null;\r\n\t\t\t\t}\r\n\t\t\t\tif ( this.isVisible )\r\n\t\t\t\t{\r\n\t\t\t\t\t$(this).hide();\r\n\t\t\t\t\tthis.isVisible = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t$('ul.clickMenu li').removeClass('hover');\r\n\t\t\t//remove events\r\n\t\t\t$('ul.clickMenu>li li').unbind('mouseover', liHoverIn).unbind('mouseout', liHoverOut).unbind('click', settings.onClick);\r\n\t\t\t$(document).unbind('mousedown', checkMouse);\r\n\t\t\tshown = false;\r\n\t\t};\r\n\r\n\t\tvar getOneChild = function(elem, name)\r\n\t\t{\r\n\t\t\tif ( !elem )\r\n\t\t\t{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tvar n = elem.firstChild;\r\n\t\t\tfor ( ; n; n = n.nextSibling ) \r\n\t\t\t{\r\n\t\t\t\tif ( n.nodeType == 1 && n.nodeName.toUpperCase() == name )\r\n\t\t\t\t{\r\n\t\t\t\t\treturn n;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\r\n\t\tvar getAllChilds = function(elem, name)\r\n\t\t{\r\n\t\t\tif ( !elem )\r\n\t\t\t{\r\n\t\t\t\treturn [];\r\n\t\t\t}\r\n\t\t\tvar r = [];\r\n\t\t\tvar n = elem.firstChild;\r\n\t\t\tfor ( ; n; n = n.nextSibling ) \r\n\t\t\t{\r\n\t\t\t\tif ( n.nodeType == 1 && n.nodeName.toUpperCase() == name )\r\n\t\t\t\t{\r\n\t\t\t\t\tr[r.length] = n;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn r;\r\n\t\t};\r\n\r\n\t\tvar findParentWithClass = function(elem, searchTag, searchClass)\r\n\t\t{\r\n\t\t\tvar pNode = elem.parentNode;\r\n\t\t\tvar pattern = new RegExp(\"(^|\\\\s)\" + searchClass + \"(\\\\s|$)\");\r\n\t\t\tfor ( ; pNode; pNode = pNode.parentNode )\r\n\t\t\t{\r\n\t\t\t\tif ( pNode.nodeType == 1 && pNode.nodeName.toUpperCase() == searchTag && pattern.test(pNode.className) )\r\n\t\t\t\t{\r\n\t\t\t\t\treturn pNode;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\t\r\n\t\tvar checkClass = function(elem, searchClass)\r\n\t\t{\r\n\t\t\tvar pattern = new RegExp(\"(^|\\\\s)\" + searchClass + \"(\\\\s|$)\");\r\n\t\t\tif ( pattern.test(elem.className) )\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\t\r\n\t\tvar isChild = function(elem, childElem)\r\n\t\t{\r\n\t\t\tvar n = elem.firstChild;\r\n\t\t\tfor ( ; n; n = n.nextSibling ) \r\n\t\t\t{\r\n\t\t\t\tif ( n == childElem )\r\n\t\t\t\t{\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t};\r\n\r\n\t    return this.each(function()\r\n\t\t{\r\n\t\t\t//add .contains() to mozilla - http://www.quirksmode.org/blog/archives/2006/01/contains_for_mo.html\r\n\t\t\tif (window.Node && Node.prototype && !Node.prototype.contains)\r\n\t\t\t{\r\n\t\t\t\tNode.prototype.contains = function(arg) \r\n\t\t\t\t{\r\n\t\t\t\t\treturn !!(this.compareDocumentPosition(arg) & 16);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t//add class\r\n\t\t\tif ( !checkClass(this, 'clickMenu') )\r\n\t\t\t{\r\n\t\t\t\t$(this).addClass('clickMenu');\r\n\t\t\t}\r\n\t\t\t//add shadows\r\n\t\t\t$('ul', this).shadowBox();\r\n\t\t\t//ie6? - add iframes\r\n\t\t\tif ( $.browser.msie && (!$.browser.version || parseInt($.browser.version) <= 6) )\r\n\t\t\t{\r\n\t\t\t\tif ( $.fn.bgiframe )\r\n\t\t\t\t{\r\n\t\t\t\t\t$('div.outerbox', this).bgiframe();\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t/* thanks to Mark Gibson - http://www.nabble.com/forum/ViewPost.jtp?post=6504414&framed=y */\r\n\t\t\t\t\t$('div.outerbox', this).append('<iframe style=\"display:block;position:absolute;top:0;left:0;z-index:-1;filter:mask();' + \r\n\t\t\t\t\t\t\t\t\t'width:expression(this.parentNode.offsetWidth);height:expression(this.parentNode.offsetHeight)\"/>');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//assign events\r\n\t\t\t$(this).bind('closemenu', function(){clean();}); //assign closemenu-event, through wich the menu can be closed from outside the plugin\r\n\t\t\t//add click event handling, if there are any elements inside the main menu\r\n\t\t\tvar liElems = getAllChilds(this, 'LI');\r\n\t\t\tfor ( var j = 0; j < liElems.length; j++ )\r\n\t\t\t{\r\n\t\t\t\tif ( getOneChild(getOneChild(getOneChild(liElems[j], 'DIV'), 'UL'), 'LI') ) // >div>ul>li\r\n\t\t\t\t{\r\n\t\t\t\t\t$(liElems[j]).click(mainClick);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//add hover event handling and assign classes\r\n\t\t\t$(liElems).hover(mainHoverIn, mainHoverOut).addClass('main').find('>div').addClass('inner');\r\n\t\t\t//add the little arrow before each submenu\r\n\t\t\tif ( settings.arrowSrc )\r\n\t\t\t{\r\n\t\t\t\t$('div.inner div.outerbox', this).before('<img src=\"' + settings.arrowSrc + '\" class=\"liArrow\" />');\r\n\t\t\t}\r\n\r\n\t\t\t//the floating list elements are destroying the layout..so make it nice again..\r\n            $(this).wrap('<div class=\"cmDiv\"></div>').after('<div style=\"clear: both; visibility: hidden;\"></div>');\r\n\t    });\r\n\t};\r\n\t$.fn.clickMenu.setDefaults = function(o)\r\n\t{\r\n\t\t$.extend(defaults, o);\r\n\t};\r\n})(jQuery);\r\n\r\n(function($)\r\n{\r\n\t$.fn.shadowBox = function() {\r\n\t    return this.each(function()\r\n\t\t{\r\n\t\t\tvar outer = $('<div class=\"outerbox\"></div>').get(0);\r\n\t\t\tif ( $(this).css('position') == 'absolute' )\r\n\t\t\t{\r\n\t\t\t\t//if the child(this) is positioned abolute, we have to use relative positioning and shrink the outerbox accordingly to the innerbox\r\n\t\t\t\t$(outer).css({position:'relative', width:this.offsetWidth, height:this.offsetHeight});\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//shrink the outerbox\r\n\t\t\t\t$(outer).css('position', 'absolute');\r\n\t\t\t}\r\n\t\t\t//add the boxes\r\n\t\t\t$(this).addClass('innerBox').wrap(outer).\r\n\t\t\t\t\tbefore('<div class=\"shadowbox1\"></div><div class=\"shadowbox2\"></div><div class=\"shadowbox3\"></div>');\r\n\t    });\r\n\t};\r\n})(jQuery);"
  },
  {
    "path": "extensions/themes/silverblue/scripts/libraries/jquery.dimensions.js",
    "content": "/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)\n * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)\n * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.\n *\n * $LastChangedDate: 2007-12-20 11:43:48 -0300 (Qui, 20 Dez 2007) $\n * $Rev: 4257 $\n *\n * Version: @VERSION\n *\n * Requires: jQuery 1.2+\n */\n\n(function($){\n\t\n$.dimensions = {\n\tversion: '@VERSION'\n};\n\n// Create innerHeight, innerWidth, outerHeight and outerWidth methods\n$.each( [ 'Height', 'Width' ], function(i, name){\n\t\n\t// innerHeight and innerWidth\n\t$.fn[ 'inner' + name ] = function() {\n\t\tif (!this[0]) return;\n\t\t\n\t\tvar torl = name == 'Height' ? 'Top'    : 'Left',  // top or left\n\t\t    borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right\n\t\t\n\t\treturn this.is(':visible') ? this[0]['client' + name] : num( this, name.toLowerCase() ) + num(this, 'padding' + torl) + num(this, 'padding' + borr);\n\t};\n\t\n\t// outerHeight and outerWidth\n\t$.fn[ 'outer' + name ] = function(options) {\n\t\tif (!this[0]) return;\n\t\t\n\t\tvar torl = name == 'Height' ? 'Top'    : 'Left',  // top or left\n\t\t    borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right\n\t\t\n\t\toptions = $.extend({ margin: false }, options || {});\n\t\t\n\t\tvar val = this.is(':visible') ? \n\t\t\t\tthis[0]['offset' + name] : \n\t\t\t\tnum( this, name.toLowerCase() )\n\t\t\t\t\t+ num(this, 'border' + torl + 'Width') + num(this, 'border' + borr + 'Width')\n\t\t\t\t\t+ num(this, 'padding' + torl) + num(this, 'padding' + borr);\n\t\t\n\t\treturn val + (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0);\n\t};\n});\n\n// Create scrollLeft and scrollTop methods\n$.each( ['Left', 'Top'], function(i, name) {\n\t$.fn[ 'scroll' + name ] = function(val) {\n\t\tif (!this[0]) return;\n\t\t\n\t\treturn val != undefined ?\n\t\t\n\t\t\t// Set the scroll offset\n\t\t\tthis.each(function() {\n\t\t\t\tthis == window || this == document ?\n\t\t\t\t\twindow.scrollTo( \n\t\t\t\t\t\tname == 'Left' ? val : $(window)[ 'scrollLeft' ](),\n\t\t\t\t\t\tname == 'Top'  ? val : $(window)[ 'scrollTop'  ]()\n\t\t\t\t\t) :\n\t\t\t\t\tthis[ 'scroll' + name ] = val;\n\t\t\t}) :\n\t\t\t\n\t\t\t// Return the scroll offset\n\t\t\tthis[0] == window || this[0] == document ?\n\t\t\t\tself[ (name == 'Left' ? 'pageXOffset' : 'pageYOffset') ] ||\n\t\t\t\t\t$.boxModel && document.documentElement[ 'scroll' + name ] ||\n\t\t\t\t\tdocument.body[ 'scroll' + name ] :\n\t\t\t\tthis[0][ 'scroll' + name ];\n\t};\n});\n\n$.fn.extend({\n\tposition: function() {\n\t\tvar left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;\n\t\t\n\t\tif (elem) {\n\t\t\t// Get *real* offsetParent\n\t\t\toffsetParent = this.offsetParent();\n\t\t\t\n\t\t\t// Get correct offsets\n\t\t\toffset       = this.offset();\n\t\t\tparentOffset = offsetParent.offset();\n\t\t\t\n\t\t\t// Subtract element margins\n\t\t\toffset.top  -= num(elem, 'marginTop');\n\t\t\toffset.left -= num(elem, 'marginLeft');\n\t\t\t\n\t\t\t// Add offsetParent borders\n\t\t\tparentOffset.top  += num(offsetParent, 'borderTopWidth');\n\t\t\tparentOffset.left += num(offsetParent, 'borderLeftWidth');\n\t\t\t\n\t\t\t// Subtract the two offsets\n\t\t\tresults = {\n\t\t\t\ttop:  offset.top  - parentOffset.top,\n\t\t\t\tleft: offset.left - parentOffset.left\n\t\t\t};\n\t\t}\n\t\t\n\t\treturn results;\n\t},\n\t\n\toffsetParent: function() {\n\t\tvar offsetParent = this[0].offsetParent;\n\t\twhile ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && $.css(offsetParent, 'position') == 'static') )\n\t\t\toffsetParent = offsetParent.offsetParent;\n\t\treturn $(offsetParent);\n\t}\n});\n\nfunction num(el, prop) {\n\treturn parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;\n};\n\n})(jQuery);"
  },
  {
    "path": "extensions/themes/silverblue/scripts/libraries/jquery.interface.js",
    "content": "/**\r\n * Interface Elements for jQuery\r\n * \r\n * http://interface.eyecon.ro\r\n * \r\n * Copyright (c) 2006 Stefan Petre\r\n * Dual licensed under the MIT (MIT-LICENSE.txt) \r\n * and GPL (GPL-LICENSE.txt) licenses.\r\n *   \r\n *\r\n */\r\n eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c])}}return p}('k.f2={2r:u(M){E q.1E(u(){if(!M.aR||!M.aZ)E;D el=q;el.2l={aq:M.aq||cO,aR:M.aR,aZ:M.aZ,8e:M.8e||\\'fV\\',aJ:M.aJ||\\'fV\\',2Y:M.2Y&&2g M.2Y==\\'u\\'?M.2Y:I,3i:M.2Y&&2g M.3i==\\'u\\'?M.3i:I,7U:M.7U&&2g M.7U==\\'u\\'?M.7U:I,as:k(M.aR,q),8f:k(M.aZ,q),H:M.H||8J,67:M.67||0};el.2l.8f.2G().B(\\'W\\',\\'9R\\').eq(0).B({W:el.2l.aq+\\'U\\',19:\\'2B\\'}).2T();el.2l.as.1E(u(2N){q.7X=2N}).gC(u(){k(q).2R(el.2l.aJ)},u(){k(q).4i(el.2l.aJ)}).1J(\\'5h\\',u(e){if(el.2l.67==q.7X)E;el.2l.as.eq(el.2l.67).4i(el.2l.8e).2T().eq(q.7X).2R(el.2l.8e).2T();el.2l.8f.eq(el.2l.67).5w({W:0},el.2l.H,u(){q.14.19=\\'1o\\';if(el.2l.3i){el.2l.3i.1D(el,[q])}}).2T().eq(q.7X).1Y().5w({W:el.2l.aq},el.2l.H,u(){q.14.19=\\'2B\\';if(el.2l.2Y){el.2l.2Y.1D(el,[q])}}).2T();if(el.2l.7U){el.2l.7U.1D(el,[q,el.2l.8f.K(q.7X),el.2l.as.K(el.2l.67),el.2l.8f.K(el.2l.67)])}el.2l.67=q.7X}).eq(0).2R(el.2l.8e).2T();k(q).B(\\'W\\',k(q).B(\\'W\\')).B(\\'2U\\',\\'2K\\')})}};k.fn.gN=k.f2.2r;k.aA={2r:u(M){E q.1E(u(){D el=q;D 7E=2*18.2Q/f1;D an=2*18.2Q;if(k(el).B(\\'Y\\')!=\\'2s\\'&&k(el).B(\\'Y\\')!=\\'1P\\'){k(el).B(\\'Y\\',\\'2s\\')}el.1l={1R:k(M.1R,q),2F:M.2F,6q:M.6q,aD:M.aD,an:an,1N:k.1a.2o(q),Y:k.1a.3w(q),26:18.2Q/2,bi:M.bi,8p:M.6r,6r:[],aG:I,7E:2*18.2Q/f1};el.1l.fB=(el.1l.1N.w-el.1l.2F)/2;el.1l.7D=(el.1l.1N.h-el.1l.6q-el.1l.6q*el.1l.8p)/2;el.1l.2D=2*18.2Q/el.1l.1R.1N();el.1l.ba=el.1l.1N.w/2;el.1l.b9=el.1l.1N.h/2-el.1l.6q*el.1l.8p;D ak=1h.3F(\\'22\\');k(ak).B({Y:\\'1P\\',3I:1,Q:0,O:0});k(el).1S(ak);el.1l.1R.1E(u(2N){a6=k(\\'1T\\',q).K(0);W=T(el.1l.6q*el.1l.8p);if(k.3a.4t){3E=1h.3F(\\'1T\\');k(3E).B(\\'Y\\',\\'1P\\');3E.2J=a6.2J;3E.14.5E=\\'gE 9n:9w.9y.cC(1G=60, 14=1, gB=0, gA=0, gv=0, gF=0)\\'}P{3E=1h.3F(\\'3E\\');if(3E.fD){4L=3E.fD(\"2d\");3E.14.Y=\\'1P\\';3E.14.W=W+\\'U\\';3E.14.Z=el.1l.2F+\\'U\\';3E.W=W;3E.Z=el.1l.2F;4L.gu();4L.gO(0,W);4L.gk(1,-1);4L.gp(a6,0,0,el.1l.2F,W);4L.6H();4L.gm=\"gG-4l\";D ap=4L.hy(0,0,0,W);ap.fs(1,\"fr(1V, 1V, 1V, 1)\");ap.fs(0,\"fr(1V, 1V, 1V, 0.6)\");4L.hx=ap;if(hA.hB.3J(\\'hw\\')!=-1){4L.hv()}P{4L.hu(0,0,el.1l.2F,W)}}}el.1l.6r[2N]=3E;k(ak).1S(3E)}).1J(\\'9z\\',u(e){el.1l.aG=1b;el.1l.H=el.1l.7E*0.1*el.1l.H/18.3S(el.1l.H);E I}).1J(\\'8B\\',u(e){el.1l.aG=I;E I});k.aA.7T(el);el.1l.H=el.1l.7E*0.2;el.1l.ht=1X.6V(u(){el.1l.26+=el.1l.H;if(el.1l.26>an)el.1l.26=0;k.aA.7T(el)},20);k(el).1J(\\'8B\\',u(){el.1l.H=el.1l.7E*0.2*el.1l.H/18.3S(el.1l.H)}).1J(\\'3D\\',u(e){if(el.1l.aG==I){1s=k.1a.4a(e);fz=el.1l.1N.w-1s.x+el.1l.Y.x;el.1l.H=el.1l.bi*el.1l.7E*(el.1l.1N.w/2-fz)/(el.1l.1N.w/2)}})})},7T:u(el){el.1l.1R.1E(u(2N){b8=el.1l.26+2N*el.1l.2D;x=el.1l.fB*18.5H(b8);y=el.1l.7D*18.83(b8);f9=T(2a*(el.1l.7D+y)/(2*el.1l.7D));fk=(el.1l.7D+y)/(2*el.1l.7D);Z=T((el.1l.2F-el.1l.aD)*fk+el.1l.aD);W=T(Z*el.1l.6q/el.1l.2F);q.14.Q=el.1l.b9+y-W/2+\"U\";q.14.O=el.1l.ba+x-Z/2+\"U\";q.14.Z=Z+\"U\";q.14.W=W+\"U\";q.14.3I=f9;el.1l.6r[2N].14.Q=T(el.1l.b9+y+W-1-W/2)+\"U\";el.1l.6r[2N].14.O=T(el.1l.ba+x-Z/2)+\"U\";el.1l.6r[2N].14.Z=Z+\"U\";el.1l.6r[2N].14.W=T(W*el.1l.8p)+\"U\"})}};k.fn.hI=k.aA.2r;k.23({G:{c8:u(p,n,1W,1H,1m){E((-18.5H(p*18.2Q)/2)+0.5)*1H+1W},hK:u(p,n,1W,1H,1m){E 1H*(n/=1m)*n*n+1W},fl:u(p,n,1W,1H,1m){E-1H*((n=n/1m-1)*n*n*n-1)+1W},hm:u(p,n,1W,1H,1m){if((n/=1m/2)<1)E 1H/2*n*n*n*n+1W;E-1H/2*((n-=2)*n*n*n-2)+1W},8l:u(p,n,1W,1H,1m){if((n/=1m)<(1/2.75)){E 1H*(7.aB*n*n)+1W}P if(n<(2/2.75)){E 1H*(7.aB*(n-=(1.5/2.75))*n+.75)+1W}P if(n<(2.5/2.75)){E 1H*(7.aB*(n-=(2.25/2.75))*n+.gY)+1W}P{E 1H*(7.aB*(n-=(2.h2/2.75))*n+.gX)+1W}},cr:u(p,n,1W,1H,1m){if(k.G.8l)E 1H-k.G.8l(p,1m-n,0,1H,1m)+1W;E 1W+1H},gW:u(p,n,1W,1H,1m){if(k.G.cr&&k.G.8l)if(n<1m/2)E k.G.cr(p,n*2,0,1H,1m)*.5+1W;E k.G.8l(p,n*2-1m,0,1H,1m)*.5+1H*.5+1W;E 1W+1H},gQ:u(p,n,1W,1H,1m){D a,s;if(n==0)E 1W;if((n/=1m)==1)E 1W+1H;a=1H*0.3;p=1m*.3;if(a<18.3S(1H)){a=1H;s=p/4}P{s=p/(2*18.2Q)*18.cb(1H/a)}E-(a*18.6b(2,10*(n-=1))*18.83((n*1m-s)*(2*18.2Q)/p))+1W},gT:u(p,n,1W,1H,1m){D a,s;if(n==0)E 1W;if((n/=1m/2)==2)E 1W+1H;a=1H*0.3;p=1m*.3;if(a<18.3S(1H)){a=1H;s=p/4}P{s=p/(2*18.2Q)*18.cb(1H/a)}E a*18.6b(2,-10*n)*18.83((n*1m-s)*(2*18.2Q)/p)+1H+1W},gV:u(p,n,1W,1H,1m){D a,s;if(n==0)E 1W;if((n/=1m/2)==2)E 1W+1H;a=1H*0.3;p=1m*.3;if(a<18.3S(1H)){a=1H;s=p/4}P{s=p/(2*18.2Q)*18.cb(1H/a)}if(n<1){E-.5*(a*18.6b(2,10*(n-=1))*18.83((n*1m-s)*(2*18.2Q)/p))+1W}E a*18.6b(2,-10*(n-=1))*18.83((n*1m-s)*(2*18.2Q)/p)*.5+1H+1W}}});k.6n={2r:u(M){E q.1E(u(){D el=q;el.1F={1R:k(M.1R,q),1Z:k(M.1Z,q),1M:k.1a.3w(q),2F:M.2F,ax:M.ax,7Y:M.7Y,ge:M.ge,51:M.51,6x:M.6x};k.6n.aH(el,0);k(1X).1J(\\'gU\\',u(){el.1F.1M=k.1a.3w(el);k.6n.aH(el,0);k.6n.7T(el)});k.6n.7T(el);el.1F.1R.1J(\\'9z\\',u(){k(el.1F.ax,q).K(0).14.19=\\'2B\\'}).1J(\\'8B\\',u(){k(el.1F.ax,q).K(0).14.19=\\'1o\\'});k(1h).1J(\\'3D\\',u(e){D 1s=k.1a.4a(e);D 5s=0;if(el.1F.51&&el.1F.51==\\'cv\\')D aI=1s.x-el.1F.1M.x-(el.4c-el.1F.2F*el.1F.1R.1N())/2-el.1F.2F/2;P if(el.1F.51&&el.1F.51==\\'2L\\')D aI=1s.x-el.1F.1M.x-el.4c+el.1F.2F*el.1F.1R.1N();P D aI=1s.x-el.1F.1M.x;D fP=18.6b(1s.y-el.1F.1M.y-el.5W/2,2);el.1F.1R.1E(u(2N){45=18.ez(18.6b(aI-2N*el.1F.2F,2)+fP);45-=el.1F.2F/2;45=45<0?0:45;45=45>el.1F.7Y?el.1F.7Y:45;45=el.1F.7Y-45;bB=el.1F.6x*45/el.1F.7Y;q.14.Z=el.1F.2F+bB+\\'U\\';q.14.O=el.1F.2F*2N+5s+\\'U\\';5s+=bB});k.6n.aH(el,5s)})})},aH:u(el,5s){if(el.1F.51)if(el.1F.51==\\'cv\\')el.1F.1Z.K(0).14.O=(el.4c-el.1F.2F*el.1F.1R.1N())/2-5s/2+\\'U\\';P if(el.1F.51==\\'O\\')el.1F.1Z.K(0).14.O=-5s/el.1F.1R.1N()+\\'U\\';P if(el.1F.51==\\'2L\\')el.1F.1Z.K(0).14.O=(el.4c-el.1F.2F*el.1F.1R.1N())-5s/2+\\'U\\';el.1F.1Z.K(0).14.Z=el.1F.2F*el.1F.1R.1N()+5s+\\'U\\'},7T:u(el){el.1F.1R.1E(u(2N){q.14.Z=el.1F.2F+\\'U\\';q.14.O=el.1F.2F*2N+\\'U\\'})}};k.fn.hi=k.6n.2r;k.N={1c:S,8R:S,3A:S,2I:S,4y:S,cl:S,1d:S,2h:S,1R:S,5o:u(){k.N.8R.5o();if(k.N.3A){k.N.3A.2G()}},4w:u(){k.N.1R=S;k.N.2h=S;k.N.4y=k.N.1d.2y;if(k.N.1c.B(\\'19\\')==\\'2B\\'){if(k.N.1d.1f.fx){3m(k.N.1d.1f.fx.1u){1e\\'c6\\':k.N.1c.7a(k.N.1d.1f.fx.1m,k.N.5o);1r;1e\\'1z\\':k.N.1c.fq(k.N.1d.1f.fx.1m,k.N.5o);1r;1e\\'a7\\':k.N.1c.g3(k.N.1d.1f.fx.1m,k.N.5o);1r}}P{k.N.1c.2G()}if(k.N.1d.1f.3i)k.N.1d.1f.3i.1D(k.N.1d,[k.N.1c,k.N.3A])}P{k.N.5o()}1X.bH(k.N.2I)},dQ:u(){D 1d=k.N.1d;D 4d=k.N.aY(1d);if(1d&&4d.3o!=k.N.4y&&4d.3o.1g>=1d.1f.aL){k.N.4y=4d.3o;k.N.cl=4d.3o;81={2n:k(1d).1p(\\'hj\\')||\\'2n\\',2y:4d.3o};k.hl({1u:\\'hk\\',81:k.hf(81),he:u(fZ){1d.1f.4e=k(\\'3o\\',fZ);1N=1d.1f.4e.1N();if(1N>0){D 5p=\\'\\';1d.1f.4e.1E(u(2N){5p+=\\'<8P 4I=\"\\'+k(\\'2y\\',q).3g()+\\'\" 8K=\"\\'+2N+\\'\" 14=\"9b: ad;\">\\'+k(\\'3g\\',q).3g()+\\'</8P>\\'});if(1d.1f.aU){D 3M=k(\\'2y\\',1d.1f.4e.K(0)).3g();1d.2y=4d.3j+3M+1d.1f.3N+4d.66;k.N.6J(1d,4d.3o.1g!=3M.1g?(4d.3j.1g+4d.3o.1g):3M.1g,4d.3o.1g!=3M.1g?(4d.3j.1g+3M.1g):3M.1g)}if(1N>0){k.N.cj(1d,5p)}P{k.N.4w()}}P{k.N.4w()}},5N:1d.1f.aN})}},cj:u(1d,5p){k.N.8R.3x(5p);k.N.1R=k(\\'8P\\',k.N.8R.K(0));k.N.1R.9z(k.N.di).1J(\\'5h\\',k.N.dj);D Y=k.1a.3w(1d);D 1N=k.1a.2o(1d);k.N.1c.B(\\'Q\\',Y.y+1N.hb+\\'U\\').B(\\'O\\',Y.x+\\'U\\').2R(1d.1f.aM);if(k.N.3A){k.N.3A.B(\\'19\\',\\'2B\\').B(\\'Q\\',Y.y+1N.hb+\\'U\\').B(\\'O\\',Y.x+\\'U\\').B(\\'Z\\',k.N.1c.B(\\'Z\\')).B(\\'W\\',k.N.1c.B(\\'W\\'))}k.N.2h=0;k.N.1R.K(0).3l=1d.1f.7H;k.N.8Q(1d,1d.1f.4e.K(0),\\'7J\\');if(k.N.1c.B(\\'19\\')==\\'1o\\'){if(1d.1f.bV){D cp=k.1a.aT(1d,1b);D cm=k.1a.6U(1d,1b);k.N.1c.B(\\'Z\\',1d.4c-(k.dF?(cp.l+cp.r+cm.l+cm.r):0)+\\'U\\')}if(1d.1f.fx){3m(1d.1f.fx.1u){1e\\'c6\\':k.N.1c.7f(1d.1f.fx.1m);1r;1e\\'1z\\':k.N.1c.fo(1d.1f.fx.1m);1r;1e\\'a7\\':k.N.1c.gb(1d.1f.fx.1m);1r}}P{k.N.1c.1Y()}if(k.N.1d.1f.2Y)k.N.1d.1f.2Y.1D(k.N.1d,[k.N.1c,k.N.3A])}},dO:u(){D 1d=q;if(1d.1f.4e){k.N.4y=1d.2y;k.N.cl=1d.2y;D 5p=\\'\\';1d.1f.4e.1E(u(2N){2y=k(\\'2y\\',q).3g().6c();fY=1d.2y.6c();if(2y.3J(fY)==0){5p+=\\'<8P 4I=\"\\'+k(\\'2y\\',q).3g()+\\'\" 8K=\"\\'+2N+\\'\" 14=\"9b: ad;\">\\'+k(\\'3g\\',q).3g()+\\'</8P>\\'}});if(5p!=\\'\\'){k.N.cj(1d,5p);q.1f.9x=1b;E}}1d.1f.4e=S;q.1f.9x=I},6J:u(2n,26,2T){if(2n.b1){D 6t=2n.b1();6t.hp(1b);6t.dI(\"ck\",26);6t.ha(\"ck\",-2T+26);6t.8C()}P if(2n.aF){2n.aF(26,2T)}P{if(2n.5q){2n.5q=26;2n.dN=2T}}2n.6K()},f0:u(2n){if(2n.5q)E 2n.5q;P if(2n.b1){D 6t=1h.6J.dZ();D eX=6t.h9();E 0-eX.dI(\\'ck\\',-h6)}},aY:u(2n){D 4P={2y:2n.2y,3j:\\'\\',66:\\'\\',3o:\\'\\'};if(2n.1f.aQ){D 8N=I;D 5q=k.N.f0(2n)||0;D 4T=4P.2y.7C(2n.1f.3N);24(D i=0;i<4T.1g;i++){if((4P.3j.1g+4T[i].1g>=5q||5q==0)&&!8N){if(4P.3j.1g<=5q)4P.3o=4T[i];P 4P.66+=4T[i]+(4T[i]!=\\'\\'?2n.1f.3N:\\'\\');8N=1b}P if(8N){4P.66+=4T[i]+(4T[i]!=\\'\\'?2n.1f.3N:\\'\\')}if(!8N){4P.3j+=4T[i]+(4T.1g>1?2n.1f.3N:\\'\\')}}}P{4P.3o=4P.2y}E 4P},bU:u(e){1X.bH(k.N.2I);D 1d=k.N.aY(q);D 3K=e.7L||e.7K||-1;if(/13|27|35|36|38|40|9/.48(3K)&&k.N.1R){if(1X.2k){1X.2k.bT=1b;1X.2k.c0=I}P{e.aP();e.aW()}if(k.N.2h!=S)k.N.1R.K(k.N.2h||0).3l=\\'\\';P k.N.2h=-1;3m(3K){1e 9:1e 13:if(k.N.2h==-1)k.N.2h=0;D 2h=k.N.1R.K(k.N.2h||0);D 3M=2h.5C(\\'4I\\');q.2y=1d.3j+3M+q.1f.3N+1d.66;k.N.4y=1d.3o;k.N.6J(q,1d.3j.1g+3M.1g+q.1f.3N.1g,1d.3j.1g+3M.1g+q.1f.3N.1g);k.N.4w();if(q.1f.68){4u=T(2h.5C(\\'8K\\'))||0;k.N.8Q(q,q.1f.4e.K(4u),\\'68\\')}if(q.7W)q.7W(I);E 3K!=13;1r;1e 27:q.2y=1d.3j+k.N.4y+q.1f.3N+1d.66;q.1f.4e=S;k.N.4w();if(q.7W)q.7W(I);E I;1r;1e 35:k.N.2h=k.N.1R.1N()-1;1r;1e 36:k.N.2h=0;1r;1e 38:k.N.2h--;if(k.N.2h<0)k.N.2h=k.N.1R.1N()-1;1r;1e 40:k.N.2h++;if(k.N.2h==k.N.1R.1N())k.N.2h=0;1r}k.N.8Q(q,q.1f.4e.K(k.N.2h||0),\\'7J\\');k.N.1R.K(k.N.2h||0).3l=q.1f.7H;if(k.N.1R.K(k.N.2h||0).7W)k.N.1R.K(k.N.2h||0).7W(I);if(q.1f.aU){D aK=k.N.1R.K(k.N.2h||0).5C(\\'4I\\');q.2y=1d.3j+aK+q.1f.3N+1d.66;if(k.N.4y.1g!=aK.1g)k.N.6J(q,1d.3j.1g+k.N.4y.1g,1d.3j.1g+aK.1g)}E I}k.N.dO.1D(q);if(q.1f.9x==I){if(1d.3o!=k.N.4y&&1d.3o.1g>=q.1f.aL)k.N.2I=1X.9T(k.N.dQ,q.1f.54);if(k.N.1R){k.N.4w()}}E 1b},8Q:u(2n,3o,1u){if(2n.1f[1u]){D 81={};ar=3o.f3(\\'*\\');24(i=0;i<ar.1g;i++){81[ar[i].4Y]=ar[i].7c.h4}2n.1f[1u].1D(2n,[81])}},di:u(e){if(k.N.1R){if(k.N.2h!=S)k.N.1R.K(k.N.2h||0).3l=\\'\\';k.N.1R.K(k.N.2h||0).3l=\\'\\';k.N.2h=T(q.5C(\\'8K\\'))||0;k.N.1R.K(k.N.2h||0).3l=k.N.1d.1f.7H}},dj:u(2k){1X.bH(k.N.2I);2k=2k||k.2k.gS(1X.2k);2k.aP();2k.aW();D 1d=k.N.aY(k.N.1d);D 3M=q.5C(\\'4I\\');k.N.1d.2y=1d.3j+3M+k.N.1d.1f.3N+1d.66;k.N.4y=q.5C(\\'4I\\');k.N.6J(k.N.1d,1d.3j.1g+3M.1g+k.N.1d.1f.3N.1g,1d.3j.1g+3M.1g+k.N.1d.1f.3N.1g);k.N.4w();if(k.N.1d.1f.68){4u=T(q.5C(\\'8K\\'))||0;k.N.8Q(k.N.1d,k.N.1d.1f.4e.K(4u),\\'68\\')}E I},eJ:u(e){3K=e.7L||e.7K||-1;if(/13|27|35|36|38|40/.48(3K)&&k.N.1R){if(1X.2k){1X.2k.bT=1b;1X.2k.c0=I}P{e.aP();e.aW()}E I}},2r:u(M){if(!M.aN||!k.1a){E}if(!k.N.1c){if(k.3a.4t){k(\\'2e\\',1h).1S(\\'<3A 14=\"19:1o;Y:1P;5E:9n:9w.9y.cC(1G=0);\" id=\"ds\" 2J=\"ek:I;\" ej=\"0\" ep=\"cD\"></3A>\\');k.N.3A=k(\\'#ds\\')}k(\\'2e\\',1h).1S(\\'<22 id=\"dr\" 14=\"Y: 1P; Q: 0; O: 0; z-cZ: h3; 19: 1o;\"><9h 14=\"6w: 0;8F: 0; h1-14: 1o; z-cZ: h0;\">&7k;</9h></22>\\');k.N.1c=k(\\'#dr\\');k.N.8R=k(\\'9h\\',k.N.1c)}E q.1E(u(){if(q.4Y!=\\'ch\\'&&q.5C(\\'1u\\')!=\\'3g\\')E;q.1f={};q.1f.aN=M.aN;q.1f.aL=18.3S(T(M.aL)||1);q.1f.aM=M.aM?M.aM:\\'\\';q.1f.7H=M.7H?M.7H:\\'\\';q.1f.68=M.68&&M.68.1K==2A?M.68:S;q.1f.2Y=M.2Y&&M.2Y.1K==2A?M.2Y:S;q.1f.3i=M.3i&&M.3i.1K==2A?M.3i:S;q.1f.7J=M.7J&&M.7J.1K==2A?M.7J:S;q.1f.bV=M.bV||I;q.1f.aQ=M.aQ||I;q.1f.3N=q.1f.aQ?(M.3N||\\', \\'):\\'\\';q.1f.aU=M.aU?1b:I;q.1f.54=18.3S(T(M.54)||aC);if(M.fx&&M.fx.1K==7M){if(!M.fx.1u||!/c6|1z|a7/.48(M.fx.1u)){M.fx.1u=\\'1z\\'}if(M.fx.1u==\\'1z\\'&&!k.fx.1z)E;if(M.fx.1u==\\'a7\\'&&!k.fx.61)E;M.fx.1m=18.3S(T(M.fx.1m)||8J);if(M.fx.1m>q.1f.54){M.fx.1m=q.1f.54-2a}q.1f.fx=M.fx}q.1f.4e=S;q.1f.9x=I;k(q).1p(\\'bU\\',\\'eN\\').6K(u(){k.N.1d=q;k.N.4y=q.2y}).dH(k.N.eJ).6y(k.N.bU).5B(u(){k.N.2I=1X.9T(k.N.4w,hM)})})}};k.fn.hR=k.N.2r;k.1y={2I:S,4Q:S,29:S,2D:10,26:u(el,4J,2D,eG){k.1y.4Q=el;k.1y.29=4J;k.1y.2D=T(2D)||10;k.1y.2I=1X.6V(k.1y.eF,T(eG)||40)},eF:u(){24(i=0;i<k.1y.29.1g;i++){if(!k.1y.29[i].2X){k.1y.29[i].2X=k.23(k.1a.7G(k.1y.29[i]),k.1a.74(k.1y.29[i]),k.1a.6z(k.1y.29[i]))}P{k.1y.29[i].2X.t=k.1y.29[i].3d;k.1y.29[i].2X.l=k.1y.29[i].3c}if(k.1y.4Q.A&&k.1y.4Q.A.7q==1b){69={x:k.1y.4Q.A.2v,y:k.1y.4Q.A.2q,1C:k.1y.4Q.A.1B.1C,hb:k.1y.4Q.A.1B.hb}}P{69=k.23(k.1a.7G(k.1y.4Q),k.1a.74(k.1y.4Q))}if(k.1y.29[i].2X.t>0&&k.1y.29[i].2X.y+k.1y.29[i].2X.t>69.y){k.1y.29[i].3d-=k.1y.2D}P if(k.1y.29[i].2X.t<=k.1y.29[i].2X.h&&k.1y.29[i].2X.t+k.1y.29[i].2X.hb<69.y+69.hb){k.1y.29[i].3d+=k.1y.2D}if(k.1y.29[i].2X.l>0&&k.1y.29[i].2X.x+k.1y.29[i].2X.l>69.x){k.1y.29[i].3c-=k.1y.2D}P if(k.1y.29[i].2X.l<=k.1y.29[i].2X.hP&&k.1y.29[i].2X.l+k.1y.29[i].2X.1C<69.x+69.1C){k.1y.29[i].3c+=k.1y.2D}}},8o:u(){1X.5T(k.1y.2I);k.1y.4Q=S;k.1y.29=S;24(i in k.1y.29){k.1y.29[i].2X=S}}};k.11={1c:S,F:S,4U:u(){E q.1E(u(){if(q.9I){q.A.5e.3q(\\'5v\\',k.11.bN);q.A=S;q.9I=I;if(k.3a.4t){q.bE=\"eN\"}P{q.14.hq=\\'\\';q.14.e1=\\'\\';q.14.e7=\\'\\'}}})},bN:u(e){if(k.11.F!=S){k.11.9A(e);E I}D C=q.3U;k(1h).1J(\\'3D\\',k.11.bX).1J(\\'5P\\',k.11.9A);C.A.1s=k.1a.4a(e);C.A.4B=C.A.1s;C.A.7q=I;C.A.ho=q!=q.3U;k.11.F=C;if(C.A.5i&&q!=q.3U){bS=k.1a.3w(C.31);bQ=k.1a.2o(C);bR={x:T(k.B(C,\\'O\\'))||0,y:T(k.B(C,\\'Q\\'))||0};dx=C.A.4B.x-bS.x-bQ.1C/2-bR.x;dy=C.A.4B.y-bS.y-bQ.hb/2-bR.y;k.3b.5c(C,[dx,dy])}E k.7n||I},ea:u(e){D C=k.11.F;C.A.7q=1b;D 9G=C.14;C.A.7V=k.B(C,\\'19\\');C.A.4n=k.B(C,\\'Y\\');if(!C.A.cz)C.A.cz=C.A.4n;C.A.2c={x:T(k.B(C,\\'O\\'))||0,y:T(k.B(C,\\'Q\\'))||0};C.A.9B=0;C.A.ai=0;if(k.3a.4t){D bW=k.1a.6U(C,1b);C.A.9B=bW.l||0;C.A.ai=bW.t||0}C.A.1B=k.23(k.1a.3w(C),k.1a.2o(C));if(C.A.4n!=\\'2s\\'&&C.A.4n!=\\'1P\\'){9G.Y=\\'2s\\'}k.11.1c.5o();D 5g=C.fI(1b);k(5g).B({19:\\'2B\\',O:\\'2P\\',Q:\\'2P\\'});5g.14.5K=\\'0\\';5g.14.5z=\\'0\\';5g.14.5k=\\'0\\';5g.14.5j=\\'0\\';k.11.1c.1S(5g);D 3Y=k.11.1c.K(0).14;if(C.A.bD){3Y.Z=\\'9F\\';3Y.W=\\'9F\\'}P{3Y.W=C.A.1B.hb+\\'U\\';3Y.Z=C.A.1B.1C+\\'U\\'}3Y.19=\\'2B\\';3Y.5K=\\'2P\\';3Y.5z=\\'2P\\';3Y.5k=\\'2P\\';3Y.5j=\\'2P\\';k.23(C.A.1B,k.1a.2o(5g));if(C.A.2V){if(C.A.2V.O){C.A.2c.x+=C.A.1s.x-C.A.1B.x-C.A.2V.O;C.A.1B.x=C.A.1s.x-C.A.2V.O}if(C.A.2V.Q){C.A.2c.y+=C.A.1s.y-C.A.1B.y-C.A.2V.Q;C.A.1B.y=C.A.1s.y-C.A.2V.Q}if(C.A.2V.2L){C.A.2c.x+=C.A.1s.x-C.A.1B.x-C.A.1B.hb+C.A.2V.2L;C.A.1B.x=C.A.1s.x-C.A.1B.1C+C.A.2V.2L}if(C.A.2V.4D){C.A.2c.y+=C.A.1s.y-C.A.1B.y-C.A.1B.hb+C.A.2V.4D;C.A.1B.y=C.A.1s.y-C.A.1B.hb+C.A.2V.4D}}C.A.2v=C.A.2c.x;C.A.2q=C.A.2c.y;if(C.A.8s||C.A.2p==\\'94\\'){8U=k.1a.6U(C.31,1b);C.A.1B.x=C.8t+(k.3a.4t?0:k.3a.7I?-8U.l:8U.l);C.A.1B.y=C.8G+(k.3a.4t?0:k.3a.7I?-8U.t:8U.t);k(C.31).1S(k.11.1c.K(0))}if(C.A.2p){k.11.c5(C);C.A.5t.2p=k.11.ce}if(C.A.5i){k.3b.ct(C)}3Y.O=C.A.1B.x-C.A.9B+\\'U\\';3Y.Q=C.A.1B.y-C.A.ai+\\'U\\';3Y.Z=C.A.1B.1C+\\'U\\';3Y.W=C.A.1B.hb+\\'U\\';k.11.F.A.9E=I;if(C.A.gx){C.A.5t.6a=k.11.c7}if(C.A.3I!=I){k.11.1c.B(\\'3I\\',C.A.3I)}if(C.A.1G){k.11.1c.B(\\'1G\\',C.A.1G);if(1X.71){k.11.1c.B(\\'5E\\',\\'8V(1G=\\'+C.A.1G*2a+\\')\\')}}if(C.A.7O){k.11.1c.2R(C.A.7O);k.11.1c.K(0).7c.14.19=\\'1o\\'}if(C.A.4o)C.A.4o.1D(C,[5g,C.A.2c.x,C.A.2c.y]);if(k.1x&&k.1x.8D>0){k.1x.ed(C)}if(C.A.46==I){9G.19=\\'1o\\'}E I},c5:u(C){if(C.A.2p.1K==b0){if(C.A.2p==\\'94\\'){C.A.28=k.23({x:0,y:0},k.1a.2o(C.31));D 8S=k.1a.6U(C.31,1b);C.A.28.w=C.A.28.1C-8S.l-8S.r;C.A.28.h=C.A.28.hb-8S.t-8S.b}P if(C.A.2p==\\'1h\\'){D bY=k.1a.bm();C.A.28={x:0,y:0,w:bY.w,h:bY.h}}}P if(C.A.2p.1K==7F){C.A.28={x:T(C.A.2p[0])||0,y:T(C.A.2p[1])||0,w:T(C.A.2p[2])||0,h:T(C.A.2p[3])||0}}C.A.28.dx=C.A.28.x-C.A.1B.x;C.A.28.dy=C.A.28.y-C.A.1B.y},9H:u(F){if(F.A.8s||F.A.2p==\\'94\\'){k(\\'2e\\',1h).1S(k.11.1c.K(0))}k.11.1c.5o().2G().B(\\'1G\\',1);if(1X.71){k.11.1c.B(\\'5E\\',\\'8V(1G=2a)\\')}},9A:u(e){k(1h).3q(\\'3D\\',k.11.bX).3q(\\'5P\\',k.11.9A);if(k.11.F==S){E}D F=k.11.F;k.11.F=S;if(F.A.7q==I){E I}if(F.A.44==1b){k(F).B(\\'Y\\',F.A.4n)}D 9G=F.14;if(F.5i){k.11.1c.B(\\'9b\\',\\'8j\\')}if(F.A.7O){k.11.1c.4i(F.A.7O)}if(F.A.6N==I){if(F.A.fx>0){if(!F.A.1O||F.A.1O==\\'4j\\'){D x=12 k.fx(F,{1m:F.A.fx},\\'O\\');x.1L(F.A.2c.x,F.A.8y)}if(!F.A.1O||F.A.1O==\\'49\\'){D y=12 k.fx(F,{1m:F.A.fx},\\'Q\\');y.1L(F.A.2c.y,F.A.8v)}}P{if(!F.A.1O||F.A.1O==\\'4j\\')F.14.O=F.A.8y+\\'U\\';if(!F.A.1O||F.A.1O==\\'49\\')F.14.Q=F.A.8v+\\'U\\'}k.11.9H(F);if(F.A.46==I){k(F).B(\\'19\\',F.A.7V)}}P if(F.A.fx>0){F.A.9E=1b;D dh=I;if(k.1x&&k.1t&&F.A.44){dh=k.1a.3w(k.1t.1c.K(0))}k.11.1c.5w({O:dh?dh.x:F.A.1B.x,Q:dh?dh.y:F.A.1B.y},F.A.fx,u(){F.A.9E=I;if(F.A.46==I){F.14.19=F.A.7V}k.11.9H(F)})}P{k.11.9H(F);if(F.A.46==I){k(F).B(\\'19\\',F.A.7V)}}if(k.1x&&k.1x.8D>0){k.1x.eO(F)}if(k.1t&&F.A.44){k.1t.fC(F)}if(F.A.2Z&&(F.A.8y!=F.A.2c.x||F.A.8v!=F.A.2c.y)){F.A.2Z.1D(F,F.A.b3||[0,0,F.A.8y,F.A.8v])}if(F.A.3T)F.A.3T.1D(F);E I},c7:u(x,y,dx,dy){if(dx!=0)dx=T((dx+(q.A.gx*dx/18.3S(dx))/2)/q.A.gx)*q.A.gx;if(dy!=0)dy=T((dy+(q.A.gy*dy/18.3S(dy))/2)/q.A.gy)*q.A.gy;E{dx:dx,dy:dy,x:0,y:0}},ce:u(x,y,dx,dy){dx=18.3L(18.3r(dx,q.A.28.dx),q.A.28.w+q.A.28.dx-q.A.1B.1C);dy=18.3L(18.3r(dy,q.A.28.dy),q.A.28.h+q.A.28.dy-q.A.1B.hb);E{dx:dx,dy:dy,x:0,y:0}},bX:u(e){if(k.11.F==S||k.11.F.A.9E==1b){E}D F=k.11.F;F.A.4B=k.1a.4a(e);if(F.A.7q==I){45=18.ez(18.6b(F.A.1s.x-F.A.4B.x,2)+18.6b(F.A.1s.y-F.A.4B.y,2));if(45<F.A.6M){E}P{k.11.ea(e)}}D dx=F.A.4B.x-F.A.1s.x;D dy=F.A.4B.y-F.A.1s.y;24(D i in F.A.5t){D 3y=F.A.5t[i].1D(F,[F.A.2c.x+dx,F.A.2c.y+dy,dx,dy]);if(3y&&3y.1K==7M){dx=i!=\\'7R\\'?3y.dx:(3y.x-F.A.2c.x);dy=i!=\\'7R\\'?3y.dy:(3y.y-F.A.2c.y)}}F.A.2v=F.A.1B.x+dx-F.A.9B;F.A.2q=F.A.1B.y+dy-F.A.ai;if(F.A.5i&&(F.A.3H||F.A.2Z)){k.3b.3H(F,F.A.2v,F.A.2q)}if(F.A.4m)F.A.4m.1D(F,[F.A.2c.x+dx,F.A.2c.y+dy]);if(!F.A.1O||F.A.1O==\\'4j\\'){F.A.8y=F.A.2c.x+dx;k.11.1c.K(0).14.O=F.A.2v+\\'U\\'}if(!F.A.1O||F.A.1O==\\'49\\'){F.A.8v=F.A.2c.y+dy;k.11.1c.K(0).14.Q=F.A.2q+\\'U\\'}if(k.1x&&k.1x.8D>0){k.1x.al(F)}E I},2r:u(o){if(!k.11.1c){k(\\'2e\\',1h).1S(\\'<22 id=\"e8\"></22>\\');k.11.1c=k(\\'#e8\\');D el=k.11.1c.K(0);D 4J=el.14;4J.Y=\\'1P\\';4J.19=\\'1o\\';4J.9b=\\'8j\\';4J.eu=\\'1o\\';4J.2U=\\'2K\\';if(1X.71){el.bE=\"e4\"}P{4J.gi=\\'1o\\';4J.e7=\\'1o\\';4J.e1=\\'1o\\'}}if(!o){o={}}E q.1E(u(){if(q.9I||!k.1a)E;if(1X.71){q.gh=u(){E I};q.gj=u(){E I}}D el=q;D 5e=o.3v?k(q).gf(o.3v):k(q);if(k.3a.4t){5e.1E(u(){q.bE=\"e4\"})}P{5e.B(\\'-gI-7R-8C\\',\\'1o\\');5e.B(\\'7R-8C\\',\\'1o\\');5e.B(\\'-gH-7R-8C\\',\\'1o\\')}q.A={5e:5e,6N:o.6N?1b:I,46:o.46?1b:I,44:o.44?o.44:I,5i:o.5i?o.5i:I,8s:o.8s?o.8s:I,3I:o.3I?T(o.3I)||0:I,1G:o.1G?2m(o.1G):I,fx:T(o.fx)||S,6R:o.6R?o.6R:I,5t:{},1s:{},4o:o.4o&&o.4o.1K==2A?o.4o:I,3T:o.3T&&o.3T.1K==2A?o.3T:I,2Z:o.2Z&&o.2Z.1K==2A?o.2Z:I,1O:/49|4j/.48(o.1O)?o.1O:I,6M:o.6M?T(o.6M)||0:0,2V:o.2V?o.2V:I,bD:o.bD?1b:I,7O:o.7O||I};if(o.5t&&o.5t.1K==2A)q.A.5t.7R=o.5t;if(o.4m&&o.4m.1K==2A)q.A.4m=o.4m;if(o.2p&&((o.2p.1K==b0&&(o.2p==\\'94\\'||o.2p==\\'1h\\'))||(o.2p.1K==7F&&o.2p.1g==4))){q.A.2p=o.2p}if(o.2O){q.A.2O=o.2O}if(o.6a){if(2g o.6a==\\'gz\\'){q.A.gx=T(o.6a)||1;q.A.gy=T(o.6a)||1}P if(o.6a.1g==2){q.A.gx=T(o.6a[0])||1;q.A.gy=T(o.6a[1])||1}}if(o.3H&&o.3H.1K==2A){q.A.3H=o.3H}q.9I=1b;5e.1E(u(){q.3U=el});5e.1J(\\'5v\\',k.11.bN)})}};k.fn.23({aS:k.11.4U,7t:k.11.2r});k.1x={du:u(5J,5G,7Q,7S){E 5J<=k.11.F.A.2v&&(5J+7Q)>=(k.11.F.A.2v+k.11.F.A.1B.w)&&5G<=k.11.F.A.2q&&(5G+7S)>=(k.11.F.A.2q+k.11.F.A.1B.h)?1b:I},cV:u(5J,5G,7Q,7S){E!(5J>(k.11.F.A.2v+k.11.F.A.1B.w)||(5J+7Q)<k.11.F.A.2v||5G>(k.11.F.A.2q+k.11.F.A.1B.h)||(5G+7S)<k.11.F.A.2q)?1b:I},1s:u(5J,5G,7Q,7S){E 5J<k.11.F.A.4B.x&&(5J+7Q)>k.11.F.A.4B.x&&5G<k.11.F.A.4B.y&&(5G+7S)>k.11.F.A.4B.y?1b:I},5r:I,3Q:{},8D:0,3P:{},ed:u(C){if(k.11.F==S){E}D i;k.1x.3Q={};D bJ=I;24(i in k.1x.3P){if(k.1x.3P[i]!=S){D 1j=k.1x.3P[i].K(0);if(k(k.11.F).is(\\'.\\'+1j.1i.a)){if(1j.1i.m==I){1j.1i.p=k.23(k.1a.7G(1j),k.1a.74(1j));1j.1i.m=1b}if(1j.1i.ac){k.1x.3P[i].2R(1j.1i.ac)}k.1x.3Q[i]=k.1x.3P[i];if(k.1t&&1j.1i.s&&k.11.F.A.44){1j.1i.el=k(\\'.\\'+1j.1i.a,1j);C.14.19=\\'1o\\';k.1t.cT(1j);1j.1i.ay=k.1t.8x(k.1p(1j,\\'id\\')).7l;C.14.19=C.A.7V;bJ=1b}if(1j.1i.9i){1j.1i.9i.1D(k.1x.3P[i].K(0),[k.11.F])}}}}if(bJ){k.1t.26()}},dS:u(){k.1x.3Q={};24(i in k.1x.3P){if(k.1x.3P[i]!=S){D 1j=k.1x.3P[i].K(0);if(k(k.11.F).is(\\'.\\'+1j.1i.a)){1j.1i.p=k.23(k.1a.7G(1j),k.1a.74(1j));if(1j.1i.ac){k.1x.3P[i].2R(1j.1i.ac)}k.1x.3Q[i]=k.1x.3P[i];if(k.1t&&1j.1i.s&&k.11.F.A.44){1j.1i.el=k(\\'.\\'+1j.1i.a,1j);C.14.19=\\'1o\\';k.1t.cT(1j);C.14.19=C.A.7V}}}}},al:u(e){if(k.11.F==S){E}k.1x.5r=I;D i;D bK=I;D eQ=0;24(i in k.1x.3Q){D 1j=k.1x.3Q[i].K(0);if(k.1x.5r==I&&k.1x[1j.1i.t](1j.1i.p.x,1j.1i.p.y,1j.1i.p.1C,1j.1i.p.hb)){if(1j.1i.hc&&1j.1i.h==I){k.1x.3Q[i].2R(1j.1i.hc)}if(1j.1i.h==I&&1j.1i.7x){bK=1b}1j.1i.h=1b;k.1x.5r=1j;if(k.1t&&1j.1i.s&&k.11.F.A.44){k.1t.1c.K(0).3l=1j.1i.eV;k.1t.al(1j)}eQ++}P if(1j.1i.h==1b){if(1j.1i.7y){1j.1i.7y.1D(1j,[e,k.11.1c.K(0).7c,1j.1i.fx])}if(1j.1i.hc){k.1x.3Q[i].4i(1j.1i.hc)}1j.1i.h=I}}if(k.1t&&!k.1x.5r&&k.11.F.44){k.1t.1c.K(0).14.19=\\'1o\\'}if(bK){k.1x.5r.1i.7x.1D(k.1x.5r,[e,k.11.1c.K(0).7c])}},eO:u(e){D i;24(i in k.1x.3Q){D 1j=k.1x.3Q[i].K(0);if(1j.1i.ac){k.1x.3Q[i].4i(1j.1i.ac)}if(1j.1i.hc){k.1x.3Q[i].4i(1j.1i.hc)}if(1j.1i.s){k.1t.7s[k.1t.7s.1g]=i}if(1j.1i.9l&&1j.1i.h==1b){1j.1i.h=I;1j.1i.9l.1D(1j,[e,1j.1i.fx])}1j.1i.m=I;1j.1i.h=I}k.1x.3Q={}},4U:u(){E q.1E(u(){if(q.9j){if(q.1i.s){id=k.1p(q,\\'id\\');k.1t.5L[id]=S;k(\\'.\\'+q.1i.a,q).aS()}k.1x.3P[\\'d\\'+q.c2]=S;q.9j=I;q.f=S}})},2r:u(o){E q.1E(u(){if(q.9j==1b||!o.3C||!k.1a||!k.11){E}q.1i={a:o.3C,ac:o.9J||I,hc:o.a5||I,eV:o.58||I,9l:o.gq||o.9l||I,7x:o.7x||o.dC||I,7y:o.7y||o.fO||I,9i:o.9i||I,t:o.6I&&(o.6I==\\'du\\'||o.6I==\\'cV\\')?o.6I:\\'1s\\',fx:o.fx?o.fx:I,m:I,h:I};if(o.cQ==1b&&k.1t){id=k.1p(q,\\'id\\');k.1t.5L[id]=q.1i.a;q.1i.s=1b;if(o.2Z){q.1i.2Z=o.2Z;q.1i.ay=k.1t.8x(id).7l}}q.9j=1b;q.c2=T(18.6o()*c9);k.1x.3P[\\'d\\'+q.c2]=k(q);k.1x.8D++})}};k.fn.23({dR:k.1x.4U,do:k.1x.2r});k.gD=k.1x.dS;k.3B={1c:S,8L:u(){3g=q.2y;if(!3g)E;14={dz:k(q).B(\\'dz\\')||\\'\\',4A:k(q).B(\\'4A\\')||\\'\\',8Z:k(q).B(\\'8Z\\')||\\'\\',dP:k(q).B(\\'dP\\')||\\'\\',dT:k(q).B(\\'dT\\')||\\'\\',dU:k(q).B(\\'dU\\')||\\'\\',c3:k(q).B(\\'c3\\')||\\'\\',dY:k(q).B(\\'dY\\')||\\'\\'};k.3B.1c.B(14);3x=k.3B.dX(3g);3x=3x.4E(12 bb(\"\\\\\\\\n\",\"g\"),\"<br />\");k.3B.1c.3x(\\'gL\\');ci=k.3B.1c.K(0).4c;k.3B.1c.3x(3x);Z=k.3B.1c.K(0).4c+ci;if(q.6l.2M&&Z>q.6l.2M[0]){Z=q.6l.2M[0]}q.14.Z=Z+\\'U\\';if(q.4Y==\\'cf\\'){W=k.3B.1c.K(0).5W+ci;if(q.6l.2M&&W>q.6l.2M[1]){W=q.6l.2M[1]}q.14.W=W+\\'U\\'}},dX:u(3g){cg={\\'&\\':\\'&gK;\\',\\'<\\':\\'&gJ;\\',\\'>\\':\\'&gt;\\',\\'\"\\':\\'&gs;\\'};24(i in cg){3g=3g.4E(12 bb(i,\\'g\\'),cg[i])}E 3g},2r:u(2M){if(k.3B.1c==S){k(\\'2e\\',1h).1S(\\'<22 id=\"dE\" 14=\"Y: 1P; Q: 0; O: 0; 3n: 2K;\"></22>\\');k.3B.1c=k(\\'#dE\\')}E q.1E(u(){if(/cf|ch/.48(q.4Y)){if(q.4Y==\\'ch\\'){dB=q.5C(\\'1u\\');if(!/3g|gr/.48(dB)){E}}if(2M&&(2M.1K==bn||(2M.1K==7F&&2M.1g==2))){if(2M.1K==bn)2M=[2M,2M];P{2M[0]=T(2M[0])||8J;2M[1]=T(2M[1])||8J}q.6l={2M:2M}}k(q).5B(k.3B.8L).6y(k.3B.8L).dH(k.3B.8L);k.3B.8L.1D(q)}})}};k.fn.kc=k.3B.2r;k.4K=u(e){if(/^kd$|^ke$|^ka$|^6L$|^k9$|^k5$|^k4$|^k6$|^k7$|^2e$|^k8$|^kf$|^kg$|^kn$|^ko$|^kp$|^kq$/i.48(e.9N))E I;P E 1b};k.fx.a0=u(e,65){D c=e.7c;D cs=c.14;cs.Y=65.Y;cs.5K=65.3G.t;cs.5j=65.3G.l;cs.5k=65.3G.b;cs.5z=65.3G.r;cs.Q=65.Q+\\'U\\';cs.O=65.O+\\'U\\';e.31.ew(c,e);e.31.km(e)};k.fx.9P=u(e){if(!k.4K(e))E I;D t=k(e);D es=e.14;D 73=I;if(t.B(\\'19\\')==\\'1o\\'){5Y=t.B(\\'3n\\');t.B(\\'3n\\',\\'2K\\').1Y();73=1b}D V={};V.Y=t.B(\\'Y\\');V.1q=k.1a.2o(e);V.3G=k.1a.cy(e);D co=e.4Z?e.4Z.ei:t.B(\\'hU\\');V.Q=T(t.B(\\'Q\\'))||0;V.O=T(t.B(\\'O\\'))||0;D eo=\\'kl\\'+T(18.6o()*c9);D 6u=1h.3F(/^1T$|^br$|^kh$|^hr$|^8C$|^kj$|^8T$|^3A$|^kk$|^k3$|^k2$|^9h$|^dl$|^jM$/i.48(e.9N)?\\'22\\':e.9N);k.1p(6u,\\'id\\',eo);D jN=k(6u).2R(\\'jO\\');D 4h=6u.14;D Q=0;D O=0;if(V.Y==\\'2s\\'||V.Y==\\'1P\\'){Q=V.Q;O=V.O}4h.Q=Q+\\'U\\';4h.O=O+\\'U\\';4h.Y=V.Y!=\\'2s\\'&&V.Y!=\\'1P\\'?\\'2s\\':V.Y;4h.W=V.1q.hb+\\'U\\';4h.Z=V.1q.1C+\\'U\\';4h.5K=V.3G.t;4h.5z=V.3G.r;4h.5k=V.3G.b;4h.5j=V.3G.l;4h.2U=\\'2K\\';if(k.3a.4t){4h.ei=co}P{4h.jK=co}if(k.3a==\"4t\"){es.5E=\"8V(1G=\"+0.ex*2a+\")\"}es.1G=0.ex;e.31.ew(6u,e);6u.jF(e);es.5K=\\'2P\\';es.5z=\\'2P\\';es.5k=\\'2P\\';es.5j=\\'2P\\';es.Y=\\'1P\\';es.eu=\\'1o\\';es.Q=\\'2P\\';es.O=\\'2P\\';if(73){t.2G();es.3n=5Y}E{V:V,3p:k(6u)}};k.fx.8E={jE:[0,1V,1V],jG:[eD,1V,1V],jH:[e6,e6,jI],jP:[0,0,0],ks:[0,0,1V],jY:[dv,42,42],jZ:[0,1V,1V],k0:[0,0,7w],k1:[0,7w,7w],jX:[cn,cn,cn],jS:[0,2a,0],jR:[jT,jU,eb],jV:[7w,0,7w],kr:[85,eb,47],kP:[1V,eA,0],kN:[kO,50,kx],kF:[7w,0,0],kD:[ku,f8,kt],ky:[kH,0,9C],kL:[1V,0,1V],kM:[1V,kJ,0],kv:[0,6C,0],kA:[75,0,kE],kC:[eD,eB,eA],kG:[kI,kB,eB],kw:[e0,1V,1V],kz:[eL,kK,eL],kQ:[9C,9C,9C],jC:[1V,iy,iz],iA:[1V,1V,e0],iB:[0,1V,0],ix:[1V,0,1V],iv:[6C,0,0],iq:[0,0,6C],ip:[6C,6C,0],ir:[1V,dv,0],it:[1V,ah,iu],iC:[6C,0,6C],iD:[1V,0,0],iK:[ah,ah,ah],iL:[1V,1V,1V],iM:[1V,1V,0]};k.fx.6D=u(4x,dm){if(k.fx.8E[4x])E{r:k.fx.8E[4x][0],g:k.fx.8E[4x][1],b:k.fx.8E[4x][2]};P if(2W=/^6Y\\\\(\\\\s*([0-9]{1,3})\\\\s*,\\\\s*([0-9]{1,3})\\\\s*,\\\\s*([0-9]{1,3})\\\\s*\\\\)$/.a4(4x))E{r:T(2W[1]),g:T(2W[2]),b:T(2W[3])};P if(2W=/6Y\\\\(\\\\s*([0-9]+(?:\\\\.[0-9]+)?)\\\\%\\\\s*,\\\\s*([0-9]+(?:\\\\.[0-9]+)?)\\\\%\\\\s*,\\\\s*([0-9]+(?:\\\\.[0-9]+)?)\\\\%\\\\s*\\\\)$/.a4(4x))E{r:2m(2W[1])*2.55,g:2m(2W[2])*2.55,b:2m(2W[3])*2.55};P if(2W=/^#([a-fA-79-9])([a-fA-79-9])([a-fA-79-9])$/.a4(4x))E{r:T(\"77\"+2W[1]+2W[1]),g:T(\"77\"+2W[2]+2W[2]),b:T(\"77\"+2W[3]+2W[3])};P if(2W=/^#([a-fA-79-9]{2})([a-fA-79-9]{2})([a-fA-79-9]{2})$/.a4(4x))E{r:T(\"77\"+2W[1]),g:T(\"77\"+2W[2]),b:T(\"77\"+2W[3])};P E dm==1b?I:{r:1V,g:1V,b:1V}};k.fx.dD={5Q:1,5b:1,5O:1,4S:1,4D:1,4A:1,W:1,O:1,c3:1,iI:1,5k:1,5j:1,5z:1,5K:1,8b:1,6x:1,8c:1,av:1,1G:1,iE:1,iF:1,5n:1,4X:1,5U:1,5M:1,2L:1,jD:1,Q:1,Z:1,3I:1};k.fx.dA={7i:1,iG:1,iH:1,io:1,im:1,4x:1,i2:1};k.fx.8A=[\\'i3\\',\\'i4\\',\\'i5\\',\\'i1\\'];k.fx.cc={\\'cd\\':[\\'2E\\',\\'dK\\'],\\'a8\\':[\\'2E\\',\\'bh\\'],\\'6w\\':[\\'6w\\',\\'\\'],\\'8F\\':[\\'8F\\',\\'\\']};k.fn.23({5w:u(5X,H,G,J){E q.1w(u(){D a1=k.H(H,G,J);D e=12 k.dM(q,a1,5X)})},c4:u(H,J){E q.1w(u(){D a1=k.H(H,J);D e=12 k.c4(q,a1)})},8o:u(2D){E q.1E(u(){if(q.6d)k.by(q,2D)})},i0:u(2D){E q.1E(u(){if(q.6d)k.by(q,2D);if(q.1w&&q.1w[\\'fx\\'])q.1w.fx=[]})}});k.23({c4:u(2f,M){D z=q,3t;z.2D=u(){if(k.fQ(M.21))M.21.1D(2f)};z.2I=6V(u(){z.2D()},M.1m);2f.6d=z},G:{c8:u(p,n,1W,1H,1m){E((-18.5H(p*18.2Q)/2)+0.5)*1H+1W}},dM:u(2f,M,5X){D z=q,3t;D y=2f.14;D fR=k.B(2f,\"2U\");D 72=k.B(2f,\"19\");D 2j={};z.9O=(12 7g()).7z();M.G=M.G&&k.G[M.G]?M.G:\\'c8\\';z.ag=u(2w,43){if(k.fx.dD[2w]){if(43==\\'1Y\\'||43==\\'2G\\'||43==\\'3R\\'){if(!2f.6v)2f.6v={};D r=2m(k.6E(2f,2w));2f.6v[2w]=r&&r>-c9?r:(2m(k.B(2f,2w))||0);43=43==\\'3R\\'?(72==\\'1o\\'?\\'1Y\\':\\'2G\\'):43;M[43]=1b;2j[2w]=43==\\'1Y\\'?[0,2f.6v[2w]]:[2f.6v[2w],0];if(2w!=\\'1G\\')y[2w]=2j[2w][0]+(2w!=\\'3I\\'&&2w!=\\'8Z\\'?\\'U\\':\\'\\');P k.1p(y,\"1G\",2j[2w][0])}P{2j[2w]=[2m(k.6E(2f,2w)),2m(43)||0]}}P if(k.fx.dA[2w])2j[2w]=[k.fx.6D(k.6E(2f,2w)),k.fx.6D(43)];P if(/^6w$|8F$|2E$|a8$|cd$/i.48(2w)){D m=43.4E(/\\\\s+/g,\\' \\').4E(/6Y\\\\s*\\\\(\\\\s*/g,\\'6Y(\\').4E(/\\\\s*,\\\\s*/g,\\',\\').4E(/\\\\s*\\\\)/g,\\')\\').d5(/([^\\\\s]+)/g);3m(2w){1e\\'6w\\':1e\\'8F\\':1e\\'cd\\':1e\\'a8\\':m[3]=m[3]||m[1]||m[0];m[2]=m[2]||m[0];m[1]=m[1]||m[0];24(D i=0;i<k.fx.8A.1g;i++){D 64=k.fx.cc[2w][0]+k.fx.8A[i]+k.fx.cc[2w][1];2j[64]=2w==\\'a8\\'?[k.fx.6D(k.6E(2f,64)),k.fx.6D(m[i])]:[2m(k.6E(2f,64)),2m(m[i])]}1r;1e\\'2E\\':24(D i=0;i<m.1g;i++){D bd=2m(m[i]);D a9=!hX(bd)?\\'dK\\':(!/cu|1o|2K|hY|hZ|i6|i7|ii|ij|ik|il/i.48(m[i])?\\'bh\\':I);if(a9){24(D j=0;j<k.fx.8A.1g;j++){64=\\'2E\\'+k.fx.8A[j]+a9;2j[64]=a9==\\'bh\\'?[k.fx.6D(k.6E(2f,64)),k.fx.6D(m[i])]:[2m(k.6E(2f,64)),bd]}}P{y[\\'ie\\']=m[i]}}1r}}P{y[2w]=43}E I};24(p in 5X){if(p==\\'14\\'){D 5f=k.bl(5X[p]);24(7A in 5f){q.ag(7A,5f[7A])}}P if(p==\\'3l\\'){if(1h.af)24(D i=0;i<1h.af.1g;i++){D 7e=1h.af[i].7e||1h.af[i].i9||S;if(7e){24(D j=0;j<7e.1g;j++){if(7e[j].i8==\\'.\\'+5X[p]){D 6X=12 bb(\\'\\\\.\\'+5X[p]+\\' {\\');D 5Z=7e[j].14.9X;D 5f=k.bl(5Z.4E(6X,\\'\\').4E(/}/g,\\'\\'));24(7A in 5f){q.ag(7A,5f[7A])}}}}}}P{q.ag(p,5X[p])}}y.19=72==\\'1o\\'?\\'2B\\':72;y.2U=\\'2K\\';z.2D=u(){D t=(12 7g()).7z();if(t>M.1m+z.9O){5T(z.2I);z.2I=S;24(p in 2j){if(p==\"1G\")k.1p(y,\"1G\",2j[p][1]);P if(2g 2j[p][1]==\\'8T\\')y[p]=\\'6Y(\\'+2j[p][1].r+\\',\\'+2j[p][1].g+\\',\\'+2j[p][1].b+\\')\\';P y[p]=2j[p][1]+(p!=\\'3I\\'&&p!=\\'8Z\\'?\\'U\\':\\'\\')}if(M.2G||M.1Y)24(D p in 2f.6v)if(p==\"1G\")k.1p(y,p,2f.6v[p]);P y[p]=\"\";y.19=M.2G?\\'1o\\':(72!=\\'1o\\'?72:\\'2B\\');y.2U=fR;2f.6d=S;if(k.fQ(M.21))M.21.1D(2f)}P{D n=t-q.9O;D 8w=n/M.1m;24(p in 2j){if(2g 2j[p][1]==\\'8T\\'){y[p]=\\'6Y(\\'+T(k.G[M.G](8w,n,2j[p][0].r,(2j[p][1].r-2j[p][0].r),M.1m))+\\',\\'+T(k.G[M.G](8w,n,2j[p][0].g,(2j[p][1].g-2j[p][0].g),M.1m))+\\',\\'+T(k.G[M.G](8w,n,2j[p][0].b,(2j[p][1].b-2j[p][0].b),M.1m))+\\')\\'}P{D bz=k.G[M.G](8w,n,2j[p][0],(2j[p][1]-2j[p][0]),M.1m);if(p==\"1G\")k.1p(y,\"1G\",bz);P y[p]=bz+(p!=\\'3I\\'&&p!=\\'8Z\\'?\\'U\\':\\'\\')}}}};z.2I=6V(u(){z.2D()},13);2f.6d=z},by:u(2f,2D){if(2D)2f.6d.9O-=iO;P{1X.5T(2f.6d.2I);2f.6d=S;k.2H(2f,\"fx\")}}});k.bl=u(5Z){D 5f={};if(2g 5Z==\\'4V\\'){5Z=5Z.6c().7C(\\';\\');24(D i=0;i<5Z.1g;i++){6X=5Z[i].7C(\\':\\');if(6X.1g==2){5f[k.g6(6X[0].4E(/\\\\-(\\\\w)/g,u(m,c){E c.jo()}))]=k.g6(6X[1])}}}E 5f};k.fn.23({g3:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.61(q,H,J,\\'4F\\',G)})},gb:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.61(q,H,J,\\'4r\\',G)})},jl:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.61(q,H,J,\\'fJ\\',G)})},jk:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.61(q,H,J,\\'O\\',G)})},jg:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.61(q,H,J,\\'2L\\',G)})},jf:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.61(q,H,J,\\'fh\\',G)})}});k.fx.61=u(e,H,J,2S,G){if(!k.4K(e)){k.2H(e,\\'1n\\');E I}D z=q;z.el=k(e);z.1N=k.1a.2o(e);z.G=2g J==\\'4V\\'?J:G||S;if(!e.4s)e.4s=z.el.B(\\'19\\');if(2S==\\'fJ\\'){2S=z.el.B(\\'19\\')==\\'1o\\'?\\'4r\\':\\'4F\\'}P if(2S==\\'fh\\'){2S=z.el.B(\\'19\\')==\\'1o\\'?\\'2L\\':\\'O\\'}z.el.1Y();z.H=H;z.J=2g J==\\'u\\'?J:S;z.fx=k.fx.9P(e);z.2S=2S;z.21=u(){if(z.J&&z.J.1K==2A){z.J.1D(z.el.K(0))}if(z.2S==\\'4r\\'||z.2S==\\'2L\\'){z.el.B(\\'19\\',z.el.K(0).4s==\\'1o\\'?\\'2B\\':z.el.K(0).4s)}P{z.el.2G()}k.fx.a0(z.fx.3p.K(0),z.fx.V);k.2H(z.el.K(0),\\'1n\\')};3m(z.2S){1e\\'4F\\':63=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,z.21),\\'W\\');63.1L(z.fx.V.1q.hb,0);1r;1e\\'4r\\':z.fx.3p.B(\\'W\\',\\'9R\\');z.el.1Y();63=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,z.21),\\'W\\');63.1L(0,z.fx.V.1q.hb);1r;1e\\'O\\':63=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,z.21),\\'Z\\');63.1L(z.fx.V.1q.1C,0);1r;1e\\'2L\\':z.fx.3p.B(\\'Z\\',\\'9R\\');z.el.1Y();63=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,z.21),\\'Z\\');63.1L(0,z.fx.V.1q.1C);1r}};k.fn.ji=u(5D,J){E q.1w(\\'1n\\',u(){if(!k.4K(q)){k.2H(q,\\'1n\\');E I}D e=12 k.fx.f4(q,5D,J);e.bp()})};k.fx.f4=u(e,5D,J){D z=q;z.el=k(e);z.el.1Y();z.J=J;z.5D=T(5D)||40;z.V={};z.V.Y=z.el.B(\\'Y\\');z.V.Q=T(z.el.B(\\'Q\\'))||0;z.V.O=T(z.el.B(\\'O\\'))||0;if(z.V.Y!=\\'2s\\'&&z.V.Y!=\\'1P\\'){z.el.B(\\'Y\\',\\'2s\\')}z.3V=5;z.5y=1;z.bp=u(){z.5y++;z.e=12 k.fx(z.el.K(0),{1m:jj,21:u(){z.e=12 k.fx(z.el.K(0),{1m:80,21:u(){z.5D=T(z.5D/2);if(z.5y<=z.3V)z.bp();P{z.el.B(\\'Y\\',z.V.Y).B(\\'Q\\',z.V.Q+\\'U\\').B(\\'O\\',z.V.O+\\'U\\');k.2H(z.el.K(0),\\'1n\\');if(z.J&&z.J.1K==2A){z.J.1D(z.el.K(0))}}}},\\'Q\\');z.e.1L(z.V.Q-z.5D,z.V.Q)}},\\'Q\\');z.e.1L(z.V.Q,z.V.Q-z.5D)}};k.fn.23({jy:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.4f(q,H,J,\\'4r\\',\\'4l\\',G)})},jz:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.4f(q,H,J,\\'4r\\',\\'in\\',G)})},jA:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.4f(q,H,J,\\'4r\\',\\'3R\\',G)})},jB:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.4f(q,H,J,\\'4F\\',\\'4l\\',G)})},jx:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.4f(q,H,J,\\'4F\\',\\'in\\',G)})},jw:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.4f(q,H,J,\\'4F\\',\\'3R\\',G)})},js:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.4f(q,H,J,\\'O\\',\\'4l\\',G)})},jt:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.4f(q,H,J,\\'O\\',\\'in\\',G)})},ju:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.4f(q,H,J,\\'O\\',\\'3R\\',G)})},jv:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.4f(q,H,J,\\'2L\\',\\'4l\\',G)})},je:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.4f(q,H,J,\\'2L\\',\\'in\\',G)})},jd:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.4f(q,H,J,\\'2L\\',\\'3R\\',G)})}});k.fx.4f=u(e,H,J,2S,1u,G){if(!k.4K(e)){k.2H(e,\\'1n\\');E I}D z=q;z.el=k(e);z.G=2g J==\\'4V\\'?J:G||S;z.V={};z.V.Y=z.el.B(\\'Y\\');z.V.Q=z.el.B(\\'Q\\');z.V.O=z.el.B(\\'O\\');if(!e.4s)e.4s=z.el.B(\\'19\\');if(1u==\\'3R\\'){1u=z.el.B(\\'19\\')==\\'1o\\'?\\'in\\':\\'4l\\'}z.el.1Y();if(z.V.Y!=\\'2s\\'&&z.V.Y!=\\'1P\\'){z.el.B(\\'Y\\',\\'2s\\')}z.1u=1u;J=2g J==\\'u\\'?J:S;8H=1;3m(2S){1e\\'4F\\':z.e=12 k.fx(z.el.K(0),k.H(H-15,z.G,J),\\'Q\\');z.62=2m(z.V.Q)||0;z.9K=z.fG;8H=-1;1r;1e\\'4r\\':z.e=12 k.fx(z.el.K(0),k.H(H-15,z.G,J),\\'Q\\');z.62=2m(z.V.Q)||0;z.9K=z.fG;1r;1e\\'2L\\':z.e=12 k.fx(z.el.K(0),k.H(H-15,z.G,J),\\'O\\');z.62=2m(z.V.O)||0;z.9K=z.fy;1r;1e\\'O\\':z.e=12 k.fx(z.el.K(0),k.H(H-15,z.G,J),\\'O\\');z.62=2m(z.V.O)||0;z.9K=z.fy;8H=-1;1r}z.e2=12 k.fx(z.el.K(0),k.H(H,z.G,u(){z.el.B(z.V);if(z.1u==\\'4l\\'){z.el.B(\\'19\\',\\'1o\\')}P z.el.B(\\'19\\',z.el.K(0).4s==\\'1o\\'?\\'2B\\':z.el.K(0).4s);k.2H(z.el.K(0),\\'1n\\')}),\\'1G\\');if(1u==\\'in\\'){z.e.1L(z.62+2a*8H,z.62);z.e2.1L(0,1)}P{z.e.1L(z.62,z.62+2a*8H);z.e2.1L(1,0)}};k.fn.23({j0:u(H,W,J,G){E q.1w(\\'1n\\',u(){12 k.fx.9L(q,H,W,J,\\'fp\\',G)})},iW:u(H,W,J,G){E q.1w(\\'1n\\',u(){12 k.fx.9L(q,H,W,J,\\'9M\\',G)})},iV:u(H,W,J,G){E q.1w(\\'1n\\',u(){12 k.fx.9L(q,H,W,J,\\'3R\\',G)})}});k.fx.9L=u(e,H,W,J,1u,G){if(!k.4K(e)){k.2H(e,\\'1n\\');E I}D z=q;z.el=k(e);z.G=2g J==\\'4V\\'?J:G||S;z.J=2g J==\\'u\\'?J:S;if(1u==\\'3R\\'){1u=z.el.B(\\'19\\')==\\'1o\\'?\\'9M\\':\\'fp\\'}z.H=H;z.W=W&&W.1K==bn?W:20;z.fx=k.fx.9P(e);z.1u=1u;z.21=u(){if(z.J&&z.J.1K==2A){z.J.1D(z.el.K(0))}if(z.1u==\\'9M\\'){z.el.1Y()}P{z.el.2G()}k.fx.a0(z.fx.3p.K(0),z.fx.V);k.2H(z.el.K(0),\\'1n\\')};if(z.1u==\\'9M\\'){z.el.1Y();z.fx.3p.B(\\'W\\',z.W+\\'U\\').B(\\'Z\\',\\'9R\\');z.ef=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,u(){z.ef=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,z.21),\\'W\\');z.ef.1L(z.W,z.fx.V.1q.hb)}),\\'Z\\');z.ef.1L(0,z.fx.V.1q.1C)}P{z.ef=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,u(){z.ef=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,z.21),\\'Z\\');z.ef.1L(z.fx.V.1q.1C,0)}),\\'W\\');z.ef.1L(z.fx.V.1q.hb,z.W)}};k.fn.iR=u(H,4x,J,G){E q.1w(\\'fv\\',u(){q.6W=k(q).1p(\"14\")||\\'\\';G=2g J==\\'4V\\'?J:G||S;J=2g J==\\'u\\'?J:S;D 9S=k(q).B(\\'7i\\');D 8I=q.31;7d(9S==\\'cu\\'&&8I){9S=k(8I).B(\\'7i\\');8I=8I.31}k(q).B(\\'7i\\',4x);if(2g q.6W==\\'8T\\')q.6W=q.6W[\"9X\"];k(q).5w({\\'7i\\':9S},H,G,u(){k.2H(q,\\'fv\\');if(2g k(q).1p(\"14\")==\\'8T\\'){k(q).1p(\"14\")[\"9X\"]=\"\";k(q).1p(\"14\")[\"9X\"]=q.6W}P{k(q).1p(\"14\",q.6W)}if(J)J.1D(q)})})};k.fn.23({iT:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.5m(q,H,J,\\'49\\',\\'6g\\',G)})},iU:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.5m(q,H,J,\\'4j\\',\\'6g\\',G)})},j1:u(H,J,G){E q.1w(\\'1n\\',u(){if(k.B(q,\\'19\\')==\\'1o\\'){12 k.fx.5m(q,H,J,\\'4j\\',\\'6Z\\',G)}P{12 k.fx.5m(q,H,J,\\'4j\\',\\'6g\\',G)}})},j2:u(H,J,G){E q.1w(\\'1n\\',u(){if(k.B(q,\\'19\\')==\\'1o\\'){12 k.fx.5m(q,H,J,\\'49\\',\\'6Z\\',G)}P{12 k.fx.5m(q,H,J,\\'49\\',\\'6g\\',G)}})},j9:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.5m(q,H,J,\\'49\\',\\'6Z\\',G)})},ja:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.5m(q,H,J,\\'4j\\',\\'6Z\\',G)})}});k.fx.5m=u(e,H,J,2S,1u,G){if(!k.4K(e)){k.2H(e,\\'1n\\');E I}D z=q;D 73=I;z.el=k(e);z.G=2g J==\\'4V\\'?J:G||S;z.J=2g J==\\'u\\'?J:S;z.1u=1u;z.H=H;z.2i=k.1a.2o(e);z.V={};z.V.Y=z.el.B(\\'Y\\');z.V.19=z.el.B(\\'19\\');if(z.V.19==\\'1o\\'){5Y=z.el.B(\\'3n\\');z.el.1Y();73=1b}z.V.Q=z.el.B(\\'Q\\');z.V.O=z.el.B(\\'O\\');if(73){z.el.2G();z.el.B(\\'3n\\',5Y)}z.V.Z=z.2i.w+\\'U\\';z.V.W=z.2i.h+\\'U\\';z.V.2U=z.el.B(\\'2U\\');z.2i.Q=T(z.V.Q)||0;z.2i.O=T(z.V.O)||0;if(z.V.Y!=\\'2s\\'&&z.V.Y!=\\'1P\\'){z.el.B(\\'Y\\',\\'2s\\')}z.el.B(\\'2U\\',\\'2K\\').B(\\'W\\',1u==\\'6Z\\'&&2S==\\'49\\'?1:z.2i.h+\\'U\\').B(\\'Z\\',1u==\\'6Z\\'&&2S==\\'4j\\'?1:z.2i.w+\\'U\\');z.21=u(){z.el.B(z.V);if(z.1u==\\'6g\\')z.el.2G();P z.el.1Y();k.2H(z.el.K(0),\\'1n\\')};3m(2S){1e\\'49\\':z.eh=12 k.fx(z.el.K(0),k.H(H-15,z.G,J),\\'W\\');z.et=12 k.fx(z.el.K(0),k.H(z.H,z.G,z.21),\\'Q\\');if(z.1u==\\'6g\\'){z.eh.1L(z.2i.h,0);z.et.1L(z.2i.Q,z.2i.Q+z.2i.h/2)}P{z.eh.1L(0,z.2i.h);z.et.1L(z.2i.Q+z.2i.h/2,z.2i.Q)}1r;1e\\'4j\\':z.eh=12 k.fx(z.el.K(0),k.H(H-15,z.G,J),\\'Z\\');z.et=12 k.fx(z.el.K(0),k.H(z.H,z.G,z.21),\\'O\\');if(z.1u==\\'6g\\'){z.eh.1L(z.2i.w,0);z.et.1L(z.2i.O,z.2i.O+z.2i.w/2)}P{z.eh.1L(0,z.2i.w);z.et.1L(z.2i.O+z.2i.w/2,z.2i.O)}1r}};k.fn.bg=u(H,3V,J){E q.1w(\\'1n\\',u(){if(!k.4K(q)){k.2H(q,\\'1n\\');E I}D fx=12 k.fx.bg(q,H,3V,J);fx.bf()})};k.fx.bg=u(el,H,3V,J){D z=q;z.3V=3V;z.5y=1;z.el=el;z.H=H;z.J=J;k(z.el).1Y();z.bf=u(){z.5y++;z.e=12 k.fx(z.el,k.H(z.H,u(){z.ef=12 k.fx(z.el,k.H(z.H,u(){if(z.5y<=z.3V)z.bf();P{k.2H(z.el,\\'1n\\');if(z.J&&z.J.1K==2A){z.J.1D(z.el)}}}),\\'1G\\');z.ef.1L(0,1)}),\\'1G\\');z.e.1L(1,0)}};k.fn.23({jb:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.6G(q,H,1,2a,1b,J,\\'fa\\',G)})},jc:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.6G(q,H,2a,1,1b,J,\\'b4\\',G)})},j8:u(H,J,G){E q.1w(\\'1n\\',u(){D G=G||\\'fl\\';12 k.fx.6G(q,H,2a,f8,1b,J,\\'6h\\',G)})},6G:u(H,57,30,6H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.6G(q,H,57,30,6H,J,\\'6G\\',G)})}});k.fx.6G=u(e,H,57,30,6H,J,1u,G){if(!k.4K(e)){k.2H(e,\\'1n\\');E I}D z=q;z.el=k(e);z.57=T(57)||2a;z.30=T(30)||2a;z.G=2g J==\\'4V\\'?J:G||S;z.J=2g J==\\'u\\'?J:S;z.1m=k.H(H).1m;z.6H=6H||S;z.2i=k.1a.2o(e);z.V={Z:z.el.B(\\'Z\\'),W:z.el.B(\\'W\\'),4A:z.el.B(\\'4A\\')||\\'2a%\\',Y:z.el.B(\\'Y\\'),19:z.el.B(\\'19\\'),Q:z.el.B(\\'Q\\'),O:z.el.B(\\'O\\'),2U:z.el.B(\\'2U\\'),4S:z.el.B(\\'4S\\'),5O:z.el.B(\\'5O\\'),5Q:z.el.B(\\'5Q\\'),5b:z.el.B(\\'5b\\'),5M:z.el.B(\\'5M\\'),5U:z.el.B(\\'5U\\'),5n:z.el.B(\\'5n\\'),4X:z.el.B(\\'4X\\')};z.Z=T(z.V.Z)||e.4c||0;z.W=T(z.V.W)||e.5W||0;z.Q=T(z.V.Q)||0;z.O=T(z.V.O)||0;1q=[\\'em\\',\\'U\\',\\'j7\\',\\'%\\'];24(i in 1q){if(z.V.4A.3J(1q[i])>0){z.fg=1q[i];z.4A=2m(z.V.4A)}if(z.V.4S.3J(1q[i])>0){z.fc=1q[i];z.bw=2m(z.V.4S)||0}if(z.V.5O.3J(1q[i])>0){z.fe=1q[i];z.bc=2m(z.V.5O)||0}if(z.V.5Q.3J(1q[i])>0){z.fL=1q[i];z.bA=2m(z.V.5Q)||0}if(z.V.5b.3J(1q[i])>0){z.g8=1q[i];z.bt=2m(z.V.5b)||0}if(z.V.5M.3J(1q[i])>0){z.g4=1q[i];z.bx=2m(z.V.5M)||0}if(z.V.5U.3J(1q[i])>0){z.g9=1q[i];z.bv=2m(z.V.5U)||0}if(z.V.5n.3J(1q[i])>0){z.gc=1q[i];z.bj=2m(z.V.5n)||0}if(z.V.4X.3J(1q[i])>0){z.fK=1q[i];z.b7=2m(z.V.4X)||0}}if(z.V.Y!=\\'2s\\'&&z.V.Y!=\\'1P\\'){z.el.B(\\'Y\\',\\'2s\\')}z.el.B(\\'2U\\',\\'2K\\');z.1u=1u;3m(z.1u){1e\\'fa\\':z.4b=z.Q+z.2i.h/2;z.5a=z.Q;z.4k=z.O+z.2i.w/2;z.59=z.O;1r;1e\\'b4\\':z.5a=z.Q+z.2i.h/2;z.4b=z.Q;z.59=z.O+z.2i.w/2;z.4k=z.O;1r;1e\\'6h\\':z.5a=z.Q-z.2i.h/4;z.4b=z.Q;z.59=z.O-z.2i.w/4;z.4k=z.O;1r}z.be=I;z.t=(12 7g).7z();z.4w=u(){5T(z.2I);z.2I=S};z.2D=u(){if(z.be==I){z.el.1Y();z.be=1b}D t=(12 7g).7z();D n=t-z.t;D p=n/z.1m;if(t>=z.1m+z.t){9T(u(){o=1;if(z.1u){t=z.5a;l=z.59;if(z.1u==\\'6h\\')o=0}z.bs(z.30,l,t,1b,o)},13);z.4w()}P{o=1;if(!k.G||!k.G[z.G]){s=((-18.5H(p*18.2Q)/2)+0.5)*(z.30-z.57)+z.57}P{s=k.G[z.G](p,n,z.57,(z.30-z.57),z.1m)}if(z.1u){if(!k.G||!k.G[z.G]){t=((-18.5H(p*18.2Q)/2)+0.5)*(z.5a-z.4b)+z.4b;l=((-18.5H(p*18.2Q)/2)+0.5)*(z.59-z.4k)+z.4k;if(z.1u==\\'6h\\')o=((-18.5H(p*18.2Q)/2)+0.5)*(-0.9Y)+0.9Y}P{t=k.G[z.G](p,n,z.4b,(z.5a-z.4b),z.1m);l=k.G[z.G](p,n,z.4k,(z.59-z.4k),z.1m);if(z.1u==\\'6h\\')o=k.G[z.G](p,n,0.9Y,-0.9Y,z.1m)}}z.bs(s,l,t,I,o)}};z.2I=6V(u(){z.2D()},13);z.bs=u(4q,O,Q,fM,1G){z.el.B(\\'W\\',z.W*4q/2a+\\'U\\').B(\\'Z\\',z.Z*4q/2a+\\'U\\').B(\\'O\\',O+\\'U\\').B(\\'Q\\',Q+\\'U\\').B(\\'4A\\',z.4A*4q/2a+z.fg);if(z.bw)z.el.B(\\'4S\\',z.bw*4q/2a+z.fc);if(z.bc)z.el.B(\\'5O\\',z.bc*4q/2a+z.fe);if(z.bA)z.el.B(\\'5Q\\',z.bA*4q/2a+z.fL);if(z.bt)z.el.B(\\'5b\\',z.bt*4q/2a+z.g8);if(z.bx)z.el.B(\\'5M\\',z.bx*4q/2a+z.g4);if(z.bv)z.el.B(\\'5U\\',z.bv*4q/2a+z.g9);if(z.bj)z.el.B(\\'5n\\',z.bj*4q/2a+z.gc);if(z.b7)z.el.B(\\'4X\\',z.b7*4q/2a+z.fK);if(z.1u==\\'6h\\'){if(1X.71)z.el.K(0).14.5E=\"8V(1G=\"+1G*2a+\")\";z.el.K(0).14.1G=1G}if(fM){if(z.6H){z.el.B(z.V)}if(z.1u==\\'b4\\'||z.1u==\\'6h\\'){z.el.B(\\'19\\',\\'1o\\');if(z.1u==\\'6h\\'){if(1X.71)z.el.K(0).14.5E=\"8V(1G=\"+2a+\")\";z.el.K(0).14.1G=1}}P z.el.B(\\'19\\',\\'2B\\');if(z.J)z.J.1D(z.el.K(0));k.2H(z.el.K(0),\\'1n\\')}}};k.fn.23({9U:u(H,1O,G){o=k.H(H);E q.1w(\\'1n\\',u(){12 k.fx.9U(q,o,1O,G)})},j6:u(H,1O,G){E q.1E(u(){k(\\'a[@3h*=\"#\"]\\',q).5h(u(e){fW=q.3h.7C(\\'#\\');k(\\'#\\'+fW[1]).9U(H,1O,G);E I})})}});k.fx.9U=u(e,o,1O,G){D z=q;z.o=o;z.e=e;z.1O=/fT|gd/.48(1O)?1O:I;z.G=G;p=k.1a.3w(e);s=k.1a.6z();z.4w=u(){5T(z.2I);z.2I=S;k.2H(z.e,\\'1n\\')};z.t=(12 7g).7z();s.h=s.h>s.ih?(s.h-s.ih):s.h;s.w=s.w>s.iw?(s.w-s.iw):s.w;z.5a=p.y>s.h?s.h:p.y;z.59=p.x>s.w?s.w:p.x;z.4b=s.t;z.4k=s.l;z.2D=u(){D t=(12 7g).7z();D n=t-z.t;D p=n/z.o.1m;if(t>=z.o.1m+z.t){z.4w();9T(u(){z.d3(z.5a,z.59)},13)}P{if(!z.1O||z.1O==\\'fT\\'){if(!k.G||!k.G[z.G]){9V=((-18.5H(p*18.2Q)/2)+0.5)*(z.5a-z.4b)+z.4b}P{9V=k.G[z.G](p,n,z.4b,(z.5a-z.4b),z.o.1m)}}P{9V=z.4b}if(!z.1O||z.1O==\\'gd\\'){if(!k.G||!k.G[z.G]){9W=((-18.5H(p*18.2Q)/2)+0.5)*(z.59-z.4k)+z.4k}P{9W=k.G[z.G](p,n,z.4k,(z.59-z.4k),z.o.1m)}}P{9W=z.4k}z.d3(9V,9W)}};z.d3=u(t,l){1X.j4(l,t)};z.2I=6V(u(){z.2D()},13)};k.fn.cY=u(3V,J){E q.1w(\\'1n\\',u(){if(!k.4K(q)){k.2H(q,\\'1n\\');E I}D e=12 k.fx.cY(q,3V,J);e.cG()})};k.fx.cY=u(e,3V,J){D z=q;z.el=k(e);z.el.1Y();z.3V=T(3V)||3;z.J=J;z.5y=1;z.V={};z.V.Y=z.el.B(\\'Y\\');z.V.Q=T(z.el.B(\\'Q\\'))||0;z.V.O=T(z.el.B(\\'O\\'))||0;if(z.V.Y!=\\'2s\\'&&z.V.Y!=\\'1P\\'){z.el.B(\\'Y\\',\\'2s\\')}z.cG=u(){z.5y++;z.e=12 k.fx(z.el.K(0),{1m:60,21:u(){z.e=12 k.fx(z.el.K(0),{1m:60,21:u(){z.e=12 k.fx(e,{1m:60,21:u(){if(z.5y<=z.3V)z.cG();P{z.el.B(\\'Y\\',z.V.Y).B(\\'Q\\',z.V.Q+\\'U\\').B(\\'O\\',z.V.O+\\'U\\');k.2H(z.el.K(0),\\'1n\\');if(z.J&&z.J.1K==2A){z.J.1D(z.el.K(0))}}}},\\'O\\');z.e.1L(z.V.O-20,z.V.O)}},\\'O\\');z.e.1L(z.V.O+20,z.V.O-20)}},\\'O\\');z.e.1L(z.V.O,z.V.O+20)}};k.fn.23({fo:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.1z(q,H,J,\\'4F\\',\\'in\\',G)})},fq:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.1z(q,H,J,\\'4F\\',\\'4l\\',G)})},iY:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.1z(q,H,J,\\'4F\\',\\'3R\\',G)})},iX:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.1z(q,H,J,\\'4r\\',\\'in\\',G)})},jr:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.1z(q,H,J,\\'4r\\',\\'4l\\',G)})},jq:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.1z(q,H,J,\\'4r\\',\\'3R\\',G)})},jp:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.1z(q,H,J,\\'O\\',\\'in\\',G)})},jn:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.1z(q,H,J,\\'O\\',\\'4l\\',G)})},jm:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.1z(q,H,J,\\'O\\',\\'3R\\',G)})},iP:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.1z(q,H,J,\\'2L\\',\\'in\\',G)})},ic:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.1z(q,H,J,\\'2L\\',\\'4l\\',G)})},ib:u(H,J,G){E q.1w(\\'1n\\',u(){12 k.fx.1z(q,H,J,\\'2L\\',\\'3R\\',G)})}});k.fx.1z=u(e,H,J,2S,1u,G){if(!k.4K(e)){k.2H(e,\\'1n\\');E I}D z=q;z.el=k(e);z.G=2g J==\\'4V\\'?J:G||S;z.J=2g J==\\'u\\'?J:S;if(1u==\\'3R\\'){1u=z.el.B(\\'19\\')==\\'1o\\'?\\'in\\':\\'4l\\'}if(!e.4s)e.4s=z.el.B(\\'19\\');z.el.1Y();z.H=H;z.fx=k.fx.9P(e);z.1u=1u;z.2S=2S;z.21=u(){if(z.1u==\\'4l\\')z.el.B(\\'3n\\',\\'2K\\');k.fx.a0(z.fx.3p.K(0),z.fx.V);if(z.1u==\\'in\\'){z.el.B(\\'19\\',z.el.K(0).4s==\\'1o\\'?\\'2B\\':z.el.K(0).4s)}P{z.el.B(\\'19\\',\\'1o\\');z.el.B(\\'3n\\',\\'dd\\')}if(z.J&&z.J.1K==2A){z.J.1D(z.el.K(0))}k.2H(z.el.K(0),\\'1n\\')};3m(z.2S){1e\\'4F\\':z.ef=12 k.fx(z.el.K(0),k.H(z.H,z.G,z.21),\\'Q\\');z.7v=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G),\\'W\\');if(z.1u==\\'in\\'){z.ef.1L(-z.fx.V.1q.hb,0);z.7v.1L(0,z.fx.V.1q.hb)}P{z.ef.1L(0,-z.fx.V.1q.hb);z.7v.1L(z.fx.V.1q.hb,0)}1r;1e\\'4r\\':z.ef=12 k.fx(z.el.K(0),k.H(z.H,z.G,z.21),\\'Q\\');if(z.1u==\\'in\\'){z.ef.1L(z.fx.V.1q.hb,0)}P{z.ef.1L(0,z.fx.V.1q.hb)}1r;1e\\'O\\':z.ef=12 k.fx(z.el.K(0),k.H(z.H,z.G,z.21),\\'O\\');z.7v=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G),\\'Z\\');if(z.1u==\\'in\\'){z.ef.1L(-z.fx.V.1q.1C,0);z.7v.1L(0,z.fx.V.1q.1C)}P{z.ef.1L(0,-z.fx.V.1q.1C);z.7v.1L(z.fx.V.1q.1C,0)}1r;1e\\'2L\\':z.ef=12 k.fx(z.el.K(0),k.H(z.H,z.G,z.21),\\'O\\');if(z.1u==\\'in\\'){z.ef.1L(z.fx.V.1q.1C,0)}P{z.ef.1L(0,z.fx.V.1q.1C)}1r}};k.3f=S;k.fn.ig=u(o){E q.1w(\\'1n\\',u(){12 k.fx.dG(q,o)})};k.fx.dG=u(e,o){if(k.3f==S){k(\\'2e\\',1h).1S(\\'<22 id=\"3f\"></22>\\');k.3f=k(\\'#3f\\')}k.3f.B(\\'19\\',\\'2B\\').B(\\'Y\\',\\'1P\\');D z=q;z.el=k(e);if(!o||!o.30){E}if(o.30.1K==b0&&1h.9e(o.30)){o.30=1h.9e(o.30)}P if(!o.30.dq){E}if(!o.1m){o.1m=g5}z.1m=o.1m;z.30=o.30;z.8r=o.3l;z.21=o.21;if(z.8r){k.3f.2R(z.8r)}z.a3=0;z.a2=0;if(k.dF){z.a3=(T(k.3f.B(\\'5b\\'))||0)+(T(k.3f.B(\\'5O\\'))||0)+(T(k.3f.B(\\'4X\\'))||0)+(T(k.3f.B(\\'5U\\'))||0);z.a2=(T(k.3f.B(\\'4S\\'))||0)+(T(k.3f.B(\\'5Q\\'))||0)+(T(k.3f.B(\\'5M\\'))||0)+(T(k.3f.B(\\'5n\\'))||0)}z.26=k.23(k.1a.3w(z.el.K(0)),k.1a.2o(z.el.K(0)));z.2T=k.23(k.1a.3w(z.30),k.1a.2o(z.30));z.26.1C-=z.a3;z.26.hb-=z.a2;z.2T.1C-=z.a3;z.2T.hb-=z.a2;z.J=o.21;k.3f.B(\\'Z\\',z.26.1C+\\'U\\').B(\\'W\\',z.26.hb+\\'U\\').B(\\'Q\\',z.26.y+\\'U\\').B(\\'O\\',z.26.x+\\'U\\').5w({Q:z.2T.y,O:z.2T.x,Z:z.2T.1C,W:z.2T.hb},z.1m,u(){if(z.8r)k.3f.4i(z.8r);k.3f.B(\\'19\\',\\'1o\\');if(z.21&&z.21.1K==2A){z.21.1D(z.el.K(0),[z.30])}k.2H(z.el.K(0),\\'1n\\')})};k.1v={M:{2E:10,ec:\\'1Q/iJ.eZ\\',e3:\\'<1T 2J=\"1Q/6g.da\" />\\',eW:0.8,d8:\\'iN a6\\',dc:\\'57\\',3W:8J},jQ:I,jW:I,6j:S,8m:I,8k:I,d1:u(2k){if(!k.1v.8k||k.1v.8m)E;D 3K=2k.7L||2k.7K||-1;3m(3K){1e 35:if(k.1v.6j)k.1v.26(S,k(\\'a[@4I=\\'+k.1v.6j+\\']:jJ\\').K(0));1r;1e 36:if(k.1v.6j)k.1v.26(S,k(\\'a[@4I=\\'+k.1v.6j+\\']:jL\\').K(0));1r;1e 37:1e 8:1e 33:1e 80:1e kb:D 9p=k(\\'#87\\');if(9p.K(0).53!=S){9p.K(0).53.1D(9p.K(0))}1r;1e 38:1r;1e 39:1e 34:1e 32:1e gl:1e 78:D 9k=k(\\'#88\\');if(9k.K(0).53!=S){9k.K(0).53.1D(9k.K(0))}1r;1e 40:1r;1e 27:k.1v.au();1r}},7q:u(M){if(M)k.23(k.1v.M,M);if(1X.2k){k(\\'2e\\',1h).1J(\\'6y\\',k.1v.d1)}P{k(1h).1J(\\'6y\\',k.1v.d1)}k(\\'a\\').1E(u(){el=k(q);en=el.1p(\\'4I\\')||\\'\\';e9=el.1p(\\'3h\\')||\\'\\';ev=/\\\\.da|\\\\.gw|\\\\.8X|\\\\.eZ|\\\\.gn/g;if(e9.6c().d5(ev)!=S&&en.6c().3J(\\'eU\\')==0){el.1J(\\'5h\\',k.1v.26)}});if(k.3a.4t){3A=1h.3F(\\'3A\\');k(3A).1p({id:\\'cN\\',2J:\\'ek:I;\\',ej:\\'cD\\',ep:\\'cD\\'}).B({19:\\'1o\\',Y:\\'1P\\',Q:\\'0\\',O:\\'0\\',5E:\\'9n:9w.9y.cC(1G=0)\\'});k(\\'2e\\').1S(3A)}8n=1h.3F(\\'22\\');k(8n).1p(\\'id\\',\\'cP\\').B({Y:\\'1P\\',19:\\'1o\\',Q:\\'0\\',O:\\'0\\',1G:0}).1S(1h.8M(\\' \\')).1J(\\'5h\\',k.1v.au);6A=1h.3F(\\'22\\');k(6A).1p(\\'id\\',\\'eK\\').B({4X:k.1v.M.2E+\\'U\\'}).1S(1h.8M(\\' \\'));cE=1h.3F(\\'22\\');k(cE).1p(\\'id\\',\\'dg\\').B({4X:k.1v.M.2E+\\'U\\',5n:k.1v.M.2E+\\'U\\'}).1S(1h.8M(\\' \\'));cF=1h.3F(\\'a\\');k(cF).1p({id:\\'gg\\',3h:\\'#\\'}).B({Y:\\'1P\\',2L:k.1v.M.2E+\\'U\\',Q:\\'0\\'}).1S(k.1v.M.e3).1J(\\'5h\\',k.1v.au);7m=1h.3F(\\'22\\');k(7m).1p(\\'id\\',\\'cM\\').B({Y:\\'2s\\',cA:\\'O\\',6w:\\'0 9F\\',3I:1}).1S(6A).1S(cE).1S(cF);2b=1h.3F(\\'1T\\');2b.2J=k.1v.M.ec;k(2b).1p(\\'id\\',\\'eM\\').B({Y:\\'1P\\'});4G=1h.3F(\\'a\\');k(4G).1p({id:\\'87\\',3h:\\'#\\'}).B({Y:\\'1P\\',19:\\'1o\\',2U:\\'2K\\',ey:\\'1o\\'}).1S(1h.8M(\\' \\'));4M=1h.3F(\\'a\\');k(4M).1p({id:\\'88\\',3h:\\'#\\'}).B({Y:\\'1P\\',2U:\\'2K\\',ey:\\'1o\\'}).1S(1h.8M(\\' \\'));1Z=1h.3F(\\'22\\');k(1Z).1p(\\'id\\',\\'eE\\').B({19:\\'1o\\',Y:\\'2s\\',2U:\\'2K\\',cA:\\'O\\',6w:\\'0 9F\\',Q:\\'0\\',O:\\'0\\',3I:2}).1S([2b,4G,4M]);6F=1h.3F(\\'22\\');k(6F).1p(\\'id\\',\\'ao\\').B({19:\\'1o\\',Y:\\'1P\\',2U:\\'2K\\',Q:\\'0\\',O:\\'0\\',cA:\\'cv\\',7i:\\'cu\\',hC:\\'0\\'}).1S([1Z,7m]);k(\\'2e\\').1S(8n).1S(6F)},26:u(e,C){el=C?k(C):k(q);9t=el.1p(\\'4I\\');D 6B,4u,4G,4M;if(9t!=\\'eU\\'){k.1v.6j=9t;8Y=k(\\'a[@4I=\\'+9t+\\']\\');6B=8Y.1N();4u=8Y.cZ(C?C:q);4G=8Y.K(4u-1);4M=8Y.K(4u+1)}89=el.1p(\\'3h\\');6A=el.1p(\\'4g\\');3O=k.1a.6z();8n=k(\\'#cP\\');if(!k.1v.8k){k.1v.8k=1b;if(k.3a.4t){k(\\'#cN\\').B(\\'W\\',18.3r(3O.ih,3O.h)+\\'U\\').B(\\'Z\\',18.3r(3O.iw,3O.w)+\\'U\\').1Y()}8n.B(\\'W\\',18.3r(3O.ih,3O.h)+\\'U\\').B(\\'Z\\',18.3r(3O.iw,3O.w)+\\'U\\').1Y().fX(cO,k.1v.M.eW,u(){k.1v.cw(89,6A,3O,6B,4u,4G,4M)});k(\\'#ao\\').B(\\'Z\\',18.3r(3O.iw,3O.w)+\\'U\\')}P{k(\\'#87\\').K(0).53=S;k(\\'#88\\').K(0).53=S;k.1v.cw(89,6A,3O,6B,4u,4G,4M)}E I},cw:u(89,gP,3O,6B,4u,4G,4M){k(\\'#cW\\').bk();aX=k(\\'#87\\');aX.2G();aO=k(\\'#88\\');aO.2G();2b=k(\\'#eM\\');1Z=k(\\'#eE\\');6F=k(\\'#ao\\');7m=k(\\'#cM\\').B(\\'3n\\',\\'2K\\');k(\\'#eK\\').3x(6A);k.1v.8m=1b;if(6B)k(\\'#dg\\').3x(k.1v.M.d8+\\' \\'+(4u+1)+\\' \\'+k.1v.M.dc+\\' \\'+6B);if(4G){aX.K(0).53=u(){q.5B();k.1v.26(S,4G);E I}}if(4M){aO.K(0).53=u(){q.5B();k.1v.26(S,4M);E I}}2b.1Y();82=k.1a.2o(1Z.K(0));56=18.3r(82.1C,2b.K(0).Z+k.1v.M.2E*2);6f=18.3r(82.hb,2b.K(0).W+k.1v.M.2E*2);2b.B({O:(56-2b.K(0).Z)/2+\\'U\\',Q:(6f-2b.K(0).W)/2+\\'U\\'});1Z.B({Z:56+\\'U\\',W:6f+\\'U\\'}).1Y();dw=k.1a.bm();6F.B(\\'Q\\',3O.t+(dw.h/15)+\\'U\\');if(6F.B(\\'19\\')==\\'1o\\'){6F.1Y().7f(k.1v.M.3W)}6k=12 9s;k(6k).1p(\\'id\\',\\'cW\\').1J(\\'hJ\\',u(){56=6k.Z+k.1v.M.2E*2;6f=6k.W+k.1v.M.2E*2;2b.2G();1Z.5w({W:6f},82.hb!=6f?k.1v.M.3W:1,u(){1Z.5w({Z:56},82.1C!=56?k.1v.M.3W:1,u(){1Z.bG(6k);k(6k).B({Y:\\'1P\\',O:k.1v.M.2E+\\'U\\',Q:k.1v.M.2E+\\'U\\'}).7f(k.1v.M.3W,u(){db=k.1a.2o(7m.K(0));if(4G){aX.B({O:k.1v.M.2E+\\'U\\',Q:k.1v.M.2E+\\'U\\',Z:56/2-k.1v.M.2E*3+\\'U\\',W:6f-k.1v.M.2E*2+\\'U\\'}).1Y()}if(4M){aO.B({O:56/2+k.1v.M.2E*2+\\'U\\',Q:k.1v.M.2E+\\'U\\',Z:56/2-k.1v.M.2E*3+\\'U\\',W:6f-k.1v.M.2E*2+\\'U\\'}).1Y()}7m.B({Z:56+\\'U\\',Q:-db.hb+\\'U\\',3n:\\'dd\\'}).5w({Q:-1},k.1v.M.3W,u(){k.1v.8m=I})})})})});6k.2J=89},au:u(){k(\\'#cW\\').bk();k(\\'#ao\\').2G();k(\\'#cM\\').B(\\'3n\\',\\'2K\\');k(\\'#cP\\').fX(cO,0,u(){k(q).2G();if(k.3a.4t){k(\\'#cN\\').2G()}});k(\\'#87\\').K(0).53=S;k(\\'#88\\').K(0).53=S;k.1v.6j=S;k.1v.8k=I;k.1v.8m=I;E I}};k.R={1A:S,41:S,F:S,1s:S,1q:S,Y:S,9a:u(e){k.R.F=(q.d0)?q.d0:q;k.R.1s=k.1a.4a(e);k.R.1q={Z:T(k(k.R.F).B(\\'Z\\'))||0,W:T(k(k.R.F).B(\\'W\\'))||0};k.R.Y={Q:T(k(k.R.F).B(\\'Q\\'))||0,O:T(k(k.R.F).B(\\'O\\'))||0};k(1h).1J(\\'3D\\',k.R.cR).1J(\\'5P\\',k.R.cK);if(2g k.R.F.1k.g2===\\'u\\'){k.R.F.1k.g2.1D(k.R.F)}E I},cK:u(e){k(1h).3q(\\'3D\\',k.R.cR).3q(\\'5P\\',k.R.cK);if(2g k.R.F.1k.fN===\\'u\\'){k.R.F.1k.fN.1D(k.R.F)}k.R.F=S},cR:u(e){if(!k.R.F){E}1s=k.1a.4a(e);7p=k.R.Y.Q-k.R.1s.y+1s.y;7r=k.R.Y.O-k.R.1s.x+1s.x;7p=18.3r(18.3L(7p,k.R.F.1k.8g-k.R.1q.W),k.R.F.1k.7h);7r=18.3r(18.3L(7r,k.R.F.1k.8h-k.R.1q.Z),k.R.F.1k.70);if(2g k.R.F.1k.4m===\\'u\\'){D 8a=k.R.F.1k.4m.1D(k.R.F,[7r,7p]);if(2g 8a==\\'hh\\'&&8a.1g==2){7r=8a[0];7p=8a[1]}}k.R.F.14.Q=7p+\\'U\\';k.R.F.14.O=7r+\\'U\\';E I},26:u(e){k(1h).1J(\\'3D\\',k.R.8j).1J(\\'5P\\',k.R.8o);k.R.1A=q.1A;k.R.41=q.41;k.R.1s=k.1a.4a(e);k.R.1q={Z:T(k(q.1A).B(\\'Z\\'))||0,W:T(k(q.1A).B(\\'W\\'))||0};k.R.Y={Q:T(k(q.1A).B(\\'Q\\'))||0,O:T(k(q.1A).B(\\'O\\'))||0};if(k.R.1A.1k.4o){k.R.1A.1k.4o.1D(k.R.1A,[q])}E I},8o:u(){k(1h).3q(\\'3D\\',k.R.8j).3q(\\'5P\\',k.R.8o);if(k.R.1A.1k.3T){k.R.1A.1k.3T.1D(k.R.1A,[k.R.41])}k.R.1A=S;k.R.41=S},6i:u(dx,az){E 18.3L(18.3r(k.R.1q.Z+dx*az,k.R.1A.1k.av),k.R.1A.1k.6x)},6m:u(dy,az){E 18.3L(18.3r(k.R.1q.W+dy*az,k.R.1A.1k.8c),k.R.1A.1k.8b)},fb:u(W){E 18.3L(18.3r(W,k.R.1A.1k.8c),k.R.1A.1k.8b)},8j:u(e){if(k.R.1A==S){E}1s=k.1a.4a(e);dx=1s.x-k.R.1s.x;dy=1s.y-k.R.1s.y;1I={Z:k.R.1q.Z,W:k.R.1q.W};2z={Q:k.R.Y.Q,O:k.R.Y.O};3m(k.R.41){1e\\'e\\':1I.Z=k.R.6i(dx,1);1r;1e\\'fj\\':1I.Z=k.R.6i(dx,1);1I.W=k.R.6m(dy,1);1r;1e\\'w\\':1I.Z=k.R.6i(dx,-1);2z.O=k.R.Y.O-1I.Z+k.R.1q.Z;1r;1e\\'5F\\':1I.Z=k.R.6i(dx,-1);2z.O=k.R.Y.O-1I.Z+k.R.1q.Z;1I.W=k.R.6m(dy,1);1r;1e\\'76\\':1I.W=k.R.6m(dy,-1);2z.Q=k.R.Y.Q-1I.W+k.R.1q.W;1I.Z=k.R.6i(dx,-1);2z.O=k.R.Y.O-1I.Z+k.R.1q.Z;1r;1e\\'n\\':1I.W=k.R.6m(dy,-1);2z.Q=k.R.Y.Q-1I.W+k.R.1q.W;1r;1e\\'at\\':1I.W=k.R.6m(dy,-1);2z.Q=k.R.Y.Q-1I.W+k.R.1q.W;1I.Z=k.R.6i(dx,1);1r;1e\\'s\\':1I.W=k.R.6m(dy,1);1r}if(k.R.1A.1k.4v){if(k.R.41==\\'n\\'||k.R.41==\\'s\\')4p=1I.W*k.R.1A.1k.4v;P 4p=1I.Z;4W=k.R.fb(4p*k.R.1A.1k.4v);4p=4W/k.R.1A.1k.4v;3m(k.R.41){1e\\'n\\':1e\\'76\\':1e\\'at\\':2z.Q+=1I.W-4W;1r}3m(k.R.41){1e\\'76\\':1e\\'w\\':1e\\'5F\\':2z.O+=1I.Z-4p;1r}1I.W=4W;1I.Z=4p}if(2z.Q<k.R.1A.1k.7h){4W=1I.W+2z.Q-k.R.1A.1k.7h;2z.Q=k.R.1A.1k.7h;if(k.R.1A.1k.4v){4p=4W/k.R.1A.1k.4v;3m(k.R.41){1e\\'76\\':1e\\'w\\':1e\\'5F\\':2z.O+=1I.Z-4p;1r}1I.Z=4p}1I.W=4W}if(2z.O<k.R.1A.1k.70){4p=1I.Z+2z.O-k.R.1A.1k.70;2z.O=k.R.1A.1k.70;if(k.R.1A.1k.4v){4W=4p*k.R.1A.1k.4v;3m(k.R.41){1e\\'n\\':1e\\'76\\':1e\\'at\\':2z.Q+=1I.W-4W;1r}1I.W=4W}1I.Z=4p}if(2z.Q+1I.W>k.R.1A.1k.8g){1I.W=k.R.1A.1k.8g-2z.Q;if(k.R.1A.1k.4v){1I.Z=1I.W/k.R.1A.1k.4v}}if(2z.O+1I.Z>k.R.1A.1k.8h){1I.Z=k.R.1A.1k.8h-2z.O;if(k.R.1A.1k.4v){1I.W=1I.Z*k.R.1A.1k.4v}}D 6p=I;if(k.R.1A.1k.f7){6p=k.R.1A.1k.f7.1D(k.R.1A,[1I,2z]);if(6p){if(6p.1q){k.23(1I,6p.1q)}if(6p.Y){k.23(2z,6p.Y)}}}8d=k.R.1A.14;8d.O=2z.O+\\'U\\';8d.Q=2z.Q+\\'U\\';8d.Z=1I.Z+\\'U\\';8d.W=1I.W+\\'U\\';E I},2r:u(M){if(!M||!M.3Z||M.3Z.1K!=7M){E}E q.1E(u(){D el=q;el.1k=M;el.1k.av=M.av||10;el.1k.8c=M.8c||10;el.1k.6x=M.6x||6P;el.1k.8b=M.8b||6P;el.1k.7h=M.7h||-aC;el.1k.70=M.70||-aC;el.1k.8h=M.8h||6P;el.1k.8g=M.8g||6P;d6=k(el).B(\\'Y\\');if(!(d6==\\'2s\\'||d6==\\'1P\\')){el.14.Y=\\'2s\\'}fS=/n|at|e|fj|s|5F|w|76/g;24(i in el.1k.3Z){if(i.6c().d5(fS)!=S){if(el.1k.3Z[i].1K==b0){3v=k(el.1k.3Z[i]);if(3v.1N()>0){el.1k.3Z[i]=3v.K(0)}}if(el.1k.3Z[i].4Y){el.1k.3Z[i].1A=el;el.1k.3Z[i].41=i;k(el.1k.3Z[i]).1J(\\'5v\\',k.R.26)}}}if(el.1k.5S){if(2g el.1k.5S===\\'4V\\'){aV=k(el.1k.5S);if(aV.1N()>0){aV.1E(u(){q.d0=el});aV.1J(\\'5v\\',k.R.9a)}}P if(el.1k.5S==1b){k(q).1J(\\'5v\\',k.R.9a)}}})},4U:u(){E q.1E(u(){D el=q;24(i in el.1k.3Z){el.1k.3Z[i].1A=S;el.1k.3Z[i].41=S;k(el.1k.3Z[i]).3q(\\'5v\\',k.R.26)}if(el.1k.5S){if(2g el.1k.5S===\\'4V\\'){3v=k(el.1k.5S);if(3v.1N()>0){3v.3q(\\'5v\\',k.R.9a)}}P if(el.1k.5S==1b){k(q).3q(\\'5v\\',k.R.9a)}}el.1k=S})}};k.fn.23({hz:k.R.2r,hs:k.R.4U});k.2C=S;k.7n=I;k.3k=S;k.7o=[];k.9v=u(e){D 3K=e.7L||e.7K||-1;if(3K==17||3K==16){k.7n=1b}};k.9u=u(e){k.7n=I};k.dL=u(e){q.f.1s=k.1a.4a(e);q.f.1M=k.23(k.1a.3w(q),k.1a.2o(q));q.f.3e=k.1a.6z(q);q.f.1s.x-=q.f.1M.x;q.f.1s.y-=q.f.1M.y;k(q).1S(k.2C.K(0));if(q.f.hc)k.2C.2R(q.f.hc).B(\\'19\\',\\'2B\\');k.2C.B({19:\\'2B\\',Z:\\'2P\\',W:\\'2P\\'});if(q.f.o){k.2C.B(\\'1G\\',q.f.o)}k.3k=q;k.96=I;k.7o=[];q.f.el.1E(u(){q.1M={x:q.8t+(q.4Z&&!k.3a.7I?T(q.4Z.5b)||0:0)+(k.3k.3c||0),y:q.8G+(q.4Z&&!k.3a.7I?T(q.4Z.4S)||0:0)+(k.3k.3d||0),1C:q.4c,hb:q.5W};if(q.s==1b){if(k.7n==I){q.s=I;k(q).4i(k.3k.f.7j)}P{k.96=1b;k.7o[k.7o.1g]=k.1p(q,\\'id\\')}}});k.am.1D(q,[e]);k(1h).1J(\\'3D\\',k.am).1J(\\'5P\\',k.cX);E I};k.am=u(e){if(!k.3k)E;k.fd.1D(k.3k,[e])};k.fd=u(e){if(!k.3k)E;D 1s=k.1a.4a(e);D 3e=k.1a.6z(k.3k);1s.x+=3e.l-q.f.3e.l-q.f.1M.x;1s.y+=3e.t-q.f.3e.t-q.f.1M.y;D 93=18.3L(1s.x,q.f.1s.x);D 5F=18.3L(18.3S(1s.x-q.f.1s.x),18.3S(q.f.3e.w-93));D 99=18.3L(1s.y,q.f.1s.y);D 9g=18.3L(18.3S(1s.y-q.f.1s.y),18.3S(q.f.3e.h-99));if(q.3d>0&&1s.y-20<q.3d){D 3X=18.3L(3e.t,10);99-=3X;9g+=3X;q.3d-=3X}P if(q.3d+q.f.1M.h<q.f.3e.h&&1s.y+20>q.3d+q.f.1M.h){D 3X=18.3L(q.f.3e.h-q.3d,10);q.3d+=3X;if(q.3d!=3e.t)9g+=3X}if(q.3c>0&&1s.x-20<q.3c){D 3X=18.3L(3e.l,10);93-=3X;5F+=3X;q.3c-=3X}P if(q.3c+q.f.1M.w<q.f.3e.w&&1s.x+20>q.3c+q.f.1M.w){D 3X=18.3L(q.f.3e.w-q.3c,10);q.3c+=3X;if(q.3c!=3e.l)5F+=3X}k.2C.B({O:93+\\'U\\',Q:99+\\'U\\',Z:5F+\\'U\\',W:9g+\\'U\\'});k.2C.l=93+q.f.3e.l;k.2C.t=99+q.f.3e.t;k.2C.r=k.2C.l+5F;k.2C.b=k.2C.t+9g;k.96=I;q.f.el.1E(u(){aw=k.7o.3J(k.1p(q,\\'id\\'));if(!(q.1M.x>k.2C.r||(q.1M.x+q.1M.1C)<k.2C.l||q.1M.y>k.2C.b||(q.1M.y+q.1M.hb)<k.2C.t)){k.96=1b;if(q.s!=1b){q.s=1b;k(q).2R(k.3k.f.7j)}if(aw!=-1){q.s=I;k(q).4i(k.3k.f.7j)}}P if((q.s==1b)&&(aw==-1)){q.s=I;k(q).4i(k.3k.f.7j)}P if((!q.s)&&(k.7n==1b)&&(aw!=-1)){q.s=1b;k(q).2R(k.3k.f.7j)}});E I};k.cX=u(e){if(!k.3k)E;k.g0.1D(k.3k,[e])};k.g0=u(e){k(1h).3q(\\'3D\\',k.am).3q(\\'5P\\',k.cX);if(!k.3k)E;k.2C.B(\\'19\\',\\'1o\\');if(q.f.hc)k.2C.4i(q.f.hc);k.3k=I;k(\\'2e\\').1S(k.2C.K(0));if(k.96==1b){if(q.f.98)q.f.98(k.cJ(k.1p(q,\\'id\\')))}P{if(q.f.9d)q.f.9d(k.cJ(k.1p(q,\\'id\\')))}k.7o=[]};k.cJ=u(s){D h=\\'\\';D o=[];if(a=k(\\'#\\'+s)){a.K(0).f.el.1E(u(){if(q.s==1b){if(h.1g>0){h+=\\'&\\'}h+=s+\\'[]=\\'+k.1p(q,\\'id\\');o[o.1g]=k.1p(q,\\'id\\')}})}E{7l:h,o:o}};k.fn.gZ=u(o){if(!k.2C){k(\\'2e\\',1h).1S(\\'<22 id=\"2C\"></22>\\').1J(\\'7B\\',k.9v).1J(\\'6y\\',k.9u);k.2C=k(\\'#2C\\');k.2C.B({Y:\\'1P\\',19:\\'1o\\'});if(1X.2k){k(\\'2e\\',1h).1J(\\'7B\\',k.9v).1J(\\'6y\\',k.9u)}P{k(1h).1J(\\'7B\\',k.9v).1J(\\'6y\\',k.9u)}}if(!o){o={}}E q.1E(u(){if(q.eP)E;q.eP=1b;q.f={a:o.3C,o:o.1G?2m(o.1G):I,7j:o.eS?o.eS:I,hc:o.58?o.58:I,98:o.98?o.98:I,9d:o.9d?o.9d:I};q.f.el=k(\\'.\\'+o.3C);k(q).1J(\\'5v\\',k.dL).B(\\'Y\\',\\'2s\\')})};k.3b={bM:1,eH:u(3t){D 3t=3t;E q.1E(u(){q.4z.6s.1E(u(ab){k.3b.5c(q,3t[ab])})})},K:u(){D 3t=[];q.1E(u(cL){if(q.bI){3t[cL]=[];D C=q;D 1q=k.1a.2o(q);q.4z.6s.1E(u(ab){D x=q.8t;D y=q.8G;92=T(x*2a/(1q.w-q.4c));91=T(y*2a/(1q.h-q.5W));3t[cL][ab]=[92||0,91||0,x||0,y||0]})}});E 3t},ct:u(C){C.A.fu=C.A.28.w-C.A.1B.1C;C.A.fw=C.A.28.h-C.A.1B.hb;if(C.9r.4z.bC){9Z=C.9r.4z.6s.K(C.bF+1);if(9Z){C.A.28.w=(T(k(9Z).B(\\'O\\'))||0)+C.A.1B.1C;C.A.28.h=(T(k(9Z).B(\\'Q\\'))||0)+C.A.1B.hb}9Q=C.9r.4z.6s.K(C.bF-1);if(9Q){D cU=T(k(9Q).B(\\'O\\'))||0;D cH=T(k(9Q).B(\\'O\\'))||0;C.A.28.x+=cU;C.A.28.y+=cH;C.A.28.w-=cU;C.A.28.h-=cH}}C.A.g7=C.A.28.w-C.A.1B.1C;C.A.eC=C.A.28.h-C.A.1B.hb;if(C.A.2O){C.A.gx=((C.A.28.w-C.A.1B.1C)/C.A.2O)||1;C.A.gy=((C.A.28.h-C.A.1B.hb)/C.A.2O)||1;C.A.fU=C.A.g7/C.A.2O;C.A.fH=C.A.eC/C.A.2O}C.A.28.dx=C.A.28.x-C.A.2c.x;C.A.28.dy=C.A.28.y-C.A.2c.y;k.11.1c.B(\\'9b\\',\\'ad\\')},3H:u(C,x,y){if(C.A.2O){fE=T(x/C.A.fU);92=fE*2a/C.A.2O;ft=T(y/C.A.fH);91=ft*2a/C.A.2O}P{92=T(x*2a/C.A.fu);91=T(y*2a/C.A.fw)}C.A.b3=[92||0,91||0,x||0,y||0];if(C.A.3H)C.A.3H.1D(C,C.A.b3)},eI:u(2k){3K=2k.7L||2k.7K||-1;3m(3K){1e 35:k.3b.5c(q.3U,[ae,ae]);1r;1e 36:k.3b.5c(q.3U,[-ae,-ae]);1r;1e 37:k.3b.5c(q.3U,[-q.3U.A.gx||-1,0]);1r;1e 38:k.3b.5c(q.3U,[0,-q.3U.A.gy||-1]);1r;1e 39:k.3b.5c(q.3U,[q.3U.A.gx||1,0]);1r;1e 40:k.11.5c(q.3U,[0,q.3U.A.gy||1]);1r}},5c:u(C,Y){if(!C.A){E}C.A.1B=k.23(k.1a.3w(C),k.1a.2o(C));C.A.2c={x:T(k.B(C,\\'O\\'))||0,y:T(k.B(C,\\'Q\\'))||0};C.A.4n=k.B(C,\\'Y\\');if(C.A.4n!=\\'2s\\'&&C.A.4n!=\\'1P\\'){C.14.Y=\\'2s\\'}k.11.c5(C);k.3b.ct(C);dx=T(Y[0])||0;dy=T(Y[1])||0;2v=C.A.2c.x+dx;2q=C.A.2c.y+dy;if(C.A.2O){3y=k.11.c7.1D(C,[2v,2q,dx,dy]);if(3y.1K==7M){dx=3y.dx;dy=3y.dy}2v=C.A.2c.x+dx;2q=C.A.2c.y+dy}3y=k.11.ce.1D(C,[2v,2q,dx,dy]);if(3y&&3y.1K==7M){dx=3y.dx;dy=3y.dy}2v=C.A.2c.x+dx;2q=C.A.2c.y+dy;if(C.A.5i&&(C.A.3H||C.A.2Z)){k.3b.3H(C,2v,2q)}2v=!C.A.1O||C.A.1O==\\'4j\\'?2v:C.A.2c.x||0;2q=!C.A.1O||C.A.1O==\\'49\\'?2q:C.A.2c.y||0;C.14.O=2v+\\'U\\';C.14.Q=2q+\\'U\\'},2r:u(o){E q.1E(u(){if(q.bI==1b||!o.3C||!k.1a||!k.11||!k.1x){E}5x=k(o.3C,q);if(5x.1N()==0){E}D 4N={2p:\\'94\\',5i:1b,3H:o.3H&&o.3H.1K==2A?o.3H:S,2Z:o.2Z&&o.2Z.1K==2A?o.2Z:S,3v:q,1G:o.1G||I};if(o.2O&&T(o.2O)){4N.2O=T(o.2O)||1;4N.2O=4N.2O>0?4N.2O:1}if(5x.1N()==1)5x.7t(4N);P{k(5x.K(0)).7t(4N);4N.3v=S;5x.7t(4N)}5x.7B(k.3b.eI);5x.1p(\\'bM\\',k.3b.bM++);q.bI=1b;q.4z={};q.4z.er=4N.er;q.4z.2O=4N.2O;q.4z.6s=5x;q.4z.bC=o.bC?1b:I;bZ=q;bZ.4z.6s.1E(u(2N){q.bF=2N;q.9r=bZ});if(o.3t&&o.3t.1K==7F){24(i=o.3t.1g-1;i>=0;i--){if(o.3t[i].1K==7F&&o.3t[i].1g==2){el=q.4z.6s.K(i);if(el.4Y){k.3b.5c(el,o.3t[i])}}}}})}};k.fn.23({hN:k.3b.2r,hS:k.3b.eH,hG:k.3b.K});k.2u={5I:[],eg:u(){q.5B();X=q.31;id=k.1p(X,\\'id\\');if(k.2u.5I[id]!=S){1X.5T(k.2u.5I[id])}1z=X.L.3u+1;if(X.L.1Q.1g<1z){1z=1}1Q=k(\\'1T\\',X.L.5u);X.L.3u=1z;if(1Q.1N()>0){1Q.7a(X.L.3W,k.2u.95)}},dp:u(){q.5B();X=q.31;id=k.1p(X,\\'id\\');if(k.2u.5I[id]!=S){1X.5T(k.2u.5I[id])}1z=X.L.3u-1;1Q=k(\\'1T\\',X.L.5u);if(1z<1){1z=X.L.1Q.1g}X.L.3u=1z;if(1Q.1N()>0){1Q.7a(X.L.3W,k.2u.95)}},2I:u(c){X=1h.9e(c);if(X.L.6o){1z=X.L.3u;7d(1z==X.L.3u){1z=1+T(18.6o()*X.L.1Q.1g)}}P{1z=X.L.3u+1;if(X.L.1Q.1g<1z){1z=1}}1Q=k(\\'1T\\',X.L.5u);X.L.3u=1z;if(1Q.1N()>0){1Q.7a(X.L.3W,k.2u.95)}},go:u(o){D X;if(o&&o.1K==7M){if(o.2b){X=1h.9e(o.2b.X);5N=1X.hn.3h.7C(\"#\");o.2b.6S=S;if(5N.1g==2){1z=T(5N[1]);1Y=5N[1].4E(1z,\\'\\');if(k.1p(X,\\'id\\')!=1Y){1z=1}}P{1z=1}}if(o.90){o.90.5B();X=o.90.31.31;id=k.1p(X,\\'id\\');if(k.2u.5I[id]!=S){1X.5T(k.2u.5I[id])}5N=o.90.3h.7C(\"#\");1z=T(5N[1]);1Y=5N[1].4E(1z,\\'\\');if(k.1p(X,\\'id\\')!=1Y){1z=1}}if(X.L.1Q.1g<1z||1z<1){1z=1}X.L.3u=1z;52=k.1a.2o(X);dt=k.1a.aT(X);d9=k.1a.6U(X);if(X.L.3z){X.L.3z.o.B(\\'19\\',\\'1o\\')}if(X.L.3s){X.L.3s.o.B(\\'19\\',\\'1o\\')}if(X.L.2b){y=T(dt.t)+T(d9.t);if(X.L.1U){if(X.L.1U.5A==\\'Q\\'){y+=X.L.1U.4C.hb}P{52.h-=X.L.1U.4C.hb}}if(X.L.2x){if(X.L.2x&&X.L.2x.6Q==\\'Q\\'){y+=X.L.2x.4C.hb}P{52.h-=X.L.2x.4C.hb}}if(!X.L.c1){X.L.df=o.2b?o.2b.W:(T(X.L.2b.B(\\'W\\'))||0);X.L.c1=o.2b?o.2b.Z:(T(X.L.2b.B(\\'Z\\'))||0)}X.L.2b.B(\\'Q\\',y+(52.h-X.L.df)/2+\\'U\\');X.L.2b.B(\\'O\\',(52.1C-X.L.c1)/2+\\'U\\');X.L.2b.B(\\'19\\',\\'2B\\')}1Q=k(\\'1T\\',X.L.5u);if(1Q.1N()>0){1Q.7a(X.L.3W,k.2u.95)}P{aj=k(\\'a\\',X.L.1U.o).K(1z-1);k(aj).2R(X.L.1U.5R);D 1T=12 9s();1T.X=k.1p(X,\\'id\\');1T.1z=1z-1;1T.2J=X.L.1Q[X.L.3u-1].2J;if(1T.21){1T.6S=S;k.2u.19.1D(1T)}P{1T.6S=k.2u.19}if(X.L.2x){X.L.2x.o.3x(X.L.1Q[1z-1].6L)}}}},95:u(){X=q.31.31;X.L.5u.B(\\'19\\',\\'1o\\');if(X.L.1U.5R){aj=k(\\'a\\',X.L.1U.o).4i(X.L.1U.5R).K(X.L.3u-1);k(aj).2R(X.L.1U.5R)}D 1T=12 9s();1T.X=k.1p(X,\\'id\\');1T.1z=X.L.3u-1;1T.2J=X.L.1Q[X.L.3u-1].2J;if(1T.21){1T.6S=S;k.2u.19.1D(1T)}P{1T.6S=k.2u.19}if(X.L.2x){X.L.2x.o.3x(X.L.1Q[X.L.3u-1].6L)}},19:u(){X=1h.9e(q.X);if(X.L.3z){X.L.3z.o.B(\\'19\\',\\'1o\\')}if(X.L.3s){X.L.3s.o.B(\\'19\\',\\'1o\\')}52=k.1a.2o(X);y=0;if(X.L.1U){if(X.L.1U.5A==\\'Q\\'){y+=X.L.1U.4C.hb}P{52.h-=X.L.1U.4C.hb}}if(X.L.2x){if(X.L.2x&&X.L.2x.6Q==\\'Q\\'){y+=X.L.2x.4C.hb}P{52.h-=X.L.2x.4C.hb}}hg=k(\\'.ca\\',X);y=y+(52.h-q.W)/2;x=(52.1C-q.Z)/2;X.L.5u.B(\\'Q\\',y+\\'U\\').B(\\'O\\',x+\\'U\\').3x(\\'<1T 2J=\"\\'+q.2J+\\'\" />\\');X.L.5u.7f(X.L.3W);3s=X.L.3u+1;if(3s>X.L.1Q.1g){3s=1}3z=X.L.3u-1;if(3z<1){3z=X.L.1Q.1g}X.L.3s.o.B(\\'19\\',\\'2B\\').B(\\'Q\\',y+\\'U\\').B(\\'O\\',x+2*q.Z/3+\\'U\\').B(\\'Z\\',q.Z/3+\\'U\\').B(\\'W\\',q.W+\\'U\\').1p(\\'4g\\',X.L.1Q[3s-1].6L);X.L.3s.o.K(0).3h=\\'#\\'+3s+k.1p(X,\\'id\\');X.L.3z.o.B(\\'19\\',\\'2B\\').B(\\'Q\\',y+\\'U\\').B(\\'O\\',x+\\'U\\').B(\\'Z\\',q.Z/3+\\'U\\').B(\\'W\\',q.W+\\'U\\').1p(\\'4g\\',X.L.1Q[3z-1].6L);X.L.3z.o.K(0).3h=\\'#\\'+3z+k.1p(X,\\'id\\')},2r:u(o){if(!o||!o.1Z||k.2u.5I[o.1Z])E;D 1Z=k(\\'#\\'+o.1Z);D el=1Z.K(0);if(el.14.Y!=\\'1P\\'&&el.14.Y!=\\'2s\\'){el.14.Y=\\'2s\\'}el.14.2U=\\'2K\\';if(1Z.1N()==0)E;el.L={};el.L.1Q=o.1Q?o.1Q:[];el.L.6o=o.6o&&o.6o==1b||I;97=el.f3(\\'hL\\');24(i=0;i<97.1g;i++){7Z=el.L.1Q.1g;el.L.1Q[7Z]={2J:97[i].2J,6L:97[i].4g||97[i].hD||\\'\\'}}if(el.L.1Q.1g==0){E}el.L.4n=k.23(k.1a.3w(el),k.1a.2o(el));el.L.b5=k.1a.aT(el);el.L.bu=k.1a.6U(el);t=T(el.L.b5.t)+T(el.L.bu.t);b=T(el.L.b5.b)+T(el.L.bu.b);k(\\'1T\\',el).bk();el.L.3W=o.3W?o.3W:g5;if(o.5A||o.9f||o.5R){el.L.1U={};1Z.1S(\\'<22 6T=\"g1\"></22>\\');el.L.1U.o=k(\\'.g1\\',el);if(o.9f){el.L.1U.9f=o.9f;el.L.1U.o.2R(o.9f)}if(o.5R){el.L.1U.5R=o.5R}el.L.1U.o.B(\\'Y\\',\\'1P\\').B(\\'Z\\',el.L.4n.w+\\'U\\');if(o.5A&&o.5A==\\'Q\\'){el.L.1U.5A=\\'Q\\';el.L.1U.o.B(\\'Q\\',t+\\'U\\')}P{el.L.1U.5A=\\'4D\\';el.L.1U.o.B(\\'4D\\',b+\\'U\\')}el.L.1U.aE=o.aE?o.aE:\\' \\';24(D i=0;i<el.L.1Q.1g;i++){7Z=T(i)+1;el.L.1U.o.1S(\\'<a 3h=\"#\\'+7Z+o.1Z+\\'\" 6T=\"gR\" 4g=\"\\'+el.L.1Q[i].6L+\\'\">\\'+7Z+\\'</a>\\'+(7Z!=el.L.1Q.1g?el.L.1U.aE:\\'\\'))}k(\\'a\\',el.L.1U.o).1J(\\'5h\\',u(){k.2u.go({90:q})});el.L.1U.4C=k.1a.2o(el.L.1U.o.K(0))}if(o.6Q||o.9c){el.L.2x={};1Z.1S(\\'<22 6T=\"dn\">&7k;</22>\\');el.L.2x.o=k(\\'.dn\\',el);if(o.9c){el.L.2x.9c=o.9c;el.L.2x.o.2R(o.9c)}el.L.2x.o.B(\\'Y\\',\\'1P\\').B(\\'Z\\',el.L.4n.w+\\'U\\');if(o.6Q&&o.6Q==\\'Q\\'){el.L.2x.6Q=\\'Q\\';el.L.2x.o.B(\\'Q\\',(el.L.1U&&el.L.1U.5A==\\'Q\\'?el.L.1U.4C.hb+t:t)+\\'U\\')}P{el.L.2x.6Q=\\'4D\\';el.L.2x.o.B(\\'4D\\',(el.L.1U&&el.L.1U.5A==\\'4D\\'?el.L.1U.4C.hb+b:b)+\\'U\\')}el.L.2x.4C=k.1a.2o(el.L.2x.o.K(0))}if(o.9D){el.L.3s={9D:o.9D};1Z.1S(\\'<a 3h=\"#2\\'+o.1Z+\\'\" 6T=\"eY\">&7k;</a>\\');el.L.3s.o=k(\\'.eY\\',el);el.L.3s.o.B(\\'Y\\',\\'1P\\').B(\\'19\\',\\'1o\\').B(\\'2U\\',\\'2K\\').B(\\'4A\\',\\'eR\\').2R(el.L.3s.9D);el.L.3s.o.1J(\\'5h\\',k.2u.eg)}if(o.9o){el.L.3z={9o:o.9o};1Z.1S(\\'<a 3h=\"#0\\'+o.1Z+\\'\" 6T=\"ee\">&7k;</a>\\');el.L.3z.o=k(\\'.ee\\',el);el.L.3z.o.B(\\'Y\\',\\'1P\\').B(\\'19\\',\\'1o\\').B(\\'2U\\',\\'2K\\').B(\\'4A\\',\\'eR\\').2R(el.L.3z.9o);el.L.3z.o.1J(\\'5h\\',k.2u.dp)}1Z.bG(\\'<22 6T=\"ca\"></22>\\');el.L.5u=k(\\'.ca\\',el);el.L.5u.B(\\'Y\\',\\'1P\\').B(\\'Q\\',\\'2P\\').B(\\'O\\',\\'2P\\').B(\\'19\\',\\'1o\\');if(o.2b){1Z.bG(\\'<22 6T=\"dW\" 14=\"19: 1o;\"><1T 2J=\"\\'+o.2b+\\'\" /></22>\\');el.L.2b=k(\\'.dW\\',el);el.L.2b.B(\\'Y\\',\\'1P\\');D 1T=12 9s();1T.X=o.1Z;1T.2J=o.2b;if(1T.21){1T.6S=S;k.2u.go({2b:1T})}P{1T.6S=u(){k.2u.go({2b:q})}}}P{k.2u.go({1Z:el})}if(o.cS){fi=T(o.cS)*aC}k.2u.5I[o.1Z]=o.cS?1X.6V(\\'k.2u.2I(\\\\\\'\\'+o.1Z+\\'\\\\\\')\\',fi):S}};k.X=k.2u.2r;k.1t={7s:[],5L:{},1c:I,7u:S,26:u(){if(k.11.F==S){E}D 4O,3G,c,cs;k.1t.1c.K(0).3l=k.11.F.A.6R;4O=k.1t.1c.K(0).14;4O.19=\\'2B\\';k.1t.1c.1B=k.23(k.1a.3w(k.1t.1c.K(0)),k.1a.2o(k.1t.1c.K(0)));4O.Z=k.11.F.A.1B.1C+\\'U\\';4O.W=k.11.F.A.1B.hb+\\'U\\';3G=k.1a.cy(k.11.F);4O.5K=3G.t;4O.5z=3G.r;4O.5k=3G.b;4O.5j=3G.l;if(k.11.F.A.46==1b){c=k.11.F.fI(1b);cs=c.14;cs.5K=\\'2P\\';cs.5z=\\'2P\\';cs.5k=\\'2P\\';cs.5j=\\'2P\\';cs.19=\\'2B\\';k.1t.1c.5o().1S(c)}k(k.11.F).f5(k.1t.1c.K(0));k.11.F.14.19=\\'1o\\'},fC:u(e){if(!e.A.44&&k.1x.5r.cQ){if(e.A.3T)e.A.3T.1D(F);k(e).B(\\'Y\\',e.A.cz||e.A.4n);k(e).aS();k(k.1x.5r).f6(e)}k.1t.1c.4i(e.A.6R).3x(\\'&7k;\\');k.1t.7u=S;D 4O=k.1t.1c.K(0).14;4O.19=\\'1o\\';k.1t.1c.f5(e);if(e.A.fx>0){k(e).7f(e.A.fx)}k(\\'2e\\').1S(k.1t.1c.K(0));D 86=[];D 8q=I;24(D i=0;i<k.1t.7s.1g;i++){D 1j=k.1x.3P[k.1t.7s[i]].K(0);D id=k.1p(1j,\\'id\\');D 8i=k.1t.8x(id);if(1j.1i.ay!=8i.7l){1j.1i.ay=8i.7l;if(8q==I&&1j.1i.2Z){8q=1j.1i.2Z}8i.id=id;86[86.1g]=8i}}k.1t.7s=[];if(8q!=I&&86.1g>0){8q(86)}},al:u(e,o){if(!k.11.F)E;D 6e=I;D i=0;if(e.1i.el.1N()>0){24(i=e.1i.el.1N();i>0;i--){if(e.1i.el.K(i-1)!=k.11.F){if(!e.5V.b2){if((e.1i.el.K(i-1).1M.y+e.1i.el.K(i-1).1M.hb/2)>k.11.F.A.2q){6e=e.1i.el.K(i-1)}P{1r}}P{if((e.1i.el.K(i-1).1M.x+e.1i.el.K(i-1).1M.1C/2)>k.11.F.A.2v&&(e.1i.el.K(i-1).1M.y+e.1i.el.K(i-1).1M.hb/2)>k.11.F.A.2q){6e=e.1i.el.K(i-1)}}}}}if(6e&&k.1t.7u!=6e){k.1t.7u=6e;k(6e).h5(k.1t.1c.K(0))}P if(!6e&&(k.1t.7u!=S||k.1t.1c.K(0).31!=e)){k.1t.7u=S;k(e).1S(k.1t.1c.K(0))}k.1t.1c.K(0).14.19=\\'2B\\'},cT:u(e){if(k.11.F==S){E}e.1i.el.1E(u(){q.1M=k.23(k.1a.74(q),k.1a.7G(q))})},8x:u(s){D i;D h=\\'\\';D o={};if(s){if(k.1t.5L[s]){o[s]=[];k(\\'#\\'+s+\\' .\\'+k.1t.5L[s]).1E(u(){if(h.1g>0){h+=\\'&\\'}h+=s+\\'[]=\\'+k.1p(q,\\'id\\');o[s][o[s].1g]=k.1p(q,\\'id\\')})}P{24(a in s){if(k.1t.5L[s[a]]){o[s[a]]=[];k(\\'#\\'+s[a]+\\' .\\'+k.1t.5L[s[a]]).1E(u(){if(h.1g>0){h+=\\'&\\'}h+=s[a]+\\'[]=\\'+k.1p(q,\\'id\\');o[s[a]][o[s[a]].1g]=k.1p(q,\\'id\\')})}}}}P{24(i in k.1t.5L){o[i]=[];k(\\'#\\'+i+\\' .\\'+k.1t.5L[i]).1E(u(){if(h.1g>0){h+=\\'&\\'}h+=i+\\'[]=\\'+k.1p(q,\\'id\\');o[i][o[i].1g]=k.1p(q,\\'id\\')})}}E{7l:h,o:o}},fF:u(e){if(!e.dq){E}E q.1E(u(){if(!q.5V||!k(e).is(\\'.\\'+q.5V.3C))k(e).2R(q.5V.3C);k(e).7t(q.5V.A)})},4U:u(){E q.1E(u(){k(\\'.\\'+q.5V.3C).aS();k(q).dR();q.5V=S;q.fm=S})},2r:u(o){if(o.3C&&k.1a&&k.11&&k.1x){if(!k.1t.1c){k(\\'2e\\',1h).1S(\\'<22 id=\"e5\">&7k;</22>\\');k.1t.1c=k(\\'#e5\\');k.1t.1c.K(0).14.19=\\'1o\\'}q.do({3C:o.3C,9J:o.9J?o.9J:I,a5:o.a5?o.a5:I,58:o.58?o.58:I,7x:o.7x||o.dC,7y:o.7y||o.fO,cQ:1b,2Z:o.2Z||o.ia,fx:o.fx?o.fx:I,46:o.46?1b:I,6I:o.6I?o.6I:\\'cV\\'});E q.1E(u(){D A={6N:o.6N?1b:I,ff:6P,1G:o.1G?2m(o.1G):I,6R:o.58?o.58:I,fx:o.fx?o.fx:I,44:1b,46:o.46?1b:I,3v:o.3v?o.3v:S,2p:o.2p?o.2p:S,4o:o.4o&&o.4o.1K==2A?o.4o:I,4m:o.4m&&o.4m.1K==2A?o.4m:I,3T:o.3T&&o.3T.1K==2A?o.3T:I,1O:/49|4j/.48(o.1O)?o.1O:I,6M:o.6M?T(o.6M)||0:I,2V:o.2V?o.2V:I};k(\\'.\\'+o.3C,q).7t(A);q.fm=1b;q.5V={3C:o.3C,6N:o.6N?1b:I,ff:6P,1G:o.1G?2m(o.1G):I,6R:o.58?o.58:I,fx:o.fx?o.fx:I,44:1b,46:o.46?1b:I,3v:o.3v?o.3v:S,2p:o.2p?o.2p:S,b2:o.b2?1b:I,A:A}})}}};k.fn.23({j3:k.1t.2r,f6:k.1t.fF,iS:k.1t.4U});k.iZ=k.1t.8x;k.2t={6O:S,7b:I,9m:S,6K:u(e){k.2t.7b=1b;k.2t.1Y(e,q,1b)},cq:u(e){if(k.2t.6O!=q)E;k.2t.7b=I;k.2t.2G(e,q)},1Y:u(e,el,7b){if(k.2t.6O!=S)E;if(!el){el=q}k.2t.6O=el;1M=k.23(k.1a.3w(el),k.1a.2o(el));8u=k(el);4g=8u.1p(\\'4g\\');3h=8u.1p(\\'3h\\');if(4g){k.2t.9m=4g;8u.1p(\\'4g\\',\\'\\');k(\\'#eT\\').3x(4g);if(3h)k(\\'#bL\\').3x(3h.4E(\\'jh://\\',\\'\\'));P k(\\'#bL\\').3x(\\'\\');1c=k(\\'#8z\\');if(el.4H.3l){1c.K(0).3l=el.4H.3l}P{1c.K(0).3l=\\'\\'}bo=k.1a.2o(1c.K(0));ga=7b&&el.4H.Y==\\'bO\\'?\\'4D\\':el.4H.Y;3m(ga){1e\\'Q\\':2q=1M.y-bo.hb;2v=1M.x;1r;1e\\'O\\':2q=1M.y;2v=1M.x-bo.1C;1r;1e\\'2L\\':2q=1M.y;2v=1M.x+1M.1C;1r;1e\\'bO\\':k(\\'2e\\').1J(\\'3D\\',k.2t.3D);1s=k.1a.4a(e);2q=1s.y+15;2v=1s.x+15;1r;ad:2q=1M.y+1M.hb;2v=1M.x;1r}1c.B({Q:2q+\\'U\\',O:2v+\\'U\\'});if(el.4H.54==I){1c.1Y()}P{1c.7f(el.4H.54)}if(el.4H.2Y)el.4H.2Y.1D(el);8u.1J(\\'8B\\',k.2t.2G).1J(\\'5B\\',k.2t.cq)}},3D:u(e){if(k.2t.6O==S){k(\\'2e\\').3q(\\'3D\\',k.2t.3D);E}1s=k.1a.4a(e);k(\\'#8z\\').B({Q:1s.y+15+\\'U\\',O:1s.x+15+\\'U\\'})},2G:u(e,el){if(!el){el=q}if(k.2t.7b!=1b&&k.2t.6O==el){k.2t.6O=S;k(\\'#8z\\').7a(1);k(el).1p(\\'4g\\',k.2t.9m).3q(\\'8B\\',k.2t.2G).3q(\\'5B\\',k.2t.cq);if(el.4H.3i)el.4H.3i.1D(el);k.2t.9m=S}},2r:u(M){if(!k.2t.1c){k(\\'2e\\').1S(\\'<22 id=\"8z\"><22 id=\"eT\"></22><22 id=\"bL\"></22></22>\\');k(\\'#8z\\').B({Y:\\'1P\\',3I:6P,19:\\'1o\\'});k.2t.1c=1b}E q.1E(u(){if(k.1p(q,\\'4g\\')){q.4H={Y:/Q|4D|O|2L|bO/.48(M.Y)?M.Y:\\'4D\\',3l:M.3l?M.3l:I,54:M.54?M.54:I,2Y:M.2Y&&M.2Y.1K==2A?M.2Y:I,3i:M.3i&&M.3i.1K==2A?M.3i:I};D el=k(q);el.1J(\\'9z\\',k.2t.1Y);el.1J(\\'6K\\',k.2t.6K)}})}};k.fn.hO=k.2t.2r;k.84={bq:u(e){3K=e.7L||e.7K||-1;if(3K==9){if(1X.2k){1X.2k.bT=1b;1X.2k.c0=I}P{e.aP();e.aW()}if(q.b1){1h.6J.dZ().3g=\"\\\\t\";q.dV=u(){q.6K();q.dV=S}}P if(q.aF){26=q.5q;2T=q.dN;q.2y=q.2y.hd(0,26)+\"\\\\t\"+q.2y.h8(2T);q.aF(26+1,26+1);q.6K()}E I}},4U:u(){E q.1E(u(){if(q.7P&&q.7P==1b){k(q).3q(\\'7B\\',k.84.bq);q.7P=I}})},2r:u(){E q.1E(u(){if(q.4Y==\\'cf\\'&&(!q.7P||q.7P==I)){k(q).1J(\\'7B\\',k.84.bq);q.7P=1b}})}};k.fn.23({j5:k.84.2r,hH:k.84.4U});k.1a={3w:u(e){D x=0;D y=0;D es=e.14;D bP=I;if(k(e).B(\\'19\\')==\\'1o\\'){D 5Y=es.3n;D 9q=es.Y;bP=1b;es.3n=\\'2K\\';es.19=\\'2B\\';es.Y=\\'1P\\'}D el=e;7d(el){x+=el.8t+(el.4Z&&!k.3a.7I?T(el.4Z.5b)||0:0);y+=el.8G+(el.4Z&&!k.3a.7I?T(el.4Z.4S)||0:0);el=el.dJ}el=e;7d(el&&el.4Y&&el.4Y.6c()!=\\'2e\\'){x-=el.3c||0;y-=el.3d||0;el=el.31}if(bP==1b){es.19=\\'1o\\';es.Y=9q;es.3n=5Y}E{x:x,y:y}},7G:u(el){D x=0,y=0;7d(el){x+=el.8t||0;y+=el.8G||0;el=el.dJ}E{x:x,y:y}},2o:u(e){D w=k.B(e,\\'Z\\');D h=k.B(e,\\'W\\');D 1C=0;D hb=0;D es=e.14;if(k(e).B(\\'19\\')!=\\'1o\\'){1C=e.4c;hb=e.5W}P{D 5Y=es.3n;D 9q=es.Y;es.3n=\\'2K\\';es.19=\\'2B\\';es.Y=\\'1P\\';1C=e.4c;hb=e.5W;es.19=\\'1o\\';es.Y=9q;es.3n=5Y}E{w:w,h:h,1C:1C,hb:hb}},74:u(el){E{1C:el.4c||0,hb:el.5W||0}},bm:u(e){D h,w,de;if(e){w=e.8W;h=e.8O}P{de=1h.5d;w=1X.d4||aa.d4||(de&&de.8W)||1h.2e.8W;h=1X.cB||aa.cB||(de&&de.8O)||1h.2e.8O}E{w:w,h:h}},6z:u(e){D t=0,l=0,w=0,h=0,iw=0,ih=0;if(e&&e.9N.6c()!=\\'2e\\'){t=e.3d;l=e.3c;w=e.d7;h=e.d2;iw=0;ih=0}P{if(1h.5d){t=1h.5d.3d;l=1h.5d.3c;w=1h.5d.d7;h=1h.5d.d2}P if(1h.2e){t=1h.2e.3d;l=1h.2e.3c;w=1h.2e.d7;h=1h.2e.d2}iw=aa.d4||1h.5d.8W||1h.2e.8W||0;ih=aa.cB||1h.5d.8O||1h.2e.8O||0}E{t:t,l:l,w:w,h:h,iw:iw,ih:ih}},cy:u(e,7N){D el=k(e);D t=el.B(\\'5K\\')||\\'\\';D r=el.B(\\'5z\\')||\\'\\';D b=el.B(\\'5k\\')||\\'\\';D l=el.B(\\'5j\\')||\\'\\';if(7N)E{t:T(t)||0,r:T(r)||0,b:T(b)||0,l:T(l)};P E{t:t,r:r,b:b,l:l}},aT:u(e,7N){D el=k(e);D t=el.B(\\'5M\\')||\\'\\';D r=el.B(\\'5U\\')||\\'\\';D b=el.B(\\'5n\\')||\\'\\';D l=el.B(\\'4X\\')||\\'\\';if(7N)E{t:T(t)||0,r:T(r)||0,b:T(b)||0,l:T(l)};P E{t:t,r:r,b:b,l:l}},6U:u(e,7N){D el=k(e);D t=el.B(\\'4S\\')||\\'\\';D r=el.B(\\'5O\\')||\\'\\';D b=el.B(\\'5Q\\')||\\'\\';D l=el.B(\\'5b\\')||\\'\\';if(7N)E{t:T(t)||0,r:T(r)||0,b:T(b)||0,l:T(l)||0};P E{t:t,r:r,b:b,l:l}},4a:u(2k){D x=2k.hT||(2k.gM+(1h.5d.3c||1h.2e.3c))||0;D y=2k.ki||(2k.iQ+(1h.5d.3d||1h.2e.3d))||0;E{x:x,y:y}},cI:u(4R,cx){cx(4R);4R=4R.7c;7d(4R){k.1a.cI(4R,cx);4R=4R.hQ}},h7:u(4R){k.1a.cI(4R,u(el){24(D 1p in el){if(2g el[1p]===\\'u\\'){el[1p]=S}}})},hV:u(el,1O){D 5l=k.1a.6z();D b6=k.1a.2o(el);if(!1O||1O==\\'49\\')k(el).B({Q:5l.t+((18.3r(5l.h,5l.ih)-5l.t-b6.hb)/2)+\\'U\\'});if(!1O||1O==\\'4j\\')k(el).B({O:5l.l+((18.3r(5l.w,5l.iw)-5l.l-b6.1C)/2)+\\'U\\'})},hW:u(el,dk){D 1Q=k(\\'1T[@2J*=\"8X\"]\\',el||1h),8X;1Q.1E(u(){8X=q.2J;q.2J=dk;q.14.5E=\"9n:9w.9y.hE(2J=\\'\"+8X+\"\\')\"})}};[].3J||(7F.hF.3J=u(v,n){n=(n==S)?0:n;D m=q.1g;24(D i=n;i<m;i++)if(q[i]==v)E i;E-1});',62,1293,'||||||||||||||||||||jQuery||||||this||||function||||||dragCfg|css|elm|var|return|dragged|easing|speed|false|callback|get|ss|options|iAuto|left|else|top|iResize|null|parseInt|px|oldStyle|height|slideshow|position|width||iDrag|new||style||||Math|display|iUtil|true|helper|subject|case|autoCFG|length|document|dropCfg|iEL|resizeOptions|carouselCfg|duration|interfaceFX|none|attr|sizes|break|pointer|iSort|type|ImageBox|queue|iDrop|iAutoscroller|slide|resizeElement|oC|wb|apply|each|fisheyeCfg|opacity|delta|newSizes|bind|constructor|custom|pos|size|axis|absolute|images|items|append|img|slideslinks|255|firstNum|window|show|container||complete|div|extend|for||start||cont|elsToScroll|100|loader|oR||body|elem|typeof|selectedItem|oldP|props|event|accordionCfg|parseFloat|field|getSize|containment|ny|build|relative|iTooltip|islideshow|nx|tp|slideCaption|value|newPosition|Function|block|selectHelper|step|border|itemWidth|hide|dequeue|timer|src|hidden|right|limit|nr|fractions|0px|PI|addClass|direction|end|overflow|cursorAt|result|parentData|onShow|onChange|to|parentNode|||||||||browser|iSlider|scrollLeft|scrollTop|scr|transferHelper|text|href|onHide|pre|selectdrug|className|switch|visibility|item|wrapper|unbind|max|nextslide|values|currentslide|handle|getPosition|html|newCoords|prevslide|iframe|iExpander|accept|mousemove|canvas|createElement|margins|onSlide|zIndex|indexOf|pressedKey|min|valueToAdd|multipleSeparator|pageSize|zones|highlighted|toggle|abs|onStop|dragElem|times|fadeDuration|diff|dhs|handlers||resizeDirection||vp|so|distance|ghosting||test|vertically|getPointer|startTop|offsetWidth|subjectValue|lastSuggestion|DropOutDirectiont|title|wrs|removeClass|horizontally|startLeft|out|onDrag|oP|onStart|nWidth|percent|down|ifxFirstDisplay|msie|iteration|ratio|clear|color|lastValue|slideCfg|fontSize|currentPointer|dimm|bottom|replace|up|prevImage|tooltipCFG|rel|els|fxCheckTag|context|nextImage|params|shs|fieldData|elToScroll|nodeEl|borderTopWidth|chunks|destroy|string|nHeight|paddingLeft|tagName|currentStyle||halign|slidePos|onclick|delay||containerW|from|helperclass|endLeft|endTop|borderLeftWidth|dragmoveBy|documentElement|dhe|newStyles|clonedEl|click|si|marginLeft|marginBottom|clientScroll|OpenClose|paddingBottom|empty|toWrite|selectionStart|overzone|toAdd|onDragModifier|holder|mousedown|animate|toDrag|cnt|marginRight|linksPosition|blur|getAttribute|hight|filter|sw|zoney|cos|slideshows|zonex|marginTop|collected|paddingTop|url|borderRightWidth|mouseup|borderBottomWidth|activeLinkClass|dragHandle|clearInterval|paddingRight|sortCfg|offsetHeight|prop|oldVisibility|styles||BlindDirection|point|fxh|nmp|old|post|currentPanel|onSelect|elementData|grid|pow|toLowerCase|animationHandler|cur|containerH|close|puff|getWidth|currentRel|imageEl|Expander|getHeight|iFisheye|random|newDimensions|itemHeight|reflections|sliders|selRange|wr|orig|margin|maxWidth|keyup|getScroll|captionText|totalImages|128|parseColor|curCSS|outerContainer|Scale|restore|tolerance|selection|focus|caption|snapDistance|revert|current|3000|captionPosition|hpc|onload|class|getBorder|setInterval|oldStyleAttr|rule|rgb|open|minLeft|ActiveXObject|oldDisplay|restoreStyle|getSizeLite||nw|0x||F0|fadeOut|focused|firstChild|while|cssRules|fadeIn|Date|minTop|backgroundColor|sc|nbsp|hash|captionEl|selectKeyHelper|selectCurrent|newTop|init|newLeft|changed|Draggable|inFrontOf|efx|139|onHover|onOut|getTime|np|keydown|split|radiusY|increment|Array|getPositionLite|selectClass|opera|onHighlight|keyCode|charCode|Object|toInteger|frameClass|hasTabsEnabled|zonew|user|zoneh|positionItems|onClick|oD|scrollIntoView|accordionPos|proximity|indic||data|containerSize|sin|iTTabs||ts|ImageBoxPrevImage|ImageBoxNextImage|imageSrc|newPos|maxHeight|minHeight|elS|activeClass|panels|maxBottom|maxRight|ser|move|opened|bounceout|animationInProgress|overlay|stop|reflectionSize|fnc|classname|insideParent|offsetLeft|jEl|nRy|pr|serialize|nRx|tooltipHelper|cssSides|mouseout|select|count|namedColors|padding|offsetTop|directionIncrement|parentEl|400|dir|expand|createTextNode|finishedPre|clientHeight|li|applyOn|content|contBorders|object|parentBorders|alpha|clientWidth|png|gallery|fontWeight|link|yproc|xproc|sx|parent|showImage|selectedone|imgs|onselect|sy|startDrag|cursor|captionClass|onselectstop|getElementById|linksClass|sh|ul|onActivate|isDroppable|nextEl|onDrop|oldTitle|progid|prevslideClass|prevEl|oldPosition|SliderContainer|Image|linkRel|selectKeyUp|selectKeyDown|DXImageTransform|inCache|Microsoft|mouseover|dragstop|diffX|211|nextslideClass|prot|auto|dEs|hidehelper|isDraggable|activeclass|unit|DoFold|unfold|nodeName|startTime|buildWrapper|prev|1px|oldColor|setTimeout|ScrollTo|st|sl|cssText|9999|next|destroyWrapper|opt|diffHeight|diffWidth|exec|hoverclass|image|blind|borderColor|sideEnd|self|key||default|2000|styleSheets|getValues|192|diffY|lnk|reflexions|checkhover|selectcheck|maxRotation|ImageBoxOuterContainer|gradient|panelHeight|childs|headers|ne|hideImage|minWidth|iIndex|itemsText|os|side|iCarousel|5625|1000|itemMinWidth|linksSeparator|setSelectionRange|protectRotation|positionContainer|posx|hoverClass|valToAdd|minchars|helperClass|source|nextImageEl|preventDefault|multiple|headerSelector|DraggableDestroy|getPadding|autofill|handleEl|stopPropagation|prevImageEl|getFieldValues|panelSelector|String|createTextRange|floats|lastSi|shrink|oPad|windowSize|paddingLeftSize|angle|paddingY|paddingX|RegExp|borderRightSize|floatVal|firstStep|pulse|Pulsate|Color|rotationSpeed|paddingBottomSize|remove|parseStyle|getClient|Number|helperSize|bounce|doTab||zoom|borderLeftSize|oBor|paddingRightSize|borderTopSize|paddingTopSize|stopAnim|pValue|borderBottomSize|extraWidth|restricted|autoSize|unselectable|SliderIteration|prepend|clearTimeout|isSlider|oneIsSortable|applyOnHover|tooltipURL|tabindex|draginit|mouse|restoreStyles|sliderSize|sliderPos|parentPos|cancelBubble|autocomplete|inputWidth|oldBorder|dragmove|clnt|sliderEl|returnValue|loaderWidth|idsa|letterSpacing|pause|getContainment|fade|snapToGrid|linear|10000|slideshowHolder|asin|cssSidesEnd|borderWidth|fitToContainer|TEXTAREA|entities|INPUT|spacer|writeItems|character|currentValue|paddings|169|oldFloat|borders|hidefocused|bouncein||modifyContainer|transparent|center|loadImage|func|getMargins|initialPosition|textAlign|innerHeight|Alpha|no|captionImages|closeEl|shake|prevTop|traverseDOM|Selectserialize|stopDrag|slider|ImageBoxCaption|ImageBoxIframe|300|ImageBoxOverlay|sortable|moveDrag|autoplay|measure|prevLeft|intersect|ImageBoxCurrentImage|selectstop|Shake|index|dragEl|keyPressed|scrollHeight|scroll|innerWidth|match|elPosition|scrollWidth|textImage|slideBor|jpg|captionSize|textImageFrom|visible||loaderHeight|ImageBoxCaptionImages||hoverItem|clickItem|emptyGIF||notColor|slideshowCaption|Droppable|goprev|childNodes|autocompleteHelper|autocompleteIframe|slidePad|fit|165|clientSize|||fontFamily|colorCssProps|elType|onhover|cssProps|expanderHelper|boxModel|itransferTo|keypress|moveStart|offsetParent|Width|selectstart|fxe|selectionEnd|checkCache|fontStyle|update|DroppableDestroy|remeasure|fontStretch|fontVariant|onblur|slideshowLoader|htmlEntities|wordSpacing|createRange|224|KhtmlUserSelect||closeHTML|on|sortHelper|245|userSelect|dragHelper|hrefAttr|dragstart|107|loaderSRC|highlight|slideshowPrevslide||gonext||styleFloat|frameborder|javascript|||relAttr|wid|scrolling||onslide|||listStyle|imageTypes|insertBefore|999|textDecoration|sqrt|140|230|maxy|240|ImageBoxContainer|doScroll|interval|set|dragmoveByKey|protect|ImageBoxCaptionText|144|ImageBoxLoader|off|checkdrop|isSelectable|hlt|30px|selectedclass|tooltipTitle|imagebox|shc|overlayOpacity|selRange2|slideshowNextSlide|gif|getSelectionStart|360|iAccordion|getElementsByTagName|iBounce|after|SortableAddItem|onResize|150|itemZIndex|grow|getHeightMinMax|borderTopUnit|selectcheckApply|borderRightUnit|zindex|fontUnit|togglehor|time|se|parte|easeout|isSortable||SlideInUp|fold|SlideOutUp|rgba|addColorStop|yfrac|containerMaxx|interfaceColorFX|containerMaxy||leftUnit|mousex||radiusX|check|getContext|xfrac|addItem|topUnit|fracH|cloneNode|togglever|paddingLeftUnit|borderBottomUnit|finish|onDragStop|onout|posy|isFunction|oldOverflow|directions|vertical|fracW|fakeAccordionClass|parts|fadeTo|inputValue|xml|selectstopApply|slideshowLinks|onDragStart|BlindUp|paddingTopUnit|500|trim|maxx|borderLeftUnit|paddingRightUnit|filteredPosition|BlindDown|paddingBottomUnit|horizontal|valign|find|ImageBoxClose|onselectstart|mozUserSelect|ondragstart|scale|110|globalCompositeOperation|bmp||drawImage|ondrop|password|quot||save|starty|jpeg|||number|startx|finishOpacity|hover|recallDroppables|flipv|finishx|destination|khtml|moz|lt|amp|pW|clientX|Accordion|translate|captiontext|elasticin|slideshowLink|fix|elasticout|resize|elasticboth|bounceboth|984375|9375|Selectable|30002|list|625|30001|nodeValue|before|100000|purgeEvents|substr|duplicate|moveEnd|||substring|success|param|par|array|Fisheye|name|POST|ajax|easeboth|location|fromHandler|collapse|MozUserSelect||ResizableDestroy|rotationTimer|fillRect|fill|WebKit|fillStyle|createLinearGradient|Resizable|navigator|appVersion|lineHeigt|alt|AlphaImageLoader|prototype|SliderGetValues|DisableTabs|Carousel|load|easein|IMG|200|Slider|ToolTip|wh|nextSibling|Autocomplete|SliderSetValues|pageX|float|centerEl|fixPNG|isNaN|dotted|dashed|stopAll|Left|outlineColor|Top|Right|Bottom|solid|double|selectorText|rules|onchange|SlideToggleRight|SlideOutRight||borderStyle||TransferTo||groove|ridge|inset|outset|borderTopColor||borderRightColor|olive|navy|orange||pink|203|maroon||magenta|182|193|lightyellow|lime|purple|red|outlineOffset|outlineWidth|borderBottomColor|borderLeftColor|lineHeight|loading|silver|white|yellow|Showing|100000000|SlideInRight|clientY|Highlight|SortableDestroy|CloseVertically|CloseHorizontally|FoldToggle|UnFold|SlideInDown|SlideToggleUp|SortSerialize|Fold|SwitchHorizontally|SwitchVertically|Sortable|scrollTo|EnableTabs|ScrollToAnchors|pt|Puff|OpenVertically|OpenHorizontally|Grow|Shrink|DropToggleRight|DropInRight|BlindToggleHorizontally|BlindRight|http|Bounce|120|BlindLeft|BlindToggleVertically|SlideToggleLeft|SlideOutLeft|toUpperCase|SlideInLeft|SlideToggleDown|SlideOutDown|DropOutLeft|DropInLeft|DropToggleLeft|DropOutRight|DropToggleUp|DropInUp|DropOutDown|DropInDown|DropToggleDown|DropOutUp|lightpink|textIndent|aqua|appendChild|azure|beige|220|last|cssFloat|first|ol|wrapEl|fxWrapper|black|imageLoaded|darkkhaki|darkgreen|189|183|darkmagenta|firstResize|darkgrey|brown|cyan|darkblue|darkcyan|table|form|col|tfoot|colgroup|th|header|thead|tbody|112|Autoexpand|tr|td|script|frame|input|pageY|textarea|button|w_|removeChild|frameset|option|optgroup|meta|darkolivegreen|blue|122|233|green|lightcyan|204|darkviolet|lightgreen|indigo|216|khaki|darksalmon|130|darkred|lightblue|148|173|215|238|fuchsia|gold|darkorchid|153|darkorange|lightgrey'.split('|'),0,{}))\n"
  },
  {
    "path": "extensions/themes/silverblue/scripts/libraries/jquery.json.js",
    "content": "/*\n * jQuery JSON Plugin\n * version: 2.1 (2009-08-14)\n *\n * This document is licensed as free software under the terms of the\n * MIT License: http://www.opensource.org/licenses/mit-license.php\n *\n * Brantley Harris wrote this plugin. It is based somewhat on the JSON.org \n * website's http://www.json.org/json2.js, which proclaims:\n * \"NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\", a sentiment that\n * I uphold.\n *\n * It is also influenced heavily by MochiKit's serializeJSON, which is \n * copyrighted 2005 by Bob Ippolito.\n */\n \n(function($) {\n    /** jQuery.toJSON( json-serializble )\n        Converts the given argument into a JSON respresentation.\n\n        If an object has a \"toJSON\" function, that will be used to get the representation.\n        Non-integer/string keys are skipped in the object, as are keys that point to a function.\n\n        json-serializble:\n            The *thing* to be converted.\n     **/\n    $.toJSON = function(o)\n    {\n        if (typeof(JSON) == 'object' && JSON.stringify)\n            return JSON.stringify(o);\n        \n        var type = typeof(o);\n    \n        if (o === null)\n            return \"null\";\n    \n        if (type == \"undefined\")\n            return undefined;\n        \n        if (type == \"number\" || type == \"boolean\")\n            return o + \"\";\n    \n        if (type == \"string\")\n            return $.quoteString(o);\n    \n        if (type == 'object')\n        {\n            if (typeof o.toJSON == \"function\") \n                return $.toJSON( o.toJSON() );\n            \n            if (o.constructor === Date)\n            {\n                var month = o.getUTCMonth() + 1;\n                if (month < 10) month = '0' + month;\n\n                var day = o.getUTCDate();\n                if (day < 10) day = '0' + day;\n\n                var year = o.getUTCFullYear();\n                \n                var hours = o.getUTCHours();\n                if (hours < 10) hours = '0' + hours;\n                \n                var minutes = o.getUTCMinutes();\n                if (minutes < 10) minutes = '0' + minutes;\n                \n                var seconds = o.getUTCSeconds();\n                if (seconds < 10) seconds = '0' + seconds;\n                \n                var milli = o.getUTCMilliseconds();\n                if (milli < 100) milli = '0' + milli;\n                if (milli < 10) milli = '0' + milli;\n\n                return '\"' + year + '-' + month + '-' + day + 'T' +\n                             hours + ':' + minutes + ':' + seconds + \n                             '.' + milli + 'Z\"'; \n            }\n\n            if (o.constructor === Array) \n            {\n                var ret = [];\n                for (var i = 0; i < o.length; i++)\n                    ret.push( $.toJSON(o[i]) || \"null\" );\n\n                return \"[\" + ret.join(\",\") + \"]\";\n            }\n        \n            var pairs = [];\n            for (var k in o) {\n                var name;\n                var type = typeof k;\n\n                if (type == \"number\")\n                    name = '\"' + k + '\"';\n                else if (type == \"string\")\n                    name = $.quoteString(k);\n                else\n                    continue;  //skip non-string or number keys\n            \n                if (typeof o[k] == \"function\") \n                    continue;  //skip pairs where the value is a function.\n            \n                var val = $.toJSON(o[k]);\n            \n                pairs.push(name + \":\" + val);\n            }\n\n            return \"{\" + pairs.join(\", \") + \"}\";\n        }\n    };\n\n    /** jQuery.evalJSON(src)\n        Evaluates a given piece of json source.\n     **/\n    $.evalJSON = function(src)\n    {\n        if (typeof(JSON) == 'object' && JSON.parse)\n            return JSON.parse(src);\n        return eval(\"(\" + src + \")\");\n    };\n    \n    /** jQuery.secureEvalJSON(src)\n        Evals JSON in a way that is *more* secure.\n    **/\n    $.secureEvalJSON = function(src)\n    {\n        if (typeof(JSON) == 'object' && JSON.parse)\n            return JSON.parse(src);\n        \n        var filtered = src;\n        filtered = filtered.replace(/\\\\[\"\\\\\\/bfnrtu]/g, '@');\n        filtered = filtered.replace(/\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g, ']');\n        filtered = filtered.replace(/(?:^|:|,)(?:\\s*\\[)+/g, '');\n        \n        if (/^[\\],:{}\\s]*$/.test(filtered))\n            return eval(\"(\" + src + \")\");\n        else\n            throw new SyntaxError(\"Error parsing JSON, source is not valid.\");\n    };\n\n    /** jQuery.quoteString(string)\n        Returns a string-repr of a string, escaping quotes intelligently.  \n        Mostly a support function for toJSON.\n    \n        Examples:\n            >>> jQuery.quoteString(\"apple\")\n            \"apple\"\n        \n            >>> jQuery.quoteString('\"Where are we going?\", she asked.')\n            \"\\\"Where are we going?\\\", she asked.\"\n     **/\n    $.quoteString = function(string)\n    {\n        if (string.match(_escapeable))\n        {\n            return '\"' + string.replace(_escapeable, function (a) \n            {\n                var c = _meta[a];\n                if (typeof c === 'string') return c;\n                c = a.charCodeAt();\n                return '\\\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);\n            }) + '\"';\n        }\n        return '\"' + string + '\"';\n    };\n    \n    var _escapeable = /[\"\\\\\\x00-\\x1f\\x7f-\\x9f]/g;\n    \n    var _meta = {\n        '\\b': '\\\\b',\n        '\\t': '\\\\t',\n        '\\n': '\\\\n',\n        '\\f': '\\\\f',\n        '\\r': '\\\\r',\n        '\"' : '\\\\\"',\n        '\\\\': '\\\\\\\\'\n    };\n})(jQuery);\n"
  },
  {
    "path": "extensions/themes/silverblue/scripts/libraries/jquery.livequery.js",
    "content": "/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)\n * Dual licensed under the MIT (MIT_LICENSE.txt)\n * and GPL Version 2 (GPL_LICENSE.txt) licenses.\n *\n * Version: 1.1.1\n * Requires jQuery 1.3+\n * Docs: http://docs.jquery.com/Plugins/livequery\n */\n\n(function($) {\n\n$.extend($.fn, {\n\tlivequery: function(type, fn, fn2) {\n\t\tvar self = this, q;\n\n\t\t// Handle different call patterns\n\t\tif ($.isFunction(type))\n\t\t\tfn2 = fn, fn = type, type = undefined;\n\n\t\t// See if Live Query already exists\n\t\t$.each( $.livequery.queries, function(i, query) {\n\t\t\tif ( self.selector == query.selector && self.context == query.context &&\n\t\t\t\ttype == query.type && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) )\n\t\t\t\t\t// Found the query, exit the each loop\n\t\t\t\t\treturn (q = query) && false;\n\t\t});\n\n\t\t// Create new Live Query if it wasn't found\n\t\tq = q || new $.livequery(this.selector, this.context, type, fn, fn2);\n\n\t\t// Make sure it is running\n\t\tq.stopped = false;\n\n\t\t// Run it immediately for the first time\n\t\tq.run();\n\n\t\t// Contnue the chain\n\t\treturn this;\n\t},\n\n\texpire: function(type, fn, fn2) {\n\t\tvar self = this;\n\n\t\t// Handle different call patterns\n\t\tif ($.isFunction(type))\n\t\t\tfn2 = fn, fn = type, type = undefined;\n\n\t\t// Find the Live Query based on arguments and stop it\n\t\t$.each( $.livequery.queries, function(i, query) {\n\t\t\tif ( self.selector == query.selector && self.context == query.context &&\n\t\t\t\t(!type || type == query.type) && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) && !this.stopped )\n\t\t\t\t\t$.livequery.stop(query.id);\n\t\t});\n\n\t\t// Continue the chain\n\t\treturn this;\n\t}\n});\n\n$.livequery = function(selector, context, type, fn, fn2) {\n\tthis.selector = selector;\n\tthis.context  = context;\n\tthis.type     = type;\n\tthis.fn       = fn;\n\tthis.fn2      = fn2;\n\tthis.elements = [];\n\tthis.stopped  = false;\n\n\t// The id is the index of the Live Query in $.livequery.queries\n\tthis.id = $.livequery.queries.push(this)-1;\n\n\t// Mark the functions for matching later on\n\tfn.$lqguid = fn.$lqguid || $.livequery.guid++;\n\tif (fn2) fn2.$lqguid = fn2.$lqguid || $.livequery.guid++;\n\n\t// Return the Live Query\n\treturn this;\n};\n\n$.livequery.prototype = {\n\tstop: function() {\n\t\tvar query = this;\n\n\t\tif ( this.type )\n\t\t\t// Unbind all bound events\n\t\t\tthis.elements.unbind(this.type, this.fn);\n\t\telse if (this.fn2)\n\t\t\t// Call the second function for all matched elements\n\t\t\tthis.elements.each(function(i, el) {\n\t\t\t\tquery.fn2.apply(el);\n\t\t\t});\n\n\t\t// Clear out matched elements\n\t\tthis.elements = [];\n\n\t\t// Stop the Live Query from running until restarted\n\t\tthis.stopped = true;\n\t},\n\n\trun: function() {\n\t\t// Short-circuit if stopped\n\t\tif ( this.stopped ) return;\n\t\tvar query = this;\n\n\t\tvar oEls = this.elements,\n\t\t\tels  = $(this.selector, this.context),\n\t\t\tnEls = els.not(oEls);\n\n\t\t// Set elements to the latest set of matched elements\n\t\tthis.elements = els;\n\n\t\tif (this.type) {\n\t\t\t// Bind events to newly matched elements\n\t\t\tnEls.bind(this.type, this.fn);\n\n\t\t\t// Unbind events to elements no longer matched\n\t\t\tif (oEls.length > 0)\n\t\t\t\t$.each(oEls, function(i, el) {\n\t\t\t\t\tif ( $.inArray(el, els) < 0 )\n\t\t\t\t\t\t$.event.remove(el, query.type, query.fn);\n\t\t\t\t});\n\t\t}\n\t\telse {\n\t\t\t// Call the first function for newly matched elements\n\t\t\tnEls.each(function() {\n\t\t\t\tquery.fn.apply(this);\n\t\t\t});\n\n\t\t\t// Call the second function for elements no longer matched\n\t\t\tif ( this.fn2 && oEls.length > 0 )\n\t\t\t\t$.each(oEls, function(i, el) {\n\t\t\t\t\tif ( $.inArray(el, els) < 0 )\n\t\t\t\t\t\tquery.fn2.apply(el);\n\t\t\t\t});\n\t\t}\n\t}\n};\n\n$.extend($.livequery, {\n\tguid: 0,\n\tqueries: [],\n\tqueue: [],\n\trunning: false,\n\ttimeout: null,\n\n\tcheckQueue: function() {\n\t\tif ( $.livequery.running && $.livequery.queue.length ) {\n\t\t\tvar length = $.livequery.queue.length;\n\t\t\t// Run each Live Query currently in the queue\n\t\t\twhile ( length-- )\n\t\t\t\t$.livequery.queries[ $.livequery.queue.shift() ].run();\n\t\t}\n\t},\n\n\tpause: function() {\n\t\t// Don't run anymore Live Queries until restarted\n\t\t$.livequery.running = false;\n\t},\n\n\tplay: function() {\n\t\t// Restart Live Queries\n\t\t$.livequery.running = true;\n\t\t// Request a run of the Live Queries\n\t\t$.livequery.run();\n\t},\n\n\tregisterPlugin: function() {\n\t\t$.each( arguments, function(i,n) {\n\t\t\t// Short-circuit if the method doesn't exist\n\t\t\tif (!$.fn[n]) return;\n\n\t\t\t// Save a reference to the original method\n\t\t\tvar old = $.fn[n];\n\n\t\t\t// Create a new method\n\t\t\t$.fn[n] = function() {\n\t\t\t\t// Call the original method\n\t\t\t\tvar r = old.apply(this, arguments);\n\n\t\t\t\t// Request a run of the Live Queries\n\t\t\t\t$.livequery.run();\n\n\t\t\t\t// Return the original methods result\n\t\t\t\treturn r;\n\t\t\t}\n\t\t});\n\t},\n\n\trun: function(id) {\n\t\tif (id != undefined) {\n\t\t\t// Put the particular Live Query in the queue if it doesn't already exist\n\t\t\tif ( $.inArray(id, $.livequery.queue) < 0 )\n\t\t\t\t$.livequery.queue.push( id );\n\t\t}\n\t\telse\n\t\t\t// Put each Live Query in the queue if it doesn't already exist\n\t\t\t$.each( $.livequery.queries, function(id) {\n\t\t\t\tif ( $.inArray(id, $.livequery.queue) < 0 )\n\t\t\t\t\t$.livequery.queue.push( id );\n\t\t\t});\n\n\t\t// Clear timeout if it already exists\n\t\tif ($.livequery.timeout) clearTimeout($.livequery.timeout);\n\t\t// Create a timeout to check the queue and actually run the Live Queries\n\t\t$.livequery.timeout = setTimeout($.livequery.checkQueue, 20);\n\t},\n\n\tstop: function(id) {\n\t\tif (id != undefined)\n\t\t\t// Stop are particular Live Query\n\t\t\t$.livequery.queries[ id ].stop();\n\t\telse\n\t\t\t// Stop all Live Queries\n\t\t\t$.each( $.livequery.queries, function(id) {\n\t\t\t\t$.livequery.queries[ id ].stop();\n\t\t\t});\n\t}\n});\n\n// Register core DOM manipulation methods\n$.livequery.registerPlugin('append', 'prepend', 'after', 'before', 'wrap', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'empty', 'remove', 'html');\n\n// Run Live Queries when the Document is ready\n$(function() { $.livequery.play(); });\n\n})(jQuery);"
  },
  {
    "path": "extensions/themes/silverblue/scripts/libraries/jquery.rdfquery.rdfa-1.0.js",
    "content": "/*\n * $ URIs @VERSION\n * \n * Copyright (c) 2008,2009 Jeni Tennison\n * Licensed under the MIT (MIT-LICENSE.txt)\n *\n */\n/**\n * @fileOverview $ URIs\n * @author <a href=\"mailto:jeni@jenitennison.com\">Jeni Tennison</a>\n * @copyright (c) 2008,2009 Jeni Tennison\n * @license MIT license (MIT-LICENSE.txt)\n * @version 1.0\n */\n/**\n * @class\n * @name jQuery\n * @exports $ as jQuery\n * @description rdfQuery is a <a href=\"http://jquery.com/\">jQuery</a> plugin. The only fields and methods listed here are those that come as part of the rdfQuery library.\n */\n(function ($) {\n\n  var\n    mem = {},\n    uriRegex = /^(([a-z][\\-a-z0-9+\\.]*):)?(\\/\\/([^\\/?#]+))?([^?#]*)?(\\?([^#]*))?(#(.*))?$/i,\n    docURI,\n\n    parseURI = function (u) {\n      var m = u.match(uriRegex);\n      if (m === null) {\n        throw \"Malformed URI: \" + u;\n      }\n      return {\n        scheme: m[1] ? m[2].toLowerCase() : undefined,\n        authority: m[3] ? m[4] : undefined,\n        path: m[5] || '',\n        query: m[6] ? m[7] : undefined,\n        fragment: m[8] ? m[9] : undefined\n      };\n    },\n\n    removeDotSegments = function (u) {\n      var r = '', m = [];\n      if (/\\./.test(u)) {\n        while (u !== undefined && u !== '') {\n          if (u === '.' || u === '..') {\n            u = '';\n          } else if (/^\\.\\.\\//.test(u)) { // starts with ../\n            u = u.substring(3);\n          } else if (/^\\.\\//.test(u)) { // starts with ./\n            u = u.substring(2);\n          } else if (/^\\/\\.(\\/|$)/.test(u)) { // starts with /./ or consists of /.\n            u = '/' + u.substring(3);\n          } else if (/^\\/\\.\\.(\\/|$)/.test(u)) { // starts with /../ or consists of /..\n            u = '/' + u.substring(4);\n            r = r.replace(/\\/?[^\\/]+$/, '');\n          } else {\n            m = u.match(/^(\\/?[^\\/]*)(\\/.*)?$/);\n            u = m[2];\n            r = r + m[1];\n          }\n        }\n        return r;\n      } else {\n        return u;\n      }\n    },\n\n    merge = function (b, r) {\n      if (b.authority !== '' && (b.path === undefined || b.path === '')) {\n        return '/' + r;\n      } else {\n        return b.path.replace(/[^\\/]+$/, '') + r;\n      }\n    };\n\n  /**\n   * Creates a new jQuery.uri object. This should be invoked as a method rather than constructed using new.\n   * @class Represents a URI\n   * @param {String} [relative='']\n   * @param {String|jQuery.uri} [base] Defaults to the base URI of the page\n   * @returns {jQuery.uri} The new jQuery.uri object.\n   * @example uri = jQuery.uri('/my/file.html');\n   */\n  $.uri = function (relative, base) {\n    var uri;\n    relative = relative || '';\n    if (mem[relative]) {\n      return mem[relative];\n    }\n    base = base || $.uri.base();\n    if (typeof base === 'string') {\n      base = $.uri.absolute(base);\n    }\n    uri = new $.uri.fn.init(relative, base);\n    if (mem[uri]) {\n      return mem[uri];\n    } else {\n      mem[uri] = uri;\n      return uri;\n    }\n  };\n\n  $.uri.fn = $.uri.prototype = {\n    /**\n     * The scheme used in the URI\n     * @type String\n     */\n    scheme: undefined,\n    /**\n     * The authority used in the URI\n     * @type String\n     */\n    authority: undefined,\n    /**\n     * The path used in the URI\n     * @type String\n     */\n    path: undefined,\n    /**\n     * The query part of the URI\n     * @type String\n     */\n    query: undefined,\n    /**\n     * The fragment part of the URI\n     * @type String\n     */\n    fragment: undefined,\n    \n    init: function (relative, base) {\n      var r = {};\n      base = base || {};\n      $.extend(this, parseURI(relative));\n      if (this.scheme === undefined) {\n        this.scheme = base.scheme;\n        if (this.authority !== undefined) {\n          this.path = removeDotSegments(this.path);\n        } else {\n          this.authority = base.authority;\n          if (this.path === '') {\n            this.path = base.path;\n            if (this.query === undefined) {\n              this.query = base.query;\n            }\n          } else {\n            if (!/^\\//.test(this.path)) {\n              this.path = merge(base, this.path);\n            }\n            this.path = removeDotSegments(this.path);\n          }\n        }\n      }\n      if (this.scheme === undefined) {\n        throw \"Malformed URI: URI is not an absolute URI and no base supplied: \" + relative;\n      }\n      return this;\n    },\n  \n    /**\n     * Resolves a relative URI relative to this URI\n     * @param {String} relative\n     * @returns jQuery.uri\n     */\n    resolve: function (relative) {\n      return $.uri(relative, this);\n    },\n    \n    /**\n     * Creates a relative URI giving the path from this URI to the absolute URI passed as a parameter\n     * @param {String|jQuery.uri} absolute\n     * @returns String\n     */\n    relative: function (absolute) {\n      var aPath, bPath, i = 0, j, resultPath = [], result = '';\n      if (typeof absolute === 'string') {\n        absolute = $.uri(absolute, {});\n      }\n      if (absolute.scheme !== this.scheme || \n          absolute.authority !== this.authority) {\n        return absolute.toString();\n      }\n      if (absolute.path !== this.path) {\n        aPath = absolute.path.split('/');\n        bPath = this.path.split('/');\n        if (aPath[1] !== bPath[1]) {\n          result = absolute.path;\n        } else {\n          while (aPath[i] === bPath[i]) {\n            i += 1;\n          }\n          j = i;\n          for (; i < bPath.length - 1; i += 1) {\n            resultPath.push('..');\n          }\n          for (; j < aPath.length; j += 1) {\n            resultPath.push(aPath[j]);\n          }\n          result = resultPath.join('/');\n        }\n        result = absolute.query === undefined ? result : result + '?' + absolute.query;\n        result = absolute.fragment === undefined ? result : result + '#' + absolute.fragment;\n        return result;\n      }\n      if (absolute.query !== undefined && absolute.query !== this.query) {\n        return '?' + absolute.query + (absolute.fragment === undefined ? '' : '#' + absolute.fragment);\n      }\n      if (absolute.fragment !== undefined && absolute.fragment !== this.fragment) {\n        return '#' + absolute.fragment;\n      }\n      return '';\n    },\n  \n    /**\n     * Returns the URI as an absolute string\n     * @returns String\n     */\n    toString: function () {\n      var result = '';\n      if (this._string) {\n        return this._string;\n      } else {\n        result = this.scheme === undefined ? result : (result + this.scheme + ':');\n        result = this.authority === undefined ? result : (result + '//' + this.authority);\n        result = result + this.path;\n        result = this.query === undefined ? result : (result + '?' + this.query);\n        result = this.fragment === undefined ? result : (result + '#' + this.fragment);\n        this._string = result;\n        return result;\n      }\n    }\n  \n  };\n\n  $.uri.fn.init.prototype = $.uri.fn;\n\n  /**\n   * Creates a {@link jQuery.uri} from a known-to-be-absolute URI\n   * @param {String}\n   * @returns {jQuery.uri}\n   */\n  $.uri.absolute = function (uri) {\n    return $.uri(uri, {});\n  };\n\n  /**\n   * Creates a {@link jQuery.uri} from a relative URI and an optional base URI\n   * @returns {jQuery.uri}\n   * @see jQuery.uri\n   */\n  $.uri.resolve = function (relative, base) {\n    return $.uri(relative, base);\n  };\n  \n  /**\n   * Creates a string giving the relative path from a base URI to an absolute URI\n   * @param {String} absolute\n   * @param {String} base\n   * @returns {String}\n   */\n  $.uri.relative = function (absolute, base) {\n    return $.uri(base, {}).relative(absolute);\n  };\n  \n  /**\n   * Returns the base URI of the page\n   * @returns {jQuery.uri}\n   */\n  $.uri.base = function () {\n    return $(document).base();\n  };\n  \n  /**\n   * Returns the base URI in scope for the first selected element\n   * @methodOf jQuery#\n   * @name jQuery#base\n   * @returns {jQuery.uri}\n   * @example baseURI = $('img').base();\n   */\n  $.fn.base = function () {\n    var base = $(this).parents().andSelf().find('base').attr('href'),\n      doc = $(this)[0].ownerDocument || document,\n      docURI = $.uri.absolute(doc.location === null ? document.location.href : doc.location.href);\n    return base === undefined ? docURI : $.uri(base, docURI);\n  };\n\n})(jQuery);\n/*\n * jQuery CURIE @VERSION\n * \n * Copyright (c) 2008,2009 Jeni Tennison\n * Licensed under the MIT (MIT-LICENSE.txt)\n *\n * Depends:\n *  jquery.uri.js\n */\n/**\n * @fileOverview XML Namespace processing\n * @author <a href=\"mailto:jeni@jenitennison.com\">Jeni Tennison</a>\n * @copyright (c) 2008,2009 Jeni Tennison\n * @license MIT license (MIT-LICENSE.txt)\n * @version 1.0\n * @requires jquery.uri.js\n */\n\n/*global jQuery */\n(function ($) {\n\n  var \n    xmlNs = 'http://www.w3.org/XML/1998/namespace',\n    xmlnsNs = 'http://www.w3.org/2000/xmlns/',\n    \n    xmlnsRegex = /\\sxmlns(?::([^ =]+))?\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')/g,\n    \n    ncNameChar = '[-A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u10000-\\uEFFFF\\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]',\n    ncNameStartChar = '[\\u0041-\\u005A\\u0061-\\u007A\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u00FF\\u0100-\\u0131\\u0134-\\u013E\\u0141-\\u0148\\u014A-\\u017E\\u0180-\\u01C3\\u01CD-\\u01F0\\u01F4-\\u01F5\\u01FA-\\u0217\\u0250-\\u02A8\\u02BB-\\u02C1\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03CE\\u03D0-\\u03D6\\u03DA\\u03DC\\u03DE\\u03E0\\u03E2-\\u03F3\\u0401-\\u040C\\u040E-\\u044F\\u0451-\\u045C\\u045E-\\u0481\\u0490-\\u04C4\\u04C7-\\u04C8\\u04CB-\\u04CC\\u04D0-\\u04EB\\u04EE-\\u04F5\\u04F8-\\u04F9\\u0531-\\u0556\\u0559\\u0561-\\u0586\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u063A\\u0641-\\u064A\\u0671-\\u06B7\\u06BA-\\u06BE\\u06C0-\\u06CE\\u06D0-\\u06D3\\u06D5\\u06E5-\\u06E6\\u0905-\\u0939\\u093D\\u0958-\\u0961\\u0985-\\u098C\\u098F-\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09DC-\\u09DD\\u09DF-\\u09E1\\u09F0-\\u09F1\\u0A05-\\u0A0A\\u0A0F-\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32-\\u0A33\\u0A35-\\u0A36\\u0A38-\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8B\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2-\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AE0\\u0B05-\\u0B0C\\u0B0F-\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32-\\u0B33\\u0B36-\\u0B39\\u0B3D\\u0B5C-\\u0B5D\\u0B5F-\\u0B61\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99-\\u0B9A\\u0B9C\\u0B9E-\\u0B9F\\u0BA3-\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB5\\u0BB7-\\u0BB9\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C60-\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CDE\\u0CE0-\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D60-\\u0D61\\u0E01-\\u0E2E\\u0E30\\u0E32-\\u0E33\\u0E40-\\u0E45\\u0E81-\\u0E82\\u0E84\\u0E87-\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA-\\u0EAB\\u0EAD-\\u0EAE\\u0EB0\\u0EB2-\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0F40-\\u0F47\\u0F49-\\u0F69\\u10A0-\\u10C5\\u10D0-\\u10F6\\u1100\\u1102-\\u1103\\u1105-\\u1107\\u1109\\u110B-\\u110C\\u110E-\\u1112\\u113C\\u113E\\u1140\\u114C\\u114E\\u1150\\u1154-\\u1155\\u1159\\u115F-\\u1161\\u1163\\u1165\\u1167\\u1169\\u116D-\\u116E\\u1172-\\u1173\\u1175\\u119E\\u11A8\\u11AB\\u11AE-\\u11AF\\u11B7-\\u11B8\\u11BA\\u11BC-\\u11C2\\u11EB\\u11F0\\u11F9\\u1E00-\\u1E9B\\u1EA0-\\u1EF9\\u1F00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2126\\u212A-\\u212B\\u212E\\u2180-\\u2182\\u3041-\\u3094\\u30A1-\\u30FA\\u3105-\\u312C\\uAC00-\\uD7A3\\u4E00-\\u9FA5\\u3007\\u3021-\\u3029_]',\n    ncNameRegex = new RegExp('^' + ncNameStartChar + ncNameChar + '*$');\n    \n\n/**\n * Returns the namespaces declared in the scope of the first selected element, or\n * adds a namespace declaration to all selected elements. Pass in no parameters\n * to return all namespaces bindings on the first selected element. If only \n * the prefix parameter is specified, this method will return the namespace\n * URI that is bound to the specified prefix on the first element in the selection\n * If the prefix and uri parameters are both specified, this method will\n * add the binding of the specified prefix and namespace URI to all elements\n * in the selection.\n * @methodOf jQuery#\n * @name jQuery#xmlns\n * @param {String} [prefix] Restricts the namespaces returned to only the namespace with the specified namespace prefix.\n * @param {String|jQuery.uri} [uri] Adds a namespace declaration to the selected elements that maps the specified prefix to the specified namespace.\n * @param {Object} [inherited] A map of inherited namespace bindings.\n * @returns {Object|jQuery.uri|jQuery}\n * @example \n * // Retrieve all of the namespace bindings on the HTML document element\n * var nsMap = $('html').xmlns();\n * @example\n * // Retrieve the namespace URI mapped to the 'dc' prefix on the HTML document element\n * var dcNamespace = $('html').xmlns('dc');\n * @example\n * // Create a namespace declaration that binds the 'dc' prefix to the URI 'http://purl.org/dc/elements/1.1/'\n * $('html').xmlns('dc', 'http://purl.org/dc/elements/1.1/');\n */\n  $.fn.xmlns = function (prefix, uri, inherited) {\n    var \n      elem = this.eq(0),\n      ns = elem.data('xmlns'),\n      e = elem[0], a, p, i,\n      decl = prefix ? 'xmlns:' + prefix : 'xmlns',\n      value,\n      tag, found = false;\n    if (uri === undefined) {\n      if (prefix === undefined) { // get the in-scope declarations on the first element\n        if (!ns) {\n          ns = {\n//            xml: $.uri(xmlNs)\n          };\n          if (e.attributes && e.attributes.getNamedItemNS) {\n            for (i = 0; i < e.attributes.length; i += 1) {\n              a = e.attributes[i];\n              if (/^xmlns(:(.+))?$/.test(a.nodeName)) {\n                prefix = /^xmlns(:(.+))?$/.exec(a.nodeName)[2] || '';\n                value = a.nodeValue;\n                if (prefix === '' || (value !== '' && value !== xmlNs && value !== xmlnsNs && ncNameRegex.test(prefix) && prefix !== 'xml' && prefix !== 'xmlns')) {\n                  ns[prefix] = $.uri(a.nodeValue);\n                  found = true;\n                }\n              }\n            }\n          } else {\n            tag = /<[^>]+>/.exec(e.outerHTML);\n            a = xmlnsRegex.exec(tag);\n            while (a !== null) {\n              prefix = a[1] || '';\n              value = a[2] || a[3];\n              if (prefix === '' || (value !== '' && value !== xmlNs && value !== xmlnsNs && ncNameRegex.test(prefix) && prefix !== 'xml' && prefix !== 'xmlns')) {\n                ns[prefix] = $.uri(a[2] || a[3]);\n                found = true;\n              }\n              a = xmlnsRegex.exec(tag);\n            }\n            xmlnsRegex.lastIndex = 0;\n          }\n          inherited = inherited || (e.parentNode.nodeType === 1 ? elem.parent().xmlns() : {});\n          ns = found ? $.extend({}, inherited, ns) : inherited;\n          elem.data('xmlns', ns);\n        }\n        return ns;\n      } else if (typeof prefix === 'object') { // set the prefix mappings defined in the object\n        for (p in prefix) {\n          if (typeof prefix[p] === 'string' && ncNameRegex.test(p)) {\n            this.xmlns(p, prefix[p]);\n          }\n        }\n        this.find('*').andSelf().removeData('xmlns');\n        return this;\n      } else { // get the in-scope declaration associated with this prefix on the first element\n        if (!ns) {\n          ns = elem.xmlns();\n        }\n        return ns[prefix];\n      }\n    } else { // set\n      this.find('*').andSelf().removeData('xmlns');\n      return this.attr(decl, uri);\n    }\n  };\n\n/**\n * Removes one or more XML namespace bindings from the selected elements.\n * @methodOf jQuery#\n * @name jQuery#removeXmlns\n * @param {String|Object|String[]} prefix The prefix(es) of the XML namespace bindings that are to be removed from the selected elements.\n * @returns {jQuery} The original jQuery object.\n * @example\n * // Remove the foaf namespace declaration from the body element:\n * $('body').removeXmlns('foaf');\n * @example\n * // Remove the foo and bar namespace declarations from all h2 elements\n * $('h2').removeXmlns(['foo', 'bar']);\n * @example\n * // Remove the foo and bar namespace declarations from all h2 elements\n * var namespaces = { foo : 'http://www.example.org/foo', bar : 'http://www.example.org/bar' };\n * $('h2').removeXmlns(namespaces);\n */\n  $.fn.removeXmlns = function (prefix) {\n    var decl, p, i;\n    if (typeof prefix === 'object') {\n      if (prefix.length === undefined) { // assume an object representing namespaces\n        for (p in prefix) {\n          if (typeof prefix[p] === 'string') {\n            this.removeXmlns(p);\n          }\n        }\n      } else { // it's an array\n        for (i = 0; i < prefix.length; i += 1) {\n          this.removeXmlns(prefix[i]);\n        }\n      }\n    } else {\n      decl = prefix ? 'xmlns:' + prefix : 'xmlns';\n      this.removeAttr(decl);\n    }\n    this.find('*').andSelf().removeData('xmlns');\n    return this;\n  };\n\n  $.fn.qname = function (name) {\n    var m, prefix, namespace;\n    if (name === undefined) {\n      if (this[0].outerHTML === undefined) {\n        name = this[0].nodeName.toLowerCase();\n      } else {\n        name = /<([^ >]+)/.exec(this[0].outerHTML)[1].toLowerCase();\n      }\n    }\n    if (name === '?xml:namespace') {\n      // there's a prefix on the name, but we can't get at it\n      throw \"XMLinHTML: Unable to get the prefix to resolve the name of this element\";\n    }\n    m = /^(([^:]+):)?([^:]+)$/.exec(name);\n    prefix = m[2] || '';\n    namespace = this.xmlns(prefix);\n    if (namespace === undefined && prefix !== '') {\n      throw \"MalformedQName: The prefix \" + prefix + \" is not declared\";\n    }\n    return {\n      namespace: namespace,\n      localPart: m[3],\n      prefix: prefix,\n      name: name\n    };\n  };\n\n})(jQuery);\n/*\n * jQuery CURIE @VERSION\n *\n * Copyright (c) 2008,2009 Jeni Tennison\n * Licensed under the MIT (MIT-LICENSE.txt)\n *\n * Depends:\n *  jquery.uri.js\n */\n/**\n * @fileOverview XML Schema datatype handling\n * @author <a href=\"mailto:jeni@jenitennison.com\">Jeni Tennison</a>\n * @copyright (c) 2008,2009 Jeni Tennison\n * @license MIT license (MIT-LICENSE.txt)\n * @version 1.0\n * @requires jquery.uri.js\n */\n\n(function ($) {\n\n  var strip = function (value) {\n    return value.replace(/[ \\t\\n\\r]+/, ' ').replace(/^ +/, '').replace(/ +$/, '');\n  };\n\n  /**\n   * Creates a new jQuery.typedValue object. This should be invoked as a method\n   * rather than constructed using new.\n   * @class Represents a value with an XML Schema datatype\n   * @param {String} value The string representation of the value\n   * @param {String} datatype The XML Schema datatype URI\n   * @returns {jQuery.typedValue}\n   * @example intValue = jQuery.typedValue('42', 'http://www.w3.org/2001/XMLSchema#integer');\n   */\n  $.typedValue = function (value, datatype) {\n    return $.typedValue.fn.init(value, datatype);\n  };\n\n  $.typedValue.fn = $.typedValue.prototype = {\n    /**\n     * The string representation of the value\n     * @memberOf jQuery.typedValue#\n     */\n    representation: undefined,\n    /**\n     * The value as an object. The type of the object will\n     * depend on the XML Schema datatype URI specified\n     * in the constructor. The following table lists the mappings\n     * currently supported:\n     * <table>\n     *   <tr>\n     *   <th>XML Schema Datatype</th>\n     *   <th>Value type</th>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#string</td>\n     *     <td>string</td>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#token</td>\n     *     <td>string</td>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#NCName</td>\n     *     <td>string</td>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#boolean</td>\n     *     <td>bool</td>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#decimal</td>\n     *     <td>string</td>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#integer</td>\n     *     <td>int</td>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#int</td>\n     *     <td>int</td>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#float</td>\n     *     <td>float</td>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#double</td>\n     *     <td>float</td>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#dateTime</td>\n     *     <td>string</td>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#date</td>\n     *     <td>string</td>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#gYear</td>\n     *     <td>int</td>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#gMonthDay</td>\n     *     <td>string</td>\n     *   </tr>\n     *   <tr>\n     *     <td>http://www.w3.org/2001/XMLSchema#anyURI</td>\n     *     <td>{@link jQuery.uri}</td>\n     *   </tr>\n     * </table>\n     * @memberOf jQuery.typedValue#\n     */\n    value: undefined,\n    /**\n     * The XML Schema datatype URI for the value's datatype\n     * @memberOf jQuery.typedValue#\n     */\n    datatype: undefined,\n\n    init: function (value, datatype) {\n      var d = $.typedValue.types[datatype];\n      if ($.typedValue.valid(value, datatype)) {\n        this.representation = value;\n        this.datatype = datatype;\n        this.value = d === undefined ? strip(value) : d.value(d.strip ? strip(value) : value);\n        return this;\n      } else {\n        throw {\n          name: 'InvalidValue',\n          message: value + ' is not a valid ' + datatype + ' value'\n        };\n      }\n    }\n  };\n\n  $.typedValue.fn.init.prototype = $.typedValue.fn;\n\n  /**\n   * An object that holds the datatypes supported by the script. The properties of this object are the URIs of the datatypes, and each datatype has four properties:\n   * <dl>\n   *   <dt>strip</dt>\n   *   <dd>A boolean value that indicates whether whitespace should be stripped from the value prior to testing against the regular expression or passing to the value function.</dd>\n   *   <dt>regex</dt>\n   *   <dd>A regular expression that valid values of the type must match.</dd>\n   *   <dt>validate</dt>\n   *   <dd>Optional. A function that performs further testing on the value.</dd>\n   *   <dt>value</dt>\n   *   <dd>A function that returns a Javascript object equivalent for the value.</dd>\n   * </dl>\n   * You can add to this object as necessary for your own datatypes, and {@link jQuery.typedValue} and {@link jQuery.typedValue.valid} will work with them.\n   * @see jQuery.typedValue\n   * @see jQuery.typedValue.valid\n   */\n  $.typedValue.types = {};\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#string'] = {\n    regex: /^[\\s\\S]*$/,\n    strip: false,\n    /** @ignore */\n    value: function (v) {\n      return v;\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#token'] = {\n    regex: /^.*$/,\n    strip: true,\n    /** @ignore */\n    value: function (v) {\n      return strip(v);\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#NCName'] = {\n    regex: /^[a-z_][-\\.a-z0-9]+$/i,\n    strip: true,\n    /** @ignore */\n    value: function (v) {\n      return strip(v);\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#boolean'] = {\n    regex: /^(?:true|false|1|0)$/,\n    strip: true,\n    /** @ignore */\n    value: function (v) {\n      return v === 'true' || v === '1';\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#decimal'] = {\n    regex: /^[\\-\\+]?(?:[0-9]+\\.[0-9]*|\\.[0-9]+|[0-9]+)$/,\n    strip: true,\n    /** @ignore */\n    value: function (v) {\n      v = v.replace(/^0+/, '')\n        .replace(/0+$/, '');\n      if (v === '') {\n        v = '0.0';\n      }\n      if (v.substring(0, 1) === '.') {\n        v = '0' + v;\n      }\n      if (/\\.$/.test(v)) {\n        v = v + '0';\n      } else if (!/\\./.test(v)) {\n        v = v + '.0';\n      }\n      return v;\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#integer'] = {\n    regex: /^[\\-\\+]?[0-9]+$/,\n    strip: true,\n    /** @ignore */\n    value: function (v) {\n      return parseInt(v, 10);\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#int'] = {\n    regex: /^[\\-\\+]?[0-9]+$/,\n    strip: true,\n    /** @ignore */\n    value: function (v) {\n      return parseInt(v, 10);\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#float'] = {\n    regex: /^(?:[\\-\\+]?(?:[0-9]+\\.[0-9]*|\\.[0-9]+|[0-9]+)(?:[eE][\\-\\+]?[0-9]+)?|[\\-\\+]?INF|NaN)$/,\n    strip: true,\n    /** @ignore */\n    value: function (v) {\n      if (v === '-INF') {\n        return -1 / 0;\n      } else if (v === 'INF' || v === '+INF') {\n        return 1 / 0;\n      } else {\n        return parseFloat(v);\n      }\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#double'] = {\n    regex: $.typedValue.types['http://www.w3.org/2001/XMLSchema#float'].regex,\n    strip: true,\n    value: $.typedValue.types['http://www.w3.org/2001/XMLSchema#float'].value\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#duration'] = {\n    regex: /^([\\-\\+])?P(?:([0-9]+)Y)?(?:([0-9]+)M)?(?:([0-9]+)D)?(?:T(?:([0-9]+)H)?(?:([0-9]+)M)?(?:([0-9]+(?:\\.[0-9]+)?)?S)?)$/,\n    /** @ignore */\n    validate: function (v) {\n      var m = this.regex.exec(v);\n      return m[2] || m[3] || m[4] || m[5] || m[6] || m[7];\n    },\n    strip: true,\n    /** @ignore */\n    value: function (v) {\n      return v;\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#yearMonthDuration'] = {\n    regex: /^([\\-\\+])?P(?:([0-9]+)Y)?(?:([0-9]+)M)?$/,\n    /** @ignore */\n    validate: function (v) {\n      var m = this.regex.exec(v);\n      return m[2] || m[3];\n    },\n    strip: true,\n    /** @ignore */\n    value: function (v) {\n      var m = this.regex.exec(v),\n        years = m[2] || 0,\n        months = m[3] || 0;\n      months += years * 12;\n      return m[1] === '-' ? -1 * months : months;\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#dateTime'] = {\n    regex: /^(-?[0-9]{4,})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):(([0-9]{2})(\\.([0-9]+))?)((?:[\\-\\+]([0-9]{2}):([0-9]{2}))|Z)?$/,\n    /** @ignore */\n    validate: function (v) {\n      var\n        m = this.regex.exec(v),\n        year = parseInt(m[1], 10),\n        tz = m[10] === undefined || m[10] === 'Z' ? '+0000' : m[10].replace(/:/, ''),\n        date;\n      if (year === 0 ||\n          parseInt(tz, 10) < -1400 || parseInt(tz, 10) > 1400) {\n        return false;\n      }\n      try {\n        year = year < 100 ? Math.abs(year) + 1000 : year;\n        month = parseInt(m[2], 10);\n        day = parseInt(m[3], 10);\n        if (day > 31) {\n          return false;\n        } else if (day > 30 && !(month === 1 || month === 3 || month === 5 || month === 7 || month === 8 || month === 10 || month === 12)) {\n          return false;\n        } else if (month === 2) {\n          if (day > 29) {\n            return false;\n          } else if (day === 29 && (year % 4 !== 0 || (year % 100 === 0 && year % 400 !== 0))) {\n            return false;\n          }\n        }\n        date = '' + year + '/' + m[2] + '/' + m[3] + ' ' + m[4] + ':' + m[5] + ':' + m[7] + ' ' + tz;\n        date = new Date(date);\n        return true;\n      } catch (e) {\n        return false;\n      }\n    },\n    strip: true,\n    /** @ignore */\n    value: function (v) {\n      return v;\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#date'] = {\n    regex: /^(-?[0-9]{4,})-([0-9]{2})-([0-9]{2})((?:[\\-\\+]([0-9]{2}):([0-9]{2}))|Z)?$/,\n    /** @ignore */\n    validate: function (v) {\n      var\n        m = this.regex.exec(v),\n        year = parseInt(m[1], 10),\n        month = parseInt(m[2], 10),\n        day = parseInt(m[3], 10),\n        tz = m[10] === undefined || m[10] === 'Z' ? '+0000' : m[10].replace(/:/, '');\n      if (year === 0 ||\n          month > 12 ||\n          day > 31 ||\n          parseInt(tz, 10) < -1400 || parseInt(tz, 10) > 1400) {\n        return false;\n      } else {\n        return true;\n      }\n    },\n    strip: true,\n    /** @ignore */\n    value: function (v) {\n      return v;\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#gYear'] = {\n    regex: /^-?([0-9]{4,})$/,\n    /** @ignore */\n    validate: function (v) {\n      var i = parseInt(v, 10);\n      return i !== 0;\n    },\n    strip: true,\n    /** @ignore */\n    value: function (v) {\n      return parseInt(v, 10);\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#gMonthDay'] = {\n    regex: /^--([0-9]{2})-([0-9]{2})((?:[\\-\\+]([0-9]{2}):([0-9]{2}))|Z)?$/,\n    /** @ignore */\n    validate: function (v) {\n      var\n        m = this.regex.exec(v),\n        month = parseInt(m[1], 10),\n        day = parseInt(m[2], 10),\n        tz = m[3] === undefined || m[3] === 'Z' ? '+0000' : m[3].replace(/:/, '');\n      if (month > 12 ||\n          day > 31 ||\n          parseInt(tz, 10) < -1400 || parseInt(tz, 10) > 1400) {\n        return false;\n      } else if (month === 2 && day > 29) {\n        return false;\n      } else if ((month === 4 || month === 6 || month === 9 || month === 11) && day > 30) {\n        return false;\n      } else {\n        return true;\n      }\n    },\n    strip: true,\n    /** @ignore */\n    value: function (v) {\n      return v;\n    }\n  };\n\n  $.typedValue.types['http://www.w3.org/2001/XMLSchema#anyURI'] = {\n    regex: /^.*$/,\n    strip: true,\n    /** @ignore */\n    value: function (v, options) {\n      var opts = $.extend({}, $.typedValue.defaults, options);\n      return $.uri.resolve(v, opts.base);\n    }\n  };\n\n  $.typedValue.defaults = {\n    base: $.uri.base(),\n    namespaces: {}\n  };\n\n  /**\n   * Checks whether a value is valid according to a given datatype. The datatype must be held in the {@link jQuery.typedValue.types} object.\n   * @param {String} value The value to validate.\n   * @param {String} datatype The URI for the datatype against which the value will be validated.\n   * @returns {boolean} True if the value is valid or the datatype is not recognised.\n   * @example validDate = $.typedValue.valid(date, 'http://www.w3.org/2001/XMLSchema#date');\n   */\n  $.typedValue.valid = function (value, datatype) {\n    var d = $.typedValue.types[datatype];\n    if (d === undefined) {\n      return true;\n    } else {\n      value = d.strip ? strip(value) : value;\n      if (d.regex.test(value)) {\n        return d.validate === undefined ? true : d.validate(value);\n      } else {\n        return false;\n      }\n    }\n  };\n\n})(jQuery);\n/*\n * jQuery CURIE @VERSION\n *\n * Copyright (c) 2008,2009 Jeni Tennison\n * Licensed under the MIT (MIT-LICENSE.txt)\n *\n * Depends:\n *  jquery.uri.js\n *  jquery.xmlns.js\n */\n\n/**\n * @fileOverview jQuery CURIE handling\n * @author <a href=\"mailto:jeni@jenitennison.com\">Jeni Tennison</a>\n * @copyright (c) 2008,2009 Jeni Tennison\n * @license MIT license (MIT-LICENSE.txt)\n * @version 1.0\n * @requires jquery.uri.js\n * @requires jquery.xmlns.js\n */\n(function ($) {\n\n   /**\n    * Creates a {@link jQuery.uri} object by parsing a CURIE.\n    * @methodOf jQuery\n    * @param {String} curie The CURIE to be parsed\n    * @param {String} uri The URI string to be converted to a CURIE.\n    * @param {Object} [options] CURIE parsing options\n    * @param {string} [options.reservedNamespace='http://www.w3.org/1999/xhtml/vocab#'] The namespace to apply to a CURIE that has no prefix and either starts with a colon or is in the list of reserved local names\n    * @param {string} [options.defaultNamespace]  The namespace to apply to a CURIE with no prefix which is not mapped to the reserved namespace by the rules given above.\n    * @param {Object} [options.namespaces] A map of namespace bindings used to map CURIE prefixes to URIs.\n    * @param {string[]} [options.reserved=['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright', 'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next', 'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']] A list of local names that will always be mapped to the URI specified by reservedNamespace.\n    * @param {string} [options.charcase='lower'] Specifies whether the curie's case is altered before it's interpreted. Acceptable values are:\n    * <dl>\n    * <dt>lower</dt><dd>Force the CURIE string to lower case.</dd>\n    * <dt>upper</dt><dd>Force the CURIE string to upper case.</dd>\n    * <dt>preserve</dt><dd>Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.</dd>\n    * </dl>\n    * @returns {jQuery.uri} A new {@link jQuery.uri} object representing the full absolute URI specified by the CURIE.\n    */\n  $.curie = function (curie, options) {\n    var\n      opts = $.extend({}, $.curie.defaults, options || {}),\n      m = /^(([^:]*):)?(.+)$/.exec(curie),\n      prefix = m[2],\n      local = m[3],\n      ns = opts.namespaces[prefix];\n    if (/^:.+/.test(curie)) { // This is the case of a CURIE like \":test\"\n      if (opts.reservedNamespace === undefined || opts.reservedNamespace === null) {\n        throw \"Malformed CURIE: No prefix and no default namespace for unprefixed CURIE \" + curie;\n      } else {\n        ns = opts.reservedNamespace;\n      }\n    } else if (prefix) {\n      if (ns === undefined) {\n        throw \"Malformed CURIE: No namespace binding for \" + prefix + \" in CURIE \" + curie;\n      }\n    } else {\n      if (opts.charcase === 'lower') {\n        curie = curie.toLowerCase();\n      } else if (opts.charcase === 'upper') {\n        curie = curie.toUpperCase();\n      }\n      if (opts.reserved.length && $.inArray(curie, opts.reserved) >= 0) {\n        ns = opts.reservedNamespace;\n        local = curie;\n      } else if (opts.defaultNamespace === undefined || opts.defaultNamespace === null) {\n        // the default namespace is provided by the application; it's not clear whether\n        // the default XML namespace should be used if there's a colon but no prefix\n        throw \"Malformed CURIE: No prefix and no default namespace for unprefixed CURIE \" + curie;\n      } else {\n        ns = opts.defaultNamespace;\n      }\n    }\n    return $.uri(ns + local);\n  };\n\n  $.curie.defaults = {\n    namespaces: {},\n    reserved: [],\n    reservedNamespace: undefined,\n    defaultNamespace: undefined,\n    charcase: 'preserve'\n  };\n\n   /**\n    * Creates a {@link jQuery.uri} object by parsing a safe CURIE string (a CURIE\n    * contained within square brackets). If the input safeCurie string does not\n    * start with '[' and end with ']', the entire string content will be interpreted\n    * as a URI string.\n    * @methodOf jQuery\n    * @param {String} safeCurie The safe CURIE string to be parsed.\n    * @param {Object} [options] CURIE parsing options\n    * @param {string} [options.reservedNamespace='http://www.w3.org/1999/xhtml/vocab#'] The namespace to apply to a CURIE that has no prefix and either starts with a colon or is in the list of reserved local names\n    * @param {string} [options.defaultNamespace]  The namespace to apply to a CURIE with no prefix which is not mapped to the reserved namespace by the rules given above.\n    * @param {Object} [options.namespaces] A map of namespace bindings used to map CURIE prefixes to URIs.\n    * @param {string[]} [options.reserved=['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright',\n      'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next',\n      'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']]\n                        A list of local names that will always be mapped to the URI specified by reservedNamespace.\n    * @param {string} [options.charcase='lower'] Specifies whether the curie's case is altered before it's interpreted. Acceptable values are:\n    * <dl>\n    * <dt>lower</dt><dd>Force the CURIE string to lower case.</dd>\n    * <dt>upper</dt><dd>Force the CURIE string to upper case.</dd>\n    * <dt>preserve</dt><dd>Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.</dd>\n    * </dl>\n    * @returns {jQuery.uri} A new {@link jQuery.uri} object representing the full absolute URI specified by the CURIE.\n    */\n  $.safeCurie = function (safeCurie, options) {\n    var m = /^\\[([^\\]]+)\\]$/.exec(safeCurie);\n    return m ? $.curie(m[1], options) : $.uri(safeCurie);\n  };\n\n   /**\n    * Creates a CURIE string from a URI string.\n    * @methodOf jQuery\n    * @param {String} uri The URI string to be converted to a CURIE.\n    * @param {Object} [options] CURIE parsing options\n    * @param {string} [options.reservedNamespace='http://www.w3.org/1999/xhtml/vocab#']\n    *        If the input URI starts with this value, the generated CURIE will\n    *        have no namespace prefix and will start with a colon character (:),\n    *        unless the local part of the CURIE is one of the reserved names specified\n    *        by the reservedNames option (see below), in which case the generated\n    *        CURIE will have no namespace prefix and will not start with a colon\n    *        character.\n    * @param {string} [options.defaultNamespace]  If the input URI starts with this value, the generated CURIE will have no namespace prefix and will not start with a colon.\n    * @param {Object} [options.namespaces] A map of namespace bindings used to map CURIE prefixes to URIs.\n    * @param {string[]} [options.reserved=['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright',\n      'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next',\n      'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']]\n                        A list of local names that will always be mapped to the URI specified by reservedNamespace.\n    * @param {string} [options.charcase='lower'] Specifies the case normalisation done to the CURIE. Acceptable values are:\n    * <dl>\n    * <dt>lower</dt><dd>Normalise the CURIE to lower case.</dd>\n    * <dt>upper</dt><dd>Normalise the CURIE to upper case.</dd>\n    * <dt>preserve</dt><dd>Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.</dd>\n    * </dl>\n    * @returns {jQuery.uri} A new {@link jQuery.uri} object representing the full absolute URI specified by the CURIE.\n    */\n  $.createCurie = function (uri, options) {\n    var opts = $.extend({}, $.curie.defaults, options || {}),\n      ns = opts.namespaces,\n      curie;\n    uri = $.uri(uri).toString();\n    if (opts.reservedNamespace !== undefined && \n        uri.substring(0, opts.reservedNamespace.toString().length) === opts.reservedNamespace.toString()) {\n      curie = uri.substring(opts.reservedNamespace.toString().length);\n      if ($.inArray(curie, opts.reserved) === -1) {\n        curie = ':' + curie;\n      }\n    } else {\n      $.each(ns, function (prefix, namespace) {\n        if (uri.substring(0, namespace.toString().length) === namespace.toString()) {\n          curie = prefix + ':' + uri.substring(namespace.toString().length);\n          return null;\n        }\n      });\n    }\n    if (curie === undefined) {\n      throw \"No Namespace Binding: There's no appropriate namespace binding for generating a CURIE from \" + uri;\n    } else {\n      return curie;\n    }\n  };\n\n   /**\n    * Creates a {@link jQuery.uri} object by parsing the specified\n    * CURIE string in the context of the namespaces defined by the\n    * jQuery selection.\n    * @methodOf jQuery#\n    * @name jQuery#curie\n    * @param {String} curie The CURIE string to be parsed\n    * @param {Object} options The CURIE parsing options.\n    *        See {@link jQuery.curie} for details of the supported options.\n    *        The namespace declarations declared on the current jQuery\n    *        selection (and inherited from any ancestor elements) will automatically\n    *        be included in the options.namespaces property.\n    * @returns {jQuery.uri}\n    * @see jQuery.curie\n    */\n  $.fn.curie = function (curie, options) {\n    var opts = $.extend({}, $.fn.curie.defaults, { namespaces: this.xmlns() }, options || {});\n    return $.curie(curie, opts);\n  };\n\n   /**\n    * Creates a {@link jQuery.uri} object by parsing the specified\n    * safe CURIE string in the context of the namespaces defined by\n    * the jQuery selection.\n    *\n    * @methodOf jQuery#\n    * @name jQuery#safeCurie\n    * @param {String} safeCurie The safe CURIE string to be parsed. See {@link jQuery.safeCurie} for details on how safe CURIE strings are processed.\n    * @param {Object} options   The CURIE parsing options.\n    *        See {@link jQuery.safeCurie} for details of the supported options.\n    *        The namespace declarations declared on the current jQuery\n    *        selection (and inherited from any ancestor elements) will automatically\n    *        be included in the options.namespaces property.\n    * @returns {jQuery.uri}\n    * @see jQuery.safeCurie\n    */\n  $.fn.safeCurie = function (safeCurie, options) {\n    var opts = $.extend({}, $.fn.curie.defaults, { namespaces: this.xmlns() }, options || {});\n    return $.safeCurie(safeCurie, opts);\n  };\n\n   /**\n    * Creates a CURIE string from a URI string using the namespace\n    * bindings in the context of the current jQuery selection.\n    *\n    * @methodOf jQuery#\n    * @name jQuery#createCurie\n    * @param {String|jQuery.uri} uri The URI string to be converted to a CURIE\n    * @param {Object} options the CURIE parsing options.\n    *        See {@link jQuery.createCurie} for details of the supported options.\n    *        The namespace declarations declared on the current jQuery\n    *        selection (and inherited from any ancestor elements) will automatically\n    *        be included in the options.namespaces property.\n    * @returns {String}\n    * @see jQuery.createCurie\n    */\n  $.fn.createCurie = function (uri, options) {\n    var opts = $.extend({}, $.fn.curie.defaults, { namespaces: this.xmlns() }, options || {});\n    return $.createCurie(uri, opts);\n  };\n\n  $.fn.curie.defaults = {\n    reserved: [\n      'alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright',\n      'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next',\n      'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up'\n    ],\n    reservedNamespace: 'http://www.w3.org/1999/xhtml/vocab#',\n    defaultNamespace: undefined,\n    charcase: 'lower'\n  };\n\n})(jQuery);\n/*\n * jQuery RDF @VERSION\n *\n * Copyright (c) 2008,2009 Jeni Tennison\n * Licensed under the MIT (MIT-LICENSE.txt)\n *\n * Depends:\n *  jquery.uri.js\n *  jquery.xmlns.js\n *  jquery.datatype.js\n *  jquery.curie.js\n *  jquery.json.js\n */\n/**\n * @fileOverview jQuery RDF\n * @author <a href=\"mailto:jeni@jenitennison.com\">Jeni Tennison</a>\n * @copyright (c) 2008,2009 Jeni Tennison\n * @license MIT license (MIT-LICENSE.txt)\n * @version 1.0\n */\n/**\n * @exports $ as jQuery\n */\n/**\n * @ignore\n */\n(function ($) {\n  var\n    memResource = {},\n    memBlank = {},\n    memLiteral = {},\n    memTriple = {},\n    memPattern = {},\n    \n    xsdNs = \"http://www.w3.org/2001/XMLSchema#\",\n    rdfNs = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n    rdfsNs = \"http://www.w3.org/2000/01/rdf-schema#\",\n    \n    uriRegex = /^<(([^>]|\\\\>)*)>$/,\n    literalRegex = /^(\"\"\"((\\\\\"|[^\"])*)\"\"\"|\"((\\\\\"|[^\"])*)\")(@([a-z]+(-[a-z0-9]+)*)|\\^\\^(.+))?$/,\n    tripleRegex = /((\"\"\"((\\\\\"|[^\"])*)\"\"\")|(\"(\\\\\"|[^\"]|)*\")|(<(\\\\>|[^>])*>)|\\S)+/g,\n\n    blankNodeSeed = databankSeed = new Date().getTime() % 1000,\n    blankNodeID = function () {\n      blankNodeSeed += 1;\n      return 'b' + blankNodeSeed.toString(16);\n    },\n\n    databankID = function () {\n      databankSeed += 1;\n      return 'data' + databankSeed.toString(16);\n    },\n    databanks = {},\n\n    documentQueue = {},\n\n    subject = function (subject, opts) {\n      if (typeof subject === 'string') {\n        try {\n          return $.rdf.resource(subject, opts);\n        } catch (e) {\n          try {\n            return $.rdf.blank(subject, opts);\n          } catch (f) {\n            throw \"Bad Triple: Subject \" + subject + \" is not a resource: \" + f;\n          }\n        }\n      } else {\n        return subject;\n      }\n    },\n\n    property = function (property, opts) {\n      if (property === 'a') {\n        return $.rdf.type;\n      } else if (typeof property === 'string') {\n        try {\n          return $.rdf.resource(property, opts);\n        } catch (e) {\n          throw \"Bad Triple: Property \" + property + \" is not a resource: \" + e;\n        }\n      } else {\n        return property;\n      }\n    },\n\n    object = function (object, opts) {\n      if (typeof object === 'string') {\n        try {\n          return $.rdf.resource(object, opts);\n        } catch (e) {\n          try {\n            return $.rdf.blank(object, opts);\n          } catch (f) {\n            try {\n              return $.rdf.literal(object, opts);\n            } catch (g) {\n              throw \"Bad Triple: Object \" + object + \" is not a resource or a literal \" + g;\n            }\n          }\n        }\n      } else {\n        return object;\n      }\n    },\n\n    testResource = function (resource, filter, existing) {\n      var variable;\n      if (typeof filter === 'string') {\n        variable = filter.substring(1);\n        if (existing[variable] && existing[variable] !== resource) {\n          return null;\n        } else {\n          existing[variable] = resource;\n          return existing;\n        }\n      } else if (filter === resource) {\n        return existing;\n      } else {\n        return null;\n      }\n    },\n\n    findMatches = function (databank, pattern) {\n      if (databank.union === undefined) {\n        if (pattern.subject.type !== undefined) {\n          if (databank.subjectIndex[pattern.subject] === undefined) {\n            return [];\n          }\n          return $.map(databank.subjectIndex[pattern.subject], function (triple) {\n            var bindings = pattern.exec(triple);\n            return bindings === null ? null : { bindings: bindings, triples: [triple] };\n          });\n        } else if (pattern.object.type === 'uri' || pattern.object.type === 'bnode') {\n          if (databank.objectIndex[pattern.object] === undefined) {\n            return [];\n          }\n          return $.map(databank.objectIndex[pattern.object], function (triple) {\n            var bindings = pattern.exec(triple);\n            return bindings === null ? null : { bindings: bindings, triples: [triple] };\n          });\n        } else if (pattern.property.type !== undefined) {\n          if (databank.propertyIndex[pattern.property] === undefined) {\n            return [];\n          }\n          return $.map(databank.propertyIndex[pattern.property], function (triple) {\n            var bindings = pattern.exec(triple);\n            return bindings === null ? null : { bindings: bindings, triples: [triple] };\n          });\n        }\n      }\n      return $.map(databank.triples(), function (triple) {\n        var bindings = pattern.exec(triple);\n        return bindings === null ? null : { bindings: bindings, triples: [triple] };\n      });\n    },\n\n    mergeMatches = function (existingMs, newMs, optional) {\n      return $.map(existingMs, function (existingM, i) {\n        var compatibleMs = $.map(newMs, function (newM) {\n          // For newM to be compatible with existingM, all the bindings\n          // in newM must either be the same as in existingM, or not\n          // exist in existingM\n          var k, b, isCompatible = true;\n          for (k in newM.bindings) {\n            b = newM.bindings[k];\n            if (!(existingM.bindings[k] === undefined ||\n                  existingM.bindings[k] === b)) {\n              isCompatible = false;\n              break;\n            }\n          }\n          return isCompatible ? newM : null;\n        });\n        if (compatibleMs.length > 0) {\n          return $.map(compatibleMs, function (compatibleM) {\n            return {\n              bindings: $.extend({}, existingM.bindings, compatibleM.bindings),\n              triples: unique(existingM.triples.concat(compatibleM.triples))\n            };\n          });\n        } else {\n          return optional ? existingM : null;\n        }\n      });\n    },\n\n    registerQuery = function (databank, query) {\n      var s, p, o;\n      if (query.filterExp !== undefined && !$.isFunction(query.filterExp)) {\n        if (databank.union === undefined) {\n          s = typeof query.filterExp.subject === 'string' ? '' : query.filterExp.subject;\n          p = typeof query.filterExp.property === 'string' ? '' : query.filterExp.property;\n          o = typeof query.filterExp.object === 'string' ? '' : query.filterExp.object;\n          if (databank.queries[s] === undefined) {\n            databank.queries[s] = {};\n          }\n          if (databank.queries[s][p] === undefined) {\n            databank.queries[s][p] = {};\n          }\n          if (databank.queries[s][p][o] === undefined) {\n            databank.queries[s][p][o] = [];\n          }\n          databank.queries[s][p][o].push(query);\n        } else {\n          $.each(databank.union, function (i, databank) {\n            registerQuery(databank, query);\n          });\n        }\n      }\n    },\n\n    resetQuery = function (query) {\n      query.length = 0;\n      query.matches = [];\n      $.each(query.children, function (i, child) {\n        resetQuery(child);\n      });\n      $.each(query.partOf, function (i, union) {\n        resetQuery(union);\n      });\n    },\n\n    updateQuery = function (query, matches) {\n      if (matches.length > 0) {\n        $.each(query.children, function (i, child) {\n          leftActivate(child, matches);\n        });\n        $.each(query.partOf, function (i, union) {\n          updateQuery(union, matches);\n        });\n        $.each(matches, function (i, match) {\n          query.matches.push(match);\n          Array.prototype.push.call(query, match.bindings);\n        });\n      }\n    },\n\n    filterMatches = function (matches, variables) {\n      var i, bindings, triples, j, k, variable, value, nvariables = variables.length,\n        newbindings, match = {}, keyobject = {}, keys = {}, filtered = [];\n      for (i = 0; i < matches.length; i += 1) {\n        bindings = matches[i].bindings;\n        triples = matches[i].triples;\n        keyobject = keys;\n        for (j = 0; j < nvariables; j += 1) {\n          variable = variables[j];\n          value = bindings[variable];\n          if (j === nvariables - 1) {\n            if (keyobject[value] === undefined) {\n              match = { bindings: {}, triples: triples };\n              for (k = 0; k < nvariables; k += 1) {\n                match.bindings[variables[k]] = bindings[variables[k]];\n              }\n              keyobject[value] = match;\n              filtered.push(match);\n            } else {\n              match = keyobject[value];\n              match.triples = match.triples.concat(triples);\n            }\n          } else {\n            if (keyobject[value] === undefined) {\n              keyobject[value] = {};\n            }\n            keyobject = keyobject[value];\n          }\n        }\n      }\n      return filtered;\n    },\n\n    renameMatches = function (matches, old) {\n      var i, match, newMatch, keys = {}, renamed = [];\n      for (i = 0; i < matches.length; i += 1) {\n        match = matches[i];\n        if (keys[match.bindings[old]] === undefined) {\n          newMatch = {\n            bindings: { node: match.bindings[old] },\n            triples: match.triples\n          };\n          renamed.push(newMatch);\n          keys[match.bindings[old]] = newMatch;\n        } else {\n          newMatch = keys[match.bindings[old]];\n          newMatch.triples = newMatch.triples.concat(match.triples);\n        }\n      }\n      return renamed;\n    },\n\n    leftActivate = function (query, matches) {\n      var newMatches;\n      if (query.union === undefined) {\n        if (query.top || query.parent.top) {\n          newMatches = query.alphaMemory;\n        } else {\n          matches = matches || query.parent.matches;\n          if ($.isFunction(query.filterExp)) {\n            newMatches = $.map(matches, function (match, i) {\n              return query.filterExp.call(match.bindings, i, match.bindings, match.triples) ? match : null;\n            });\n          } else if (query.filterExp !== undefined) {\n            newMatches = mergeMatches(matches, query.alphaMemory, query.filterExp.optional);\n          } else {\n            newMatches = matches;\n          }\n        }\n      } else {\n        newMatches = $.map(query.union, function (q) {\n          return q.matches;\n        });\n      }\n      if (query.selections !== undefined) {\n        newMatches = filterMatches(newMatches, query.selections);\n      } else if (query.navigate !== undefined) {\n        newMatches = renameMatches(newMatches, query.navigate);\n      }\n      updateQuery(query, newMatches);\n    },\n\n    rightActivate = function (query, match) {\n      var newMatches;\n      if (query.filterExp.optional) {\n        resetQuery(query);\n        leftActivate(query);\n      } else {\n        if (query.top || query.parent.top) {\n          newMatches = [match];\n        } else {\n          newMatches = mergeMatches(query.parent.matches, [match], false);\n        }\n        updateQuery(query, newMatches);\n      }\n    },\n\n    addToQuery = function (query, triple) {\n      var match,\n        bindings = query.filterExp.exec(triple);\n      if (bindings !== null) {\n        match = { triples: [triple], bindings: bindings };\n        query.alphaMemory.push(match);\n        rightActivate(query, match);\n      }\n    },\n\n    removeFromQuery = function (query, triple) {\n      query.alphaMemory.splice($.inArray(triple, query.alphaMemory), 1);\n      resetQuery(query);\n      leftActivate(query);\n    },\n\n    addToQueries = function (queries, triple) {\n      $.each(queries, function (i, query) {\n        addToQuery(query, triple);\n      });\n    },\n\n    removeFromQueries = function (queries, triple) {\n      $.each(queries, function (i, query) {\n        removeFromQuery(query, triple);\n      });\n    },\n\n    addToDatabankQueries = function (databank, triple) {\n      var s = triple.subject,\n        p = triple.property,\n        o = triple.object;\n      if (databank.union === undefined) {\n        if (databank.queries[s] !== undefined) {\n          if (databank.queries[s][p] !== undefined) {\n            if (databank.queries[s][p][o] !== undefined) {\n              addToQueries(databank.queries[s][p][o], triple);\n            }\n            if (databank.queries[s][p][''] !== undefined) {\n              addToQueries(databank.queries[s][p][''], triple);\n            }\n          }\n          if (databank.queries[s][''] !== undefined) {\n            if (databank.queries[s][''][o] !== undefined) {\n              addToQueries(databank.queries[s][''][o], triple);\n            }\n            if (databank.queries[s][''][''] !== undefined) {\n              addToQueries(databank.queries[s][''][''], triple);\n            }\n          }\n        }\n        if (databank.queries[''] !== undefined) {\n          if (databank.queries[''][p] !== undefined) {\n            if (databank.queries[''][p][o] !== undefined) {\n              addToQueries(databank.queries[''][p][o], triple);\n            }\n            if (databank.queries[''][p][''] !== undefined) {\n              addToQueries(databank.queries[''][p][''], triple);\n            }\n          }\n          if (databank.queries[''][''] !== undefined) {\n            if (databank.queries[''][''][o] !== undefined) {\n              addToQueries(databank.queries[''][''][o], triple);\n            }\n            if (databank.queries[''][''][''] !== undefined) {\n              addToQueries(databank.queries[''][''][''], triple);\n            }\n          }\n        }\n      } else {\n        $.each(databank.union, function (i, databank) {\n          addToDatabankQueries(databank, triple);\n        });\n      }\n    },\n\n    removeFromDatabankQueries = function (databank, triple) {\n      var s = triple.subject,\n        p = triple.property,\n        o = triple.object;\n      if (databank.union === undefined) {\n        if (databank.queries[s] !== undefined) {\n          if (databank.queries[s][p] !== undefined) {\n            if (databank.queries[s][p][o] !== undefined) {\n              removeFromQueries(databank.queries[s][p][o], triple);\n            }\n            if (databank.queries[s][p][''] !== undefined) {\n              removeFromQueries(databank.queries[s][p][''], triple);\n            }\n          }\n          if (databank.queries[s][''] !== undefined) {\n            if (databank.queries[s][''][o] !== undefined) {\n              removeFromQueries(databank.queries[s][''][o], triple);\n            }\n            if (databank.queries[s][''][''] !== undefined) {\n              removeFromQueries(databank.queries[s][''][''], triple);\n            }\n          }\n        }\n        if (databank.queries[''] !== undefined) {\n          if (databank.queries[''][p] !== undefined) {\n            if (databank.queries[''][p][o] !== undefined) {\n              removeFromQueries(databank.queries[''][p][o], triple);\n            }\n            if (databank.queries[''][p][''] !== undefined) {\n              removeFromQueries(databank.queries[''][p][''], triple);\n            }\n          }\n          if (databank.queries[''][''] !== undefined) {\n            if (databank.queries[''][''][o] !== undefined) {\n              removeFromQueries(databank.queries[''][''][o], triple);\n            }\n            if (databank.queries[''][''][''] !== undefined) {\n              removeFromQueries(databank.queries[''][''][''], triple);\n            }\n          }\n        }\n      } else {\n        $.each(databank.union, function (i, databank) {\n          removeFromDatabankQueries(databank, triple);\n        });\n      }\n    },\n    \n    group = function (bindings, variables, base) {\n      var variable = variables[0], grouped = {}, results = [], i, newbase;\n      base = base || {};\n      if (variables.length === 0) {\n        for (i = 0; i < bindings.length; i += 1) {\n          for (v in bindings[i]) {\n            if (base[v] === undefined) {\n              base[v] = [];\n            }\n            if ($.isArray(base[v])) {\n              base[v].push(bindings[i][v]);\n            }\n          }\n        }\n        return [base];\n      }\n      // collect together the grouped results\n      for (i = 0; i < bindings.length; i += 1) {\n        key = bindings[i][variable];\n        if (grouped[key] === undefined) {\n          grouped[key] = [];\n        }\n        grouped[key].push(bindings[i]);\n      }\n      // call recursively on each group\n      variables = variables.splice(1, 1);\n      for (v in grouped) {\n        newbase = $.extend({}, base);\n        newbase[variable] = grouped[v][0][variable];\n        results = results.concat(group(grouped[v], variables, newbase));\n      }\n      return results;\n    },\n    \n    queue = function (databank, url, callbacks) {\n      if (documentQueue[databank.id] === undefined) {\n        documentQueue[databank.id] = {};\n      }\n      if (documentQueue[databank.id][url] === undefined) {\n        documentQueue[databank.id][url] = callbacks;\n        return false;\n      }\n      return true;\n    },\n    \n    dequeue = function (databank, url, result, args) {\n      var callbacks = documentQueue[databank.id][url];\n      if ($.isFunction(callbacks[result])) {\n        callbacks[result].call(databank, args);\n      }\n      documentQueue[databank.id][url] = undefined;\n    },\n\n    unique = function( b ) {\n      var a = [];\n      var l = b.length;\n      for(var i=0; i<l; i++) {\n        for(var j=i+1; j<l; j++) {\n          // If b[i] is found later in the array\n          if (b[i] === b[j])\n            j = ++i;\n        }\n        a.push(b[i]);\n      }\n      return a;\n     };\n\n\n  $.typedValue.types['http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral'] = {\n    regex: /^.*$/m,\n    strip: false,\n    value: function (v) {\n      return v;\n    }\n  };\n\n  /**\n   * <p>Creates a new jQuery.rdf object. This should be invoked as a method rather than constructed using new; indeed you will usually want to generate these objects using a method such as {@link jQuery#rdf} or {@link jQuery.rdf#where}.</p>\n   * @class <p>A jQuery.rdf object represents the results of a query over its {@link jQuery.rdf#databank}. The results of a query are a sequence of objects which represent the bindings of values to the variables used in filter expressions specified using {@link jQuery.rdf#where} or {@link jQuery.rdf#optional}. Each of the objects in this sequence has associated with it a set of triples that are the sources for the variable bindings, which you can get at using {@link jQuery.rdf#sources}.</p>\n    * <p>The {@link jQuery.rdf} object itself is a lot like a {@link jQuery} object. It has a {@link jQuery.rdf#length} and the individual matches can be accessed using <code>[<var>n</var>]</code>, but you can also iterate through the matches using {@link jQuery.rdf#map} or {@link jQuery.rdf#each}.</p>\n    * <p>{@link jQuery.rdf} is designed to mirror the functionality of <a href=\"http://www.w3.org/TR/rdf-sparql-query/\">SPARQL</a> while providing an interface that's familiar and easy to use for jQuery programmers.</p>\n   * @param {Object} [options]\n   * @param {jQuery.rdf.databank} [options.databank] The databank that this query should operate over.\n   * @param {jQuery.rdf.triple[]} [options.triples] A set of triples over which the query operates; this is only used if options.databank isn't specified, in which case a new databank with these triples is generated.\n   * @param {Object} [options.namespaces] An object representing a set of namespace bindings. Rather than passing this in when you construct the {@link jQuery.rdf} instance, you will usually want to use the {@link jQuery.rdf#prefix} method.\n   * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the query.\n   * @returns {jQuery.rdf}\n   * @example rdf = jQuery.rdf();\n   * @see jQuery#rdf\n   */\n  $.rdf = function (options) {\n    return new $.rdf.fn.init(options);\n  };\n\n  $.rdf.fn = $.rdf.prototype = {\n    /**\n     * The version of rdfQuery.\n     * @type String\n     */\n    rdfquery: '1.1',\n\n    init: function (options) {\n      var databanks, i;\n      options = options || {};\n      /* must specify either a parent or a union, otherwise it's the top */\n      this.parent = options.parent;\n      this.union = options.union;\n      this.top = this.parent === undefined && this.union === undefined;\n      if (this.union === undefined) {\n        if (options.databank === undefined) {\n          /**\n           * The databank over which this query operates.\n           * @type jQuery.rdf.databank\n           */\n          this.databank = this.parent === undefined ? $.rdf.databank(options.triples, options) : this.parent.databank;\n        } else {\n          this.databank = options.databank;\n        }\n      } else {\n        databanks = $.map(this.union, function (query) {\n          return query.databank;\n        });\n        databanks = unique(databanks);\n        if (databanks[1] !== undefined) {\n          this.databank = $.rdf.databank(undefined, { union: databanks });\n        } else {\n          this.databank = databanks[0];\n        }\n      }\n      this.children = [];\n      this.partOf = [];\n      this.filterExp = options.filter;\n      this.selections = options.distinct;\n      this.navigate = options.navigate;\n      this.alphaMemory = [];\n      this.matches = [];\n      /**\n       * The number of matches represented by the {@link jQuery.rdf} object.\n       * @type Integer\n       */\n      this.length = 0;\n      if (this.filterExp !== undefined) {\n        if (!$.isFunction(this.filterExp)) {\n          registerQuery(this.databank, this);\n          this.alphaMemory = findMatches(this.databank, this.filterExp);\n        }\n      } else if (options.nodes !== undefined) {\n        this.alphaMemory = [];\n        for (i = 0; i < options.nodes.length; i += 1) {\n          this.alphaMemory.push({\n            bindings: { node: options.nodes[i] },\n            triples: []\n          });\n        }\n      }\n      leftActivate(this);\n      return this;\n    },\n\n    /**\n     * Sets or returns the base URI of the {@link jQuery.rdf#databank}.\n     * @param {String|jQuery.uri} [base]\n     * @returns A {@link jQuery.uri} if no base URI is specified, otherwise returns this {@link jQuery.rdf} object.\n     * @example baseURI = jQuery('html').rdf().base();\n     * @example jQuery('html').rdf().base('http://www.example.org/');\n     * @see jQuery.rdf.databank#base\n     */\n    base: function (base) {\n      if (base === undefined) {\n        return this.databank.base();\n      } else {\n        this.databank.base(base);\n        return this;\n      }\n    },\n\n    /**\n     * Sets or returns a namespace binding on the {@link jQuery.rdf#databank}.\n     * @param {String} [prefix]\n     * @param {String} [namespace]\n     * @returns {Object|jQuery.uri|jQuery.rdf} If no prefix or namespace is specified, returns an object providing all namespace bindings on the {@link jQuery.rdf.databank}. If a prefix is specified without a namespace, returns the {@link jQuery.uri} associated with that prefix. Otherwise returns this {@link jQuery.rdf} object after setting the namespace binding.\n     * @example namespace = jQuery('html').rdf().prefix('foaf');\n     * @example jQuery('html').rdf().prefix('foaf', 'http://xmlns.com/foaf/0.1/');\n     * @see jQuery.rdf.databank#prefix\n     */\n    prefix: function (prefix, namespace) {\n      if (namespace === undefined) {\n        return this.databank.prefix(prefix);\n      } else {\n        this.databank.prefix(prefix, namespace);\n        return this;\n      }\n    },\n\n    /**\n     * Adds a triple to the {@link jQuery.rdf#databank} or another {@link jQuery.rdf} object to create a union.\n     * @param {String|jQuery.rdf.triple|jQuery.rdf.pattern|jQuery.rdf} triple The triple, {@link jQuery.rdf.pattern} or {@link jQuery.rdf} object to be added to this one. If the triple is a {@link jQuery.rdf} object, the two queries are unioned together. If the triple is a string, it's parsed as a {@link jQuery.rdf.pattern}. The pattern will be completed using the current matches on the {@link jQuery.rdf} object to create multiple triples, one for each set of bindings.\n     * @param {Object} [options]\n     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret CURIEs within the triple. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.\n     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the triple. Defaults to the base URI defined on the {@link jQuery.rdf#databank}.\n     * @returns {jQuery.rdf} This {@link jQuery.rdf} object.\n     * @example\n     * var rdf = $.rdf()\n     *   .prefix('dc', ns.dc)\n     *   .prefix('foaf', ns.foaf)\n     *   .add('&lt;photo1.jpg> dc:creator &lt;http://www.blogger.com/profile/1109404> .')\n     *   .add('&lt;http://www.blogger.com/profile/1109404> foaf:img &lt;photo1.jpg> .');\n     * @example\n     * var rdfA = $.rdf()\n     *   .prefix('dc', ns.dc)\n     *   .add('&lt;photo1.jpg> dc:creator \"Jane\"');\n     * var rdfB = $.rdf()\n     *   .prefix('foaf', ns.foaf)\n     *   .add('&lt;photo1.jpg> foaf:depicts \"Jane\"');\n     * var rdf = rdfA.add(rdfB);\n     * @see jQuery.rdf.databank#add\n     */\n    add: function (triple, options) {\n      var query, databank;\n      if (triple.rdfquery !== undefined) {\n        if (triple.top) {\n          databank = this.databank.add(triple.databank);\n          query = $.rdf({ parent: this.parent, databank: databank });\n          return query;\n        } else if (this.top) {\n          databank = triple.databank.add(this.databank);\n          query = $.rdf({ parent: triple.parent, databank: databank });\n          return query;\n        } else if (this.union === undefined) {\n          query = $.rdf({ union: [this, triple] });\n          this.partOf.push(query);\n          triple.partOf.push(query);\n          return query;\n        } else {\n          this.union.push(triple);\n          triple.partOf.push(this);\n        }\n      } else {\n        if (typeof triple === 'string') {\n          options = $.extend({}, { base: this.base(), namespaces: this.prefix(), source: triple }, options);\n          triple = $.rdf.pattern(triple, options);\n        }\n        if (triple.isFixed()) {\n          this.databank.add(triple.triple(), options);\n        } else {\n          query = this;\n          this.each(function (i, data) {\n            var t = triple.triple(data);\n            if (t !== null) {\n              query.databank.add(t, options);\n            }\n          });\n        }\n      }\n      return this;\n    },\n\n    /**\n     * Removes a triple or several triples from the {@link jQuery.rdf#databank}.\n     * @param {String|jQuery.rdf.triple|jQuery.rdf.pattern} triple The triple to be removed, or a {@link jQuery.rdf.pattern} that matches the triples that should be removed.\n     * @param {Object} [options]\n     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret any CURIEs within the triple or pattern. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.\n     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the triple or pattern. Defaults to the base URI defined on the {@link jQuery.rdf#databank}.\n     * @returns {jQuery.rdf} The {@link jQuery.rdf} object itself.\n     * @example\n     * var rdf = $('html').rdf()\n     *   .prefix('foaf', ns.foaf)\n     *   .where('?person foaf:givenname ?gname')\n     *   .where('?person foaf:family_name ?fname')\n     *   .remove('?person foaf:family_name ?fname');\n     * @see jQuery.rdf.databank#remove\n     */\n    remove: function (triple, options) {\n      if (typeof triple === 'string') {\n        options = $.extend({}, { base: this.base(), namespaces: this.prefix() }, options);\n        triple = $.rdf.pattern(triple, options);\n      }\n      if (triple.isFixed()) {\n        this.databank.remove(triple.triple(), options);\n      } else {\n        query = this;\n        this.each(function (i, data) {\n          var t = triple.triple(data);\n          if (t !== null) {\n            query.databank.remove(t, options);\n          }\n        });\n      }\n      return this;\n    },\n\n    /**\n     * Loads some data into the {@link jQuery.rdf#databank}\n     * @param data\n     * @param {Object} [options]\n     * @see jQuery.rdf.databank#load\n     */\n    load: function (data, options) {\n      var rdf = this,\n        options = options || {},\n        success = options.success;\n      if (success !== undefined) {\n        options.success = function () {\n          success.call(rdf);\n        }\n      }\n      this.databank.load(data, options);\n      return this;\n    },\n\n    /**\n     * Creates a new {@link jQuery.rdf} object whose databank contains all the triples in this object's databank except for those in the argument's databank.\n     * @param {jQuery.rdf} query\n     * @see jQuery.rdf.databank#except\n     */\n    except: function (query) {\n      return $.rdf({ databank: this.databank.except(query.databank) });\n    },\n\n    /**\n     * Creates a new {@link jQuery.rdf} object that is the result of filtering the matches on this {@link jQuery.rdf} object based on the filter that's passed into it.\n     * @param {String|jQuery.rdf.pattern} filter An expression that filters the triples in the {@link jQuery.rdf#databank} to locate matches based on the matches on this {@link jQuery.rdf} object. If it's a string, the filter is parsed as a {@link jQuery.rdf.pattern}.\n     * @param {Object} [options]\n     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret any CURIEs within the pattern. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.\n     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the pattern. Defaults to the base URI defined on the {@link jQuery.rdf#databank}.\n     * @param {boolean} [options.optional] Not usually used (use {@link jQuery.rdf#optional} instead).\n     * @returns {jQuery.rdf} A new {@link jQuery.rdf} object whose {@link jQuery.rdf#parent} is this {@link jQuery.rdf}.\n     * @see jQuery.rdf#optional\n     * @see jQuery.rdf#filter\n     * @see jQuery.rdf#about\n     * @example\n     * var rdf = $.rdf()\n     *   .prefix('foaf', ns.foaf)\n     *   .add('_:a foaf:givenname   \"Alice\" .')\n     *   .add('_:a foaf:family_name \"Hacker\" .')\n     *   .add('_:b foaf:givenname   \"Bob\" .')\n     *   .add('_:b foaf:family_name \"Hacker\" .')\n     *   .where('?person foaf:family_name \"Hacker\"')\n     *   .where('?person foaf:givenname \"Bob\");\n     */ \n    where: function (filter, options) {\n      var query, base, namespaces, optional;\n      options = options || {};\n      if (typeof filter === 'string') {\n        base = options.base || this.base();\n        namespaces = $.extend({}, this.prefix(), options.namespaces || {});\n        optional = options.optional || false;\n        filter = $.rdf.pattern(filter, { namespaces: namespaces, base: base, optional: optional });\n      }\n      query = $.rdf($.extend({}, options, { parent: this, filter: filter }));\n      this.children.push(query);\n      return query;\n    },\n\n    /**\n     * Creates a new {@link jQuery.rdf} object whose set of bindings might optionally include those based on the filter pattern.\n     * @param {String|jQuery.rdf.pattern} filter An pattern for a set of bindings that might be added to those in this {@link jQuery.rdf} object.\n     * @param {Object} [options]\n     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret any CURIEs within the pattern. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.\n     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the pattern. Defaults to the base URI defined on the {@link jQuery.rdf#databank}.\n     * @returns {jQuery.rdf} A new {@link jQuery.rdf} object whose {@link jQuery.rdf#parent} is this {@link jQuery.rdf}.\n     * @see jQuery.rdf#where\n     * @see jQuery.rdf#filter\n     * @see jQuery.rdf#about\n     * @example\n     * var rdf = $.rdf()\n     *   .prefix('foaf', 'http://xmlns.com/foaf/0.1/')\n     *   .prefix('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#')\n     *   .add('_:a  rdf:type        foaf:Person .')\n     *   .add('_:a  foaf:name       \"Alice\" .')\n     *   .add('_:a  foaf:mbox       &lt;mailto:alice@example.com> .')\n     *   .add('_:a  foaf:mbox       &lt;mailto:alice@work.example> .')\n     *   .add('_:b  rdf:type        foaf:Person .')\n     *   .add('_:b  foaf:name       \"Bob\" .')\n     *   .where('?x foaf:name ?name')\n     *   .optional('?x foaf:mbox ?mbox');\n     */\n    optional: function (filter, options) {\n      return this.where(filter, $.extend({}, options || {}, { optional: true }));\n    },\n\n    /**\n     * Creates a new {@link jQuery.rdf} object whose set of bindings include <code>property</code> and <code>value</code> for every triple that is about the specified resource.\n     * @param {String|jQuery.rdf.resource} resource The subject of the matching triples.\n     * @param {Object} [options]\n     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret the resource if it's a CURIE. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.\n     * @param {String|jQuery.uri} [options.base] The base URI used to interpret the resource if it's a relative URI (wrapped in <code>&lt;</code> and <code>&gt;</code>). Defaults to the base URI defined on the {@link jQuery.rdf#databank}.\n     * @returns {jQuery.rdf} A new {@link jQuery.rdf} object whose {@link jQuery.rdf#parent} is this {@link jQuery.rdf}.\n     * @see jQuery.rdf#where\n     * @see jQuery.rdf#optional\n     * @see jQuery.rdf#filter\n     * @example\n     * var rdf = $.rdf()\n     *   .prefix('dc', ns.dc)\n     *   .prefix('foaf', ns.foaf)\n     *   .add('&lt;photo1.jpg> dc:creator &lt;http://www.blogger.com/profile/1109404> .')\n     *   .add('&lt;http://www.blogger.com/profile/1109404> foaf:img &lt;photo1.jpg> .')\n     *   .add('&lt;photo2.jpg> dc:creator &lt;http://www.blogger.com/profile/1109404> .')\n     *   .add('&lt;http://www.blogger.com/profile/1109404> foaf:img &lt;photo2.jpg> .')\n     *   .about('&lt;http://www.blogger.com/profile/1109404>');\n     */\n    about: function (resource, options) {\n      return this.where(resource + ' ?property ?value', options);\n    },\n\n    /**\n     * Creates a new {@link jQuery.rdf} object whose set of bindings include only those that satisfy some arbitrary condition. There are two main ways to call this method: with two arguments in which case the first is a binding to be tested and the second represents a condition on the test, or with one argument which is a function that should return true for acceptable bindings.\n     * @param {Function|String} property <p>In the two-argument version, this is the name of a property to be tested against the condition specified in the second argument. In the one-argument version, this is a function in which <code>this</code> is an object whose properties are a set of {@link jQuery.rdf.resource}, {@link jQuery.rdf.literal} or {@link jQuery.rdf.blank} objects and whose arguments are:</p>\n     * <dl>\n     *   <dt>i</dt>\n     *   <dd>The index of the set of bindings amongst the other matches</dd>\n     *   <dt>bindings</dt>\n     *   <dd>An object representing the bindings (the same as <code>this</code>)</dd>\n     *   <dt>triples</dt>\n     *   <dd>The {@link jQuery.rdf.triple}s that underly this set of bindings</dd>\n     * </dl>\n     * @param {RegExp|String} condition In the two-argument version of this function, the condition that the property's must match. If it is a regular expression, the value must match the regular expression. If it is a {@link jQuery.rdf.literal}, the value of the literal must match the property's value. Otherwise, they must be the same resource.\n     * @returns {jQuery.rdf} A new {@link jQuery.rdf} object whose {@link jQuery.rdf#parent} is this {@link jQuery.rdf}.\n     * @see jQuery.rdf#where\n     * @see jQuery.rdf#optional\n     * @see jQuery.rdf#about\n     * @example\n     * var rdf = $.rdf()\n     *   .prefix('foaf', 'http://xmlns.com/foaf/0.1/')\n     *   .add('_:a foaf:surname \"Jones\" .')\n     *   .add('_:b foaf:surname \"Macnamara\" .')\n     *   .add('_:c foaf:surname \"O\\'Malley\"')\n     *   .add('_:d foaf:surname \"MacFee\"')\n     *   .where('?person foaf:surname ?surname')\n     *     .filter('surname', /^Ma?c/)\n     *       .each(function () { scottish.push(this.surname.value); })\n     *     .end()\n     *     .filter('surname', /^O'/)\n     *       .each(function () { irish.push(this.surname.value); })\n     *     .end();\n     * @example\n     * var rdf = $.rdf()\n     *   .prefix('foaf', 'http://xmlns.com/foaf/0.1/')\n     *   .add('_:a foaf:surname \"Jones\" .')\n     *   .add('_:b foaf:surname \"Macnamara\" .')\n     *   .add('_:c foaf:surname \"O\\'Malley\"')\n     *   .add('_:d foaf:surname \"MacFee\"')\n     *   .where('?person foaf:surname ?surname')\n     *   .filter(function () { return this.surname !== \"Jones\"; })\n     */\n    filter: function (property, condition) {\n      var func, query;\n      if (typeof property === 'string') {\n        if (condition.constructor === RegExp) {\n          /** @ignore func */\n          func = function () {\n            return condition.test(this[property].value);\n          };\n        } else {\n          func = function () {\n            return this[property].type === 'literal' ? this[property].value === condition : this[property] === condition;\n          };\n        }\n      } else {\n        func = property;\n      }\n      query = $.rdf({ parent: this, filter: func });\n      this.children.push(query);\n      return query;\n    },\n\n    /**\n     * Creates a new {@link jQuery.rdf} object containing one binding for each selected resource.\n     * @param {String|Object} node The node to be selected. If this is a string beginning with a question mark the resources are those identified by the bindings of that value in the currently selected bindings. Otherwise, only the named resource is selected as the node.\n     * @returns {jQuery.rdf} A new {@link jQuery.rdf} object.\n     * @see jQuery.rdf#find\n     * @see jQuery.rdf#back\n     * @example\n     * // returns an rdfQuery object with a pointer to <http://example.com/aReallyGreatBook>\n     * var rdf = $('html').rdf()\n     *   .node('<http://example.com/aReallyGreatBook>');\n     */\n    node: function (resource) {\n      var variable, query;\n      if (resource.toString().substring(0, 1) === '?') {\n        variable = resource.toString().substring(1);\n        query = $.rdf({ parent: this, navigate: variable });\n      } else {\n        if (typeof resource === 'string') {\n          resource = object(resource, { namespaces: this.prefix(), base: this.base() });\n        }\n        query = $.rdf({ parent: this, nodes: [resource] });\n      }\n      this.children.push(query);\n      return query;\n    },\n    \n    /**\n     * Navigates from the resource identified by the 'node' binding to another node through the property passed as the argument.\n     * @param {String|Object} property The property whose value will be the new node.\n     * @returns {jQuery.rdf} A new {@link jQuery.rdf} object whose {@link jQuery.rdf#parent} is this {@link jQuery.rdf}.\n     * @see jQuery.rdf#back\n     * @see jQuery.rdf#node\n     * @example\n     * var creators = $('html').rdf()\n     *   .node('<>')\n     *   .find('dc:creator');\n     */\n    find: function (property) {\n      return this.where('?node ' + property + ' ?object', { navigate: 'object' });\n    },\n    \n    /**\n     * Navigates from the resource identified by the 'node' binding to another node through the property passed as the argument, like {jQuery.rdf#find}, but backwards.\n     * @param {String|Object} property The property whose value will be the new node.\n     * @returns {jQuery.rdf} A new {@link jQuery.rdf} object whose {@link jQuery.rdf#parent} is this {@link jQuery.rdf}.\n     * @see jQuery.rdf#find\n     * @see jQuery.rdf#node\n     * @example\n     * var people = $('html').rdf()\n     *   .node('foaf:Person')\n     *   .back('rdf:type');\n     */\n    back: function (property) {\n      return this.where('?subject ' + property + ' ?node', { navigate: 'subject' });\n    },\n\n    /**\n     * Groups the bindings held by this {@link jQuery.rdf} object based on the values of the variables passed as the parameter.\n     * @param {String[]} [bindings] The variables to group by. The returned objects will contain all their current properties, but those aside from the specified variables will be arrays listing the relevant values.\n     * @returns {jQuery} A jQuery object containing objects representing the grouped bindings.\n     * @example\n     * // returns one object per person and groups all the names and all the emails together in arrays\n     * var grouped = rdf\n     *   .where('?person foaf:name ?name')\n     *   .where('?person foaf:email ?email')\n     *   .group('person');\n     * @example\n     * // returns one object per surname/firstname pair, with the person property being an array in the resulting objects\n     * var grouped = rdf\n     *   .where('?person foaf:first_name ?forename')\n     *   .where('?person foaf:givenname ?surname')\n     *   .group(['surname', 'forename']);\n     */\n    group: function (bindings) {\n      var grouped = {}, results = [], i, key, v;\n      if (!$.isArray(bindings)) {\n        bindings = [bindings];\n      }\n      return $(group(this, bindings));\n    },\n\n    /**\n     * Filters the variable bindings held by this {@link jQuery.rdf} object down to those listed in the bindings parameter. This mirrors the <a href=\"http://www.w3.org/TR/rdf-sparql-query/#select\">SELECT</a> form in SPARQL.\n     * @param {String[]} [bindings] The variables that you're interested in. The returned objects will only contain those variables. If bindings is undefined, you will get all the variable bindings in the returned objects.\n     * @returns {Object[]} An array of objects with the properties named by the bindings parameter.\n     * @example\n     * var filtered = rdf\n     *   .where('?photo dc:creator ?creator')\n     *   .where('?creator foaf:img ?photo');\n     * var selected = rdf.select(['creator']);\n     */\n    select: function (bindings) {\n      var s = [], i, j;\n      for (i = 0; i < this.length; i += 1) {\n        if (bindings === undefined) {\n          s[i] = this[i];\n        } else {\n          s[i] = {};\n          for (j = 0; j < bindings.length; j += 1) {\n            s[i][bindings[j]] = this[i][bindings[j]];\n          }\n        }\n      }\n      return s;\n    },\n\n    /**\n     * Provides <a href=\"http://n2.talis.com/wiki/Bounded_Descriptions_in_RDF#Simple_Concise_Bounded_Description\">simple concise bounded descriptions</a> of the resources or bindings that are passed in the argument. This mirrors the <a href=\"http://www.w3.org/TR/rdf-sparql-query/#describe\">DESCRIBE</a> form in SPARQL.\n     * @param {(String|jQuery.rdf.resource)[]} bindings An array that can contain strings, {@link jQuery.rdf.resource}s or a mixture of the two. Any strings that begin with a question mark (<code>?</code>) are taken as variable names; each matching resource is described by the function.\n     * @returns {jQuery} A {@link jQuery} object that contains {@link jQuery.rdf.triple}s that describe the listed resources.\n     * @see jQuery.rdf.databank#describe\n     * @example\n     * $.rdf.dump($('html').rdf().describe(['<photo1.jpg>']));\n     * @example\n     * $('html').rdf()\n     *   .where('?person foaf:img ?picture')\n     *   .describe(['?photo'])\n     */\n    describe: function (bindings) {\n      var i, j, binding, resources = [];\n      for (i = 0; i < bindings.length; i += 1) {\n        binding = bindings[i];\n        if (binding.substring(0, 1) === '?') {\n          binding = binding.substring(1);\n          for (j = 0; j < this.length; j += 1) {\n            resources.push(this[j][binding]);\n          }\n        } else {\n          resources.push(binding);\n        }\n      }\n      return this.databank.describe(resources);\n    },\n\n    /**\n     * Returns a new {@link jQuery.rdf} object that contains only one set of variable bindings. This is designed to mirror the <a href=\"http://docs.jquery.com/Traversing/eq#index\">jQuery#eq</a> method.\n     * @param {Integer} n The index number of the match that should be selected.\n     * @returns {jQuery.rdf} A new {@link jQuery.rdf} object with just that match.\n     * @example\n     * var rdf = $.rdf()\n     *   .prefix('foaf', 'http://xmlns.com/foaf/0.1/')\n     *   .add('_:a  foaf:name       \"Alice\" .')\n     *   .add('_:a  foaf:homepage   <http://work.example.org/alice/> .')\n     *   .add('_:b  foaf:name       \"Bob\" .')\n     *   .add('_:b  foaf:mbox       <mailto:bob@work.example> .')\n     *   .where('?x foaf:name ?name')\n     *   .eq(1);\n     */\n    eq: function (n) {\n      return this.filter(function (i) {\n        return i === n;\n      });\n    },\n\n    /**\n     * Returns a {@link jQuery.rdf} object that includes no filtering (and therefore has no matches) over the {@link jQuery.rdf#databank}.\n     * @returns {jQuery.rdf} An empty {@link jQuery.rdf} object.\n     * @example\n     * $('html').rdf()\n     *   .where('?person foaf:family_name \"Hacker\"')\n     *   .where('?person foaf:givenname \"Alice\"')\n     *   .each(...do something with Alice Hacker...)\n     *   .reset()\n     *   .where('?person foaf:family_name \"Jones\"')\n     *   .where('?person foaf:givenname \"Bob\"')\n     *   .each(...do something with Bob Jones...);\n     */\n    reset: function () {\n      var query = this;\n      while (query.parent !== undefined) {\n        query = query.parent;\n      }\n      return query;\n    },\n\n    /**\n     * Returns the parent {@link jQuery.rdf} object, which is equivalent to undoing the most recent filtering operation (such as {@link jQuery.rdf#where} or {@link jQuery.rdf#filter}). This is designed to mirror the <a href=\"http://docs.jquery.com/Traversing/end\">jQuery#end</a> method.\n     * @returns {jQuery.rdf}\n     * @example\n     * $('html').rdf()\n     *   .where('?person foaf:family_name \"Hacker\"')\n     *   .where('?person foaf:givenname \"Alice\"')\n     *   .each(...do something with Alice Hacker...)\n     *   .end()\n     *   .where('?person foaf:givenname \"Bob\"')\n     *   .each(...do something with Bob Hacker...);\n     */\n    end: function () {\n      return this.parent;\n    },\n\n    /**\n     * Returns the number of matches in this {@link jQuery.rdf} object (equivalent to {@link jQuery.rdf#length}).\n     * @returns {Integer} The number of matches in this {@link jQuery.rdf} object.\n     * @see jQuery.rdf#length\n     */\n    size: function () {\n      return this.length;\n    },\n\n    /**\n     * Gets the triples that form the basis of the variable bindings that are the primary product of {@link jQuery.rdf}. Getting hold of the triples can be useful for understanding the facts that form the basis of the variable bindings.\n     * @returns {jQuery} A {@link jQuery} object containing arrays of {@link jQuery.rdf.triple} objects. A {@link jQuery} object is returned so that you can easily iterate over the contents.\n     * @example\n     * $('html').rdf()\n     *   .where('?thing a foaf:Person')\n     *   .sources()\n     *   .each(function () {\n     *     ...do something with the array of triples... \n     *   });\n     */\n    sources: function () {\n      return $($.map(this.matches, function (match) {\n        // return an array-of-an-array because arrays automatically get expanded by $.map()\n        return [match.triples];\n      }));\n    },\n\n    /**\n     * Dumps the triples that form the basis of the variable bindings that are the primary product of {@link jQuery.rdf} into a format that can be shown to the user or sent to a server.\n     * @param {Object} [options] Options that control the formatting of the triples. See {@link jQuery.rdf.dump} for details.\n     * @see jQuery.rdf.dump\n     */\n    dump: function (options) {\n      var triples = $.map(this.matches, function (match) {\n        return match.triples;\n      });\n      options = $.extend({ namespaces: this.databank.namespaces, base: this.databank.base }, options || {});\n      return $.rdf.dump(triples, options);\n    },\n\n    /**\n     * Either returns the item specified by the argument or turns the {@link jQuery.rdf} object into an array. This mirrors the <a href=\"http://docs.jquery.com/Core/get\">jQuery#get</a> method.\n     * @param {Integer} [num] The number of the item to be returned.\n     * @returns {Object[]|Object} Returns either a single Object representing variable bindings or an array of such.\n     * @example\n     * $('html').rdf()\n     *   .where('?person a foaf:Person')\n     *   .get(0)\n     *   .subject\n     *   .value;\n     */\n    get: function (num) {\n      return (num === undefined) ? $.makeArray(this) : this[num];\n    },\n\n    /**\n     * Iterates over the matches held by the {@link jQuery.rdf} object and performs a function on each of them. This mirrors the <a href=\"http://docs.jquery.com/Core/each\">jQuery#each</a> method.\n     * @param {Function} callback A function that is called for each match on the {@link jQuery.rdf} object. Within the function, <code>this</code> is set to the object representing the variable bindings. The function can take up to three parameters:\n     * <dl>\n     *   <dt>i</dt><dd>The index of the match amongst the other matches.</dd>\n     *   <dt>bindings</dt><dd>An object representing the variable bindings for the match, the same as <code>this</code>.</dd>\n     *   <dt>triples</dt><dd>An array of {@link jQuery.rdf.triple}s associated with the particular match.</dd>\n     * </dl>\n     * @returns {jQuery.rdf} The {@link jQuery.rdf} object.\n     * @see jQuery.rdf#map\n     * @example\n     * var rdf = $('html').rdf()\n     *   .where('?photo dc:creator ?creator')\n     *   .where('?creator foaf:img ?photo')\n     *   .each(function () {\n     *     photos.push(this.photo.value);\n     *   });\n     */\n    each: function (callback) {\n      $.each(this.matches, function (i, match) {\n        callback.call(match.bindings, i, match.bindings, match.triples);\n      });\n      return this;\n    },\n\n    /**\n     * Iterates over the matches held by the {@link jQuery.rdf} object and creates a new {@link jQuery} object that holds the result of applying the passed function to each one. This mirrors the <a href=\"http://docs.jquery.com/Traversing/map\">jQuery#map</a> method.\n     * @param {Function} callback A function that is called for each match on the {@link jQuery.rdf} object. Within the function, <code>this</code> is set to the object representing the variable bindings. The function can take up to three parameters and should return some kind of value:\n     * <dl>\n     *   <dt>i</dt><dd>The index of the match amongst the other matches.</dd>\n     *   <dt>bindings</dt><dd>An object representing the variable bindings for the match, the same as <code>this</code>.</dd>\n     *   <dt>triples</dt><dd>An array of {@link jQuery.rdf.triple}s associated with the particular match.</dd>\n     * </dl>\n     * @returns {jQuery} A jQuery object holding the results of the function for each of the matches on the original {@link jQuery.rdf} object.\n     * @example\n     * var photos = $('html').rdf()\n     *   .where('?photo dc:creator ?creator')\n     *   .where('?creator foaf:img ?photo')\n     *   .map(function () {\n     *     return this.photo.value;\n     *   });\n     */\n    map: function (callback) {\n      return $($.map(this.matches, function (match, i) {\n        // in the callback, \"this\" is the bindings, and the arguments are swapped from $.map()\n        return callback.call(match.bindings, i, match.bindings, match.triples);\n      }));\n    },\n\n    /**\n     * Returns a {@link jQuery} object that wraps this {@link jQuery.rdf} object.\n     * @returns {jQuery}\n     */\n    jquery: function () {\n      return $(this);\n    }\n  };\n\n  $.rdf.fn.init.prototype = $.rdf.fn;\n\n  $.rdf.gleaners = [];\n  $.rdf.parsers = {};\n\n  /**\n   * Dumps the triples passed as the first argument into a format that can be shown to the user or sent to a server.\n   * @param {jQuery.rdf.triple[]} triples An array (or {@link jQuery} object) of {@link jQuery.rdf.triple}s.\n   * @param {Object} [options] Options that control the format of the dump.\n   * @param {String} [options.format='application/json'] The mime type of the format of the dump. The supported formats are:\n   * <table>\n   *   <tr><th>mime type</th><th>description</th></tr>\n   *   <tr>\n   *     <td><code>application/json</code></td>\n   *     <td>An <a href=\"http://n2.talis.com/wiki/RDF_JSON_Specification\">RDF/JSON</a> object</td>\n   *   </tr>\n   *   <tr>\n   *     <td><code>application/rdf+xml</code></td>\n   *     <td>An DOMDocument node holding XML in <a href=\"http://www.w3.org/TR/rdf-syntax-grammar/\">RDF/XML syntax</a></td>\n   *   </tr>\n   *   <tr>\n   *     <td><code>text/turtle</code></td>\n   *     <td>A String holding a representation of the RDF in <a href=\"http://www.w3.org/TeamSubmission/turtle/\">Turtle syntax</a></td>\n   *   </tr>\n   * </table>\n   * @param {Object} [options.namespaces={}] A set of namespace bindings used when mapping resource URIs to CURIEs or QNames (particularly in a RDF/XML serialisation).\n   * @param {boolean} [options.serialize=false] If true, rather than creating an Object, the function will return a string which is ready to display or send to a server.\n   * @param {boolean} [options.indent=false] If true, the serialised (RDF/XML) output has indentation added to it to make it more readable.\n   * @returns {Object|String} The alternative representation of the triples.\n   */\n  $.rdf.dump = function (triples, options) {\n    var opts = $.extend({}, $.rdf.dump.defaults, options || {}),\n      format = opts.format,\n      serialize = opts.serialize,\n      dump, parser, parsers;\n    parser = $.rdf.parsers[format];\n    if (parser === undefined) {\n      parsers = [];\n      for (p in $.rdf.parsers) {\n        parsers.push(p);\n      }\n      throw \"Unrecognised dump format: \" + format + \". Expected one of \" + parsers.join(\", \");\n    }\n    dump = parser.dump(triples, opts);\n    return serialize ? parser.serialize(dump) : dump;\n  };\n\n  $.rdf.dump.defaults = {\n    format: 'application/json',\n    serialize: false,\n    indent: false,\n    namespaces: {}\n  }\n\n  /**\n   * Gleans RDF triples from the nodes held by the {@link jQuery} object, puts them into a {@link jQuery.rdf.databank} and returns a {@link jQuery.rdf} object that allows you to query and otherwise manipulate them. The mechanism for gleaning RDF triples from the web page depends on the rdfQuery modules that have been included. The core version of rdfQuery doesn't support any gleaners; other versions support a RDFa gleaner, and there are some modules available for common microformats.\n   * @methodOf jQuery#\n   * @name jQuery#rdf\n   * @param {Function} [callback] A callback function that is called every time a triple is gleaned from the page. Within the function, <code>this</code> is set to the triple that has been located. The function can take up to two parameters:\n   * <dl>\n   *   <dt>node</dt><dd>The node on which the triple has been found; should be the same as <code>this.source</code>.</dd>\n   *   <dt>triple</dt><dd>The triple that's been found; the same as <code>this</code>.</dd>\n   * </dl>\n   * The callback should return the triple or triples that should be added to the databank. This enables you to filter, extend or modify the contents of the databank itself, should you wish to.\n   * @returns {jQuery.rdf} An empty query over the triples stored within the page.\n   * @example $('#content').rdf().databank.dump();\n   */\n  $.fn.rdf = function (callback) {\n    var triples = [],\n      callback = callback || function () { return this; };\n    if ($(this)[0] && $(this)[0].nodeType === 9) {\n      return $(this).children('*').rdf(callback);\n    } else if ($(this).length > 0) {\n      triples = $(this).map(function (i, elem) {\n        return $.map($.rdf.gleaners, function (gleaner) {\n          return gleaner.call($(elem), { callback: callback });\n        });\n      });\n      return $.rdf({ triples: triples, namespaces: $(this).xmlns() });\n    } else {\n      return $.rdf();\n    }\n  };\n\n  $.extend($.expr[':'], {\n\n    about: function (a, i, m) {\n      var j = $(a),\n        resource = m[3] ? j.safeCurie(m[3]) : null,\n        isAbout = false;\n      $.each($.rdf.gleaners, function (i, gleaner) {\n        isAbout = gleaner.call(j, { about: resource });\n        if (isAbout) {\n          return null;\n        }\n      });\n      return isAbout;\n    },\n\n    type: function (a, i, m) {\n      var j = $(a),\n        type = m[3] ? j.curie(m[3]) : null,\n        isType = false;\n      $.each($.rdf.gleaners, function (i, gleaner) {\n        if (gleaner.call(j, { type: type })) {\n          isType = true;\n          return null;\n        }\n      });\n      return isType;\n    }\n\n  });\n\n  /**\n   * <p>Creates a new jQuery.rdf.databank object. This should be invoked as a method rather than constructed using new; indeed you will not usually want to generate these objects directly, but manipulate them through a {@link jQuery.rdf} object.</p>\n   * @class Represents a triplestore, holding a bunch of {@link jQuery.rdf.triple}s.\n   * @param {(String|jQuery.rdf.triple)[]} [triples=[]] An array of triples to store in the databank.\n   * @param {Object} [options] Initialisation of the databank.\n   * @param {Object} [options.namespaces] An object representing a set of namespace bindings used when interpreting the CURIEs in strings representing triples. Rather than passing this in when you construct the {@link jQuery.rdf.databank} instance, you will usually want to use the {@link jQuery.rdf.databank#prefix} method.\n   * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the strings representing triples.\n   * @returns {jQuery.rdf.databank} The newly-created databank.\n   * @see jQuery.rdf\n   */\n  $.rdf.databank = function (triples, options) {\n    return new $.rdf.databank.fn.init(triples, options);\n  };\n\n  $.rdf.databank.fn = $.rdf.databank.prototype = {\n    init: function (triples, options) {\n      var i;\n      triples = triples || [];\n      options = options || {};\n      this.id = databankID();\n      databanks[this.id] = this;\n      if (options.union === undefined) {\n        this.queries = {};\n        this.tripleStore = [];\n        this.subjectIndex = {};\n        this.propertyIndex = {};\n        this.objectIndex = {};\n        this.baseURI = options.base || $.uri.base();\n        this.namespaces = $.extend({}, options.namespaces || {});\n        for (i = 0; i < triples.length; i += 1) {\n          this.add(triples[i]);\n        }\n      } else {\n        this.union = options.union;\n      }\n      return this;\n    },\n    \n    /**\n     * Sets or returns the base URI of the {@link jQuery.rdf.databank}.\n     * @param {String|jQuery.uri} [base]\n     * @returns A {@link jQuery.uri} if no base URI is specified, otherwise returns this {@link jQuery.rdf.databank} object.\n     * @see jQuery.rdf#base\n     */\n    base: function (base) {\n      if (this.union === undefined) {\n        if (base === undefined) {\n          return this.baseURI;\n        } else {\n          this.baseURI = base;\n          return this;\n        }\n      } else if (base === undefined) {\n        return this.union[0].base();\n      } else {\n        $.each(this.union, function (i, databank) {\n          databank.base(base);\n        });\n        return this;\n      }\n    },\n\n    /**\n     * Sets or returns a namespace binding on the {@link jQuery.rdf.databank}.\n     * @param {String} [prefix]\n     * @param {String} [namespace]\n     * @returns {Object|jQuery.uri|jQuery.rdf} If no prefix or namespace is specified, returns an object providing all namespace bindings on the {@link jQuery.rdf#databank}. If a prefix is specified without a namespace, returns the {@link jQuery.uri} associated with that prefix. Otherwise returns this {@link jQuery.rdf} object after setting the namespace binding.\n     * @see jQuery.rdf#prefix\n     */\n    prefix: function (prefix, uri) {\n      var namespaces = {};\n      if (this.union === undefined) {\n        if (prefix === undefined) {\n          return this.namespaces;\n        } else if (uri === undefined) {\n          return this.namespaces[prefix];\n        } else {\n          this.namespaces[prefix] = uri;\n          return this;\n        }\n      } else if (uri === undefined) {\n        $.each(this.union, function (i, databank) {\n          $.extend(namespaces, databank.prefix());\n        });\n        if (prefix === undefined) {\n          return namespaces;\n        } else {\n          return namespaces[prefix];\n        }\n      } else {\n        $.each(this.union, function (i, databank) {\n          databank.prefix(prefix, uri);\n        });\n        return this;\n      }\n    },\n\n    /**\n     * Adds a triple to the {@link jQuery.rdf.databank} or another {@link jQuery.rdf.databank} object to create a union.\n     * @param {String|jQuery.rdf.triple|jQuery.rdf.databank} triple The triple or {@link jQuery.rdf.databank} object to be added to this one. If the triple is a {@link jQuery.rdf.databank} object, the two databanks are unioned together. If the triple is a string, it's parsed as a {@link jQuery.rdf.triple}.\n     * @param {Object} [options]\n     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret CURIEs within the triple. Defaults to the namespace bindings defined on the {@link jQuery.rdf.databank}.\n     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the triple. Defaults to the base URI defined on the {@link jQuery.rdf.databank}.\n     * @param {Integer} [options.depth] The number of links to traverse to gather more information about the subject, property and object of the triple.\n     * @returns {jQuery.rdf.databank} This {@link jQuery.rdf.databank} object.\n     * @see jQuery.rdf#add\n     */\n    add: function (triple, options) {\n      var base = (options && options.base) || this.base(),\n        namespaces = $.extend({}, this.prefix(), (options && options.namespaces) || {}),\n        depth = (options && options.depth) || $.rdf.databank.defaults.depth,\n        proxy = (options && options.proxy) || $.rdf.databank.defaults.proxy,\n        databank;\n      if (triple === this) {\n        return this;\n      } else if (triple.subjectIndex !== undefined) {\n        // merging two databanks\n        if (this.union === undefined) {\n          databank = $.rdf.databank(undefined, { union: [this, triple] });\n          return databank;\n        } else {\n          this.union.push(triple);\n          return this;\n        }\n      } else {\n        if (typeof triple === 'string') {\n          triple = $.rdf.triple(triple, { namespaces: namespaces, base: base, source: triple });\n        }\n        if (this.union === undefined) {\n          if (this.subjectIndex[triple.subject] === undefined) {\n            this.subjectIndex[triple.subject] = [];\n            if (depth > 0 && triple.subject.type === 'uri') {\n              this.load(triple.subject.value, { depth: depth - 1, proxy: proxy });\n            }\n          }\n          if (this.propertyIndex[triple.property] === undefined) {\n            this.propertyIndex[triple.property] = [];\n            if (depth > 0) {\n              this.load(triple.property.value, { depth: depth - 1, proxy: proxy });\n            }\n          }\n          if ($.inArray(triple, this.subjectIndex[triple.subject]) === -1) {\n            this.tripleStore.push(triple);\n            this.subjectIndex[triple.subject].push(triple);\n            this.propertyIndex[triple.property].push(triple);\n            if (triple.object.type === 'uri' || triple.object.type === 'bnode') {\n              if (this.objectIndex[triple.object] === undefined) {\n                this.objectIndex[triple.object] = [];\n                if (depth > 0 && triple.object.type === 'uri') {\n                  this.load(triple.object.value, { depth: depth - 1, proxy: proxy });\n                }\n              }\n              this.objectIndex[triple.object].push(triple);\n            }\n            addToDatabankQueries(this, triple);\n          }\n        } else {\n          $.each(this.union, function (i, databank) {\n            databank.add(triple);\n          });\n        }\n        return this;\n      }\n    },\n\n    /**\n     * Removes a triple from the {@link jQuery.rdf.databank}.\n     * @param {String|jQuery.rdf.triple} triple The triple to be removed.\n     * @param {Object} [options]\n     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret any CURIEs within the triple. Defaults to the namespace bindings defined on the {@link jQuery.rdf.databank}.\n     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the triple. Defaults to the base URI defined on the {@link jQuery.rdf.databank}.\n     * @returns {jQuery.rdf.databank} The {@link jQuery.rdf.databank} object itself.\n     * @see jQuery.rdf#remove\n     */\n    remove: function (triple, options) {\n      var base = (options && options.base) || this.base(),\n        namespaces = $.extend({}, this.prefix(), (options && options.namespaces) || {}),\n        striples, ptriples, otriples,\n        databank;\n      if (typeof triple === 'string') {\n        triple = $.rdf.triple(triple, { namespaces: namespaces, base: base, source: triple });\n      }\n      var pos = $.inArray(triple, this.tripleStore);\n      if (pos === -1) {\n          return this;\n      }\n      this.tripleStore.splice(pos, 1);\n      striples = this.subjectIndex[triple.subject];\n      if (striples !== undefined) {\n        striples.splice($.inArray(triple, striples), 1);\n      }\n      ptriples = this.propertyIndex[triple.property];\n      if (ptriples !== undefined) {\n        ptriples.splice($.inArray(triple, ptriples), 1);\n      }\n      if (triple.object.type === 'uri' || triple.object.type === 'bnode') {\n        otriples = this.objectIndex[triple.object];\n        if (otriples !== undefined) {\n          otriples.splice($.inArray(triple, otriples), 1);\n        }\n      }\n      removeFromDatabankQueries(this, triple);\n      return this;\n    },\n\n    /**\n     * Creates a new databank containing all the triples in this {@link jQuery.rdf.databank} except those in the {@link jQuery.rdf.databank} passed as the argument.\n     * @param {jQuery.rdf.databank} data The other {@link jQuery.rdf.databank}\n     * @returns {jQuery.rdf.databank} A new {@link jQuery.rdf.databank} containing the triples in this {@link jQuery.rdf.databank} except for those in the data parameter.\n     * @example\n     * var old = $('html').rdf().databank;\n     * ...some processing occurs...\n     * var new = $('html').rdf().databank;\n     * var added = new.except(old);\n     * var removed = old.except(new);\n     */\n    except: function (data) {\n      var store = data.subjectIndex,\n        diff = [];\n      $.each(this.subjectIndex, function (s, ts) {\n        var ots = store[s];\n        if (ots === undefined) {\n          diff = diff.concat(ts);\n        } else {\n          $.each(ts, function (i, t) {\n            if ($.inArray(t, ots) === -1) {\n              diff.push(t);\n            }\n          });\n        }\n      });\n      return $.rdf.databank(diff);\n    },\n\n    /**\n     * Provides a {@link jQuery} object containing the triples held in this {@link jQuery.rdf.databank}.\n     * @returns {jQuery} A {@link jQuery} object containing {@link jQuery.rdf.triple} objects.\n     */\n    triples: function () {\n      var s, triples = [];\n      if (this.union === undefined) {\n        triples = this.tripleStore;\n      } else {\n        $.each(this.union, function (i, databank) {\n          triples = triples.concat(databank.triples().get());\n        });\n        triples = unique(triples);\n      }\n      return $(triples);\n    },\n\n    /**\n     * Tells you how many triples the databank contains.\n     * @returns {Integer} The number of triples in the {@link jQuery.rdf.databank}.\n     * @example $('html').rdf().databank.size();\n     */\n    size: function () {\n      return this.triples().length;\n    },\n\n    /**\n     * Provides <a href=\"http://n2.talis.com/wiki/Bounded_Descriptions_in_RDF#Simple_Concise_Bounded_Description\">simple concise bounded descriptions</a> of the resources that are passed in the argument. This mirrors the <a href=\"http://www.w3.org/TR/rdf-sparql-query/#describe\">DESCRIBE</a> form in SPARQL.\n     * @param {(String|jQuery.rdf.resource)[]} resources An array that can contain strings, {@link jQuery.rdf.resource}s or a mixture of the two.\n     * @returns {jQuery} A {@link jQuery} object holding the {@link jQuery.rdf.triple}s that describe the listed resources.\n     * @see jQuery.rdf#describe\n     */\n    describe: function (resources) {\n      var i, r, t, rhash = {}, triples = [];\n      while (resources.length > 0) {\n        r = resources.pop();\n        if (rhash[r] === undefined) {\n          if (r.value === undefined) {\n            r = $.rdf.resource(r);\n          }\n          if (this.subjectIndex[r] !== undefined) {\n            for (i = 0; i < this.subjectIndex[r].length; i += 1) {\n              t = this.subjectIndex[r][i];\n              triples.push(t);\n              if (t.object.type === 'bnode') {\n                resources.push(t.object);\n              }\n            }\n          }\n          if (this.objectIndex[r] !== undefined) {\n            for (i = 0; i < this.objectIndex[r].length; i += 1) {\n              t = this.objectIndex[r][i];\n              triples.push(t);\n              if (t.subject.type === 'bnode') {\n                resources.push(t.subject);\n              }\n            }\n          }\n          rhash[r] = true;\n        }\n      }\n      return unique(triples);\n    },\n\n    /**\n     * Dumps the triples in the databank into a format that can be shown to the user or sent to a server.\n     * @param {Object} [options] Options that control the formatting of the triples. See {@link jQuery.rdf.dump} for details.\n     * @returns {Object|Node|String}\n     * @see jQuery.rdf.dump\n     */\n    dump: function (options) {\n      options = $.extend({ namespaces: this.namespaces, base: this.base }, options || {});\n      return $.rdf.dump(this.triples(), options);\n    },\n\n    /**\n     * Loads some data into the databank.\n     * @param {Node|Object|String} data If the data is a string and starts with 'http://' then it's taken to be a URI and data is loaded from that URI via the proxy specified in the options. If it doesn't start with 'http://' then it's taken to be a serialized version of some format capable of representing RDF, parsed and interpreted. If the data is a node, it's interpreted to be an <a href=\"http://www.w3.org/TR/rdf-syntax-grammar/\">RDF/XML syntax</a> document and will be parsed as such. Otherwise, it's taken to be a <a href=\"http://n2.talis.com/wiki/RDF_JSON_Specification\">RDF/JSON</a> object.\n     * @param {Object} opts Options governing the loading of the data.\n     * @param {String} [opts.format] The mime type of the format the data is in, particularly useful if you're supplying the data as a string. If unspecified, the data will be sniffed to see if it might be HTML, RDF/XML, RDF/JSON or Turtle.\n     * @param {boolean} [opts.async=true] When loading data from a URI, this determines whether it will be done synchronously or asynchronously.\n     * @param {Function} [opts.success] When loading data from a URI, a function that will be called after the data is successfully loaded.\n     * @param {Function} [opts.error] When loading data from a URI, a function that will be called if there's an error when accessing the URI.\n     * @param {String} [opts.proxy='http://www.jenitennison.com/rdfquery/proxy.php'] The URI for a server-side proxy through which the data can be accessed. This does not have to be hosted on the same server as this Javascript, the HTML page or the remote data. The proxy must accept id, url and depth parameters and respond with some Javascript that will invoke the {@link jQuery.rdf.databank.load} function. <a href=\"http://code.google.com/p/rdfquery/source/browse/#svn/trunk/proxies\">Example proxies</a> that do the right thing are available. If you are intending to use this facility a lot, please do not use the default proxy.\n     * @param {integer} [opts.depth=0] Triggers recursive loading of located resources, to the depth specified. This is useful for automatically populating a databank with linked data.\n     * @returns {jQuery.rdf.databank} The {@link jQuery.rdf.databank} itself.\n     * @see jQuery.rdf#load\n     */\n    load: function (data, opts) {\n      var i, triples, url, script, parser, docElem,\n        format = (opts && opts.format),\n        async = (opts && opts.async) || $.rdf.databank.defaults.async,\n        success = (opts && opts.success) || $.rdf.databank.defaults.success,\n        error = (opts && opts.error) || $.rdf.databank.defaults.error,\n        proxy = (opts && opts.proxy) || $.rdf.databank.defaults.proxy,\n        depth = (opts && opts.depth) || $.rdf.databank.defaults.depth;\n      url = (typeof data === 'string' && data.substring(1, 7) === 'http://') ? $.uri(data) : data;\n      if (url.scheme) {\n        if (!queue(this, url, { success: success, error: error })) {\n          script = '<script type=\"text/javascript\" src=\"' + proxy + '?id=' + this.id + '&amp;depth=' + depth + '&amp;url=' + encodeURIComponent(url.resolve('').toString()) + '\"></script>';\n          if (async) {\n            setTimeout(\"$('head').append('\" + script + \"')\", 0);\n          } else {\n            $('head').append(script);\n          }\n        }\n        return this;\n      } else {\n        if (format === undefined) {\n          if (typeof data === 'string') {\n            if (data.substring(0, 1) === '{') {\n              format = 'application/json';\n            } else if (data.substring(0, 14) === '<!DOCTYPE html' || data.substring(0, 5) === '<html') {\n              format = 'application/xhtml+xml';\n            } else if (data.substring(0, 5) === '<?xml' || data.substring(0, 8) === '<rdf:RDF') {\n              format = 'application/rdf+xml';\n            } else {\n              format = 'text/turtle';\n            }\n          } else if (data.documentElement || data.ownerDocument) {\n            docElem = data.documentElement ? data.documentElement : data.ownerDocument.documentElement;\n            if (docElem.nodeName === 'html') {\n              format = 'application/xhtml+xml';\n            } else {\n              format = 'application/rdf+xml';\n            }\n          } else {\n            format = 'application/json';\n          }\n        }\n        parser = $.rdf.parsers[format];\n        if (typeof data === 'string') {\n          data = parser.parse(data);\n        }\n        triples = parser.triples(data);\n        for (i = 0; i < triples.length; i += 1) {\n          this.add(triples[i], opts);\n        }\n        return this;\n      }\n    },\n\n    /**\n     * Provides a string representation of the databank which simply specifies how many triples it contains.\n     * @returns {String}\n     */\n    toString: function () {\n      return '[Databank with ' + this.size() + ' triples]';\n    }\n  };\n\n  $.rdf.databank.fn.init.prototype = $.rdf.databank.fn;\n  \n  $.rdf.databank.defaults = {\n    parse: false,\n    async: true,\n    success: null,\n    error: null,\n    depth: 0,\n    proxy: 'http://www.jenitennison.com/rdfquery/proxy.php'\n  };\n  \n  $.rdf.databank.load = function (id, url, doc, opts) {\n    if (doc !== undefined) {\n      databanks[id].load(doc, opts);\n    }\n    dequeue(databanks[id], url, (doc === undefined) ? 'error' : 'success', opts);\n  };\n\n  /**\n   * <p>Creates a new jQuery.rdf.pattern object. This should be invoked as a method rather than constructed using new; indeed you will not usually want to generate these objects directly, since they are automatically created from strings where necessary, such as by {@link jQuery.rdf#where}.</p>\n   * @class Represents a pattern that may or may not match a given {@link jQuery.rdf.triple}.\n   * @param {String|jQuery.rdf.resource|jQuery.rdf.blank} subject The subject pattern, or a single string that defines the entire pattern. If the subject is specified as a string, it can be a fixed resource (<code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>), a blank node (<code>_:<var>id</var></code>) or a variable placeholder (<code>?<var>name</var></code>).\n   * @param {String|jQuery.rdf.resource} [property] The property pattern. If the property is specified as a string, it can be a fixed resource (<code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>) or a variable placeholder (<code>?<var>name</var></code>).\n   * @param {String|jQuery.rdf.resource|jQuery.rdf.blank|jQuery.rdf.literal} [value] The value pattern. If the property is specified as a string, it can be a fixed resource (<code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>), a blank node (<code>_:<var>id</var></code>), a literal (<code>\"<var>value</var>\"</code>) or a variable placeholder (<code>?<var>name</var></code>).\n   * @param {Object} [options] Initialisation of the pattern.\n   * @param {Object} [options.namespaces] An object representing a set of namespace bindings used when interpreting the CURIEs in the subject, property and object.\n   * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the subject, property and object.\n   * @param {boolean} [options.optional]\n   * @returns {jQuery.rdf.pattern} The newly-created pattern.\n   * @throws {String} Errors if any of the strings are not in a recognised format.\n   * @example pattern = $.rdf.pattern('?person', $.rdf.type, 'foaf:Person', { namespaces: { foaf: \"http://xmlns.com/foaf/0.1/\" }});\n   * @example \n   * pattern = $.rdf.pattern('?person a foaf:Person', { \n   *   namespaces: { foaf: \"http://xmlns.com/foaf/0.1/\" }, \n   *   optional: true \n   * });\n   * @see jQuery.rdf#where\n   * @see jQuery.rdf.resource\n   * @see jQuery.rdf.blank\n   * @see jQuery.rdf.literal\n   */\n  $.rdf.pattern = function (subject, property, object, options) {\n    var pattern, m, optional;\n    // using a two-argument version; first argument is a Turtle statement string\n    if (object === undefined) {\n      options = property || {};\n      m = $.trim(subject).match(tripleRegex);\n      if (m.length === 3 || (m.length === 4 && m[3] === '.')) {\n        subject = m[0];\n        property = m[1];\n        object = m[2];\n      } else {\n        throw \"Bad Pattern: Couldn't parse string \" + subject;\n      }\n      optional = (options.optional === undefined) ? $.rdf.pattern.defaults.optional : options.optional;\n    }\n    if (memPattern[subject] && \n        memPattern[subject][property] && \n        memPattern[subject][property][object] && \n        memPattern[subject][property][object][optional]) {\n      return memPattern[subject][property][object][optional];\n    }\n    pattern = new $.rdf.pattern.fn.init(subject, property, object, options);\n    if (memPattern[pattern.subject] &&\n        memPattern[pattern.subject][pattern.property] &&\n        memPattern[pattern.subject][pattern.property][pattern.object] &&\n        memPattern[pattern.subject][pattern.property][pattern.object][pattern.optional]) {\n      return memPattern[pattern.subject][pattern.property][pattern.object][pattern.optional];\n    } else {\n      if (memPattern[pattern.subject] === undefined) {\n        memPattern[pattern.subject] = {};\n      }\n      if (memPattern[pattern.subject][pattern.property] === undefined) {\n        memPattern[pattern.subject][pattern.property] = {};\n      }\n      if (memPattern[pattern.subject][pattern.property][pattern.object] === undefined) {\n        memPattern[pattern.subject][pattern.property][pattern.object] = {};\n      }\n      memPattern[pattern.subject][pattern.property][pattern.object][pattern.optional] = pattern;\n      return pattern;\n    }\n  };\n\n  $.rdf.pattern.fn = $.rdf.pattern.prototype = {\n    init: function (s, p, o, options) {\n      var opts = $.extend({}, $.rdf.pattern.defaults, options);\n      /**\n       * The placeholder for the subject of triples matching against this pattern.\n       * @type String|jQuery.rdf.resource|jQuery.rdf.blank\n       */\n      this.subject = s.toString().substring(0, 1) === '?' ? s : subject(s, opts);\n      /**\n       * The placeholder for the property of triples matching against this pattern.\n       * @type String|jQuery.rdf.resource\n       */\n      this.property = p.toString().substring(0, 1) === '?' ? p : property(p, opts);\n      /**\n       * The placeholder for the object of triples matching against this pattern.\n       * @type String|jQuery.rdf.resource|jQuery.rdf.blank|jQuery.rdf.literal\n       */\n      this.object = o.toString().substring(0, 1) === '?' ? o : object(o, opts);\n      /**\n       * Whether the pattern should only optionally match against the triple\n       * @type boolean\n       */\n      this.optional = opts.optional;\n      return this;\n    },\n\n    /**\n     * Creates a new {@link jQuery.rdf.pattern} with any variable placeholders within this one's subject, property or object filled in with values from the bindings passed as the argument.\n     * @param {Object} bindings An object holding the variable bindings to be used to replace any placeholders in the pattern. These bindings are of the type held by the {@link jQuery.rdf} object.\n     * @returns {jQuery.rdf.pattern} A new {@link jQuery.rdf.pattern} object.\n     * @example\n     * pattern = $.rdf.pattern('?thing a ?class');\n     * // pattern2 matches all triples that indicate the classes of this page. \n     * pattern2 = pattern.fill({ thing: $.rdf.resource('<>') });\n     */\n    fill: function (bindings) {\n      var s = this.subject,\n        p = this.property,\n        o = this.object;\n      if (typeof s === 'string' && bindings[s.substring(1)]) {\n        s = bindings[s.substring(1)];\n      }\n      if (typeof p === 'string' && bindings[p.substring(1)]) {\n        p = bindings[p.substring(1)];\n      }\n      if (typeof o === 'string' && bindings[o.substring(1)]) {\n        o = bindings[o.substring(1)];\n      }\n      return $.rdf.pattern(s, p, o, { optional: this.optional });\n    },\n\n    /**\n     * Creates a new Object holding variable bindings by matching the passed triple against this pattern.\n     * @param {jQuery.rdf.triple} triple A {@link jQuery.rdf.triple} for this pattern to match against.\n     * @returns {null|Object} An object containing the bindings of variables (as specified in this pattern) to values (as specified in the triple), or <code>null</code> if the triple doesn't match the pattern.\n     * pattern = $.rdf.pattern('?thing a ?class');\n     * bindings = pattern.exec($.rdf.triple('<> a foaf:Person', { namespaces: ns }));\n     * thing = bindings.thing; // the resource for this page\n     * class = bindings.class; // a resource for foaf:Person\n     */\n    exec: function (triple) {\n      var binding = {};\n      binding = testResource(triple.subject, this.subject, binding);\n      if (binding === null) {\n        return null;\n      }\n      binding = testResource(triple.property, this.property, binding);\n      if (binding === null) {\n        return null;\n      }\n      binding = testResource(triple.object, this.object, binding);\n      return binding;\n    },\n\n    /**\n     * Tests whether this pattern has any variable placeholders in it or not.\n     * @returns {boolean} True if the pattern doesn't contain any variable placeholders.\n     * @example\n     * $.rdf.pattern('?thing a ?class').isFixed(); // false\n     * $.rdf.pattern('<> a foaf:Person', { namespaces: ns }).isFixed(); // true\n     */\n    isFixed: function () {\n      return typeof this.subject !== 'string' &&\n        typeof this.property !== 'string' &&\n        typeof this.object !== 'string';\n    },\n\n    /**\n     * Creates a new triple based on the bindings passed to the pattern, if possible.\n     * @param {Object} bindings An object holding the variable bindings to be used to replace any placeholders in the pattern. These bindings are of the type held by the {@link jQuery.rdf} object.\n     * @returns {null|jQuery.rdf.triple} A new {@link jQuery.rdf.triple} object, or null if not all the variable placeholders in the pattern are specified in the bindings. The {@link jQuery.rdf.triple#source} of the generated triple is set to the string value of this pattern.\n     * @example\n     * pattern = $.rdf.pattern('?thing a ?class');\n     * // triple is a new triple '<> a foaf:Person'\n     * triple = pattern.triple({ \n     *   thing: $.rdf.resource('<>'),\n     *   class: $.rdf.resource('foaf:Person', { namespaces: ns }) \n     * });\n     */\n    triple: function (bindings) {\n      var t = this;\n      if (!this.isFixed()) {\n        t = this.fill(bindings);\n      }\n      if (t.isFixed()) {\n        return $.rdf.triple(t.subject, t.property, t.object, { source: this.toString() });\n      } else {\n        return null;\n      }\n    },\n\n    /**\n     * Returns a string representation of the pattern by concatenating the subject, property and object.\n     * @returns {String}\n     */\n    toString: function () {\n      return this.subject + ' ' + this.property + ' ' + this.object;\n    }\n  };\n\n  $.rdf.pattern.fn.init.prototype = $.rdf.pattern.fn;\n\n  $.rdf.pattern.defaults = {\n    base: $.uri.base(),\n    namespaces: {},\n    optional: false\n  };\n\n  /**\n   * <p>Creates a new jQuery.rdf.triple object. This should be invoked as a method rather than constructed using new; indeed you will not usually want to generate these objects directly, since they are automatically created from strings where necessary, such as by {@link jQuery.rdf#add}.</p>\n   * @class Represents an RDF triple.\n   * @param {String|jQuery.rdf.resource|jQuery.rdf.blank} subject The subject of the triple, or a single string that defines the entire triple. If the subject is specified as a string, it can be a fixed resource (<code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>) or a blank node (<code>_:<var>id</var></code>).\n   * @param {String|jQuery.rdf.resource} [property] The property pattern. If the property is specified as a string, it must be a fixed resource (<code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>).\n   * @param {String|jQuery.rdf.resource|jQuery.rdf.blank|jQuery.rdf.literal} [value] The value pattern. If the property is specified as a string, it can be a fixed resource (<code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>), a blank node (<code>_:<var>id</var></code>), or a literal (<code>\"<var>value</var>\"</code>).\n   * @param {Object} [options] Initialisation of the triple.\n   * @param {Object} [options.namespaces] An object representing a set of namespace bindings used when interpreting the CURIEs in the subject, property and object.\n   * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the subject, property and object.\n   * @returns {jQuery.rdf.triple} The newly-created triple.\n   * @throws {String} Errors if any of the strings are not in a recognised format.\n   * @example pattern = $.rdf.triple('<>', $.rdf.type, 'foaf:Person', { namespaces: { foaf: \"http://xmlns.com/foaf/0.1/\" }});\n   * @example \n   * pattern = $.rdf.triple('<> a foaf:Person', { \n   *   namespaces: { foaf: \"http://xmlns.com/foaf/0.1/\" }\n   * });\n   * @see jQuery.rdf#add\n   * @see jQuery.rdf.resource\n   * @see jQuery.rdf.blank\n   * @see jQuery.rdf.literal\n   */\n  $.rdf.triple = function (subject, property, object, options) {\n    var triple, graph, m;\n    // using a two-argument version; first argument is a Turtle statement string\n    if (object === undefined) {\n      options = property;\n      m = $.trim(subject).match(tripleRegex);\n      if (m.length === 3 || (m.length === 4 && m[3] === '.')) {\n        subject = m[0];\n        property = m[1];\n        object = m[2];\n      } else {\n        throw \"Bad Triple: Couldn't parse string \" + subject;\n      }\n    }\n    graph = (options && options.graph) || '';\n    if (memTriple[graph] &&\n        memTriple[graph][subject] &&\n        memTriple[graph][subject][property] &&\n        memTriple[graph][subject][property][object]) {\n      return memTriple[graph][subject][property][object];\n    }\n    triple = new $.rdf.triple.fn.init(subject, property, object, options);\n    graph = triple.graph || '';\n    if (memTriple[graph] &&\n        memTriple[graph][triple.subject] &&\n        memTriple[graph][triple.subject][triple.property] &&\n        memTriple[graph][triple.subject][triple.property][triple.object]) {\n      return memTriple[graph][triple.subject][triple.property][triple.object];\n    } else {\n      if (memTriple[graph] === undefined) {\n        memTriple[graph] = {};\n      }\n      if (memTriple[graph][triple.subject] === undefined) {\n        memTriple[graph][triple.subject] = {};\n      }\n      if (memTriple[graph][triple.subject][triple.property] === undefined) {\n        memTriple[graph][triple.subject][triple.property] = {};\n      }\n      memTriple[graph][triple.subject][triple.property][triple.object] = triple;\n      return triple;\n    }\n  };\n\n  $.rdf.triple.fn = $.rdf.triple.prototype = {\n    init: function (s, p, o, options) {\n      var opts;\n      opts = $.extend({}, $.rdf.triple.defaults, options);\n      /**\n       * The subject of the triple.\n       * @type jQuery.rdf.resource|jQuery.rdf.blank\n       */\n      this.subject = subject(s, opts);\n      /**\n       * The property of the triple.\n       * @type jQuery.rdf.resource\n       */\n      this.property = property(p, opts);\n      /**\n       * The object of the triple.\n       * @type jQuery.rdf.resource|jQuery.rdf.blank|jQuery.rdf.literal\n       */\n      this.object = object(o, opts);\n      /**\n       * (Experimental) The named graph the triple belongs to.\n       * @type jQuery.rdf.resource|jQuery.rdf.blank\n       */\n      this.graph = opts.graph === undefined ? undefined : subject(opts.graph, opts);\n      /**\n       * The source of the triple, which might be a node within the page (if the RDF is generated from the page) or a string holding the pattern that generated the triple.\n       */\n      this.source = opts.source;\n      return this;\n    },\n\n    /**\n     * Always returns true for triples.\n     * @see jQuery.rdf.pattern#isFixed\n     */\n    isFixed: function () {\n      return true;\n    },\n\n    /**\n     * Always returns this triple.\n     * @see jQuery.rdf.pattern#triple\n     */\n    triple: function (bindings) {\n      return this;\n    },\n\n    /**\n     * Returns a <a href=\"http://n2.talis.com/wiki/RDF_JSON_Specification\">RDF/JSON</a> representation of this triple.\n     * @returns {Object}\n     */\n    dump: function () {\n      var e = {},\n        s = this.subject.value.toString(),\n        p = this.property.value.toString();\n      e[s] = {};\n      e[s][p] = this.object.dump();\n      return e;\n    },\n\n    /**\n     * Returns a string representing this triple in Turtle format.\n     * @returns {String}\n     */\n    toString: function () {\n      return this.subject + ' ' + this.property + ' ' + this.object + ' .';\n    }\n  };\n\n  $.rdf.triple.fn.init.prototype = $.rdf.triple.fn;\n\n  $.rdf.triple.defaults = {\n    base: $.uri.base(),\n    source: [document],\n    namespaces: {}\n  };\n\n  /**\n   * <p>Creates a new jQuery.rdf.resource object. This should be invoked as a method rather than constructed using new; indeed you will not usually want to generate these objects directly, since they are automatically created from strings where necessary, such as by {@link jQuery.rdf#add}.</p>\n   * @class Represents an RDF resource.\n   * @param {String|jQuery.uri} value The value of the resource. If it's a string it must be in the format <code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>.\n   * @param {Object} [options] Initialisation of the resource.\n   * @param {Object} [options.namespaces] An object representing a set of namespace bindings used when interpreting the CURIE specifying the resource.\n   * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the URI specifying the resource.\n   * @returns {jQuery.rdf.resource} The newly-created resource.\n   * @throws {String} Errors if the string is not in a recognised format.\n   * @example thisPage = $.rdf.resource('<>');\n   * @example foaf.Person = $.rdf.resource('foaf:Person', { namespaces: ns });\n   * @see jQuery.rdf.pattern\n   * @see jQuery.rdf.triple\n   * @see jQuery.rdf.blank\n   * @see jQuery.rdf.literal\n   */\n  $.rdf.resource = function (value, options) {\n    var resource;\n    if (memResource[value]) {\n      return memResource[value];\n    }\n    resource = new $.rdf.resource.fn.init(value, options);\n    if (memResource[resource]) {\n      return memResource[resource];\n    } else {\n      memResource[resource] = resource;\n      return resource;\n    }\n  };\n\n  $.rdf.resource.fn = $.rdf.resource.prototype = {\n    /**\n     * Always fixed to 'uri' for resources.\n     * @type String\n     */\n    type: 'uri',\n    /**\n     * The URI for the resource.\n     * @type jQuery.rdf.uri\n     */\n    value: undefined,\n\n    init: function (value, options) {\n      var m, prefix, uri, opts;\n      if (typeof value === 'string') {\n        m = uriRegex.exec(value);\n        opts = $.extend({}, $.rdf.resource.defaults, options);\n        if (m !== null) {\n          this.value = $.uri.resolve(m[1].replace(/\\\\>/g, '>'), opts.base);\n        } else if (value.substring(0, 1) === ':') {\n          uri = opts.namespaces[''];\n          if (uri === undefined) {\n            throw \"Malformed Resource: No namespace binding for default namespace in \" + value;\n          } else {\n            this.value = $.uri.resolve(uri + value.substring(1));\n          }\n        } else if (value.substring(value.length - 1) === ':') {\n          prefix = value.substring(0, value.length - 1);\n          uri = opts.namespaces[prefix];\n          if (uri === undefined) {\n            throw \"Malformed Resource: No namespace binding for prefix \" + prefix + \" in \" + value;\n          } else {\n            this.value = $.uri.resolve(uri);\n          }\n        } else {\n          try {\n            this.value = $.curie(value, { namespaces: opts.namespaces });\n          } catch (e) {\n            throw \"Malformed Resource: Bad format for resource \" + e;\n          }\n        }\n      } else {\n        this.value = value;\n      }\n      return this;\n    }, // end init\n\n    /**\n     * Returns a <a href=\"http://n2.talis.com/wiki/RDF_JSON_Specification\">RDF/JSON</a> representation of this triple.\n     * @returns {Object}\n     */\n    dump: function () {\n      return {\n        type: 'uri',\n        value: this.value.toString()\n      };\n    },\n\n    /**\n     * Returns a string representing this resource in Turtle format.\n     * @returns {String}\n     */\n    toString: function () {\n      return '<' + this.value + '>';\n    }\n  };\n\n  $.rdf.resource.fn.init.prototype = $.rdf.resource.fn;\n\n  $.rdf.resource.defaults = {\n    base: $.uri.base(),\n    namespaces: {}\n  };\n\n  /**\n   * A {@link jQuery.rdf.resource} for rdf:type\n   * @constant\n   * @type jQuery.rdf.resource\n   */\n  $.rdf.type = $.rdf.resource('<' + rdfNs + 'type>');\n  /**\n   * A {@link jQuery.rdf.resource} for rdfs:label\n   * @constant\n   * @type jQuery.rdf.resource\n   */\n  $.rdf.label = $.rdf.resource('<' + rdfsNs + 'label>');\n  /**\n   * A {@link jQuery.rdf.resource} for rdf:first\n   * @constant\n   * @type jQuery.rdf.resource\n   */\n  $.rdf.first = $.rdf.resource('<' + rdfNs + 'first>');\n  /**\n   * A {@link jQuery.rdf.resource} for rdf:rest\n   * @constant\n   * @type jQuery.rdf.resource\n   */\n  $.rdf.rest = $.rdf.resource('<' + rdfNs + 'rest>');\n  /**\n   * A {@link jQuery.rdf.resource} for rdf:nil\n   * @constant\n   * @type jQuery.rdf.resource\n   */\n  $.rdf.nil = $.rdf.resource('<' + rdfNs + 'nil>');\n  /**\n   * A {@link jQuery.rdf.resource} for rdf:subject\n   * @constant\n   * @type jQuery.rdf.resource\n   */\n  $.rdf.subject = $.rdf.resource('<' + rdfNs + 'subject>');\n  /**\n   * A {@link jQuery.rdf.resource} for rdf:property\n   * @constant\n   * @type jQuery.rdf.resource\n   */\n  $.rdf.property = $.rdf.resource('<' + rdfNs + 'property>');\n  /**\n   * A {@link jQuery.rdf.resource} for rdf:object\n   * @constant\n   * @type jQuery.rdf.resource\n   */\n  $.rdf.object = $.rdf.resource('<' + rdfNs + 'object>');\n\n  /**\n   * <p>Creates a new jQuery.rdf.blank object. This should be invoked as a method rather than constructed using new; indeed you will not usually want to generate these objects directly, since they are automatically created from strings where necessary, such as by {@link jQuery.rdf#add}.</p>\n   * @class Represents an RDF blank node.\n   * @param {String} value A representation of the blank node in the format <code>_:<var>id</var></code> or <code>[]</code> (which automatically creates a new blank node with a unique ID).\n   * @returns {jQuery.rdf.blank} The newly-created blank node.\n   * @throws {String} Errors if the string is not in a recognised format.\n   * @example newBlank = $.rdf.blank('[]');\n   * @example identifiedBlank = $.rdf.blank('_:fred');\n   * @see jQuery.rdf.pattern\n   * @see jQuery.rdf.triple\n   * @see jQuery.rdf.resource\n   * @see jQuery.rdf.literal\n   */\n  $.rdf.blank = function (value) {\n    var blank;\n    if (memBlank[value]) {\n      return memBlank[value];\n    }\n    blank = new $.rdf.blank.fn.init(value);\n    if (memBlank[blank]) {\n      return memBlank[blank];\n    } else {\n      memBlank[blank] = blank;\n      return blank;\n    }\n  };\n\n  $.rdf.blank.fn = $.rdf.blank.prototype = {\n    /**\n     * Always fixed to 'bnode' for blank nodes.\n     * @type String\n     */\n    type: 'bnode',\n    /**\n     * The value of the blank node in the format <code>_:<var>id</var></code>\n     * @type String\n     */\n    value: undefined,\n    /**\n     * The id of the blank node.\n     * @type String\n     */\n    id: undefined,\n\n    init: function (value) {\n      if (value === '[]') {\n        this.id = blankNodeID();\n        this.value = '_:' + this.id;\n      } else if (value.substring(0, 2) === '_:') {\n        this.id = value.substring(2);\n        this.value = value;\n      } else {\n        throw \"Malformed Blank Node: \" + value + \" is not a legal format for a blank node\";\n      }\n      return this;\n    },\n\n    /**\n     * Returns a <a href=\"http://n2.talis.com/wiki/RDF_JSON_Specification\">RDF/JSON</a> representation of this blank node.\n     * @returns {Object}\n     */\n    dump: function () {\n      return {\n        type: 'bnode',\n        value: this.value\n      };\n    },\n\n    /**\n     * Returns the value this blank node.\n     * @returns {String}\n     */\n    toString: function () {\n      return this.value;\n    }\n  };\n\n  $.rdf.blank.fn.init.prototype = $.rdf.blank.fn;\n\n  /**\n   * <p>Creates a new jQuery.rdf.literal object. This should be invoked as a method rather than constructed using new; indeed you will not usually want to generate these objects directly, since they are automatically created from strings where necessary, such as by {@link jQuery.rdf#add}.</p>\n   * @class Represents an RDF literal.\n   * @param {String|boolean|Number} value Either the value of the literal or a string representation of it. If the datatype or lang options are specified, the value is taken as given. Otherwise, if it's a Javascript boolean or numeric value, it is interpreted as a value with a xsd:boolean or xsd:double datatype. In all other cases it's interpreted as a literal as defined in <a href=\"http://www.w3.org/TeamSubmission/turtle/#literal\">Turtle syntax</a>.\n   * @param {Object} [options] Initialisation options for the literal.\n   * @param {String} [options.datatype] The datatype for the literal. This should be a safe CURIE; in other words, it can be in the format <code><var>uri</var></code> or <code>[<var>curie</var>]</code>. Must not be specified if options.lang is also specified.\n   * @param {String} [options.lang] The language for the literal. Must not be specified if options.datatype is also specified.\n   * @param {Object} [options.namespaces] An object representing a set of namespace bindings used when interpreting a CURIE in the datatype.\n   * @param {String|jQuery.uri} [options.base] The base URI used to interpret a relative URI in the datatype.\n   * @returns {jQuery.rdf.literal} The newly-created literal.\n   * @throws {String} Errors if the string is not in a recognised format or if both options.datatype and options.lang are specified.\n   * @example trueLiteral = $.rdf.literal(true);\n   * @example numericLiteral = $.rdf.literal(5);\n   * @example dateLiteral = $.rdf.literal('\"2009-07-13\"^^xsd:date', { namespaces: ns });\n   * @see jQuery.rdf.pattern\n   * @see jQuery.rdf.triple\n   * @see jQuery.rdf.resource\n   * @see jQuery.rdf.blank\n   */\n  $.rdf.literal = function (value, options) {\n    var literal;\n    if (memLiteral[value]) {\n      return memLiteral[value];\n    }\n    literal = new $.rdf.literal.fn.init(value, options);\n    if (memLiteral[literal]) {\n      return memLiteral[literal];\n    } else {\n      memLiteral[literal] = literal;\n      return literal;\n    }\n  };\n\n  $.rdf.literal.fn = $.rdf.literal.prototype = {\n    /**\n     * Always fixed to 'literal' for literals.\n     * @type String\n     */\n    type: 'literal',\n    /**\n     * The value of the literal as a string.\n     * @type String\n     */\n    value: undefined,\n    /**\n     * The language of the literal, if it has one; otherwise undefined.\n     * @type String\n     */\n    lang: undefined,\n    /**\n     * The datatype of the literal, if it has one; otherwise undefined.\n     * @type jQuery.uri\n     */\n    datatype: undefined,\n\n    init: function (value, options) {\n      var\n        m, datatype,\n        opts = $.extend({}, $.rdf.literal.defaults, options);\n      datatype = $.safeCurie(opts.datatype, { namespaces: opts.namespaces });\n      if (opts.lang !== undefined && opts.datatype !== undefined && datatype.toString() !== (rdfNs + 'XMLLiteral')) {\n        throw \"Malformed Literal: Cannot define both a language and a datatype for a literal (\" + value + \")\";\n      }\n      if (opts.datatype !== undefined) {\n        datatype = $.safeCurie(opts.datatype, { namespaces: opts.namespaces });\n        $.extend(this, $.typedValue(value.toString(), datatype));\n        if (datatype.toString() === rdfNs + 'XMLLiteral') {\n          this.lang = opts.lang;\n        }\n      } else if (opts.lang !== undefined) {\n        this.value = value.toString();\n        this.lang = opts.lang;\n      } else if (typeof value === 'boolean') {\n        $.extend(this, $.typedValue(value.toString(), xsdNs + 'boolean'));\n      } else if (typeof value === 'number') {\n        $.extend(this, $.typedValue(value.toString(), xsdNs + 'double'));\n      } else if (value === 'true' || value === 'false') {\n        $.extend(this, $.typedValue(value, xsdNs + 'boolean'));\n      } else if ($.typedValue.valid(value, xsdNs + 'integer')) {\n        $.extend(this, $.typedValue(value, xsdNs + 'integer'));\n      } else if ($.typedValue.valid(value, xsdNs + 'decimal')) {\n        $.extend(this, $.typedValue(value, xsdNs + 'decimal'));\n      } else if ($.typedValue.valid(value, xsdNs + 'double') &&\n                 !/^\\s*([\\-\\+]?INF|NaN)\\s*$/.test(value)) {  // INF, -INF and NaN aren't valid literals in Turtle\n        $.extend(this, $.typedValue(value, xsdNs + 'double'));\n      } else if (true === opts.plain) {\n        // Option to not use turtle syntax for a plain literal w/o datatype or lang\n        this.value = String(value);\n      } else {\n        m = literalRegex.exec(value);\n        if (m !== null) {\n          this.value = (m[2] || m[4]).replace(/\\\\\"/g, '\"').replace(/\\\\n/g, '\\n').replace(/\\\\t/g, '\\t').replace(/\\\\r/g, '\\r');\n          if (m[9]) {\n            datatype = $.rdf.resource(m[9], opts);\n            $.extend(this, $.typedValue(this.value, datatype.value));\n          } else if (m[7]) {\n            this.lang = m[7];\n          }\n        } else {\n          throw \"Malformed Literal: Couldn't recognise the value \" + value;\n        }\n      }\n      return this;\n    }, // end init\n\n    /**\n     * Returns a <a href=\"http://n2.talis.com/wiki/RDF_JSON_Specification\">RDF/JSON</a> representation of this blank node.\n     * @returns {Object}\n     */\n    dump: function () {\n      var e = {\n        type: 'literal',\n        value: this.value.toString()\n      };\n      if (this.lang !== undefined) {\n        e.lang = this.lang;\n      } else if (this.datatype !== undefined) {\n        e.datatype = this.datatype.toString();\n      }\n      return e;\n    },\n    \n    /**\n     * Returns a string representing this resource in <a href=\"http://www.w3.org/TeamSubmission/turtle/#literal\">Turtle format</a>.\n     * @returns {String}\n     */\n    toString: function () {\n      var val = '\"' + this.value + '\"';\n      if (this.lang !== undefined) {\n        val += '@' + this.lang;\n      } else if (this.datatype !== undefined) {\n        val += '^^<' + this.datatype + '>';\n      }\n      return val;\n    }\n  };\n\n  $.rdf.literal.fn.init.prototype = $.rdf.literal.fn;\n\n  $.rdf.literal.defaults = {\n    base: $.uri.base(),\n    namespaces: {},\n    datatype: undefined,\n    lang: undefined,\n    plain: false\n  };\n\n})(jQuery);\n/*\n * jQuery RDF @VERSION\n *\n * Copyright (c) 2008,2009 Jeni Tennison\n * Licensed under the MIT (MIT-LICENSE.txt)\n *\n * Depends:\n *  jquery.uri.js\n *  jquery.xmlns.js\n *  jquery.datatype.js\n *  jquery.curie.js\n *  jquery.rdf.js\n *  jquery.json.js\n */\n/**\n * @fileOverview jQuery RDF/JSON parser\n * @author <a href=\"mailto:jeni@jenitennison.com\">Jeni Tennison</a>\n * @copyright (c) 2008,2009 Jeni Tennison\n * @license MIT license (MIT-LICENSE.txt)\n * @version 1.0\n */\n/**\n * @exports $ as jQuery\n */\n/**\n * @ignore\n */\n(function ($) {\n\n  $.rdf.parsers['application/json'] = {\n    parse: $.secureEvalJSON,\n    serialize: $.toJSON,\n    triples: function (data) {\n      var s, subject, p, property, o, object, i, opts, triples = [];\n      for (s in data) {\n        subject = (s.substring(0, 2) === '_:') ? $.rdf.blank(s) : $.rdf.resource('<' + s + '>');\n        for (p in data[s]) {\n          property = $.rdf.resource('<' + p + '>');\n          for (i = 0; i < data[s][p].length; i += 1) {\n            o = data[s][p][i];\n            if (o.type === 'uri') {\n              object = $.rdf.resource('<' + o.value + '>');\n            } else if (o.type === 'bnode') {\n              object = $.rdf.blank(o.value);\n            } else {\n              // o.type === 'literal'\n              if (o.datatype !== undefined) {\n                object = $.rdf.literal(o.value, { datatype: o.datatype });\n              } else {\n                opts = {};\n                if (o.lang !== undefined) {\n                  opts.lang = o.lang;\n                }\n                object = $.rdf.literal('\"' + o.value + '\"', opts);\n              }\n            }\n            triples.push($.rdf.triple(subject, property, object));\n          }\n        }\n      }\n      return triples;\n    },\n    dump: function (triples) {\n      var e = {},\n        i, t, s, p;\n      for (i = 0; i < triples.length; i += 1) {\n        t = triples[i];\n        s = t.subject.value.toString();\n        p = t.property.value.toString();\n        if (e[s] === undefined) {\n          e[s] = {};\n        }\n        if (e[s][p] === undefined) {\n          e[s][p] = [];\n        }\n        e[s][p].push(t.object.dump());\n      }\n      return e;\n    }\n  };\n\n})(jQuery);\n\n/*\n * jQuery RDF @VERSION\n *\n * Copyright (c) 2008,2009 Jeni Tennison\n * Licensed under the MIT (MIT-LICENSE.txt)\n *\n * Depends:\n *  jquery.uri.js\n *  jquery.xmlns.js\n *  jquery.datatype.js\n *  jquery.curie.js\n *  jquery.rdf.js\n *  jquery.rdf.json.js\n *  jquery.rdf.xml.js\n */\n/**\n * @fileOverview jQuery RDF/XML parser\n * @author <a href=\"mailto:jeni@jenitennison.com\">Jeni Tennison</a>\n * @copyright (c) 2008,2009 Jeni Tennison\n * @license MIT license (MIT-LICENSE.txt)\n * @version 1.0\n */\n/**\n * @exports $ as jQuery\n */\n/**\n * @ignore\n */\n(function ($) {\n  var\n    rdfNs = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n  \n    addAttribute = function (parent, namespace, name, value) {\n      var doc = parent.ownerDocument,\n        a;\n      if (namespace !== undefined && namespace !== null) {\n        if (doc.createAttributeNS) {\n          a = doc.createAttributeNS(namespace, name);\n          a.nodeValue = value;\n          parent.attributes.setNamedItemNS(a);\n        } else {\n          a = doc.createNode(2, name, namespace);\n          a.nodeValue = value;\n          parent.attributes.setNamedItem(a);\n        }\n      } else {\n        a = doc.createAttribute(name);\n        a.nodeValue = value;\n        parent.attributes.setNamedItem(a);\n      }\n      return parent;\n    },\n\n    createXmlnsAtt = function (parent, namespace, prefix) {\n      if (namespace === 'http://www.w3.org/XML/1998/namespace' || namespace === 'http://www.w3.org/2000/xmlns/') {\n      } else if (prefix) {\n        addAttribute(parent, 'http://www.w3.org/2000/xmlns/', 'xmlns:' + prefix, namespace);\n      } else {\n        addAttribute(parent, undefined, 'xmlns', namespace);\n      }\n      return parent;\n    },\n\n    createDocument = function (namespace, name) {\n      var doc, xmlns = '', prefix, addAttribute = false;\n      if (namespace !== undefined && namespace !== null) {\n        if (/:/.test(name)) {\n          prefix = /([^:]+):/.exec(name)[1];\n        }\n        addAttribute = true;\n      }\n      if (document.implementation &&\n          document.implementation.createDocument) {\n        doc = document.implementation.createDocument(namespace, name, null);\n        if (addAttribute) {\n          createXmlnsAtt(doc.documentElement, namespace, prefix);\n        }\n        return doc;\n      } else {\n        doc = new ActiveXObject(\"Microsoft.XMLDOM\");\n        doc.async = \"false\";\n        if (prefix === undefined) {\n          xmlns = ' xmlns=\"' + namespace + '\"';\n        } else {\n          xmlns = ' xmlns:' + prefix + '=\"' + namespace + '\"';\n        }\n        doc.loadXML('<' + name + xmlns + '/>');\n        return doc;\n      }\n    },\n\n    appendElement = function (parent, namespace, name, indent) {\n      var doc = parent.ownerDocument,\n        e;\n      if (namespace !== undefined && namespace !== null) {\n        e = doc.createElementNS ? doc.createElementNS(namespace, name) : doc.createNode(1, name, namespace);\n      } else {\n        e = doc.createElement(name);\n      }\n      if (indent !== -1) {\n        appendText(parent, '\\n');\n        if (indent === 0) {\n          appendText(parent, '\\n');\n        } else {\n          appendText(parent, '  ');\n        }\n      }\n      parent.appendChild(e);\n      return e;\n    },\n\n    appendText = function (parent, text) {\n      var doc = parent.ownerDocument,\n        t;\n      t = doc.createTextNode(text);\n      parent.appendChild(t);\n      return parent;\n    },\n\n    appendXML = function (parent, xml) {\n      var parser, doc, i, child;\n      try {\n        doc = new ActiveXObject('Microsoft.XMLDOM');\n        doc.async = \"false\";\n        doc.loadXML('<temp>' + xml + '</temp>');\n      } catch(e) {\n        parser = new DOMParser();\n        doc = parser.parseFromString('<temp>' + xml + '</temp>', 'text/xml');\n      }\n      for (i = 0; i < doc.documentElement.childNodes.length; i += 1) {\n        parent.appendChild(doc.documentElement.childNodes[i].cloneNode(true));\n      }\n      return parent;\n    },\n\n    createRdfXml = function (triples, options) {\n      var doc = createDocument(rdfNs, 'rdf:RDF'),\n        dump = $.rdf.parsers['application/json'].dump(triples),\n        namespaces = options.namespaces || {},\n        indent = options.indent || false,\n        n, s, se, p, pe, i, v,\n        m, local, ns, prefix;\n      for (n in namespaces) {\n        createXmlnsAtt(doc.documentElement, namespaces[n], n);\n      }\n      for (s in dump) {\n        if (dump[s][$.rdf.type.value] !== undefined) {\n          m = /(.+[#\\/])([^#\\/]+)/.exec(dump[s][$.rdf.type.value][0].value);\n          ns = m[1];\n          local = m[2];\n          for (n in namespaces) {\n            if (namespaces[n].toString() === ns) {\n              prefix = n;\n              break;\n            }\n          }\n          se = appendElement(doc.documentElement, ns, prefix + ':' + local, indent ? 0 : -1);\n        } else {\n          se = appendElement(doc.documentElement, rdfNs, 'rdf:Description', indent ? 0 : -1);\n        }\n        if (/^_:/.test(s)) {\n          addAttribute(se, rdfNs, 'rdf:nodeID', s.substring(2));\n        } else {\n          addAttribute(se, rdfNs, 'rdf:about', s);\n        }\n        for (p in dump[s]) {\n          if (p !== $.rdf.type.value.toString() || dump[s][p].length > 1) {\n            m = /(.+[#\\/])([^#\\/]+)/.exec(p);\n            ns = m[1];\n            local = m[2];\n            for (n in namespaces) {\n              if (namespaces[n].toString() === ns) {\n                prefix = n;\n                break;\n              }\n            }\n            for (i = (p === $.rdf.type.value.toString() ? 1 : 0); i < dump[s][p].length; i += 1) {\n              v = dump[s][p][i];\n              pe = appendElement(se, ns, prefix + ':' + local, indent ? 1 : -1);\n              if (v.type === 'uri') {\n                addAttribute(pe, rdfNs, 'rdf:resource', v.value);\n              } else if (v.type === 'literal') {\n                if (v.datatype !== undefined) {\n                  if (v.datatype === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral') {\n                    addAttribute(pe, rdfNs, 'rdf:parseType', 'Literal');\n                    if (indent) {\n                      appendText(pe, '\\n    ');\n                    }\n                    appendXML(pe, v.value);\n                    if (indent) {\n                      appendText(pe, '\\n  ');\n                    }\n                  } else {\n                    addAttribute(pe, rdfNs, 'rdf:datatype', v.datatype);\n                    appendText(pe, v.value);\n                  }\n                } else if (v.lang !== undefined) {\n                  addAttribute(pe, 'http://www.w3.org/XML/1998/namespace', 'xml:lang', v.lang);\n                  appendText(pe, v.value);\n                } else {\n                  appendText(pe, v.value);\n                }\n              } else {\n                // blank node\n                addAttribute(pe, rdfNs, 'rdf:nodeID', v.value.substring(2));\n              }\n            }\n            if (indent) {\n              appendText(se, '\\n');\n            }\n          }\n        }\n      }\n      if (indent) {\n        appendText(doc.documentElement, '\\n\\n');\n      }\n      return doc;\n    },\n\n    getDefaultNamespacePrefix = function (namespaceUri) {\n      switch (namespaceUri) {\n        case 'http://www.w3.org/1999/02/22-rdf-syntax-ns':\n          return 'rdf';\n        case 'http://www.w3.org/XML/1998/namespace':\n          return 'xml';\n        case 'http://www.w3.org/2000/xmlns/':\n          return 'xmlns';\n        default:\n          throw ('No default prefix mapped for namespace ' + namespaceUri);\n      }\n    },\n\n    hasAttributeNS  = function(elem, namespace, name){\n      var basename;\n      if (elem.hasAttributeNS) {\n        return elem.hasAttributeNS(namespace, name);\n      } else {\n        try {\n          basename = /:/.test(name) ? /:(.+)$/.exec(name)[1] : name;\n          return elem.attributes.getQualifiedItem(basename, namespace) !== null;\n        } catch (e) {\n          return elem.getAttribute(getDefaultNamespacePrefix(namespace) + ':' + name) !== null;\n        }\n      }\n    },\n\n    getAttributeNS = function(elem, namespace, name){\n      var basename;\n      if (elem.getAttributeNS) {\n        return elem.getAttributeNS(namespace, name);\n      } else {\n        try {\n          basename = /:/.test(name) ? /:(.+)$/.exec(name)[1] : name;\n          return elem.attributes.getQualifiedItem(basename, namespace).nodeValue;\n        } catch (e) {\n          return elem.getAttribute(getDefaultNamespacePrefix(namespace) + ':' + name);\n        }\n      }\n    },\n\n    getLocalName = function(elem){\n      return elem.localName || elem.baseName;\n    },\n\n    parseRdfXmlSubject = function (elem, base) {\n      var s, subject;\n      if (hasAttributeNS(elem, rdfNs, 'about')) {\n        s = getAttributeNS(elem, rdfNs, 'about');\n        subject = $.rdf.resource('<' + s + '>', { base: base });\n      } else if (hasAttributeNS(elem, rdfNs, 'ID')) {\n        s = getAttributeNS(elem, rdfNs, 'ID');\n        subject = $.rdf.resource('<#' + s + '>', { base: base });\n      } else if (hasAttributeNS(elem, rdfNs, 'nodeID')) {\n        s = getAttributeNS(elem, rdfNs, 'nodeID');\n        subject = $.rdf.blank('_:' + s);\n      } else {\n        subject = $.rdf.blank('[]');\n      }\n      return subject;\n    },\n\n    parseRdfXmlDescription = function (elem, isDescription, base, lang) {\n      var subject, p, property, o, object, reified, lang, i, j, li = 1,\n        collection1, collection2, collectionItem, collectionItems = [],\n        parseType, serializer, literalOpts = {}, oTriples, triples = [];\n      lang = getAttributeNS(elem, 'http://www.w3.org/XML/1998/namespace', 'lang') || lang;\n      base = getAttributeNS(elem, 'http://www.w3.org/XML/1998/namespace', 'base') || base;\n      if (lang !== null && lang !== undefined && lang !== '') {\n        literalOpts = { lang: lang };\n      }\n      subject = parseRdfXmlSubject(elem, base);\n      if (isDescription && (elem.namespaceURI !== rdfNs || getLocalName(elem) !== 'Description')) {\n        property = $.rdf.type;\n        object = $.rdf.resource('<' + elem.namespaceURI + getLocalName(elem) + '>');\n        triples.push($.rdf.triple(subject, property, object));\n      }\n      for (i = 0; i < elem.attributes.length; i += 1) {\n        p = elem.attributes.item(i);\n        if (p.namespaceURI !== undefined &&\n            p.namespaceURI !== 'http://www.w3.org/2000/xmlns/' &&\n            p.namespaceURI !== 'http://www.w3.org/XML/1998/namespace' &&\n            p.prefix !== 'xmlns' &&\n            p.prefix !== 'xml') {\n          if (p.namespaceURI !== rdfNs) {\n            property = $.rdf.resource('<' + p.namespaceURI + getLocalName(p) + '>');\n            object = $.rdf.literal(literalOpts.lang ? p.nodeValue : '\"' + p.nodeValue.replace(/\"/g, '\\\\\"') + '\"', literalOpts);\n            triples.push($.rdf.triple(subject, property, object));\n          } else if (getLocalName(p) === 'type') {\n            property = $.rdf.type;\n            object = $.rdf.resource('<' + p.nodeValue + '>', { base: base });\n            triples.push($.rdf.triple(subject, property, object));\n          }\n        }\n      }\n      var parentLang = lang;\n      for (i = 0; i < elem.childNodes.length; i += 1) {\n        p = elem.childNodes[i];\n        if (p.nodeType === 1) {\n          if (p.namespaceURI === rdfNs && getLocalName(p) === 'li') {\n            property = $.rdf.resource('<' + rdfNs + '_' + li + '>');\n            li += 1;\n          } else {\n            property = $.rdf.resource('<' + p.namespaceURI + getLocalName(p) + '>');\n          }\n          lang = getAttributeNS(p, 'http://www.w3.org/XML/1998/namespace', 'lang') || parentLang;\n           if (lang !== null && lang !== undefined && lang !== '') {\n             literalOpts = { lang: lang };\n          } else {\n            literalOpts = {};\n          }\n          if (hasAttributeNS(p, rdfNs, 'resource')) {\n            o = getAttributeNS(p, rdfNs, 'resource');\n            object = $.rdf.resource('<' + o + '>', { base: base });\n          } else if (hasAttributeNS(p, rdfNs, 'nodeID')) {\n            o = getAttributeNS(p, rdfNs, 'nodeID');\n            object = $.rdf.blank('_:' + o);\n          } else if (hasAttributeNS(p, rdfNs, 'parseType')) {\n            parseType = getAttributeNS(p, rdfNs, 'parseType');\n            if (parseType === 'Literal') {\n              try {\n                serializer = new XMLSerializer();\n                o = serializer.serializeToString(p.getElementsByTagName('*')[0]);\n              } catch (e) {\n                o = \"\";\n                for (j = 0; j < p.childNodes.length; j += 1) {\n                  o += p.childNodes[j].xml;\n                }\n              }\n              object = $.rdf.literal(o, { datatype: rdfNs + 'XMLLiteral' });\n            } else if (parseType === 'Resource') {\n              oTriples = parseRdfXmlDescription(p, false, base, lang);\n              if (oTriples.length > 0) {\n                object = oTriples[oTriples.length - 1].subject;\n                triples = triples.concat(oTriples);\n              } else {\n                object = $.rdf.blank('[]');\n              }\n            } else if (parseType === 'Collection') {\n              if (p.getElementsByTagName('*').length > 0) {\n                for (j = 0; j < p.childNodes.length; j += 1) {\n                  o = p.childNodes[j];\n                  if (o.nodeType === 1) {\n                    collectionItems.push(o);\n                  }\n                }\n                collection1 = $.rdf.blank('[]');\n                object = collection1;\n                for (j = 0; j < collectionItems.length; j += 1) {\n                  o = collectionItems[j];\n                  oTriples = parseRdfXmlDescription(o, true, base, lang);\n                  if (oTriples.length > 0) {\n                    collectionItem = oTriples[oTriples.length - 1].subject;\n                    triples = triples.concat(oTriples);\n                  } else {\n                    collectionItem = parseRdfXmlSubject(o);\n                  }\n                  triples.push($.rdf.triple(collection1, $.rdf.first, collectionItem));\n                  if (j === collectionItems.length - 1) {\n                    triples.push($.rdf.triple(collection1, $.rdf.rest, $.rdf.nil));\n                  } else {\n                    collection2 = $.rdf.blank('[]');\n                    triples.push($.rdf.triple(collection1, $.rdf.rest, collection2));\n                    collection1 = collection2;\n                  }\n                }\n              } else {\n                object = $.rdf.nil;\n              }\n            }\n          } else if (hasAttributeNS(p, rdfNs, 'datatype')) {\n            o = p.childNodes[0] ? p.childNodes[0].nodeValue : \"\";\n            object = $.rdf.literal(o, { datatype: getAttributeNS(p, rdfNs, 'datatype') });\n          } else if (p.getElementsByTagName('*').length > 0) {\n            for (j = 0; j < p.childNodes.length; j += 1) {\n              o = p.childNodes[j];\n              if (o.nodeType === 1) {\n                oTriples = parseRdfXmlDescription(o, true, base, lang);\n                if (oTriples.length > 0) {\n                  object = oTriples[oTriples.length - 1].subject;\n                  triples = triples.concat(oTriples);\n                } else {\n                  object = parseRdfXmlSubject(o);\n                }\n              }\n            }\n          } else if (p.childNodes.length > 0) {\n            o = p.childNodes[0].nodeValue;\n            object = $.rdf.literal(literalOpts.lang ? o : '\"' + o.replace(/\"/g, '\\\\\"') + '\"', literalOpts);\n          } else {\n            oTriples = parseRdfXmlDescription(p, false, base, lang);\n            if (oTriples.length > 0) {\n              object = oTriples[oTriples.length - 1].subject;\n              triples = triples.concat(oTriples);\n            } else {\n              object = $.rdf.blank('[]');\n            }\n          }\n          triples.push($.rdf.triple(subject, property, object));\n          if (hasAttributeNS(p, rdfNs, 'ID')) {\n            reified = $.rdf.resource('<#' + getAttributeNS(p, rdfNs, 'ID') + '>', { base: base });\n            triples.push($.rdf.triple(reified, $.rdf.subject, subject));\n            triples.push($.rdf.triple(reified, $.rdf.property, property));\n            triples.push($.rdf.triple(reified, $.rdf.object, object));\n          }\n        }\n      }\n      return triples;\n    },\n\n    parseRdfXml = function (doc) {\n      var i, lang, d, triples = [];\n      if (doc.documentElement.namespaceURI === rdfNs && getLocalName(doc.documentElement) === 'RDF') {\n        lang = getAttributeNS(doc.documentElement, 'http://www.w3.org/XML/1998/namespace', 'lang');\n        base = getAttributeNS(doc.documentElement, 'http://www.w3.org/XML/1998/namespace', 'base') || $.uri.base();\n        triples = $.map(doc.documentElement.childNodes, function (d) {\n          if (d.nodeType === 1) {\n            return parseRdfXmlDescription(d, true, base, lang);\n          } else {\n            return null;\n          }\n        });\n        /*\n        for (i = 0; i < doc.documentElement.childNodes.length; i += 1) {\n          d = doc.documentElement.childNodes[i];\n          if (d.nodeType === 1) {\n            triples = triples.concat(parseRdfXmlDescription(d, true, base, lang));\n          }\n        }\n        */\n      } else {\n        triples = parseRdfXmlDescription(doc.documentElement, true);\n      }\n      return triples;\n    };\n\n  $.rdf.parsers['application/rdf+xml'] = {\n    parse: function (data) {\n      var doc;\n      try {\n        doc = new ActiveXObject(\"Microsoft.XMLDOM\");\n        doc.async = \"false\";\n        doc.loadXML(data);\n      } catch(e) {\n        var parser = new DOMParser();\n        doc = parser.parseFromString(data, 'text/xml');\n      }\n      return doc;\n    },\n    serialize: function (data) {\n      if (data.xml) {\n        return data.xml.replace(/\\s+$/,'');\n      } else {\n        serializer = new XMLSerializer();\n        return serializer.serializeToString(data);\n      }\n    },\n    triples: parseRdfXml,\n    dump: createRdfXml\n  };\n\n})(jQuery);\n/*\n * jQuery RDFa @VERSION\n *\n * Copyright (c) 2008,2009 Jeni Tennison\n * Licensed under the MIT (MIT-LICENSE.txt)\n *\n * Depends:\n *  jquery.uri.js\n *  jquery.xmlns.js\n *  jquery.curie.js\n *  jquery.datatype.js\n *  jquery.rdf.js\n */\n/**\n * @fileOverview jQuery RDFa processing\n * @author <a href=\"mailto:jeni@jenitennison.com\">Jeni Tennison</a>\n * @copyright (c) 2008,2009 Jeni Tennison\n * @license MIT license (MIT-LICENSE.txt)\n * @version 1.0\n * @requires jquery.uri.js\n * @requires jquery.xmlns.js\n * @requires jquery.curie.js\n * @requires jquery.datatype.js\n * @requires jquery.rdf.js\n */\n(function ($) {\n\n  var\n    ns = {\n      rdf: \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n      xsd: \"http://www.w3.org/2001/XMLSchema#\"\n    },\n\n    rdfXMLLiteral = ns.rdf + 'XMLLiteral',\n\n    rdfaCurieDefaults = $.fn.curie.defaults,\n\n    attRegex = /\\s([^ =]+)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^ >]+))/g,\n\n    docResource = $.rdf.resource('<>'),\n\n    parseEntities = function (string) {\n      var result = \"\", m, entity;\n      if (!/&/.test(string)) {\n         return string;\n      }\n      while (string.length > 0) {\n        m = /([^&]*)(&([^;]+);)(.*)/g.exec(string);\n        if (m === null) {\n          result += string;\n          break;\n        }\n        result += m[1];\n        entity = m[3];\n        string = m[4];\n        if (entity.charAt(0) === '#') {\n          if (entity.charAt(1) === 'x') {\n              result += String.fromCharCode(parseInt(entity.substring(2), 16));\n          } else {\n              result += String.fromCharCode(parseInt(entity.substring(1), 10));\n          }\n        } else {\n          switch(entity) {\n            case 'amp':\n              result += '&';\n              break;\n            case 'nbsp':\n              result += String.fromCharCode(160);\n              break;\n            case 'quot':\n              result += '\"';\n              break;\n            case 'apos':\n              result += \"'\";\n              break;\n            default:\n              result += '&' + entity + ';';\n          }\n        }\n      }\n      return result;\n    },\n\n    getAttributes = function (elem) {\n      var i, e, a, tag, name, value, attMap, prefix,\n        ns = {}, atts = {};\n      e = elem[0];\n      ns[':length'] = 0;\n      if (e.attributes && e.attributes.getNamedItemNS) {\n        attMap = e.attributes;\n        for (i = 0; i < attMap.length; i += 1) {\n          a = attMap[i];\n          if (/^xmlns(:(.+))?$/.test(a.nodeName) && a.nodeValue !== '') {\n            prefix = /^xmlns(:(.+))?$/.exec(a.nodeName)[2] || '';\n            ns[prefix] = $.uri(a.nodeValue);\n            ns[':length'] += 1;\n          } else if (/rel|rev|lang|xml:lang/.test(a.nodeName)) {\n            atts[a.nodeName] = a.nodeValue === '' ? undefined : a.nodeValue;\n          } else if (/about|href|src|resource|property|typeof|content|datatype/.test(a.nodeName)) {\n            atts[a.nodeName] = a.nodeValue === null ? undefined : a.nodeValue;\n          }\n        }\n      } else {\n        tag = /<[^>]+>/.exec(e.outerHTML);\n        a = attRegex.exec(tag);\n        while (a !== null) {\n          name = a[1];\n          value = a[2] || a[3] || a[4];\n          if (/^xmlns/.test(name) && name !== 'xmlns:' && value !== '') {\n            prefix = /^xmlns(:(.+))?$/.exec(name)[2] || '';\n            ns[prefix] = $.uri(value);\n            ns[':length'] += 1;\n          } else if (/about|href|src|resource|property|typeof|content|datatype|rel|rev|lang|xml:lang/.test(name)) {\n            atts[name] = parseEntities(value);\n          }\n          a = attRegex.exec(tag);\n        }\n        attRegex.lastIndex = 0;\n      }\n      return { atts: atts, namespaces: ns };\n    },\n\n    getAttribute = function (elem, attr) {\n      var val = elem[0].getAttribute(attr);\n      if (attr === 'rev' || attr === 'rel' || attr === 'lang' || attr === 'xml:lang') {\n        val = val === '' ? undefined : val;\n      }\n      return val === null ? undefined : val;\n    },\n\n    resourceFromUri = function (uri) {\n      return $.rdf.resource(uri);\n    },\n\n    resourceFromCurie = function (curie, elem, options) {\n      if (curie.substring(0, 2) === '_:') {\n        return $.rdf.blank(curie);\n      } else {\n        try {\n          return resourceFromUri($.curie(curie, options));\n        } catch (e) {\n          return undefined;\n        }\n      }\n    },\n\n    resourceFromSafeCurie = function (safeCurie, elem, options) {\n      var m = /^\\[([^\\]]+)\\]$/.exec(safeCurie),\n        base = options.base || elem.base();\n      return m ? resourceFromCurie(m[1], elem, options) : resourceFromUri($.uri(safeCurie, base));\n    },\n\n    resourcesFromCuries = function (curies, elem, options) {\n      var i, resource, resources = [];\n      curies = curies && curies.split ? curies.split(/[ \\t\\n\\r\\x0C]+/g) : [];\n      for (i = 0; i < curies.length; i += 1) {\n        if (curies[i] !== '') {\n          resource = resourceFromCurie(curies[i], elem, options);\n          if (resource !== undefined) {\n            resources.push(resource);\n          }\n        }\n      }\n      return resources;\n    },\n\n    removeCurie = function (curies, resource, options) {\n      var i, r, newCuries = [];\n      resource = resource.type === 'uri' ? resource : $.rdf.resource(resource, options);\n      curies = curies && curies.split ? curies.split(/\\s+/) : [];\n      for (i = 0; i < curies.length; i += 1) {\n        if (curies[i] !== '') {\n          r = resourceFromCurie(curies[i], null, options);\n          if (r !== resource) {\n            newCuries.push(curies[i]);\n          }\n        }\n      }\n      return newCuries.reverse().join(' ');\n    },\n\n    getObjectResource = function (elem, context, relation) {\n      var r, resource, atts, curieOptions;\n      context = context || {};\n      atts = context.atts || getAttributes(elem).atts;\n      r = relation === undefined ? atts.rel !== undefined || atts.rev !== undefined : relation;\n      resource = atts.resource;\n      resource = resource === undefined ? atts.href : resource;\n      if (resource === undefined) {\n        resource = r ? $.rdf.blank('[]') : resource;\n      } else {\n        curieOptions = context.curieOptions || $.extend({}, rdfaCurieDefaults, { namespaces: elem.xmlns() });\n        resource = resourceFromSafeCurie(resource, elem, curieOptions);\n      }\n      return resource;\n    },\n\n    getSubject = function (elem, context, relation) {\n      var r, atts, curieOptions, subject, skip = false;\n      context = context || {};\n      atts = context.atts || getAttributes(elem).atts;\n      curieOptions = context.curieOptions || $.extend({}, rdfaCurieDefaults, { namespaces: elem.xmlns(), base: elem.base() });\n      r = relation === undefined ? atts.rel !== undefined || atts.rev !== undefined : relation;\n      if (atts.about !== undefined) {\n        subject = resourceFromSafeCurie(atts.about, elem, curieOptions);\n      }\n      if (subject === undefined && atts.src !== undefined) {\n        subject = resourceFromSafeCurie(atts.src, elem, curieOptions);\n      }\n      if (!r && subject === undefined && atts.resource !== undefined) {\n        subject = resourceFromSafeCurie(atts.resource, elem, curieOptions);\n      }\n      if (!r && subject === undefined && atts.href !== undefined) {\n        subject = resourceFromSafeCurie(atts.href, elem, curieOptions);\n      }\n      if (subject === undefined) {\n        if (/head|body/i.test(elem[0].nodeName)) {\n          subject = docResource;\n        } else if (atts['typeof'] !== undefined) {\n          subject = $.rdf.blank('[]');\n        } else if (elem[0].parentNode.nodeType === 1) {\n          subject = context.object || getObjectResource(elem.parent()) || getSubject(elem.parent()).subject;\n          skip = !r && atts.property === undefined;\n        } else {\n          subject = docResource;\n        }\n      }\n      return { subject: subject, skip: skip };\n    },\n\n    getLang = function (elem, context) {\n      var lang;\n      context = context || {};\n      if (context.atts) {\n        lang = context.atts.lang;\n        lang = lang || context.atts['xml:lang'];\n      } else {\n        lang = elem[0].getAttribute('lang');\n        lang = (lang === null || lang === '') ? elem[0].getAttribute('xml:lang') : lang;\n        lang = (lang === null || lang === '') ? undefined : lang;\n      }\n      if (lang === undefined) {\n        if (context.lang) {\n          lang = context.lang;\n        } else {\n          if (elem[0].parentNode.nodeType === 1) {\n            lang = getLang(elem.parent());\n          }\n        }\n      }\n      return lang;\n    },\n\n    entity = function (c) {\n      switch (c) {\n      case '<':\n        return '&lt;';\n      case '\"':\n        return '&quot;';\n      case '&':\n        return '&amp;';\n      }\n    },\n\n    serialize = function (elem, ignoreNs) {\n      var i, string = '', atts, a, name, ns, tag;\n      elem.contents().each(function () {\n        var j = $(this),\n          e = j[0];\n        if (e.nodeType === 1) { // tests whether the node is an element\n          name = e.nodeName.toLowerCase();\n          string += '<' + name;\n          if (e.outerHTML) {\n            tag = /<[^>]+>/.exec(e.outerHTML);\n            a = attRegex.exec(tag);\n            while (a !== null) {\n              if (!/^jQuery/.test(a[1])) {\n                string += ' ' + a[1] + '=';\n                string += a[2] ? a[3] : '\"' + a[1] + '\"';\n              }\n              a = attRegex.exec(tag);\n            }\n            attRegex.lastIndex = 0;\n          } else {\n            atts = e.attributes;\n            for (i = 0; i < atts.length; i += 1) {\n              a = atts.item(i);\n              string += ' ' + a.nodeName + '=\"';\n              string += a.nodeValue.replace(/[<\"&]/g, entity);\n              string += '\"';\n            }\n          }\n          if (!ignoreNs) {\n            ns = j.xmlns('');\n            if (ns !== undefined && j.attr('xmlns') === undefined) {\n              string += ' xmlns=\"' + ns + '\"';\n            }\n          }\n          string += '>';\n          string += serialize(j, true);\n          string += '</' + name + '>';\n        } else if (e.nodeType === 8) { // tests whether the node is a comment\n          string += '<!--';\n          string += e.nodeValue;\n          string += '-->';\n        } else {\n          string += e.nodeValue;\n        }\n      });\n      return string;\n    },\n\n    rdfa = function (context) {\n      var i, subject, resource, lang, datatype, content,\n        types, object, triple, parent,\n        properties, rels, revs,\n        forward, backward,\n        triples = [],\n        attsAndNs, atts, namespaces, ns,\n        children = this.children();\n      context = context || {};\n      forward = context.forward || [];\n      backward = context.backward || [];\n      attsAndNs = getAttributes(this);\n      atts = attsAndNs.atts;\n      context.atts = atts;\n      namespaces = context.namespaces || this.xmlns();\n      if (attsAndNs.namespaces[':length'] > 0) {\n        namespaces = $.extend({}, namespaces);\n        for (ns in attsAndNs.namespaces) {\n          if (ns !== ':length') {\n            namespaces[ns] = attsAndNs.namespaces[ns];\n          }\n        }\n      }\n      context.curieOptions = $.extend({}, rdfaCurieDefaults, { namespaces: namespaces, base: this.base() });\n      subject = getSubject(this, context);\n      lang = getLang(this, context);\n      if (subject.skip) {\n        rels = context.forward;\n        revs = context.backward;\n        subject = context.subject;\n        resource = context.object;\n      } else {\n        subject = subject.subject;\n        if (forward.length > 0 || backward.length > 0) {\n          parent = context.subject || getSubject(this.parent()).subject;\n          for (i = 0; i < forward.length; i += 1) {\n            triple = $.rdf.triple(parent, forward[i], subject, { source: this[0] });\n            triples.push(triple);\n          }\n          for (i = 0; i < backward.length; i += 1) {\n            triple = $.rdf.triple(subject, backward[i], parent, { source: this[0] });\n            triples.push(triple);\n          }\n        }\n        resource = getObjectResource(this, context);\n        types = resourcesFromCuries(atts['typeof'], this, context.curieOptions);\n        for (i = 0; i < types.length; i += 1) {\n          triple = $.rdf.triple(subject, $.rdf.type, types[i], { source: this[0] });\n          triples.push(triple);\n        }\n        properties = resourcesFromCuries(atts.property, this, context.curieOptions);\n        if (properties.length > 0) {\n          datatype = atts.datatype;\n          content = atts.content;\n          if (datatype !== undefined && datatype !== '') {\n            datatype = $.curie(datatype, context.curieOptions);\n            if (datatype === rdfXMLLiteral) {\n              object = $.rdf.literal(serialize(this), { datatype: rdfXMLLiteral });\n            } else if (content !== undefined) {\n              object = $.rdf.literal(content, { datatype: datatype });\n            } else {\n              object = $.rdf.literal(this.text(), { datatype: datatype });\n            }\n          } else if (content !== undefined) {\n            if (lang === undefined) {\n              object = $.rdf.literal('\"' + content + '\"');\n            } else {\n              object = $.rdf.literal(content, { lang: lang });\n            }\n          } else if (children.length === 0 ||\n                     datatype === '') {\n            lang = getLang(this, context);\n            if (lang === undefined) {\n              object = $.rdf.literal('\"' + this.text() + '\"');\n            } else {\n              object = $.rdf.literal(this.text(), { lang: lang });\n            }\n          } else {\n            object = $.rdf.literal(serialize(this), { datatype: rdfXMLLiteral });\n          }\n          for (i = 0; i < properties.length; i += 1) {\n            triple = $.rdf.triple(subject, properties[i], object, { source: this[0] });\n            triples.push(triple);\n          }\n        }\n        rels = resourcesFromCuries(atts.rel, this, context.curieOptions);\n        revs = resourcesFromCuries(atts.rev, this, context.curieOptions);\n        if (atts.resource !== undefined || atts.href !== undefined) {\n          // make the triples immediately\n          if (rels !== undefined) {\n            for (i = 0; i < rels.length; i += 1) {\n              triple = $.rdf.triple(subject, rels[i], resource, { source: this[0] });\n              triples.push(triple);\n            }\n          }\n          rels = [];\n          if (revs !== undefined) {\n            for (i = 0; i < revs.length; i += 1) {\n              triple = $.rdf.triple(resource, revs[i], subject, { source: this[0] });\n              triples.push(triple);\n            }\n          }\n          revs = [];\n        }\n      }\n      children.each(function () {\n        triples = triples.concat(rdfa.call($(this), { forward: rels, backward: revs, subject: subject, object: resource || subject, lang: lang, namespaces: namespaces }));\n      });\n      return triples;\n    },\n\n    gleaner = function (options) {\n      var type, atts;\n      if (options && options.about !== undefined) {\n        atts = getAttributes(this).atts;\n        if (options.about === null) {\n          return atts.property !== undefined ||\n                 atts.rel !== undefined ||\n                 atts.rev !== undefined ||\n                 atts['typeof'] !== undefined;\n        } else {\n          return getSubject(this, {atts: atts}).subject.value === options.about;\n        }\n      } else if (options && options.type !== undefined) {\n        type = getAttribute(this, 'typeof');\n        if (type !== undefined) {\n          return options.type === null ? true : this.curie(type) === options.type;\n        }\n        return false;\n      } else {\n        return rdfa.call(this);\n      }\n    },\n\n    nsCounter = 1,\n\n    createCurieAttr = function (elem, attr, uri) {\n      var m, curie, value;\n      try {\n        curie = elem.createCurie(uri);\n      } catch (e) {\n        if (uri.toString() === rdfXMLLiteral) {\n          elem.attr('xmlns:rdf', ns.rdf);\n          curie = 'rdf:XMLLiteral';\n        } else {\n          m = /^(.+[\\/#])([^#]+)$/.exec(uri);\n          elem.attr('xmlns:ns' + nsCounter, m[1]);\n          curie = 'ns' + nsCounter + ':' + m[2];\n          nsCounter += 1;\n        }\n      }\n      value = getAttribute(elem, attr);\n      if (value !== undefined) {\n        if ($.inArray(curie, value.split(/\\s+/)) === -1) {\n          elem.attr(attr, value + ' ' + curie);\n        }\n      } else {\n        elem.attr(attr, curie);\n      }\n    },\n\n    createResourceAttr = function (elem, attr, resource) {\n      var ref;\n      if (resource.type === 'bnode') {\n        ref = '[_:' + resource.id + ']';\n      } else {\n        ref = $(elem).base().relative(resource.value);\n      }\n      elem.attr(attr, ref);\n    },\n\n    createSubjectAttr = function (elem, subject) {\n      var s = getSubject(elem).subject;\n      if (subject !== s) {\n        createResourceAttr(elem, 'about', subject);\n      }\n      elem.removeData('rdfa.subject');\n    },\n\n    createObjectAttr = function (elem, object) {\n      var o = getObjectResource(elem);\n      if (object !== o) {\n        createResourceAttr(elem, 'resource', object);\n      }\n      elem.removeData('rdfa.objectResource');\n    },\n\n    resetLang = function (elem, lang) {\n      elem.wrapInner('<span></span>')\n        .children('span')\n        .attr('lang', lang);\n      return elem;\n    },\n\n    addRDFa = function (triple) {\n      var hasContent, hasRelation, hasRDFa, overridableObject, span,\n        subject, sameSubject,\n        object, sameObject,\n        lang, content,\n        i, atts,\n        ns = this.xmlns();\n      span = this;\n      atts = getAttributes(this).atts;\n      if (typeof triple === 'string') {\n        triple = $.rdf.triple(triple, { namespaces: ns, base: this.base() });\n      } else if (triple.rdfquery) {\n        addRDFa.call(this, triple.sources().get(0));\n        return this;\n      } else if (triple.length) {\n        for (i = 0; i < triple.length; i += 1) {\n          addRDFa.call(this, triple[i]);\n        }\n        return this;\n      }\n      hasRelation = atts.rel !== undefined || atts.rev !== undefined;\n      hasRDFa = hasRelation || atts.property !== undefined || atts['typeof'] !== undefined;\n      if (triple.object.type !== 'literal') {\n        subject = getSubject(this, {atts: atts}, true).subject;\n        object = getObjectResource(this, {atts: atts}, true);\n        overridableObject = !hasRDFa && atts.resource === undefined;\n        sameSubject = subject === triple.subject;\n        sameObject = object === triple.object;\n        if (triple.property === $.rdf.type) {\n          if (sameSubject) {\n            createCurieAttr(this, 'typeof', triple.object.value);\n          } else if (hasRDFa) {\n            span = this.wrapInner('<span />').children('span');\n            createCurieAttr(span, 'typeof', triple.object.value);\n            if (object !== triple.subject) {\n              createSubjectAttr(span, triple.subject);\n            }\n          } else {\n            createCurieAttr(this, 'typeof', triple.object.value);\n            createSubjectAttr(this, triple.subject);\n          }\n        } else if (sameSubject) {\n          // use a rel\n          if (sameObject) {\n            createCurieAttr(this, 'rel', triple.property.value);\n          } else if (overridableObject || !hasRDFa) {\n            createCurieAttr(this, 'rel', triple.property.value);\n            createObjectAttr(this, triple.object);\n          } else {\n            span = this.wrap('<span />').parent();\n            createCurieAttr(span, 'rev', triple.property.value);\n            createSubjectAttr(span, triple.object);\n          }\n        } else if (subject === triple.object) {\n          if (object === triple.subject) {\n            // use a rev\n            createCurieAttr(this, 'rev', triple.property.value);\n          } else if (overridableObject || !hasRDFa) {\n            createCurieAttr(this, 'rev', triple.property.value);\n            createObjectAttr(this, triple.subject);\n          } else {\n            // wrap in a span with a rel\n            span = this.wrap('<span />').parent();\n            createCurieAttr(span, 'rel', triple.property.value);\n            createSubjectAttr(span, triple.subject);\n          }\n        } else if (sameObject) {\n          if (hasRDFa) {\n            // use a rev on a nested span\n            span = this.wrapInner('<span />').children('span');\n            createCurieAttr(span, 'rev', triple.property.value);\n            createObjectAttr(span, triple.subject);\n            span = span.wrapInner('<span />').children('span');\n            createSubjectAttr(span, triple.object);\n            span = this;\n          } else {\n            createSubjectAttr(this, triple.subject);\n            createCurieAttr(this, 'rel', triple.property.value);\n          }\n        } else if (object === triple.subject) {\n          if (hasRDFa) {\n            // wrap the contents in a span and use a rel\n            span = this.wrapInner('<span />').children('span');\n            createCurieAttr(span, 'rel', this.property.value);\n            createObjectAttr(span, triple.object);\n            span = span.wrapInner('<span />').children('span');\n            createSubjectAttr(span, object);\n            span = this;\n          } else {\n            // use a rev on this element\n            createSubjectAttr(this, triple.object);\n            createCurieAttr(this, 'rev', triple.property.value);\n          }\n        } else if (hasRDFa) {\n          span = this.wrapInner('<span />').children('span');\n          createCurieAttr(span, 'rel', triple.property.value);\n          createSubjectAttr(span, triple.subject);\n          createObjectAttr(span, triple.object);\n          if (span.children('*').length > 0) {\n            span = this.wrapInner('<span />').children('span');\n            createSubjectAttr(span, subject);\n          }\n          span = this;\n        } else {\n          createCurieAttr(span, 'rel', triple.property.value);\n          createSubjectAttr(this, triple.subject);\n          createObjectAttr(this, triple.object);\n          if (this.children('*').length > 0) {\n            span = this.wrapInner('<span />').children('span');\n            createSubjectAttr(span, subject);\n            span = this;\n          }\n        }\n      } else {\n        subject = getSubject(this, {atts: atts}).subject;\n        object = getObjectResource(this, {atts: atts});\n        sameSubject = subject === triple.subject;\n        hasContent = this.text() !== triple.object.value;\n        if (atts.property !== undefined) {\n          content = atts.content;\n          sameObject = content !== undefined ? content === triple.object.value : !hasContent;\n          if (sameSubject && sameObject) {\n            createCurieAttr(this, 'property', triple.property.value);\n          } else {\n            span = this.wrapInner('<span />').children('span');\n            return addRDFa.call(span, triple);\n          }\n        } else {\n          if (object === triple.subject) {\n            span = this.wrapInner('<span />').children('span');\n            return addRDFa.call(span, triple);\n          }\n          createCurieAttr(this, 'property', triple.property.value);\n          createSubjectAttr(this, triple.subject);\n          if (hasContent) {\n            if (triple.object.datatype && triple.object.datatype.toString() === rdfXMLLiteral) {\n              this.html(triple.object.value);\n            } else {\n              this.attr('content', triple.object.value);\n            }\n          }\n          lang = getLang(this);\n          if (triple.object.lang) {\n            if (lang !== triple.object.lang) {\n              this.attr('lang', triple.object.lang);\n              if (hasContent) {\n                resetLang(this, lang);\n              }\n            }\n          } else if (triple.object.datatype) {\n            createCurieAttr(this, 'datatype', triple.object.datatype);\n          } else {\n            // the empty datatype ensures that any child elements that might be added won't mess up this triple\n            if (!hasContent) {\n              this.attr('datatype', '');\n            }\n            // the empty lang ensures that a language won't be assigned to the literal\n            if (lang !== undefined) {\n              this.attr('lang', '');\n              if (hasContent) {\n                resetLang(this, lang);\n              }\n            }\n          }\n        }\n      }\n      this.parents().andSelf().trigger(\"rdfChange\");\n      return span;\n    },\n\n    removeRDFa = function (what) {\n      var span, atts, property, rel, rev, type,\n        ns = this.xmlns();\n      atts = getAttributes(this).atts;\n      if (what.length) {\n        for (i = 0; i < what.length; i += 1) {\n          removeRDFa.call(this, what[i]);\n        }\n        return this;\n      }\n      hasRelation = atts.rel !== undefined || atts.rev !== undefined;\n      hasRDFa = hasRelation || atts.property !== undefined || atts['typeof'] !== undefined;\n      if (hasRDFa) {\n        if (what.property !== undefined) {\n          if (atts.property !== undefined) {\n            property = removeCurie(atts.property, what.property, { namespaces: ns });\n            if (property === '') {\n              this.removeAttr('property');\n            } else {\n              this.attr('property', property);\n            }\n          }\n          if (atts.rel !== undefined) {\n            rel = removeCurie(atts.rel, what.property, { namespaces: ns });\n            if (rel === '') {\n              this.removeAttr('rel');\n            } else {\n              this.attr('rel', rel);\n            }\n          }\n          if (atts.rev !== undefined) {\n            rev = removeCurie(atts.rev, what.property, { namespaces: ns });\n            if (rev === '') {\n              this.removeAttr('rev');\n            } else {\n              this.attr('rev', rev);\n            }\n          }\n        }\n        if (what.type !== undefined) {\n          if (atts['typeof'] !== undefined) {\n            type = removeCurie(atts['typeof'], what.type, { namespaces: ns });\n            if (type === '') {\n              this.removeAttr('typeof');\n            } else {\n              this.attr('typeof', type);\n            }\n          }\n        }\n        if (atts.property === this.attr('property') && atts.rel === this.attr('rel') && atts.rev === this.attr('rev') && atts['typeof'] === this.attr('typeof')) {\n          return removeRDFa.call(this.parent(), what);\n        }\n      }\n      this.parents().andSelf().trigger(\"rdfChange\");\n      return this;\n    };\n\n  /**\n   * Creates a {@link jQuery.rdf} object containing the RDF triples parsed from the RDFa found in the current jQuery selection or adds the specified triple as RDFa markup on each member of the current jQuery selection. To create an {@link jQuery.rdf} object, you will usually want to use {@link jQuery#rdf} instead, as this may perform other useful processing (such as of microformats used within the page).\n   * @methodOf jQuery#\n   * @name jQuery#rdfa\n   * @param {jQuery.rdf.triple} [triple] The RDF triple to be added to each item in the jQuery selection. \n   * @returns {jQuery.rdf}\n   * @example\n   * // Extract RDFa markup from all span elements contained inside #main\n   * rdf = $('#main > span').rdfa();\n   * @example\n   * // Add RDFa markup to a particular element\n   *  var span = $('#main > p > span');\n   *  span.rdfa('&lt;> dc:date \"2008-10-19\"^^xsd:date .');\n   */\n  $.fn.rdfa = function (triple) {\n    if (triple === undefined) {\n      var triples = $.map($(this), function (elem) {\n        return rdfa.call($(elem));\n      });\n      return $.rdf({ triples: triples });\n    } else {\n      $(this).each(function () {\n        addRDFa.call($(this), triple);\n      });\n      return this;\n    }\n  };\n\n  /**\n   * Removes the specified RDFa markup from each of the items in the current jQuery selection. The input parameter can be either an object or an array of objects. The objects can either have a <code>type</code> property, in which case the specified type is removed from the RDFa provided on the selected elements, or a <code>property</code> property, in which case the specified property is removed from the RDFa provided on the selected elements.\n   * @methodOf jQuery#\n   * @name jQuery#removeRdfa\n   * @param {Object|Object[]} triple The RDFa markup items to be removed\n   * from the items in the jQuery selection.\n   * @returns {jQuery} The original jQuery object.\n   * @example \n   * // To remove a property resource or relation from an element \n   * $('#main > p > a').removeRdfa({ property: \"dc:creator\" });\n   * @example\n   * // To remove a type from an element\n   * $('#main >p > a').removeRdfa({ type: \"foaf:Person\" });\n   * @example\n   * // To remove multiple triples from an element\n   * $('#main > p > a').removeRdfa([{ property: \"foaf:depicts\" }, { property: \"dc:creator\" }]);\n   */\n  $.fn.removeRdfa = function (triple) {\n    $(this).each(function () {\n      removeRDFa.call($(this), triple);\n    });\n    return this;\n  };\n\n  $.rdf.gleaners.push(gleaner);\n\n})(jQuery);\n"
  },
  {
    "path": "extensions/themes/silverblue/scripts/libraries/jquery.simplemodal.js",
    "content": "/*\n * SimpleModal 1.3 - jQuery Plugin\n * http://www.ericmmartin.com/projects/simplemodal/\n * Copyright (c) 2009 Eric Martin\n * Dual licensed under the MIT and GPL licenses\n * Revision: $Id: jquery.simplemodal.js 205 2009-06-12 13:29:21Z emartin24 $\n */\n;(function($){var ie6=$.browser.msie&&parseInt($.browser.version)==6&&typeof window['XMLHttpRequest']!=\"object\",ieQuirks=null,w=[];$.modal=function(data,options){return $.modal.impl.init(data,options);};$.modal.close=function(){$.modal.impl.close();};$.fn.modal=function(options){return $.modal.impl.init(this,options);};$.modal.defaults={appendTo:'body',focus:true,opacity:50,overlayId:'simplemodal-overlay',overlayCss:{},containerId:'simplemodal-container',containerCss:{},dataId:'simplemodal-data',dataCss:{},minHeight:200,minWidth:300,maxHeight:null,maxWidth:null,autoResize:false,zIndex:1000,close:true,closeHTML:'<a class=\"modalCloseImg\" title=\"Close\"></a>',closeClass:'simplemodal-close',escClose:true,overlayClose:false,position:null,persist:false,onOpen:null,onShow:null,onClose:null};$.modal.impl={opts:null,dialog:{},init:function(data,options){if(this.dialog.data){return false;}ieQuirks=$.browser.msie&&!$.boxModel;this.opts=$.extend({},$.modal.defaults,options);this.zIndex=this.opts.zIndex;this.occb=false;if(typeof data=='object'){data=data instanceof jQuery?data:$(data);if(data.parent().parent().size()>0){this.dialog.parentNode=data.parent();if(!this.opts.persist){this.dialog.orig=data.clone(true);}}}else if(typeof data=='string'||typeof data=='number'){data=$('<div/>').html(data);}else{alert('SimpleModal Error: Unsupported data type: '+typeof data);return false;}this.create(data);data=null;this.open();if($.isFunction(this.opts.onShow)){this.opts.onShow.apply(this,[this.dialog]);}return this;},create:function(data){w=this.getDimensions();if(ie6){this.dialog.iframe=$('<iframe src=\"javascript:false;\"/>').css($.extend(this.opts.iframeCss,{display:'none',opacity:0,position:'fixed',height:w[0],width:w[1],zIndex:this.opts.zIndex,top:0,left:0})).appendTo(this.opts.appendTo);}this.dialog.overlay=$('<div/>').attr('id',this.opts.overlayId).addClass('simplemodal-overlay').css($.extend(this.opts.overlayCss,{display:'none',opacity:this.opts.opacity/100,height:w[0],width:w[1],position:'fixed',left:0,top:0,zIndex:this.opts.zIndex+1})).appendTo(this.opts.appendTo);this.dialog.container=$('<div/>').attr('id',this.opts.containerId).addClass('simplemodal-container').css($.extend(this.opts.containerCss,{display:'none',position:'fixed',zIndex:this.opts.zIndex+2})).append(this.opts.close&&this.opts.closeHTML?$(this.opts.closeHTML).addClass(this.opts.closeClass):'').appendTo(this.opts.appendTo);this.dialog.wrap=$('<div/>').attr('tabIndex',-1).addClass('simplemodal-wrap').css({height:'100%',outline:0,width:'100%'}).appendTo(this.dialog.container);this.dialog.data=data.attr('id',data.attr('id')||this.opts.dataId).addClass('simplemodal-data').css($.extend(this.opts.dataCss,{display:'none'}));data=null;this.setContainerDimensions();this.dialog.data.appendTo(this.dialog.wrap);if(ie6||ieQuirks){this.fixIE();}},bindEvents:function(){var self=this;$('.'+self.opts.closeClass).bind('click.simplemodal',function(e){e.preventDefault();self.close();});if(self.opts.close&&self.opts.overlayClose){self.dialog.overlay.bind('click.simplemodal',function(e){e.preventDefault();self.close();});}$(document).bind('keydown.simplemodal',function(e){if(self.opts.focus&&e.keyCode==9){self.watchTab(e);}else if((self.opts.close&&self.opts.escClose)&&e.keyCode==27){e.preventDefault();self.close();}});$(window).bind('resize.simplemodal',function(){w=self.getDimensions();self.opts.autoResize?self.setContainerDimensions():self.setPosition();if(ie6||ieQuirks){self.fixIE();}else{self.dialog.iframe&&self.dialog.iframe.css({height:w[0],width:w[1]});self.dialog.overlay.css({height:w[0],width:w[1]});}});},unbindEvents:function(){$('.'+this.opts.closeClass).unbind('click.simplemodal');$(document).unbind('keydown.simplemodal');$(window).unbind('resize.simplemodal');this.dialog.overlay.unbind('click.simplemodal');},fixIE:function(){var p=this.opts.position;$.each([this.dialog.iframe||null,this.dialog.overlay,this.dialog.container],function(i,el){if(el){var bch='document.body.clientHeight',bcw='document.body.clientWidth',bsh='document.body.scrollHeight',bsl='document.body.scrollLeft',bst='document.body.scrollTop',bsw='document.body.scrollWidth',ch='document.documentElement.clientHeight',cw='document.documentElement.clientWidth',sl='document.documentElement.scrollLeft',st='document.documentElement.scrollTop',s=el[0].style;s.position='absolute';if(i<2){s.removeExpression('height');s.removeExpression('width');s.setExpression('height',''+bsh+' > '+bch+' ? '+bsh+' : '+bch+' + \"px\"');s.setExpression('width',''+bsw+' > '+bcw+' ? '+bsw+' : '+bcw+' + \"px\"');}else{var te,le;if(p&&p.constructor==Array){var top=p[0]?typeof p[0]=='number'?p[0].toString():p[0].replace(/px/,''):el.css('top').replace(/px/,'');te=top.indexOf('%')==-1?top+' + (t = '+st+' ? '+st+' : '+bst+') + \"px\"':parseInt(top.replace(/%/,''))+' * (('+ch+' || '+bch+') / 100) + (t = '+st+' ? '+st+' : '+bst+') + \"px\"';if(p[1]){var left=typeof p[1]=='number'?p[1].toString():p[1].replace(/px/,'');le=left.indexOf('%')==-1?left+' + (t = '+sl+' ? '+sl+' : '+bsl+') + \"px\"':parseInt(left.replace(/%/,''))+' * (('+cw+' || '+bcw+') / 100) + (t = '+sl+' ? '+sl+' : '+bsl+') + \"px\"';}}else{te='('+ch+' || '+bch+') / 2 - (this.offsetHeight / 2) + (t = '+st+' ? '+st+' : '+bst+') + \"px\"';le='('+cw+' || '+bcw+') / 2 - (this.offsetWidth / 2) + (t = '+sl+' ? '+sl+' : '+bsl+') + \"px\"';}s.removeExpression('top');s.removeExpression('left');s.setExpression('top',te);s.setExpression('left',le);}}});},focus:function(pos){var self=this,p=pos||'first';var input=$(':input:enabled:visible:'+p,self.dialog.wrap);input.length>0?input.focus():self.dialog.wrap.focus();},getDimensions:function(){var el=$(window);var h=$.browser.opera&&$.browser.version>'9.5'&&$.fn.jquery<='1.2.6'?document.documentElement['clientHeight']:$.browser.opera&&$.browser.version<'9.5'&&$.fn.jquery>'1.2.6'?window.innerHeight:el.height();return[h,el.width()];},getVal:function(v){return v=='auto'?0:parseInt(v.replace(/px/,''));},setContainerDimensions:function(){var ch=this.getVal(this.dialog.container.css('height')),cw=this.dialog.container.width(),dh=this.dialog.data.height(),dw=this.dialog.data.width();var mh=this.opts.maxHeight&&this.opts.maxHeight<w[0]?this.opts.maxHeight:w[0],mw=this.opts.maxWidth&&this.opts.maxWidth<w[1]?this.opts.maxWidth:w[1];if(!ch){if(!dh){ch=this.opts.minHeight;}else{if(dh>mh){ch=mh;}else if(dh<this.opts.minHeight){ch=this.opts.minHeight;}else{ch=dh;}}}else{ch=ch>mh?mh:ch;}if(!cw){if(!dw){cw=this.opts.minWidth;}else{if(dw>mw){cw=mw;}else if(dw<this.opts.minWidth){cw=this.opts.minWidth;}else{cw=dw;}}}else{cw=cw>mw?mw:cw;}this.dialog.container.css({height:ch,width:cw});if(dh>ch||dw>cw){this.dialog.wrap.css({overflow:'auto'});}this.setPosition();},setPosition:function(){var top,left,hc=(w[0]/2)-((this.dialog.container.height()||this.dialog.data.height())/2),vc=(w[1]/2)-((this.dialog.container.width()||this.dialog.data.width())/2);if(this.opts.position&&this.opts.position.constructor==Array){top=this.opts.position[0]||hc;left=this.opts.position[1]||vc;}else{top=hc;left=vc;}this.dialog.container.css({left:left,top:top});},watchTab:function(e){var self=this;if($(e.target).parents('.simplemodal-container').length>0){self.inputs=$(':input:enabled:visible:first, :input:enabled:visible:last',self.dialog.data);if(!e.shiftKey&&e.target==self.inputs[self.inputs.length-1]||e.shiftKey&&e.target==self.inputs[0]||self.inputs.length==0){e.preventDefault();var pos=e.shiftKey?'last':'first';setTimeout(function(){self.focus(pos);},10);}}else{e.preventDefault();setTimeout(function(){self.focus();},10);}},open:function(){this.dialog.iframe&&this.dialog.iframe.show();if($.isFunction(this.opts.onOpen)){this.opts.onOpen.apply(this,[this.dialog]);}else{this.dialog.overlay.show();this.dialog.container.show();this.dialog.data.show();}this.focus();this.bindEvents();},close:function(){if(!this.dialog.data){return false;}this.unbindEvents();if($.isFunction(this.opts.onClose)&&!this.occb){this.occb=true;this.opts.onClose.apply(this,[this.dialog]);}else{if(this.dialog.parentNode){if(this.opts.persist){this.dialog.data.hide().appendTo(this.dialog.parentNode);}else{this.dialog.data.hide().remove();this.dialog.orig.appendTo(this.dialog.parentNode);}}else{this.dialog.data.hide().remove();}this.dialog.container.hide().remove();this.dialog.overlay.hide().remove();this.dialog.iframe&&this.dialog.iframe.hide().remove();this.dialog={};}}};})(jQuery);"
  },
  {
    "path": "extensions/themes/silverblue/scripts/libraries/jquery.tablesorter.js",
    "content": "/*\n * \n * TableSorter 2.0 - Client-side table sorting with ease!\n * Version 2.0.3\n * @requires jQuery v1.2.3\n * \n * Copyright (c) 2007 Christian Bach\n * Examples and docs at: http://tablesorter.com\n * Dual licensed under the MIT and GPL licenses:\n * http://www.opensource.org/licenses/mit-license.php\n * http://www.gnu.org/licenses/gpl.html\n * \n */\n/**\n *\n * @description Create a sortable table with multi-column sorting capabilitys\n * \n * @example $('table').tablesorter();\n * @desc Create a simple tablesorter interface.\n *\n * @example $('table').tablesorter({ sortList:[[0,0],[1,0]] });\n * @desc Create a tablesorter interface and sort on the first and secound column in ascending order.\n * \n * @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } });\n * @desc Create a tablesorter interface and disableing the first and secound column headers.\n * \n * @example $('table').tablesorter({ 0: {sorter:\"integer\"}, 1: {sorter:\"currency\"} });\n * @desc Create a tablesorter interface and set a column parser for the first and secound column.\n * \n * \n * @param Object settings An object literal containing key/value pairs to provide optional settings.\n * \n * @option String cssHeader (optional) \t\t\tA string of the class name to be appended to sortable tr elements in the thead of the table. \n * \t\t\t\t\t\t\t\t\t\t\t\tDefault value: \"header\"\n * \n * @option String cssAsc (optional) \t\t\tA string of the class name to be appended to sortable tr elements in the thead on a ascending sort. \n * \t\t\t\t\t\t\t\t\t\t\t\tDefault value: \"headerSortUp\"\n * \n * @option String cssDesc (optional) \t\t\tA string of the class name to be appended to sortable tr elements in the thead on a descending sort. \n * \t\t\t\t\t\t\t\t\t\t\t\tDefault value: \"headerSortDown\"\n * \n * @option String sortInitialOrder (optional) \tA string of the inital sorting order can be asc or desc. \n * \t\t\t\t\t\t\t\t\t\t\t\tDefault value: \"asc\"\n * \n * @option String sortMultisortKey (optional) \tA string of the multi-column sort key. \n * \t\t\t\t\t\t\t\t\t\t\t\tDefault value: \"shiftKey\"\n * \n * @option String textExtraction (optional) \tA string of the text-extraction method to use. \n * \t\t\t\t\t\t\t\t\t\t\t\tFor complex html structures inside td cell set this option to \"complex\", \n * \t\t\t\t\t\t\t\t\t\t\t\ton large tables the complex option can be slow. \n * \t\t\t\t\t\t\t\t\t\t\t\tDefault value: \"simple\"\n * \n * @option Object headers (optional) \t\t\tAn array containing the forces sorting rules. \n * \t\t\t\t\t\t\t\t\t\t\t\tThis option let's you specify a default sorting rule. \n * \t\t\t\t\t\t\t\t\t\t\t\tDefault value: null\n * \n * @option Array sortList (optional) \t\t\tAn array containing the forces sorting rules. \n * \t\t\t\t\t\t\t\t\t\t\t\tThis option let's you specify a default sorting rule. \n * \t\t\t\t\t\t\t\t\t\t\t\tDefault value: null\n * \n * @option Array sortForce (optional) \t\t\tAn array containing forced sorting rules. \n * \t\t\t\t\t\t\t\t\t\t\t\tThis option let's you specify a default sorting rule, which is prepended to user-selected rules.\n * \t\t\t\t\t\t\t\t\t\t\t\tDefault value: null\n *  \n  * @option Array sortAppend (optional) \t\t\tAn array containing forced sorting rules. \n * \t\t\t\t\t\t\t\t\t\t\t\tThis option let's you specify a default sorting rule, which is appended to user-selected rules.\n * \t\t\t\t\t\t\t\t\t\t\t\tDefault value: null\n * \n * @option Boolean widthFixed (optional) \t\tBoolean flag indicating if tablesorter should apply fixed widths to the table columns.\n * \t\t\t\t\t\t\t\t\t\t\t\tThis is usefull when using the pager companion plugin.\n * \t\t\t\t\t\t\t\t\t\t\t\tThis options requires the dimension jquery plugin.\n * \t\t\t\t\t\t\t\t\t\t\t\tDefault value: false\n *\n * @option Boolean cancelSelection (optional) \tBoolean flag indicating if tablesorter should cancel selection of the table headers text.\n * \t\t\t\t\t\t\t\t\t\t\t\tDefault value: true\n *\n * @option Boolean debug (optional) \t\t\tBoolean flag indicating if tablesorter should display debuging information usefull for development.\n *\n * @type jQuery\n *\n * @name tablesorter\n * \n * @cat Plugins/Tablesorter\n * \n * @author Christian Bach/christian.bach@polyester.se\n */\n\n(function($) {\n\t$.extend({\n\t\ttablesorter: new function() {\n\t\t\t\n\t\t\tvar parsers = [], widgets = [];\n\t\t\t\n\t\t\tthis.defaults = {\n\t\t\t\tcssHeader: \"header\",\n\t\t\t\tcssAsc: \"headerSortUp\",\n\t\t\t\tcssDesc: \"headerSortDown\",\n\t\t\t\tsortInitialOrder: \"asc\",\n\t\t\t\tsortMultiSortKey: \"shiftKey\",\n\t\t\t\tsortForce: null,\n\t\t\t\tsortAppend: null,\n\t\t\t\ttextExtraction: \"simple\",\n\t\t\t\tparsers: {}, \n\t\t\t\twidgets: [],\t\t\n\t\t\t\twidgetZebra: {css: [\"even\",\"odd\"]},\n\t\t\t\theaders: {},\n\t\t\t\twidthFixed: false,\n\t\t\t\tcancelSelection: true,\n\t\t\t\tsortList: [],\n\t\t\t\theaderList: [],\n\t\t\t\tdateFormat: \"us\",\n\t\t\t\tdecimal: '.',\n\t\t\t\tdebug: false\n\t\t\t};\n\t\t\t\n\t\t\t/* debuging utils */\n\t\t\tfunction benchmark(s,d) {\n\t\t\t\tlog(s + \",\" + (new Date().getTime() - d.getTime()) + \"ms\");\n\t\t\t}\n\t\t\t\n\t\t\tthis.benchmark = benchmark;\n\t\t\t\n\t\t\tfunction log(s) {\n\t\t\t\tif (typeof console != \"undefined\" && typeof console.debug != \"undefined\") {\n\t\t\t\t\tconsole.log(s);\n\t\t\t\t} else {\n\t\t\t\t\talert(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t/* parsers utils */\n\t\t\tfunction buildParserCache(table,$headers) {\n\t\t\t\t\n\t\t\t\tif(table.config.debug) { var parsersDebug = \"\"; }\n\t\t\t\t\n\t\t\t\tvar rows = table.tBodies[0].rows;\n\t\t\t\t\n\t\t\t\tif(table.tBodies[0].rows[0]) {\n\n\t\t\t\t\tvar list = [], cells = rows[0].cells, l = cells.length;\n\t\t\t\t\t\n\t\t\t\t\tfor (var i=0;i < l; i++) {\n\t\t\t\t\t\tvar p = false;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter)  ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tp = getParserById($($headers[i]).metadata().sorter);\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t} else if((table.config.headers[i] && table.config.headers[i].sorter)) {\n\t\n\t\t\t\t\t\t\tp = getParserById(table.config.headers[i].sorter);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!p) {\n\t\t\t\t\t\t\tp = detectParserForColumn(table,cells[i]);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif(table.config.debug) { parsersDebug += \"column:\" + i + \" parser:\" +p.id + \"\\n\"; }\n\t\n\t\t\t\t\t\tlist.push(p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(table.config.debug) { log(parsersDebug); }\n\n\t\t\t\treturn list;\n\t\t\t};\n\t\t\t\n\t\t\tfunction detectParserForColumn(table,node) {\n\t\t\t\tvar l = parsers.length;\n\t\t\t\tfor(var i=1; i < l; i++) {\n\t\t\t\t\tif(parsers[i].is($.trim(getElementText(table.config,node)),table,node)) {\n\t\t\t\t\t\treturn parsers[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// 0 is always the generic parser (text)\n\t\t\t\treturn parsers[0];\n\t\t\t}\n\t\t\t\n\t\t\tfunction getParserById(name) {\n\t\t\t\tvar l = parsers.length;\n\t\t\t\tfor(var i=0; i < l; i++) {\n\t\t\t\t\tif(parsers[i].id.toLowerCase() == name.toLowerCase()) {\t\n\t\t\t\t\t\treturn parsers[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t/* utils */\n\t\t\tfunction buildCache(table) {\n\t\t\t\t\n\t\t\t\tif(table.config.debug) { var cacheTime = new Date(); }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tvar totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0,\n\t\t\t\t\ttotalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0,\n\t\t\t\t\tparsers = table.config.parsers, \n\t\t\t\t\tcache = {row: [], normalized: []};\n\t\t\t\t\n\t\t\t\t\tfor (var i=0;i < totalRows; ++i) {\n\t\t\t\t\t\n\t\t\t\t\t\t/** Add the table data to main data array */\n\t\t\t\t\t\tvar c = table.tBodies[0].rows[i], cols = [];\n\t\t\t\t\t\n\t\t\t\t\t\tcache.row.push($(c));\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(var j=0; j < totalCells; ++j) {\n\t\t\t\t\t\t\tcols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]));\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tcols.push(i); // add position for rowCache\n\t\t\t\t\t\tcache.normalized.push(cols);\n\t\t\t\t\t\tcols = null;\n\t\t\t\t\t};\n\t\t\t\t\n\t\t\t\tif(table.config.debug) { benchmark(\"Building cache for \" + totalRows + \" rows:\", cacheTime); }\n\t\t\t\t\n\t\t\t\treturn cache;\n\t\t\t};\n\t\t\t\n\t\t\tfunction getElementText(config,node) {\n\t\t\t\t\n\t\t\t\tif(!node) return \"\";\n\t\t\t\t\t\t\t\t\n\t\t\t\tvar t = \"\";\n\t\t\t\t\n\t\t\t\tif(config.textExtraction == \"simple\") {\n\t\t\t\t\tif(node.childNodes[0] && node.childNodes[0].hasChildNodes()) {\n\t\t\t\t\t\tt = node.childNodes[0].innerHTML;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt = node.innerHTML;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif(typeof(config.textExtraction) == \"function\") {\n\t\t\t\t\t\tt = config.textExtraction(node);\n\t\t\t\t\t} else { \n\t\t\t\t\t\tt = $(node).text();\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\treturn t;\n\t\t\t}\n\t\t\t\n\t\t\tfunction appendToTable(table,cache) {\n\t\t\t\t\n\t\t\t\tif(table.config.debug) {var appendTime = new Date()}\n\t\t\t\t\n\t\t\t\tvar c = cache, \n\t\t\t\t\tr = c.row, \n\t\t\t\t\tn= c.normalized, \n\t\t\t\t\ttotalRows = n.length, \n\t\t\t\t\tcheckCell = (n[0].length-1), \n\t\t\t\t\ttableBody = $(table.tBodies[0]),\n\t\t\t\t\trows = [];\n\t\t\t\t\n\t\t\t\tfor (var i=0;i < totalRows; i++) {\n\t\t\t\t\trows.push(r[n[i][checkCell]]);\t\n\t\t\t\t\tif(!table.config.appender) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar o = r[n[i][checkCell]];\n\t\t\t\t\t\tvar l = o.length;\n\t\t\t\t\t\tfor(var j=0; j < l; j++) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttableBody[0].appendChild(o[j]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//tableBody.append(r[n[i][checkCell]]);\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tif(table.config.appender) {\n\t\t\t\t\n\t\t\t\t\ttable.config.appender(table,rows);\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\trows = null;\n\t\t\t\t\n\t\t\t\tif(table.config.debug) { benchmark(\"Rebuilt table:\", appendTime); }\n\t\t\t\t\t\t\t\t\n\t\t\t\t//apply table widgets\n\t\t\t\tapplyWidget(table);\n\t\t\t\t\n\t\t\t\t// trigger sortend\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t$(table).trigger(\"sortEnd\");\t\n\t\t\t\t},0);\n\t\t\t\t\n\t\t\t};\n\t\t\t\n\t\t\tfunction buildHeaders(table) {\n\t\t\t\t\n\t\t\t\tif(table.config.debug) { var time = new Date(); }\n\t\t\t\t\n\t\t\t\tvar meta = ($.metadata) ? true : false, tableHeadersRows = [];\n\t\t\t\n\t\t\t\tfor(var i = 0; i < table.tHead.rows.length; i++) { tableHeadersRows[i]=0; };\n\t\t\t\t\n\t\t\t\t$tableHeaders = $(\"thead th\",table);\n\t\t\n\t\t\t\t$tableHeaders.each(function(index) {\n\t\t\t\t\t\t\t\n\t\t\t\t\tthis.count = 0;\n\t\t\t\t\tthis.column = index;\n\t\t\t\t\tthis.order = formatSortingOrder(table.config.sortInitialOrder);\n\t\t\t\t\t\n\t\t\t\t\tif(checkHeaderMetadata(this) || checkHeaderOptions(table,index)) this.sortDisabled = true;\n\t\t\t\t\t\n\t\t\t\t\tif(!this.sortDisabled) {\n\t\t\t\t\t\t$(this).addClass(table.config.cssHeader);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// add cell to headerList\n\t\t\t\t\ttable.config.headerList[index]= this;\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tif(table.config.debug) { benchmark(\"Built headers:\", time); log($tableHeaders); }\n\t\t\t\t\n\t\t\t\treturn $tableHeaders;\n\t\t\t\t\n\t\t\t};\n\t\t\t\t\t\t\n\t\t   \tfunction checkCellColSpan(table, rows, row) {\n                var arr = [], r = table.tHead.rows, c = r[row].cells;\n\t\t\t\t\n\t\t\t\tfor(var i=0; i < c.length; i++) {\n\t\t\t\t\tvar cell = c[i];\n\t\t\t\t\t\n\t\t\t\t\tif ( cell.colSpan > 1) { \n\t\t\t\t\t\tarr = arr.concat(checkCellColSpan(table, headerArr,row++));\n\t\t\t\t\t} else  {\n\t\t\t\t\t\tif(table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row+1])) {\n\t\t\t\t\t\t\tarr.push(cell);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//headerArr[row] = (i+row);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn arr;\n\t\t\t};\n\t\t\t\n\t\t\tfunction checkHeaderMetadata(cell) {\n\t\t\t\tif(($.metadata) && ($(cell).metadata().sorter === false)) { return true; };\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tfunction checkHeaderOptions(table,i) {\t\n\t\t\t\tif((table.config.headers[i]) && (table.config.headers[i].sorter === false)) { return true; };\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tfunction applyWidget(table) {\n\t\t\t\tvar c = table.config.widgets;\n\t\t\t\tvar l = c.length;\n\t\t\t\tfor(var i=0; i < l; i++) {\n\t\t\t\t\t\n\t\t\t\t\tgetWidgetById(c[i]).format(table);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfunction getWidgetById(name) {\n\t\t\t\tvar l = widgets.length;\n\t\t\t\tfor(var i=0; i < l; i++) {\n\t\t\t\t\tif(widgets[i].id.toLowerCase() == name.toLowerCase() ) {\n\t\t\t\t\t\treturn widgets[i]; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tfunction formatSortingOrder(v) {\n\t\t\t\t\n\t\t\t\tif(typeof(v) != \"Number\") {\n\t\t\t\t\ti = (v.toLowerCase() == \"desc\") ? 1 : 0;\n\t\t\t\t} else {\n\t\t\t\t\ti = (v == (0 || 1)) ? v : 0;\n\t\t\t\t}\n\t\t\t\treturn i;\n\t\t\t}\n\t\t\t\n\t\t\tfunction isValueInArray(v, a) {\n\t\t\t\tvar l = a.length;\n\t\t\t\tfor(var i=0; i < l; i++) {\n\t\t\t\t\tif(a[i][0] == v) {\n\t\t\t\t\t\treturn true;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\t\n\t\t\tfunction setHeadersCss(table,$headers, list, css) {\n\t\t\t\t// remove all header information\n\t\t\t\t$headers.removeClass(css[0]).removeClass(css[1]);\n\t\t\t\t\n\t\t\t\tvar h = [];\n\t\t\t\t$headers.each(function(offset) {\n\t\t\t\t\t\tif(!this.sortDisabled) {\n\t\t\t\t\t\t\th[this.column] = $(this);\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tvar l = list.length; \n\t\t\t\tfor(var i=0; i < l; i++) {\n\t\t\t\t\th[list[i][0]].addClass(css[list[i][1]]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfunction fixColumnWidth(table,$headers) {\n\t\t\t\tvar c = table.config;\n\t\t\t\tif(c.widthFixed) {\n\t\t\t\t\tvar colgroup = $('<colgroup>');\n\t\t\t\t\t$(\"tr:first td\",table.tBodies[0]).each(function() {\n\t\t\t\t\t\tcolgroup.append($('<col>').css('width',$(this).width()));\n\t\t\t\t\t});\n\t\t\t\t\t$(table).prepend(colgroup);\n\t\t\t\t};\n\t\t\t}\n\t\t\t\n\t\t\tfunction updateHeaderSortCount(table,sortList) {\n\t\t\t\tvar c = table.config, l = sortList.length;\n\t\t\t\tfor(var i=0; i < l; i++) {\n\t\t\t\t\tvar s = sortList[i], o = c.headerList[s[0]];\n\t\t\t\t\to.count = s[1];\n\t\t\t\t\to.count++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* sorting methods */\n\t\t\tfunction multisort(table,sortList,cache) {\n\t\t\t\t\n\t\t\t\tif(table.config.debug) { var sortTime = new Date(); }\n\t\t\t\t\n\t\t\t\tvar dynamicExp = \"var sortWrapper = function(a,b) {\", l = sortList.length;\n\t\t\t\t\t\n\t\t\t\tfor(var i=0; i < l; i++) {\n\t\t\t\t\t\n\t\t\t\t\tvar c = sortList[i][0];\n\t\t\t\t\tvar order = sortList[i][1];\n\t\t\t\t\tvar s = (getCachedSortType(table.config.parsers,c) == \"text\") ? ((order == 0) ? \"sortText\" : \"sortTextDesc\") : ((order == 0) ? \"sortNumeric\" : \"sortNumericDesc\");\n\t\t\t\t\t\n\t\t\t\t\tvar e = \"e\" + i;\n\t\t\t\t\t\n\t\t\t\t\tdynamicExp += \"var \" + e + \" = \" + s + \"(a[\" + c + \"],b[\" + c + \"]); \";\n\t\t\t\t\tdynamicExp += \"if(\" + e + \") { return \" + e + \"; } \";\n\t\t\t\t\tdynamicExp += \"else { \";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if value is the same keep orignal order\t\n\t\t\t\tvar orgOrderCol = cache.normalized[0].length - 1;\n\t\t\t\tdynamicExp += \"return a[\" + orgOrderCol + \"]-b[\" + orgOrderCol + \"];\";\n\t\t\t\t\t\t\n\t\t\t\tfor(var i=0; i < l; i++) {\n\t\t\t\t\tdynamicExp += \"}; \";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdynamicExp += \"return 0; \";\t\n\t\t\t\tdynamicExp += \"}; \";\t\n\t\t\t\t\n\t\t\t\teval(dynamicExp);\n\t\t\t\t\n\t\t\t\tcache.normalized.sort(sortWrapper);\n\t\t\t\t\n\t\t\t\tif(table.config.debug) { benchmark(\"Sorting on \" + sortList.toString() + \" and dir \" + order+ \" time:\", sortTime); }\n\t\t\t\t\n\t\t\t\treturn cache;\n\t\t\t};\n\t\t\t\n\t\t\tfunction sortText(a,b) {\n\t\t\t\treturn ((a < b) ? -1 : ((a > b) ? 1 : 0));\n\t\t\t};\n\t\t\t\n\t\t\tfunction sortTextDesc(a,b) {\n\t\t\t\treturn ((b < a) ? -1 : ((b > a) ? 1 : 0));\n\t\t\t};\t\n\t\t\t\n\t \t\tfunction sortNumeric(a,b) {\n\t\t\t\treturn a-b;\n\t\t\t};\n\t\t\t\n\t\t\tfunction sortNumericDesc(a,b) {\n\t\t\t\treturn b-a;\n\t\t\t};\n\t\t\t\n\t\t\tfunction getCachedSortType(parsers,i) {\n\t\t\t\treturn parsers[i].type;\n\t\t\t};\n\t\t\t\n\t\t\t/* public methods */\n\t\t\tthis.construct = function(settings) {\n\n\t\t\t\treturn this.each(function() {\n\t\t\t\t\t\n\t\t\t\t\tif(!this.tHead || !this.tBodies) return;\n\t\t\t\t\t\n\t\t\t\t\tvar $this, $document,$headers, cache, config, shiftDown = 0, sortOrder;\n\t\t\t\t\t\n\t\t\t\t\tthis.config = {};\n\t\t\t\t\t\n\t\t\t\t\tconfig = $.extend(this.config, $.tablesorter.defaults, settings);\n\t\t\t\t\t\n\t\t\t\t\t// store common expression for speed\t\t\t\t\t\n\t\t\t\t\t$this = $(this);\n\t\t\t\t\t\n\t\t\t\t\t// build headers\n\t\t\t\t\t$headers = buildHeaders(this);\n\t\t\t\t\t\n\t\t\t\t\t// try to auto detect column type, and store in tables config\n\t\t\t\t\tthis.config.parsers = buildParserCache(this,$headers);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// build the cache for the tbody cells\n\t\t\t\t\tcache = buildCache(this);\n\t\t\t\t\t\n\t\t\t\t\t// get the css class names, could be done else where.\n\t\t\t\t\tvar sortCSS = [config.cssDesc,config.cssAsc];\n\t\t\t\t\t\n\t\t\t\t\t// fixate columns if the users supplies the fixedWidth option\n\t\t\t\t\tfixColumnWidth(this);\n\t\t\t\t\t\n\t\t\t\t\t// apply event handling to headers\n\t\t\t\t\t// this is to big, perhaps break it out?\n\t\t\t\t\t$headers.click(function(e) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this.trigger(\"sortStart\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!this.sortDisabled && totalRows > 0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// store exp, for speed\n\t\t\t\t\t\t\tvar $cell = $(this);\n\t\n\t\t\t\t\t\t\t// get current column index\n\t\t\t\t\t\t\tvar i = this.column;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// get current column sort order\n\t\t\t\t\t\t\tthis.order = this.count++ % 2;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// user only whants to sort on one column\n\t\t\t\t\t\t\tif(!e[config.sortMultiSortKey]) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// flush the sort list\n\t\t\t\t\t\t\t\tconfig.sortList = [];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(config.sortForce != null) {\n\t\t\t\t\t\t\t\t\tvar a = config.sortForce; \n\t\t\t\t\t\t\t\t\tfor(var j=0; j < a.length; j++) {\n\t\t\t\t\t\t\t\t\t\tif(a[j][0] != i) {\n\t\t\t\t\t\t\t\t\t\t\tconfig.sortList.push(a[j]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// add column to sort list\n\t\t\t\t\t\t\t\tconfig.sortList.push([i,this.order]);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// multi column sorting\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// the user has clicked on an all ready sortet column.\n\t\t\t\t\t\t\t\tif(isValueInArray(i,config.sortList)) {\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// revers the sorting direction for all tables.\n\t\t\t\t\t\t\t\t\tfor(var j=0; j < config.sortList.length; j++) {\n\t\t\t\t\t\t\t\t\t\tvar s = config.sortList[j], o = config.headerList[s[0]];\n\t\t\t\t\t\t\t\t\t\tif(s[0] == i) {\n\t\t\t\t\t\t\t\t\t\t\to.count = s[1];\n\t\t\t\t\t\t\t\t\t\t\to.count++;\n\t\t\t\t\t\t\t\t\t\t\ts[1] = o.count % 2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// add column to sort list array\n\t\t\t\t\t\t\t\t\tconfig.sortList.push([i,this.order]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t//set css for headers\n\t\t\t\t\t\t\t\tsetHeadersCss($this[0],$headers,config.sortList,sortCSS);\n\t\t\t\t\t\t\t\tappendToTable($this[0],multisort($this[0],config.sortList,cache));\n\t\t\t\t\t\t\t},1);\n\t\t\t\t\t\t\t// stop normal event by returning false\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t// cancel selection\t\n\t\t\t\t\t}).mousedown(function() {\n\t\t\t\t\t\tif(config.cancelSelection) {\n\t\t\t\t\t\t\tthis.onselectstart = function() {return false};\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t// apply easy methods that trigger binded events\n\t\t\t\t\t$this.bind(\"update\",function() {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// rebuild parsers.\n\t\t\t\t\t\tthis.config.parsers = buildParserCache(this,$headers);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// rebuild the cache map\n\t\t\t\t\t\tcache = buildCache(this);\n\t\t\t\t\t\t\n\t\t\t\t\t}).bind(\"sorton\",function(e,list) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(this).trigger(\"sortStart\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tconfig.sortList = list;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// update and store the sortlist\n\t\t\t\t\t\tvar sortList = config.sortList;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// update header count index\n\t\t\t\t\t\tupdateHeaderSortCount(this,sortList);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//set css for headers\n\t\t\t\t\t\tsetHeadersCss(this,$headers,sortList,sortCSS);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// sort the table and append it to the dom\n\t\t\t\t\t\tappendToTable(this,multisort(this,sortList,cache));\n\n\t\t\t\t\t}).bind(\"appendCache\",function() {\n\t\t\t\t\t\t\n\t\t\t\t\t\tappendToTable(this,cache);\n\t\t\t\t\t\n\t\t\t\t\t}).bind(\"applyWidgetId\",function(e,id) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tgetWidgetById(id).format(this);\n\t\t\t\t\t\t\n\t\t\t\t\t}).bind(\"applyWidgets\",function() {\n\t\t\t\t\t\t// apply widgets\n\t\t\t\t\t\tapplyWidget(this);\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tif($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) {\n\t\t\t\t\t\tconfig.sortList = $(this).metadata().sortlist;\n\t\t\t\t\t}\n\t\t\t\t\t// if user has supplied a sort list to constructor.\n\t\t\t\t\tif(config.sortList.length > 0) {\n\t\t\t\t\t\t$this.trigger(\"sorton\",[config.sortList]);\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// apply widgets\n\t\t\t\t\tapplyWidget(this);\n\t\t\t\t});\n\t\t\t};\n\t\t\t\n\t\t\tthis.addParser = function(parser) {\n\t\t\t\tvar l = parsers.length, a = true;\n\t\t\t\tfor(var i=0; i < l; i++) {\n\t\t\t\t\tif(parsers[i].id.toLowerCase() == parser.id.toLowerCase()) {\n\t\t\t\t\t\ta = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(a) { parsers.push(parser); };\n\t\t\t};\n\t\t\t\n\t\t\tthis.addWidget = function(widget) {\n\t\t\t\twidgets.push(widget);\n\t\t\t};\n\t\t\t\n\t\t\tthis.formatFloat = function(s) {\n\t\t\t\tvar i = parseFloat(s);\n\t\t\t\treturn (isNaN(i)) ? 0 : i;\n\t\t\t};\n\t\t\tthis.formatInt = function(s) {\n\t\t\t\tvar i = parseInt(s);\n\t\t\t\treturn (isNaN(i)) ? 0 : i;\n\t\t\t};\n\t\t\t\n\t\t\tthis.isDigit = function(s,config) {\n\t\t\t\tvar DECIMAL = '\\\\' + config.decimal;\n\t\t\t\tvar exp = '/(^[+]?0(' + DECIMAL +'0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)' + DECIMAL +'(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*' + DECIMAL +'0+$)/';\n\t\t\t\treturn RegExp(exp).test($.trim(s));\n\t\t\t};\n\t\t\t\n\t\t\tthis.clearTableBody = function(table) {\n\t\t\t\tif($.browser.msie) {\n\t\t\t\t\tfunction empty() {\n\t\t\t\t\t\twhile ( this.firstChild ) this.removeChild( this.firstChild );\n\t\t\t\t\t}\n\t\t\t\t\tempty.apply(table.tBodies[0]);\n\t\t\t\t} else {\n\t\t\t\t\ttable.tBodies[0].innerHTML = \"\";\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t});\n\t\n\t// extend plugin scope\n\t$.fn.extend({\n        tablesorter: $.tablesorter.construct\n\t});\n\t\n\tvar ts = $.tablesorter;\n\t\n\t// add default parsers\n\tts.addParser({\n\t\tid: \"text\",\n\t\tis: function(s) {\n\t\t\treturn true;\n\t\t},\n\t\tformat: function(s) {\n\t\t\treturn $.trim(s.toLowerCase());\n\t\t},\n\t\ttype: \"text\"\n\t});\n\t\n\tts.addParser({\n\t\tid: \"digit\",\n\t\tis: function(s,table) {\n\t\t\tvar c = table.config;\n\t\t\treturn $.tablesorter.isDigit(s,c);\n\t\t},\n\t\tformat: function(s) {\n\t\t\treturn $.tablesorter.formatFloat(s);\n\t\t},\n\t\ttype: \"numeric\"\n\t});\n\t\n\tts.addParser({\n\t\tid: \"currency\",\n\t\tis: function(s) {\n\t\t\treturn /^[£$€?.]/.test(s);\n\t\t},\n\t\tformat: function(s) {\n\t\t\treturn $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),\"\"));\n\t\t},\n\t\ttype: \"numeric\"\n\t});\n\t\n\tts.addParser({\n\t\tid: \"ipAddress\",\n\t\tis: function(s) {\n\t\t\treturn /^\\d{2,3}[\\.]\\d{2,3}[\\.]\\d{2,3}[\\.]\\d{2,3}$/.test(s);\n\t\t},\n\t\tformat: function(s) {\n\t\t\tvar a = s.split(\".\"), r = \"\", l = a.length;\n\t\t\tfor(var i = 0; i < l; i++) {\n\t\t\t\tvar item = a[i];\n\t\t\t   \tif(item.length == 2) {\n\t\t\t\t\tr += \"0\" + item;\n\t\t\t   \t} else {\n\t\t\t\t\tr += item;\n\t\t\t   \t}\n\t\t\t}\n\t\t\treturn $.tablesorter.formatFloat(r);\n\t\t},\n\t\ttype: \"numeric\"\n\t});\n\t\n\tts.addParser({\n\t\tid: \"url\",\n\t\tis: function(s) {\n\t\t\treturn /^(https?|ftp|file):\\/\\/$/.test(s);\n\t\t},\n\t\tformat: function(s) {\n\t\t\treturn jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\\/\\//),''));\n\t\t},\n\t\ttype: \"text\"\n\t});\n\t\n\tts.addParser({\n\t\tid: \"isoDate\",\n\t\tis: function(s) {\n\t\t\treturn /^\\d{4}[\\/-]\\d{1,2}[\\/-]\\d{1,2}$/.test(s);\n\t\t},\n\t\tformat: function(s) {\n\t\t\treturn $.tablesorter.formatFloat((s != \"\") ? new Date(s.replace(new RegExp(/-/g),\"/\")).getTime() : \"0\");\n\t\t},\n\t\ttype: \"numeric\"\n\t});\n\t\t\n\tts.addParser({\n\t\tid: \"percent\",\n\t\tis: function(s) { \n\t\t\treturn /\\%$/.test($.trim(s));\n\t\t},\n\t\tformat: function(s) {\n\t\t\treturn $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),\"\"));\n\t\t},\n\t\ttype: \"numeric\"\n\t});\n\n\tts.addParser({\n\t\tid: \"usLongDate\",\n\t\tis: function(s) {\n\t\t\treturn s.match(new RegExp(/^[A-Za-z]{3,10}\\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\\s(AM|PM)))$/));\n\t\t},\n\t\tformat: function(s) {\n\t\t\treturn $.tablesorter.formatFloat(new Date(s).getTime());\n\t\t},\n\t\ttype: \"numeric\"\n\t});\n\n\tts.addParser({\n\t\tid: \"shortDate\",\n\t\tis: function(s) {\n\t\t\treturn /\\d{1,2}[\\/\\-]\\d{1,2}[\\/\\-]\\d{2,4}/.test(s);\n\t\t},\n\t\tformat: function(s,table) {\n\t\t\tvar c = table.config;\n\t\t\ts = s.replace(/\\-/g,\"/\");\n\t\t\tif(c.dateFormat == \"us\") {\n\t\t\t\t// reformat the string in ISO format\n\t\t\t\ts = s.replace(/(\\d{1,2})[\\/\\-](\\d{1,2})[\\/\\-](\\d{4})/, \"$3/$1/$2\");\n\t\t\t} else if(c.dateFormat == \"uk\") {\n\t\t\t\t//reformat the string in ISO format\n\t\t\t\ts = s.replace(/(\\d{1,2})[\\/\\-](\\d{1,2})[\\/\\-](\\d{4})/, \"$3/$2/$1\");\n\t\t\t} else if(c.dateFormat == \"dd/mm/yy\" || c.dateFormat == \"dd-mm-yy\") {\n\t\t\t\ts = s.replace(/(\\d{1,2})[\\/\\-](\\d{1,2})[\\/\\-](\\d{2})/, \"$1/$2/$3\");\t\n\t\t\t}\n\t\t\treturn $.tablesorter.formatFloat(new Date(s).getTime());\n\t\t},\n\t\ttype: \"numeric\"\n\t});\n\n\tts.addParser({\n\t    id: \"time\",\n\t    is: function(s) {\n\t        return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\\s(am|pm)))$/.test(s);\n\t    },\n\t    format: function(s) {\n\t        return $.tablesorter.formatFloat(new Date(\"2000/01/01 \" + s).getTime());\n\t    },\n\t  type: \"numeric\"\n\t});\n\t\n\t\n\tts.addParser({\n\t    id: \"metadata\",\n\t    is: function(s) {\n\t        return false;\n\t    },\n\t    format: function(s,table,cell) {\n\t\t\tvar c = table.config, p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName;\n\t        return $(cell).metadata()[p];\n\t    },\n\t  type: \"numeric\"\n\t});\n\t\n\t// add default widgets\n\tts.addWidget({\n\t\tid: \"zebra\",\n\t\tformat: function(table) {\n\t\t\tif(table.config.debug) { var time = new Date(); }\n\t\t\t$(\"tr:visible\",table.tBodies[0])\n\t        .filter(':even')\n\t        .removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0])\n\t        .end().filter(':odd')\n\t        .removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);\n\t\t\tif(table.config.debug) { $.tablesorter.benchmark(\"Applying Zebra widget\", time); }\n\t\t}\n\t});\t\n})(jQuery);"
  },
  {
    "path": "extensions/themes/silverblue/scripts/main.js",
    "content": "/**\n * \n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n// namespace for script variables\nvar OntoWiki = {};\n\n// how fast should we fade, slide, ...\nvar effectTime = 250;\n\n// integer value of the dragNdrop z-index and context-menu z-index\nvar dragZIndex = 1000;\nvar menuZIndex = 1000;\n\n// number of chars entered before autocompleting starts\nvar autoCompleteMinChars = 3;\n\n// time to wait before autocompleting (ms)\nvar autoCompleteDelay = 500;\n\n// The id counter is used to create autoids\nidCounter = 1;\n\n// This array is used to temp. store href attributes\ntempHrefs = new Array();\n\n/*\n * core css assignments\n */\n$(document).ready(function() {\n    // keyboard shortcuts\n    $(document).keydown(function(e) {\n        if (/view\\/?|resource\\/properties\\/?/gi.test(window.document.baseURI)) {\n            if (e.shiftKey && e.altKey) {\n                var shouldPreventDefault = false;\n\n                switch(e.which) {\n                    //e - 101 - edit E - 69\n                    case 69 :\n                        $('.edit-enable').trigger('click');\n                        shouldPreventDefault = true;\n                        break;\n                    //a - 97 - add property - A - 65\n                    case 65 :\n                        $('.property-add').trigger('click');\n                        e.preventDefault();\n                        break;\n                    //s - 115 - save S - 83\n                    case 83 :\n                        if ($('.edit-enable').hasClass('active')) {\n                            $('.edit.save').trigger('click');\n                            e.preventDefault();\n                        }; \n                        break;\n                    //c  - 99 - cancel C - 67\n                    case 67 :\n                        if ($('.edit-enable').hasClass('active')) {\n                            $('.edit.cancel').trigger('click');\n                            e.preventDefault();\n                        };\n                        break;\n                    //l - 108 - clone L - 76\n                    case 76 :\n                        $('.clone-resource').trigger('click');\n                        e.preventDefault();\n                        break;\n                }\n\n                if (shouldPreventDefault) {\n                    e.preventDefault();\n                }\n            }\n        }\n    });\n    // Object.keys support in older environments that do not natively support it\n    if (!Object.keys) {\n        Object.keys = (function () {\n            var hasOwnProperty = Object.prototype.hasOwnProperty,\n                hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),\n                dontEnums = [\n                  'toString',\n                  'toLocaleString',\n                  'valueOf',\n                  'hasOwnProperty',\n                  'isPrototypeOf',\n                  'propertyIsEnumerable',\n                  'constructor'\n                ],\n                dontEnumsLength = dontEnums.length\n\n            return function (obj) {\n                if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) throw new TypeError('Object.keys called on non-object')\n\n                var result = []\n\n                for (var prop in obj) {\n                    if (hasOwnProperty.call(obj, prop)) result.push(prop)\n                }\n\n                if (hasDontEnumBug) {\n                    for (var i=0; i < dontEnumsLength; i++) {\n                        if (hasOwnProperty.call(obj, dontEnums[i])) result.push(dontEnums[i])\n                    }\n                }\n              return result\n            }\n        })()\n    };\n\n    // the body gets a new class to indicate that javascript is turned on\n    $('body').removeClass('javascript-off').addClass('javascript-on');\n\n    // the body gets the contextmenu clone container\n    $('body').append('<div class=\"contextmenu-enhanced\"></div>');\n\n    // every click fadeout (and remove) all contextmenus\n    // every click un-marks all marked elements\n    $('html').click(function(){\n        $('.contextmenu-enhanced .contextmenu').fadeOut(effectTime, function(){$(this).remove();})\n        $('.marked').removeClass('marked');\n    });\n    \n    // add section resizer\n    $('.section-sidewindows').append('<span class=\"resizer-horizontal\"></span>');\n    \n    // give it a nice (non-standard) cursor\n    if ($.browser.safari) {\n        $('.resizer-horizontal').css('cursor', 'col-resize');\n    } else if ($.browser.mozilla) {\n        $('.resizer-horizontal').css('cursor', 'ew-resize');\n    }\n    \n    // make resizer draggable\n    // draggables need an explicit (inline) position\n    $('.section-sidewindows .resizer-horizontal')\n        .css('position', 'absolute')\n        .draggable({\n            axis: 'x', \n            zIndex: dragZIndex,  \n            cursor: 'move', \n            start: function(event, ui) {\n                $('.section-sidewindows .resizer-horizontal').addClass('dragging');\n            }, \n            stop: function(event, ui) {\n                var resizerWidth = $('.section-sidewindows .resizer-horizontal').width();\n                var sectionRatioPercent = Math.round((((event.originalEvent.pageX) / $(document).width())) * 1000) * 0.1;\n                setSectionRatio(sectionRatioPercent);\n                sessionStore('sectionRation', sectionRatioPercent, {encode: true});\n                $('.window div.cmDiv').adjustClickMenu();\n                // jQuery UI bug in Safari\n                $('.section-sidewindows').css('position', 'absolute');\n                $('.section-sidewindows .resizer-horizontal').removeClass('dragging');\n            }});\n    \n    // resize separator when all ajax crap is loaded\n    window.setTimeout(function () {\n        $('.section-sidewindows .resizer-horizontal').height(\n            Math.max(\n                $(document).height(),\n                $(window).height(),\n                /* for Opera: */\n                document.documentElement.clientHeight\n            ) + 'px');\n    }, 750);\n\n    if (typeof sectionRatio != 'undefined') {\n        setSectionRatio(sectionRatio);\n    }\n\n    /* list selection */\n    /* bind to selection events */\n    $('body').bind(\n        'ontowiki.selection.changed',\n        function(event, data)\n        {\n            // select event\n            $('.list-selected').removeClass('list-selected'); // should not add class in the click function\n            $('table.resource-list > tbody > tr').each(\n                function(key)\n                {\n                    var pos = $.inArray($(this).children('td').children('a').attr('about'), data);\n                    if (pos >= 0) {\n                        $(this).addClass('list-selected');\n                    }\n                }\n            );\n        }\n    );\n\n    /* trigger selection events */\n    $('table.resource-list > tbody > tr').live('click', function(e) {\n        var selectee     = $(this);\n        var selectionURI = $(this).attr('about') | $(this).children('td').children('a').attr('about');\n\n        // return if we have no URI (e.g. a Literal list)\n        if (typeof selectionURI == 'undefined') {\n            return false;\n        }\n\n        // return true if user clicked on a link (so the link is fired)\n        if ( $(e.target).is('a') ) {\n            return true;\n        }\n\n        // create array for all selected resources\n        if (typeof OntoWiki.selectedResources == 'undefined') {\n            OntoWiki.selectedResources = [];\n        }\n\n        if (!selectee.hasClass('list-selected')) { // select a resource\n            // TODO: check for macos UI compability\n            if (e.ctrlKey) {\n                // ctrl+click for select multiple resources\n\n            } else if (e.shiftKey) {\n                // shift+click for select multiple resources in a range\n                // not implemented yet\n            } else {\n                // normal click on unselected means deselect all and select this one\n                // purge the container array\n                OntoWiki.selectedResources = [];\n            }\n\n            // add this resource\n            OntoWiki.selectedResources.push(selectionURI);\n            // event for most recent selection\n            $('body').trigger('ontowiki.resource.selected', [selectionURI]);\n        } else { // deselect a resource\n            // TODO: check for macos UI compability\n            if (e.ctrlKey) {\n                // ctrl+click on selected means deselect this one\n                var pos = $.inArray(selectionURI, OntoWiki.selectedResources);\n                OntoWiki.selectedResources.splice(pos, 1);\n            } else if (e.shiftKey) {\n                // shift+click for select multiple resources in a range\n                // not implemented yet\n            } else {\n                // normal click on selected means deselect all\n                // purge the container array\n                OntoWiki.selectedResources = [];\n            }\n\n            // event for most recent unselection\n            $('body').trigger('ontowiki.resource.unselected', [selectionURI]);\n        }\n\n        // event for all selected\n        $('body').trigger('ontowiki.selection.changed', [OntoWiki.selectedResources]);\n    });\n    /* END list selection */\n\n    $('body').bind('ontowiki.resource-list.reloaded', function() {\n        // synchronize selection with list style\n        $('.resource-list tr').each(function() {\n            var resourceURI = $(this).find('*[about]').eq(0).attr('about');\n            if ($.inArray(resourceURI, OntoWiki.selectedResources) > -1) {\n                $(this).addClass('list-selected');\n            }\n        })\n    })\n    \n    /* end: list selection */\n    \n    // inner labels\n    $('input.inner-label').innerLabel().blur();\n    \n    // prefix preserving inputs\n    $('input.prefix-value').prefixValue();\n    \n    $('.editable').makeEditable();\n    \n    // autosubmit\n    $('a.submit').click(function() {\n        // submit all forms inside this submit button's parent window\n        var formName = $(this).attr('id');\n        var formSpec = formName ? '[name=' + formName + ']' : '';\n        \n        $(this).parents('.window').eq(0).find('form' + formSpec).each(function() {\n            if ($(this).hasClass('ajaxForm')) {\n                // submit asynchronously\n                var actionUrl = $(this).attr('action');\n                var method    = $(this).attr('method');\n                var data      = $(this).serialize();\n                \n                if ($(this).hasClass('reloadOnSuccess')) {\n                    var mainContent = $(this).parents('.content.has-innerwindows').eq(0).children('.innercontent');\n                    var onSuccess = function() {\n                        mainContent.load(document.URL);\n                    }\n                }\n                // alert(data);\n                if (method == 'post') {\n                    $.post(actionUrl, data, onSuccess);\n                } else {\n                    $.get(actionUrl, data, onSuccess);\n                }\n                \n                this.reset();\n            } else {\n                // submit normally\n                this.submit();\n            }\n        })\n    });\n    \n    /*\n     *  simulate Safari behaviour for other browsers\n     *  on return/enter, submit the form\n     */\n    $('.submitOnEnter').keypress(function(event) {\n        // return pressed\n        if (event.target.tagName.toLowerCase() != 'textarea' && event.which == 13) {\n            $(this).parents('form').submit();\n        }\n    });\n    \n    /*\n     *  on press enter, this type of textbox looses focus and gives it to the next element of the same type\n     */\n    $('.focusNextOnEnter').keypress(function(event) {\n        // return pressed\n        if (event.target.tagName.toLowerCase() != 'textarea' && event.which == 13) {\n            var me = $(this)\n            var meType = me.get(0).tagName.toLowerCase()\n            var next = me.next(); //next element\n            if(next.get(0).tagName.toLowerCase() == meType){\n                next.focus();\n            } else {\n                // if thats not of the same type, go to \"parent and \"cousin\"\"\n                var next2 = me.parent().next().find('>'+meType+':first')\n                if (next2.length != 0){\n                    next2.focus();\n                } \n            } \n        }\n    });\n    \n    // autosubmit\n    $('a.reset').click(function() {\n        // reset all forms inside this submit button's parent window\n        $(this).parents('.window').find('form').each(function() {\n            document.forms[$(this).attr('name')].reset();\n        })\n    });\n\n    // init new resource based on type\n    $('.init-resource').click(function(event) {\n        // parse .resource-list and query for all types\n        if ($('.resource-list').length != 0) {\n            var types = $('.resource-list').rdf()\n                                           .where('?type a rdfs:Class')\n                                           .where('?type rdfs:label ?value')\n                                           .dump();\n\n            if (Object.keys(types).length == 1) {\n                createInstanceFromClassURI(Object.keys(types)[0]);\n            } else {\n                showAddInstanceMenu(event, types);\n            }\n        } else {\n            // workaround to create instance when number of instances of a class is null\n            // The selected class should be hardcoded by ontowiki in the header as \n            // javascript variable.\n            createInstanceFromClassURI($('#filterbox a').attr('about'));\n        }\n        \n    });\n\n    $('.edit.save').click(function() {\n        RDFauthor.commit();\n    });\n    \n    $('.edit.cancel').click(function() {\n        $(body).data('editingMode', false);\n        // reload page\n        window.location.href = window.location.href;\n        RDFauthor.cancel();\n        // var mainInnerContent = $('.window .content.has-innerwindows').eq(0).find('.innercontent');\n        // mainInnerContent.load(document.URL);\n        // $('.edit-enable').click();\n    });\n    \n//    $('.icon-edit').click(function() {return editProperty(this)});\n    \n    // disable inline-editing for not readable models\n    if (typeof selectedGraph !== 'undefined' && !selectedGraph.editable) {\n        $('.icon-edit').closest('a').remove();\n    }\n    \n    // edit mode\n    $('.edit-enable').click(function() {\n        $(body).data('editingMode', true);\n        var button = this;\n        if ($(button).hasClass('active')) {\n            RDFauthor.cancel();\n            $('.edit').each(function() {\n                $(this).fadeOut(effectTime);\n            });\n            $(button).removeClass('active');\n            window.location.href = window.location.href;\n        } else {\n            if(typeof(RDFauthor) !== 'undefined') {\n                RDFauthor.cancel();\n            }\n            loadRDFauthor(function () {\n                RDFauthor.setOptions({\n                    onSubmitSuccess: function () {\n                        // var mainInnerContent = $('.window .content.has-innerwindows').eq(0).find('.innercontent');\n                        // mainInnerContent.load(document.URL);\n\n                        // tell RDFauthor that page content has changed\n                        // RDFauthor.invalidatePage();\n\n                        $('.edit').each(function() {\n                            $(this).fadeOut(effectTime);\n                        });\n                        $('.edit-enable').removeClass('active');\n                        \n                        // HACK: reload whole page after 1000 ms\n                        window.setTimeout(function () {\n                            window.location.href = window.location.href;\n                        }, 500);\n                    }, \n                    onCancel: function () {\n                        $('.edit').each(function() {\n                            $(this).fadeOut(effectTime);\n                        });\n                        $('.edit-enable').removeClass('active');\n                    }, \n                    saveButtonTitle: 'Save Changes', \n                    cancelButtonTitle: 'Cancel', \n                    title: $('.section-mainwindows .window').eq(0).children('.title').eq(0).text(),\n                    loadOwStylesheet: false,\n                    viewOptions: {\n                        // no statements needs popover\n                        type: $('.section-mainwindows table.Resource').length ? RDFAUTHOR_VIEW_MODE : 'popover', \n                        container: function (statement) {\n                            var element = RDFauthor.elementForStatement(statement);\n                            var parent  = $(element).closest('div');\n                            \n                            if (!parent.hasClass('ontowiki-processed')) {\n                                parent.children().each(function () {\n                                    $(this).hide();\n                                });\n                                parent.addClass('ontowiki-processed');\n                            }\n                            \n                            return parent.get(0);\n                        }\n                    }\n                });\n                \n                RDFauthor.start();\n                \n                $('.edit').each(function() {\n                    $(this).fadeIn(effectTime, function() {\n                        $(button).addClass('active');\n                    });\n                });\n            });\n        }\n    });\n    \n    $('.clone-resource').click(function() {\n        loadRDFauthor(function () {\n            var serviceURI = urlBase + 'service/rdfauthorinit';\n            var prototypeResource = selectedResource.URI;\n            RDFauthor.reset();\n\n            $.getJSON(serviceURI, {\n               mode: 'clone',\n               uri: prototypeResource\n            }, function(data) {\n                // get default resource uri for subjects in added statements (issue 673)\n                // grab first object key\n                for (var subjectUri in data) {break;};\n                \n                populateRDFauthor(data, true, subjectUri, selectedGraph.URI);\n                \n                RDFauthor.setOptions({\n                    saveButtonTitle: 'Create Resource',\n                    cancelButtonTitle: 'Cancel',\n                    title: 'Create New Resource by Cloning ' + selectedResource.title,  \n                    autoParse: false, \n                    showPropertyButton: true,\n                    loadOwStylesheet: false,\n                    onSubmitSuccess: function (responseData) {\n                        var newLocation;\n                        if (responseData && responseData.changed) {\n                            newLocation = resourceURL(responseData.changed);\n                        } else {\n                            newLocation = window.location.href;\n                        }\n                        // HACK: reload whole page after 500 ms\n                        window.setTimeout(function () {\n                            window.location.href = newLocation;\n                        }, 500);\n                    }\n                });\n                \n                RDFauthor.start();\n            });\n        });\n    })\n    \n    // add property\n    $('.property-add').click(function() {\n        $(body).data('editingMode', true);\n        if(typeof(RDFauthor) === 'undefined') {\n            loadRDFauthor(function () {\n                RDFauthor.setOptions({\n                    onSubmitSuccess: function () {\n                        // var mainInnerContent = $('.window .content.has-innerwindows').eq(0).find('.innercontent');\n                        // mainInnerContent.load(document.URL);\n\n                        // tell RDFauthor that page content has changed\n                        // RDFauthor.invalidatePage();\n\n                        $('.edit').each(function() {\n                            $(this).fadeOut(effectTime);\n                        });\n                        $('.edit-enable').removeClass('active');\n                        \n                        // HACK: reload whole page after 1000 ms\n                        window.setTimeout(function () {\n                            window.location.href = window.location.href;\n                        }, 500);\n                    }, \n                    onCancel: function () {\n                        $('.edit').each(function() {\n                            $(this).fadeOut(effectTime);\n                        });\n                        $('.edit-enable').removeClass('active');\n                    }, \n                    saveButtonTitle: 'Save Changes', \n                    cancelButtonTitle: 'Cancel',\n                    loadOwStylesheet: false,\n                    title: $('.section-mainwindows .window').eq(0).children('.title').eq(0).text(), \n                    viewOptions: {\n                        // no statements needs popover\n                        type: $('.section-mainwindows table.Resource').length ? RDFAUTHOR_VIEW_MODE : 'popover', \n                        container: function (statement) {\n                            var element = RDFauthor.elementForStatement(statement);\n                            var parent  = $(element).closest('div');\n                            \n                            if (!parent.hasClass('ontowiki-processed')) {\n                                parent.children().each(function () {\n                                    $(this).hide();\n                                });\n                                parent.addClass('ontowiki-processed');\n                            }\n                            \n                            return parent.get(0);\n                        }\n                    }\n                });\n                //workaround: don't load widget\n                RDFauthor.start($('head'));\n                $('.edit-enable').addClass('active');\n                setTimeout(\"addProperty()\",500);\n            });\n        } else {\n            addProperty();\n        }\n        \n    });\n    \n    $('.tabs').children('li').children('a').click(function() {\n        var url = $(this).attr('href');\n        \n        $(this).parents('.tabs').children('li').removeClass('active');\n        $(this).parent('li').addClass('active');\n                \n        if (url.match(/#/)) {\n            var wnd = $(this).parents('.window').eq(0);\n            wnd.children('div').children('.content').removeClass('active-tab-content');\n            wnd.children('div').children('.content' + url).addClass('active-tab-content');\n            return false;\n        } else {\n            return true;\n        }\n    });\n    \n    // box display/hide    \n    // $('.toggle-module-display').click(function() {\n    //     var module = $('.window#' + $(this).attr('id').replace('toggle-', ''));\n    //     var menuEntry = $(this);\n    //     if (module.length) {\n    //         if (module.hasClass('is-disabled')) {\n    //             module.removeClass('is-disabled');\n    //             module.fadeIn(effectTime, function() {\n    //                 menuEntry.text(menuEntry.text().replace('Show', 'Hide'));\n    //             })\n    //         } else {\n    //             module.fadeOut(effectTime, function() {\n    //                 module.addClass('is-disabled');\n    //                 menuEntry.text(menuEntry.text().replace('Hide', 'Show'));\n    //             });\n    //         }\n    //     }\n    // })\n    \n    \n    // make sidebar windows sortable\n/*    if ($('.section-sidewindows .window').length) {\n        $('.section-sidewindows .window .title').css('cursor', 'move');\n        $('.section-sidewindows').sortable({\n            items: '.window', \n            handle: '.title', \n            // containment: 'parent', \n            opacity: 0.8, \n            axis: 'y', \n            cursor: 'move', \n            revert: true, \n            start: function(event, ui) {\n                ui.helper.css('width', $('.section-sidewindows .window').eq(0).width() + 'px');\n                ui.helper.css('margin-left', '0');\n            }, \n            update: function() {\n                var moduleOrder = $('.section-sidewindows').sortable('serialize', {\n                    expression: '(.*)', \n                    key: 'value'\n                });\n                sessionStore('moduleOrder', moduleOrder, {encode: false, namespace: 'Module_Registry'});\n            }\n        });\n        // draggables need an explicit (inline) position\n        $('.section-sidewindows').css('position', 'absolute');\n    }\n*/\n    \n    // make tabs sortable\n    // if ($('#tabs').children().length) {\n    //     $('#tabs').sortable({\n    //         axis: 'x', \n    //         // containment: 'parent', \n    //         opacity: 0.8, \n    //         revert: true, \n    //         update: function() {\n    //             var tabOrder = $('#tabs').sortable('serialize', {\n    //                 expression: '(.*)', \n    //                 key: 'value'\n    //             });\n    //             sessionStore('tabOrder', tabOrder, {encode: false, namespace: 'ONTOWIKI_NAVIGATION'});\n    //         }\n    //     });\n    // }\n    \n    // inline widgets\n    // $('.inline-edit-local').live('click', function() {\n    //     RDFauthor.startInline($(this).closest('.editable').get(0));\n    // });\n    \n    $('.hidden').hide();\n    \n    //-------------------------------------------------------------------------\n    //---- liveQuery triggers\n    //-------------------------------------------------------------------------\n    \n    // expandables\n    $('.expandable').livequery(function() {\n        $(this).expandable();\n    });\n\n    // create showResourceMenu toogle where wanted and applicable\n    $('a.hasMenu[about]').livequery(function() {\n        $(this).createResourceMenuToggle();\n    });\n    $('a.hasMenu[resource]').livequery(function() {\n        $(this).createResourceMenuToggle();\n    });\n\n    $('.init-resource').livequery(function() {\n        $(this).createResourceMenuToggle();\n    });\n\n    // All RDFa elements with @about or @resource attribute are resources\n    $('*[about]').livequery(function() {\n        $(this).addClass('Resource');\n    });\n    $('*[resource]').livequery(function() {\n        $(this).addClass('Resource');\n    });\n    \n    \n    var liveSearchMinChars = 3;\n    var liveSearchTimeout  = 250; // ms\n    var count = 0;\n    \n    // live-search\n    $('input.live-search').livequery('keyup', function() {\n        var localCount = ++count;\n        var searchInput = $(this);\n        \n        window.setTimeout(function() {\n            // no more input, so do something\n            if (count == localCount) {\n                if (($(searchInput).val().length >= liveSearchMinChars)) {\n                    $(searchInput).parents('.content').children('ul').hide();\n                    if ($(searchInput).parents('.content').children('.messagebox').length < 1) {\n                        $(searchInput).parents('.content').append(\n                            '<div style=\"display:none\" class=\"messagebox info\">Not implemented yet.</div>');\n                        $(searchInput).parents('.content').children('.messagebox').fadeIn(effectTime);\n                    }\n                } else {\n                    // load normal hierarchy\n                    $(searchInput).parents('.content').children('ul').fadeIn(effectTime);\n                    $(searchInput).parents('.content').children('.messagebox').remove();\n                }                \n            }\n        }, liveSearchTimeout);\n    });\n    \n    /* RESOURCE CONTEXT MENUS */\n    $('.has-contextmenus-block .Resource').livequery(function() {\n        $(this).append('<span class=\"button\"></span>');\n    });\n    \n    $('.has-contextmenus-block .Resource span.button').livequery(function() {\n        $(this).mouseover(function() {\n            hideHref($(this).parent());\n            $('.contextmenu-enhanced .contextmenu').remove(); // remove all other menus\n        })\n        .click(function(event) {\n            showResourceMenu(event);\n        }).mouseout(function() {\n            showHref($(this).parent())\n        });\n    });\n    \n    var loadChildren = function(li) {\n        var ul;\n        var a   = $(li).children('.hierarchy-toggle');\n        var uri = $(li).children('.has-children').attr('about');\n        \n        var toggleDisplay = function(ul) {\n            if (ul.css('display') != 'none') {\n                ul.slideUp(effectTime, function() {\n                    a.removeClass('open');\n                    sessionStore('hierarchyOpen', 'value=' + encodeURIComponent(uri), {method: 'unset', withValue: true});\n                });\n            } else {\n                ul.slideDown(effectTime, function() {\n                    a.addClass('open');\n                    sessionStore('hierarchyOpen', 'value=' + encodeURIComponent(uri), {method: 'push', withValue: true});\n                });\n            }\n        }\n        \n        var serviceUrl = urlBase + 'service/hierarchy?entry=' + encodeURIComponent(uri);\n        $.get(serviceUrl, function(data) {\n            ul = $(data);\n            ul.css('display', 'none');\n            $(li).append(ul);\n            toggleDisplay(ul);\n        })\n    }\n    \n    $('ul .hierarchy .has-children').livequery(function() {\n        // is open and should have children but has none\n        if ($(this).prev('.hierarchy-toggle').hasClass('open') && $(this).parent().children('ul').length < 1) {\n            loadChildren($(this).parent());\n        }\n    });\n    \n    $('.hierarchy-toggle').livequery('click', function(event) {\n        var ul;\n        var a   = $(this);\n        var uri = a.next().attr('about');\n        \n        var toggleDisplay = function(ul) {\n            if (ul.css('display') != 'none') {\n                ul.slideUp(effectTime, function() {\n                    a.removeClass('open');\n                    sessionStore('hierarchyOpen', 'value=' + encodeURIComponent(uri), {method: 'unset', withValue: true});\n                });\n            } else {\n                ul.slideDown(effectTime, function() {\n                    a.addClass('open');\n                    sessionStore('hierarchyOpen', 'value=' + encodeURIComponent(uri), {method: 'push', withValue: true});\n                });\n            }\n        }\n        \n        if ($(this).parent('li').children('ul').length < 1) {\n            // TODO: Ajax\n            var serviceUrl = urlBase + 'service/hierarchy?entry=' + encodeURIComponent(uri);\n            $.get(serviceUrl, function(data) {\n                ul = $(data);\n                ul.css('display', 'none');\n                a.parent('li').append(ul);\n                toggleDisplay(ul);\n            })\n        } else {\n            ul = a.parent('li').children('ul');\n            toggleDisplay(ul);\n        }\n        \n        event.stopPropagation();\n    })\n    \n    $('tbody a.toggle').live('click', function() {\n        $(this).closest('tbody').toggleClass('closed');\n    })\n    \n    // site is ready, processing is finished\n    $('body').removeClass('is-processing');\n\n    // enhance every window with buttons, menu and resizer\n    // this must be done at the end of the onready block (because we generate the menu automatically)\n    $('.window').enhanceWindow();\n    \n    // adjust neede space for clickmenu\n    $('.window div.cmDiv').adjustClickMenu();\n    \n}) // $(document).ready\n\n"
  },
  {
    "path": "extensions/themes/silverblue/scripts/serialize-php.js",
    "content": "/**\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\nfunction serialize (mixed_value) {\n    // Returns a string representation of variable (which can later be unserialized by php)\n    //\n    // version: 909.322\n    // discuss at: http://phpjs.org/functions/serialize\n    // +   original by: Arpad Ray (mailto:arpad@php.net)\n    // +   improved by: Dino\n    // +   bugfixed by: Andrej Pavlovic\n    // +   bugfixed by: Garagoth\n    // +      input by: DtTvB (http://dt.in.th/2008-09-16.string-length-in-bytes.html)\n    // +   bugfixed by: Russell Walker (http://www.nbill.co.uk/)\n    // +   bugfixed by: Jamie Beck (http://www.terabit.ca/)\n    // %          note: We feel the main purpose of this function should be to ease the transport of data between php & js\n    // %          note: Aiming for PHP-compatibility, we have to translate objects to arrays\n    // *     example 1: serialize(['Kevin', 'van', 'Zonneveld']);\n    // *     returns 1: 'a:3:{i:0;s:5:\"Kevin\";i:1;s:3:\"van\";i:2;s:9:\"Zonneveld\";}'\n    // *     example 2: serialize({firstName: 'Kevin', midName: 'van', surName: 'Zonneveld'});\n    // *     returns 2: 'a:3:{s:9:\"firstName\";s:5:\"Kevin\";s:7:\"midName\";s:3:\"van\";s:7:\"surName\";s:9:\"Zonneveld\";}'\n    var _getType = function (inp) {\n        var type = typeof inp, match;\n        var key;\n        if (type == 'object' && !inp) {\n            return 'null';\n        }\n        if (type == \"object\") {\n            if (!inp.constructor) {\n                return 'object';\n            }\n            var cons = inp.constructor.toString();\n            match = cons.match(/(\\w+)\\(/);\n            if (match) {\n                cons = match[1].toLowerCase();\n            }\n            var types = [\"boolean\", \"number\", \"string\", \"array\"];\n            for (key in types) {\n                if (cons == types[key]) {\n                    type = types[key];\n                    break;\n                }\n            }\n        }\n        return type;\n    };\n    var type = _getType(mixed_value);\n    var val, ktype = '';\n\n    switch (type) {\n        case \"function\":\n            val = \"\";\n            break;\n        case \"boolean\":\n            val = \"b:\" + (mixed_value ? \"1\" : \"0\");\n            break;\n        case \"number\":\n            val = (Math.round(mixed_value) == mixed_value ? \"i\" : \"d\") + \":\" + mixed_value;\n            break;\n        case \"string\":\n            val = \"s:\" + encodeURIComponent(mixed_value).replace(/%../g, 'x').length + \":\\\"\" + mixed_value + \"\\\"\";\n            break;\n        case \"array\":\n        case \"object\":\n            val = \"a\";\n            /*\n            if (type == \"object\") {\n                var objname = mixed_value.constructor.toString().match(/(\\w+)\\(\\)/);\n                if (objname == undefined) {\n                    return;\n                }\n                objname[1] = this.serialize(objname[1]);\n                val = \"O\" + objname[1].substring(1, objname[1].length - 1);\n            }\n            */\n            var count = 0;\n            var vals = \"\";\n            var okey;\n            var key;\n            for (key in mixed_value) {\n                ktype = _getType(mixed_value[key]);\n                if (ktype == \"function\") {\n                    continue;\n                }\n\n                okey = (key.match(/^[0-9]+$/) ? parseInt(key, 10) : key);\n                vals += this.serialize(okey) +\n                        this.serialize(mixed_value[key]);\n                count++;\n            }\n            val += \":\" + count + \":{\" + vals + \"}\";\n            break;\n        case \"undefined\": // Fall-through\n        default: // if the JS object has a property which contains a null value, the string cannot be unserialized by PHP\n            val = \"N\";\n            break;\n    }\n    if (type != \"object\" && type != \"array\") {\n        val += \";\";\n    }\n    return val;\n}\n"
  },
  {
    "path": "extensions/themes/silverblue/scripts/support.js",
    "content": "\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2009, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki Support functions\n */\n\nfunction toggleExpansion(event) {\n    var target = $(event.target);\n    var resourceUri = target.next().attr('about') ? target.next().attr('about') : target.next().attr('resource');\n    \n    if (target.hasClass('expand')) {\n        target.removeClass('expand').addClass('collapse');\n        \n        if (target.parent().children('.expansion').length) {\n            target.parent().children('.expansion').slideDown(effectTime);\n        } else {\n            var expansion = $('<div class=\"expansion\" style=\"font-size:90%\"></div>');\n            target.parent().append(expansion);\n            var url    = urlBase + 'view/';\n            var params = 'r=' + encodeURIComponent(resourceUri);\n            $.ajax({\n                url:      url, \n                data:     params, \n                dataType: 'html', \n                success:  function(content) {\n                    expansion.hide();\n                    expansion.append(content);\n                    expansion.slideDown(effectTime);\n                    /*map.updateInfoWindow([\n                        new GInfoWindowTab('', target.parent().html())\n                    ])*/ // only a javascript error, i think it was neccessery for the old ontowiki\n                }\n            });\n        }\n    } else {\n        target.removeClass('collapse').addClass('expand');\n        target.parent().find('.expansion').slideUp(effectTime);\n    }\n}\n\nfunction expand(event) {\n    target = $(event.target);\n    resourceURI = target.next().attr('about');\n    encodedResourceURI = encodeURIComponent(resourceURI);\n    resource = target.next();\n\n    if (target.is('.expand')) {\n        target.removeClass('expand').addClass('deexpand');\n        // target.next().after('<div class=\"is-processing expanded-content\"></div>');\n        url = urlBase + 'resource/properties/';\n        params = 'r=' + encodedResourceURI;\n        $.ajax({\n            url: url,\n            data: params,\n            dataType: 'html',\n            // success: function(msg){alert( 'Data Saved: ' + msg );}\n            success: function(content) {\n                map.updateInfoWindow([new GInfoWindowTab('', target.parent().html() + '<div style=\"font-size:90%\">' + content + '</div>')]);\n                // resource.next().html(content);\n                // resource.next().removeClass('is-processing');\n                }\n        });\n    }\n    else if (target.is('.deexpand')) {\n        target.removeClass('deexpand').addClass('expand');\n        target.next().next().remove();\n    }\n}\n\n/**\n * Changes the Ratio between main and side-section\n */\nfunction setSectionRatio(x) {\n    $('div.section-sidewindows').css('width', x + '%');\n    $('div.section-mainwindows').css('width', (100 - x) + '%');\n    $('div.section-mainwindows').css('margin-left', x + '%');\n}\n\nfunction showWindowMenu(event) {\n    // remove all other menus\n    $('.contextmenu-enhanced .contextmenu').remove();\n    \n    menuX  = event.pageX - 11;\n    menuY  = event.pageY - 11;\n    menuId = 'windowmenu-' + menuX + '-' + menuY;\n\n    // create the plain menu with correct style and position\n    $('.contextmenu-enhanced').append('<div class=\"contextmenu is-processing\" id=\"' + menuId + '\"></div>');\n    $('#' + menuId)\n        .attr({style: 'z-index: ' + menuZIndex + '; top: ' + menuY + 'px; left: ' + menuX + 'px;'})\n        .click(function(event) {event.stopPropagation();});\n\n    $('#' + menuId).fadeIn();\n\n    // setting url parameters\n    var urlParams = {};\n    urlParams.module = $(event.target).parents('.window').eq(0).attr('id');\n\n    // load menu with specific options from service\n    $.ajax({\n        type: \"GET\",\n        url: urlBase + 'service/menu/',\n        data: urlParams,\n        error: function (XMLHttpRequest, textStatus, errorThrown) {\n            alert(\"error occured - details at firebug-console\");\n            console.log(\"menu service error\\nfailure message:\\n\" + textStatus);\n            $('#' + menuId).fadeOut();\n        },\n        success: function(data, textStatus) {\n            try {\n\n                menuData = $.evalJSON(data);\n\n                var menuStr = '';\n                var tempStr = '';\n                var href    = '';\n\n                // construct menu content\n                for (var key in menuData) {\n                    if ( menuData[key] == '_---_' ) {\n                        menuStr += '</ul><hr/><ul>';\n                    } else {\n                        if ( typeof(menuData[key]) == 'string' ) {\n                            tempStr = '<a href=\"' + menuData[key] + '\">' + key + '</a>';\n                        } else {\n                            tempStr = '<a ';\n                            for (var attr in menuData[key]) {\n                                tempStr += attr + '=\"' + menuData[key][attr] + '\" ';\n                            }\n                            tempStr += '>' + key + '</a>';\n                        }\n                        menuStr += '<li>' + tempStr + '</li>';\n                    }\n                }\n\n                // append menu string with surrounding list\n                $('#' + menuId).append('<ul>' + menuStr + '</ul>');\n\n                // remove is-processing\n                $('#' + menuId).toggleClass('is-processing');\n\n            } catch (e) {\n                alert(\"error occured - details at firebug-console\");\n                console.log(\"menu service error\\nmenu service replied:\\n\" + data);\n                $('#' + menuId).fadeOut();\n            }\n\n        }\n    });\n\n    // prevent href trigger\n    event.stopPropagation();\n\n}\n\n/*\n * Save a key-value pair via ajax\n */\nfunction sessionStore(name, value, options) {\n    var defaultOptions = {\n        encode:    false, \n        namespace: _OWSESSION, \n        callback:  null, \n        method:    'set', \n        url:       urlBase + 'service/session/', \n        withValue: false\n    };\n    var config = $.extend(defaultOptions, options);\n\n    // TODO\n    if (!config.encode) {\n        if (!config.withValue) {\n            config.url += '?name=' + name + '&value=' + value + '&method=' + config.method + '&namespace=' + config.namespace;\n        } else {\n            config.url += '?name=' + name + '&' + value + '&method=' + config.method + '&namespace=' + config.namespace;\n        }\n\n        $.get(config.url, config.callback);\n    } else {\n        var params = {name: name, value: value, namespace: config.namespace};\n        $.get(config.url, params, config.callback);\n    }\n}\n\n/*\n * This function sets an automatic id attribute if no id exists\n * parameter: el -> jquery element\n */\nfunction setAutoId(element) {\n    if (!element.attr('id')) {\n        element.attr('id', 'autoid' + idCounter++);\n    }\n}\n\n/*\n * hide a href by putting this attribute into an array\n * parameter: el -> jquery element\n */\nfunction hideHref(element) {\n    setAutoId(element);\n    \n    if (element.attr('href')) {\n        tempHrefs[element.attr('id')] = element.attr('href');\n        element.removeAttr('href');\n    }\n}\n\nfunction showHref(element) {\n    if (tempHrefs[element.attr('id')]) {\n        element.attr('href', tempHrefs[element.attr('id')]);\n    }\n}\n\nfunction serializeArray(array, key)\n{\n    if (typeof key == 'undefined') {\n        key = 'value';\n    }\n    \n    var serialization = '';\n    \n    if (array.length) {\n        serialization += key + '[]=' + encodeURIComponent(array[0]);\n        \n        for (var i = 1; i < array.length; ++i) {\n            serialization += '&' + key + '[]=' + encodeURIComponent(array[i]);\n        }\n    } else {\n        serialization += key + '=';\n    }\n    \n    return serialization;\n}\n\n/*\n * remove all other menus\n */\nfunction removeResourceMenus() {\n    $('.contextmenu-enhanced .contextmenu').remove();\n}\n\nfunction showAddInstanceMenu(event, menuData) {\n    // remove all other menus\n    removeResourceMenus();\n\n    var pos = $('.init-resource').offset();\n    menuX = pos.left - $('.init-resource').innerWidth() + 4;\n    menuY = pos.top + $('.init-resource').outerHeight();\n    menuId = 'windowmenu-' + menuX.toFixed() + '-' + menuY.toFixed();\n\n    // create the plain menu with correct style and position\n    $('.contextmenu-enhanced').append('<div class=\"contextmenu is-processing\" id=\"' + menuId + '\"></div>');\n    $('#' + menuId)\n        .css({ \n          'z-index': menuZIndex,\n          'top': menuY + 'px',\n          'left': menuX + 'px'\n        })\n        .click(function(event) {event.stopPropagation();})\n        .fadeIn();\n\n    var tempMenu = \"\";\n    for (var key in menuData) {\n        var label = menuData[key]['http://www.w3.org/2000/01/rdf-schema#label'][0].value;\n        tempMenu += '<li><a href=\"javascript:createInstanceFromClassURI(\\'' + key + '\\');\">' + label + '</a></li>'\n    }\n    // append menu\n    // console.log(tempMenu);\n    $('#' + menuId).append('<ul>' + tempMenu + '</ul>');\n    // remove is-processing\n    $('#' + menuId).toggleClass('is-processing');\n    // repositioning\n    menuX = pos.left - $('#' + menuId).innerWidth() + $('.init-resource').outerWidth();\n    menuY = pos.top + $('.init-resource').outerHeight();\n    \n    // set new position\n    $('#' + menuId).css({ top: menuY + 'px', left: menuX + 'px'});\n\n    // remove is-processing\n    $('#' + menuId).removeClass(\"is-processing\");\n    // prevent href trigger\n    event.stopPropagation();\n\n}\n\nfunction showResourceMenu(event, json) {\n    // remove all other menus\n    removeResourceMenus();\n    \n    menuX  = event.pageX - 30;\n    menuY  = event.pageY - 20;\n    menuId = 'windowmenu-' + menuX + '-' + menuY;\n    \n    // create the plain menu with correct style and position\n    $('.contextmenu-enhanced').append('<div class=\"contextmenu is-processing\" id=\"' + menuId + '\"></div>');\n    $('#' + menuId)\n        .attr({style: 'z-index: ' + menuZIndex + '; top: ' + menuY + 'px; left: ' + menuX + 'px;'})\n        .click(function(event) {event.stopPropagation();});\n\n    $('#' + menuId).fadeIn();\n    \n    parentHref = tempHrefs[$(event.target).parent().attr('id')];\n    \n    function onJSON(menuData, textStatus) {\n        try {\n            //console.log(menuData)\n            var menuStr = '';\n            var tempStr = '';\n            var href    = '';\n\n            // construct menu content\n            for (var key in menuData) {\n                href = menuData[key];\n                if ( menuData[key] == '_---_' ) {\n                    menuStr += '</ul><hr/><ul>';\n                } else {\n                    if (typeof(href) == 'object') {\n                        tempStr = '<a class=\"' + href['class'] + '\" about=\"' + href['about'] + '\">' + key + '</a>';\n                    } else {\n                        tempStr = '<a href=\"' + href + '\">' + key + '</a>';\n                        if (href == parentHref) {\n                            tempStr = '<strong>' + tempStr + '</strong>';\n                        }\n                    }\n                    menuStr += '<li>' + tempStr + '</li>';\n                }\n            }\n\n            // append menu string with surrounding list\n            $('#' + menuId).append('<ul>' + menuStr + '</ul>');\n\n            // remove is-processing\n            $('#' + menuId).toggleClass('is-processing');\n\n        } catch (e) {\n            alert(\"error occured - details at firebug-console\");\n            console.log(\"menu service error\\nmenu service replied:\\n\" + data);\n            $('#' + menuId).fadeOut();\n        }\n    }\n\n    if(json == undefined){\n        var aboutUri, modelUri, resourceUri;\n\n        // URI of the resource clicked (used attribute can be about and resource)\n        if ( typeof $(event.target).parent().attr('about') != 'undefined' ) {\n            aboutUri = $(event.target).parent().attr('about');\n        } else if ( typeof $(event.target).parent().attr('resource') != 'undefined' ) {\n            aboutUri = $(event.target).parent().attr('resource');\n        }\n\n        if (aboutUri == null) {\n            // no usable resource uri, so we exit here\n            return false;\n        } else if ($(event.target).parent().hasClass('Model')) {\n            modelUri = aboutUri;\n        } else {\n            resourceUri = aboutUri;\n        }\n\n        var urlParams = {};\n        if (modelUri != null) {\n            urlParams.model = modelUri;\n        } else {\n            urlParams.resource = resourceUri;\n        }\n\n        // load menu with specific options from service\n        $.ajax({\n            type: \"GET\",\n            url: urlBase + 'service/menu/',\n            data: urlParams,\n            error: function (XMLHttpRequest, textStatus, errorThrown) {\n                alert(\"error occured - details at firebug-console\");\n                console.log(\"menu service error\\nfailure message:\\n\" + textStatus);\n                $('#' + menuId).fadeOut();\n            },\n            success: function(data, textStatus){onJSON($.evalJSON(data), textStatus);}\n        });\n    } else {\n        onJSON(json)\n    }\n\n    // prevent href trigger\n    event.stopPropagation();\n}\n\n/**\n * Loads RDFauthor if necessary and executes callback afterwards.\n */\nfunction loadRDFauthor(callback) {\n    var loaderURI = RDFAUTHOR_BASE + 'src/rdfauthor.js';\n    \n    if ($('head').children('script[src=\"' + loaderURI + '\"]').length > 0) {\n        callback();\n    } else {\n        RDFAUTHOR_READY_CALLBACK = callback;\n        // load script\n        var s = document.createElement('script');\n        s.type = 'text/javascript';\n        s.src = loaderURI;\n        document.getElementsByTagName('head')[0].appendChild(s);\n    }\n}\n\nfunction populateRDFauthor(data, protect, resource, graph, workingmode) {\n    /*\n     * Set default values\n     */\n    protect  = arguments.length >= 2 ? protect : true;\n    resource = arguments.length >= 3 ? resource : null;\n    graph    = arguments.length >= 4 ? graph : null;\n    \n    for (var currentSubject in data) {\n        for (var currentProperty in data[currentSubject]) {\n            var objects = data[currentSubject][currentProperty];\n\n            for (var i = 0; i < objects.length; i++) {\n                var objSpec = objects[i];\n\n                if ( objSpec.type == 'uri' ) { \n                    var value = '<' + objSpec.value + '>'; \n                } else if ( objSpec.type == 'bnode' ) { \n                    var value = '_:' + objSpec.value;\n                } else {\n                    // IE fix, object keys with empty strings are removed\n                    var value = objSpec.value ? objSpec.value : \"\"; \n                }\n\n                var newObjectSpec = {\n                    value : value,\n                    type: String(objSpec.type).replace('typed-', '')\n                }\n\n                if (objSpec.value) {\n                    if (objSpec.type == 'typed-literal') {\n                        newObjectSpec.options = {\n                            datatype: objSpec.datatype\n                        }\n                    } else if (objSpec.lang) {\n                        newObjectSpec.options = {\n                            lang: objSpec.lang\n                        }\n                    }\n                }\n\n                var stmt = new Statement({\n                    subject: '<' + currentSubject + '>', \n                    predicate: '<' + currentProperty + '>', \n                    object: newObjectSpec\n                }, {\n                    graph: graph, \n                    title: objSpec.title, \n                    protected: protect ? true : false, \n                    hidden: objSpec.hidden ? objSpec.hidden : false\n                });\n\n                if (workingmode == 'class') {\n                    // remove all values except for type\n                    if ( stmt.predicateURI() !== 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' ) {\n                        stmt._object.value = \"\";\n                    } else {\n                        stmt._hidden = true;\n                    }\n                }\n\n                RDFauthor.addStatement(stmt);\n            }\n        }\n    }\n}\n\n/*\n * get the rdfa init description from the service in class mode and start the\n * RDFauthor window\n * dataCallback is called right after the json request to manipulate the requested data\n */\nfunction createInstanceFromClassURI(type, dataCallback) {\n    var serviceUri = urlBase + 'service/rdfauthorinit';\n\n    // check if an resource is in editing mode\n    if($(body).data('editingMode')) {\n        RDFauthor.cancel();\n        RDFauthor.reset();\n    }\n\n    // remove resource menus\n    removeResourceMenus();\n\n    loadRDFauthor(function() {\n        $.getJSON(serviceUri, {\n            mode: 'class',\n            uri: type\n        }, function(data) {\n            // pass data through callback\n            if (typeof dataCallback == 'function') {\n                data = dataCallback(data);\n            }\n            // get default resource uri for subjects in added statements (issue 673)\n            // grab first object key\n            for (var subjectUri in data) {break;};\n            // add statements to RDFauthor\n            populateRDFauthor(data, true, subjectUri, selectedGraph.URI, 'class');\n            RDFauthor.setOptions({\n                saveButtonTitle: 'Create Resource',\n                cancelButtonTitle: 'Cancel',\n                title: 'Create New Instance of ' + type,  \n                autoParse: false, \n                showPropertyButton: true,\n                loadOwStylesheet: false,\n                onSubmitSuccess: function (responseData) {\n                    var newLocation;\n                    if (responseData && responseData.changed) {\n                        newLocation = resourceURL(responseData.changed);\n                    } else {\n                        newLocation = window.location.href;\n                    }\n                    // HACK: reload whole page after 500 ms\n                    window.setTimeout(function () {\n                        window.location.href = newLocation;\n                    }, 500);\n                },\n                onCancel: function () {\n                    // HACK: reload whole page after 500 ms\n                    window.setTimeout(function () {\n                        window.location.href = window.location.href;\n                    }, 500);\n                }\n            });\n           \n            RDFauthor.start();\n        })\n    });\n}\n\n/*\n * get the rdfauthor init description from the service in and start the RDFauthor window\n */\nfunction editResourceFromURI(resource) {\n    var serviceUri = urlBase + 'service/rdfauthorinit';\n\n    // remove resource menus\n    removeResourceMenus();\n\n    loadRDFauthor(function() {\n        $.getJSON(serviceUri, {\n           mode: 'edit',\n           uri: resource\n        }, function(data) {\n            \n            // get default resource uri for subjects in added statements (issue 673)\n            // grab first object key\n            for (var subjectUri in data) {break;};\n\n            // add statements to RDFauthor\n            populateRDFauthor(data, false, resource, selectedGraph.URI);\n\n            RDFauthor.setOptions({\n                saveButtonTitle: 'Save Changes',\n                cancelButtonTitle: 'Cancel',\n                title: 'Edit Resource ' + resource,  \n                autoParse: false, \n                showPropertyButton: true,\n                loadOwStylesheet: false,\n                onSubmitSuccess: function () {\n                    // HACK: reload whole page after 500 ms\n                    window.setTimeout(function () {\n                        window.location.href = window.location.href;\n                    }, 500);\n                },\n                onCancel: function () {\n                    // HACK: reload whole page after 500 ms\n                    window.setTimeout(function () {\n                        window.location.href = window.location.href;\n                    }, 500);\n                }\n            });\n\n            RDFauthor.start();\n        })\n    });\n}\n\n/**\n * Creates a new internal OntoWiki URL for the given resource URI.\n * @return string\n */\nfunction resourceURL(resourceURI) {\n    if (resourceURI.indexOf(urlBase) === 0) {\n        // URL base is a prefix of requested resource URL\n        return resourceURI;\n    }\n\n    return urlBase + 'view/?r=' + encodeURIComponent(resourceURI);\n}\n\n/**\n * Starts RDFauthor in inline mode to edit a single property\n *\n * @param event the JavaScript event which startes the method\n */\nfunction editProperty(event) {\n    var element = $.event.fix(event).target;\n\n    loadRDFauthor(function () {\n        RDFauthor.setOptions({\n            saveButtonTitle: 'Save Changes', \n            cancelButtonTitle: 'Cancel',\n            title: $('.section-mainwindows .window').eq(0).children('.title').eq(0).text(), \n            loadOwStylesheet: false,\n            onSubmitSuccess: function () {\n                $('.edit').each(function() {\n                    $(this).fadeOut(effectTime);\n                });\n                $('.edit-enable').removeClass('active');\n\n                // HACK: reload whole page after 1000 ms\n                window.setTimeout(function () {\n                    window.location.href = window.location.href;\n                }, 1000);\n            }, \n            onCancel: function () {\n                $('.edit').each(function() {\n                    $(this).fadeOut(effectTime);\n                });\n                $('.edit-enable').removeClass('active');\n            }, \n            viewOptions: {\n                type: RDFAUTHOR_VIEW_MODE,\n                container: function (statement) {\n                    var element = RDFauthor.elementForStatement(statement);\n                    var parent  = $(element).closest('div');\n\n                    if (!parent.hasClass('ontowiki-processed')) {\n                        parent.children().each(function () {\n                            $(this).hide();\n                        });\n                        parent.addClass('ontowiki-processed');\n                    }\n\n                    return parent.get(0);\n                }\n            }\n        });\n\n        RDFauthor.start($(element).closest('td'));\n        $('.edit-enable').addClass('active');\n        $('.edit').each(function() {\n            var button = this;\n            $(this).fadeIn(effectTime);\n        });\n    });\n}\n\n/**\n * Starts RDFauthor in overlay mode to edit a single property in the listview table\n *\n * @param event the JavaScript event which startes the method\n */\nfunction editPropertyListmode(event) {\n    var element = $.event.fix(event).target;\n    var resource = $(element).parents('td').rdf().where('?s ?p ?o').dump();\n    var resourceUri = Object.keys(resource)[0];\n    var serviceUri = urlBase + 'service/rdfauthorinit';\n\n    // remove resource menus\n    removeResourceMenus();\n\n    loadRDFauthor(function() {\n        // add statements to RDFauthor\n        populateRDFauthor(resource, false, resource, selectedGraph.URI);\n\n        RDFauthor.setOptions({\n            saveButtonTitle: 'Save Changes',\n            cancelButtonTitle: 'Cancel',\n            title: 'Edit Resource ' + resourceUri,\n            autoParse: false, \n            showPropertyButton: false,\n            loadOwStylesheet: false,\n            onSubmitSuccess: function () {\n                // HACK: reload whole page after 500 ms\n                window.setTimeout(function () {\n                    window.location.href = window.location.href;\n                }, 500);\n            }\n        });\n\n        RDFauthor.start();\n    });\n}\n\nfunction addProperty() {\n    var ID = RDFauthor.nextID();\n    var td1ID = 'rdfauthor-property-selector-' + ID;\n    var td2ID = 'rdfauthor-property-widget-' + ID;\n\n    $('.edit').each(function() {\n        $(this).fadeIn(effectTime);\n    });\n\n    $('table.rdfa')\n        .removeClass('hidden')\n        .show()\n        .children('tbody')\n        .prepend('<tr><td colspan=\"2\" width=\"120\"><div style=\"width:75%\" id=\"' + td1ID + '\"></div></td></tr>');\n\n    $('table.rdfa').parent().find('p.messagebox').hide();\n    \n    var selectorOptions = {\n        container: $('#' + td1ID), \n        selectionCallback: function (uri, label) {\n            var statement = new Statement({\n                subject: '<' + RDFAUTHOR_DEFAULT_SUBJECT + '>', \n                predicate: '<' + uri + '>'\n            }, {\n                title: label, \n                graph: RDFAUTHOR_DEFAULT_GRAPH\n            });\n            \n            var owURL = urlBase + 'view?r=' + encodeURIComponent(uri);\n            $('#' + td1ID).closest('td')\n                .attr('colspan', '1')\n                .html('<a class=\"hasMenu\" about=\"' + uri + '\" href=\"' + owURL + '\">' + label + '</a>')\n                .after('<td id=\"' + td2ID + '\"></td>');\n            RDFauthor.getView().addWidget(statement, null, {container: $('#' + td2ID), activate: true});\n        }\n    };\n    \n    var selector = new Selector(RDFAUTHOR_DEFAULT_GRAPH, RDFAUTHOR_DEFAULT_SUBJECT, selectorOptions);\n    selector.presentInContainer();\n}\n"
  },
  {
    "path": "extensions/themes/silverblue/styles/clickmenu.css",
    "content": "/**\r\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\r\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\r\n */\r\n\r\ndiv.cmDiv {\r\n/*  border-top: 1px solid #000;*/\r\n    border-bottom: 0.1em solid #ddd;\r\n    background-color: #eee;\r\n    line-height: 1;\r\n    /*z-index: 100;*/\r\n    overflow: visible;\r\n}\r\n\r\n.clickMenu {\r\n    margin: 0;\r\n    padding: 0;\r\n    cursor: default;\r\n}\r\n\r\n.clickMenu, .clickMenu ul {\r\n    list-style: none;\r\n}\r\n\r\n.clickMenu ul {\r\n    margin: 0 !important;\r\n    padding: 1px;\r\n    border: 1px solid #999;\r\n    background-color: #f6f6f6;\r\n    min-width: 15em; /* ie doesnt know this : / */\r\n}\r\n\r\n.clickMenu div.outerbox {\r\n    display: none;\r\n    min-width: 15em; /* firefox produces animation-flickering when the box is bigger than this : / */\r\n    top: 1.65em;\r\n    z-index: 101;\r\n    /* opacity: 0.95; */\r\n}\r\n\r\n.clickMenu div.inner {\r\n    left: 0;\r\n    margin: 0;\r\n}\r\n\r\n.clickMenu div.inner div.outerbox {\r\n    margin: 0 4px 0 0;\r\n    left: 50% !important; /*right: 0;*/\r\n    top: 0;\r\n}\r\n\r\n.clickMenu li {\r\n    position: relative;\r\n    padding: 0.35em 0.5em 0.25em 0.5em;\r\n    border: solid 1px transparent;\r\n    white-space: nowrap; /* does not really work in ie */\r\n    \r\n}\r\n\r\n.clickMenu li.main {\r\n    float: left;\r\n    background-color: #eee;\r\n}\r\n\r\n.clickMenu li.main li {\r\n    z-index: 102;\r\n    min-width: 78px;\r\n}\r\n\r\n.clickMenu li.hover {\r\n    z-index: 103 !important;\r\n    border-color: #cdd7dd;\r\n    background: url(./../images/layout-button-menu-hover-gradient.png) repeat-x bottom center #eff9ff;\r\n}\r\n\r\n.clickMenu img.liArrow {\r\n    position: absolute;\r\n    right: 5px;\r\n    top: 0.5em;\r\n}\r\n\r\n.clickMenu a {\r\n    text-decoration: none;\r\n    color: black;\r\n    cursor: default;\r\n}\r\n\r\n/* thats for the shadowbox */\r\n/*\r\nhtml>body div.outerbox {\r\n    padding: 0 5px 5px 0;\r\n}\r\n\r\nhtml>body div.shadowbox1 {\r\n    position: absolute;\r\n    right: 0;\r\n    bottom: 5px;\r\n    width: 5px;\r\n    height: 100%;\r\n    background: url(myshadow.png) no-repeat right top;\r\n}\r\n\r\nhtml>body div.shadowbox2 {\r\n    position: absolute;\r\n    bottom: 0;\r\n    right: 5px;\r\n    height: 5px;\r\n    width: 100%;\r\n    background: url(myshadow.png) left bottom;\r\n}\r\n\r\nhtml>body div.shadowbox3 {\r\n    position: absolute;\r\n    bottom: 0;\r\n    right: 0;\r\n    height: 5px;\r\n    width: 5px;\r\n    background: url(myshadow.png) no-repeat right bottom;\r\n}\r\n\r\nhtml>body .innerbox {\r\n    margin: 0;\r\n    display: inherit;\r\n}\r\n\r\n*/\r\n\r\n"
  },
  {
    "path": "extensions/themes/silverblue/styles/default.css",
    "content": "/**\n * default.css\n * Ontowiki main style sheet, advanced theme\n * @author    http://michael.haschke.biz/\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n *\n\n    CONTENT\n    \n    1. Layout\n        1.1. Positions\n        1.2. Windows\n            1.2.1. Drop Down Menu\n            1.2.2. Context Menu\n            1.2.3. Tabs\n            1.2.4. Content\n                1.2.4.1. Inner Windows\n            1.2.5. Versatile Windows and Popups\n        1.3. Generic Layout Helpers\n            1.3.1. Marker\n            1.3.2. Message Boxes\n    2. Typography\n        2.1. Headings\n        2.2. Lists\n            2.2.1. Bullets and Numbers\n            2.2.2. Separations\n        2.3. Standard margins and Paddings\n        2.4. Images\n        2.5. Links\n        2.6. Tables\n            2.6.1. Separations and Spacings\n    3. Forms\n        3.1. Buttons\n        3.2. Input Fields\n        3.3. Selects\n        3.4. Grouping Form Elements\n    4. Javascript Enhancements\n        4.1. Windows\n            4.1.1. Context Menu (Elements)\n            4.1.2. Drop Down Menu\n            4.1.3. Tabs\n            4.1.4. Context Menu (Window)\n        4.2. Context Enabled Elements\n            4.2.1. Inline Context Menus\n            4.2.2. Area Context Menus\n        4.3. Drag and Drop\n        4.4. Resizer\n        4.5. Processing state\n        4.6. Edit\n        4.7. Tables\n    5. jQuery UI enhancements\n    6. Etcetera\n    7. Specials\n    8. GUI-Facelift\n\n  */\n  \n/* @import url('default.dev.css'); - included extra with debug modus */\n\n@import url('jquery-ui.css');\n\n/* 1. Layout ---------------------------------------------------------------- */\n\n\n* {\n    padding: 0;\n    margin: 0;\n}\n\nbody {\n    font-family: sans-serif;\n    line-height: 1.5;\n    background: url(./../images/layout-background-body.png) fixed no-repeat 97% 96% #eff9ff;\n    font-size:16px; /* same font-size for all browsers */\n}\n\n/* -- 1.1. Positions -------------------------------------------------------- */\n\n\ndiv.section-mainwindows {\n    position: static;\n    width: auto;\n    margin-left: 17.5em;\n}\n\ndiv.section-sidewindows {\n    position: absolute;\n    width: 17.5em;\n    left: 0;\n    top: 0;\n}\n\n/*div.modal-wrapper {\n    position: absolute;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n    background: url(./../images/layout-background-black-20.png) fixed repeat transparent;\n    z-index: 10000;\n}*/\n\n/* -- 1.2. Windows ---------------------------------------------------------- */\n\ndiv.window {\n    font-size: 0.8em;\n    font-weight: 500;\n    color: #333;\n    background-color: #f3f3f3;\n    margin: 1em 0.5em;\n    position: relative;\n    border: solid 1px #666;\n    width: auto;\n/*    overflow: hidden;*/ /* this is now set on the window content instead */\n}\n\ndiv.window .title {\n    font-size: 1em;\n    font-weight: 900;\n    color: #fff;\n    border-bottom: solid 1px #666;\n    padding: 0.3em 0.5em 0.2em 0.5em !important;\n    margin: 0 !important;\n    line-height: 1;\n    background: url(../images/layout-windowtitle-gradient.png) repeat-x center #999;\n}\n\ndiv.window .title a {\n    color: #fff;\n    text-decoration: none;\n}\n\ndiv.window .title a:focus, div.window .title a:hover {\n    color: #fff;\n    text-decoration: underline;\n}\n\n/* ------ 1.2.1. Drop down menu --------------------------------------------- */\n\n/* see clickmenu.css */\n\n/* ------ 1.2.2. Context Menu ----------------------------------------------- */\n\ndiv.window .contextmenu {\n    background-color: transparent;\n    border-top: solid 1px #000;\n}\n\n.contextmenu {\n    background-color: #efefef;\n    padding: 1px;\n}\n\n.contextmenu ul, .contextmenu ol {\n    list-style: none;\n    margin-top: 0;\n    padding-top: 0;\n    margin-bottom: 0;\n    padding-bottom: 0;\n}\n\n.contextmenu > ul, .contextmenu > ol {\n    margin-left: 0;\n}\n\n.contextmenu ul a, .contextmenu ol a, .contextmenu ul span, .contextmenu ol span {\n    border: solid 1px transparent;\n    display: block;\n    color: #000;\n    padding: 0 0.5em;\n}\n\n.contextmenu ul a:hover, .contextmenu ol a:hover, .contextmenu ul span:hover, .contextmenu ol span:hover {\n    border-color: #cdd7dd;\n    background: url(./../images/layout-button-menu-hover-gradient.png) repeat-x bottom center #eff9ff;\n}\n\nhr.menusep, .contextmenu hr {\n    border-top: solid 1px #ccc;\n    border-bottom: solid 1px #fff;\n    border-left-style: none;\n    border-right-style: none;\n    margin: 0.25em 0.5em\n}\n\n/* ------ 1.2.3. Window Tabs ------------------------------------------------ */\n\ndiv.window .tabs {\n    margin-top: 0.5em;\n    list-style: none;\n    margin-left: 0;\n    padding: 0 0.5em;\n}\n\ndiv.window .tabs li {\n    float: left;\n    white-space: nowrap;\n}\n\ndiv.window .tabs li a {\n    display: block;\n    position: relative;\n    top: 0.1em;\n    border-color: #999;\n    border-bottom-color: #666;\n    border-width: 1px 1px 0.1em 1px;\n    border-style: solid;\n    border-left-style: none;\n    padding: 0.5em 1em;\n    text-decoration: none;\n    color: #333;\n    background: url(./../images/layout-tab-gradient.png) repeat-x bottom center #dfdfdf;\n}\n\ndiv.window .tabs li:first-child a {\n    border-left-style: solid;\n}\n\ndiv.window .tabs li a:focus, div.window .tabs li a:hover {\n    background-color: #eff9ff;\n/*    text-decoration: underline;*/\n}\n\ndiv.window .tabs li.active a {\n    border-color: #666;\n    border-bottom: none;\n    padding-bottom: 0.6em;\n    background: url(./../images/layout-tabactive-gradient.png) repeat-x top center #f2f2f2;\n    z-index: 1;\n    color: #333;\n    font-weight: bold;\n}\n\n/* ------ 1.2.4. Window Content --------------------------------------------- */\n\ndiv.window .slidehelper {\n    overflow: hidden;\n}\n\ndiv.window .content {\n    padding: 0.25em 0.5em;\n    width: auto;\n    border: solid 1px transparent;\n    border-top-style: none;\n    overflow: auto;\n    color: #333;\n    clear: both;\n    background: url(../images/layout-window-gradient.png) repeat-x top center #fff;\n}\n\ndiv.tabbed > .slidehelper > .content {\n    border-top: solid 1px #666;\n}\n\nbody.javascript-off div.window div.window-buttons {\n    display: none;\n}\n\ndiv.window span.resizer-vertical {\n    display: none;\n}\n\n/* -------- 1.2.4.1. Inner Window in content -------------------------------- */\n\ndiv.window div.has-innerwindows div.innercontent { /* content contains inner windows */\n    width: 70%;\n    padding-top: 1em;\n    float: left;\n    overflow: auto;\n}\n\ndiv.window .content div.innerwindows {\n    width: 29%;\n    float: right;\n    position: relative;\n}\n\ndiv.window .content .innerwindows .window {\n    border-color: #ccc;\n    font-size: 1em;\n    min-height: auto;\n}\n\ndiv.window .content .innerwindows .window .title {\n    background-color: #ddd;\n    color: #000;\n    border-color: #ccc;\n    font-weight: normal;\n}\n\n/* -- 1.2.5. Versatile windows and popups ----------------------------------- */\n\n/**\n * Versatile windows and popups\n *\n * @since 0.9.5\n *\n * @option .shadowed versatile window get a shadow in the back\n * @option .centered versatile window will be shown appr. centered\n *\n * <div class=\"overlay\"></div> <!-- optional -->\n * <div class=\"versatile shadowed centered\">\n *     ###CONTENT###\n * </div>\n *\n * use inline styles for height/width (and negative margins for centered option)\n * on the div.versatile\n *\n */\n \n/* option- overlay background to prevent interaction with other elements from behind */\n\ndiv.overlay\n{\n    position:absolute;\n    z-index:999;\n    height:100%; width:100%;\n    top:0; left:0;\n    background-color:#fff;\n    opacity:0.5;\n}\n\n/* versatile window */\n\ndiv.versatile\n{\n    position:absolute;\n    width:20em;\n    z-index:1000;\n}\n\n/* shadow option */\n\ndiv.versatile.shadowed\n{\n    padding:10px;\n    background:rgba(204, 204, 204, 0.5); /* #ccc */\n    border-radius:10px;\n    -moz-border-radius:10px;\n    -webkit-border-radius:10px;\n}\n\ndiv.versatile.shadowed > *\n{\n    margin:0 !important;\n}\n\n/* do not use .shadow element, I just let it here as workaround idea for the IE */\ndiv.versatile.shadowed > .shadow\n{\n    display:block;\n    position:absolute; top:0; left:0; \n    width:100%; height:100%;\n    background-color:#ccc;\n    opacity:0.5;\n    border-radius:10px;\n    -moz-border-radius:10px;\n    -webkit-border-radius:10px;\n}\n\n/* center option */\n\ndiv.versatile.centered\n{\n    top:25%;\n    left:50%; margin-left:-10em;\n}\n\n/* -- 1.3. Generic layout helper -------------------------------------------- */\n\n.width25 { width: 25%; }\n\n.width33 { width: 33.3%; }\n\n.width50 { width: 50%; }\n\n.width67 { width: 66.6%; }\n\n.width75 { width: 75%; }\n\n.width90 { width: 90% !important; }\n\n.width95 { width: 95% !important; }\n\n.width98 { width: 98% !important; }\n\n.width99 { width: 99% !important; }\n\n.width100 { width: 100% !important; }\n\n.width-auto { width: auto !important; }\n\n.width25.float-left  { width: 24%; padding-right: 1%; }\n\n.width25.float-right { width: 24%; padding-left: 1%; }\n\n.width33.float-left  { width: 32.3%; padding-right: 1%; }\n\n.width33.float-right { width: 32.3%; padding-left: 1%; }\n\n.width50.float-left  { width: 49%; padding-right: 1%; }\n\n.width50.float-right { width: 49%; padding-left: 1%; }\n\n.width67.float-left  { width: 66.6%; padding-right: 1%; }\n\n.width67.float-right { width: 65.6%; padding-left: 1%; }\n\n.width75.float-left  { width: 74%; padding-right: 1%; }\n\n.width75.float-right { width: 74%; padding-left: 1%; }\n\n.float-left { float: left; clear: none !important; overflow: hidden;}\n\n.float-right { float: right; clear: none !important; overflow: hidden; }\n\n/* ---- 1.3.1. Marker ------------------------------------------------------- */\n\n.even, tr.even td {\n    background-color: transparent;\n}\n\n.odd, tr.odd td {\n    background-color: #f6f6f6;\n}\n\n.marked, tr.list-selected td, .selected, tr.marked td {\n    background-color: #dee8ee !important;\n    border-color: #cdd7dd !important;\n}\n\n.implicit {\n    padding-left: 16px;\n    background-image: url(./../images/icon-implicit-mini.png);\n    background-repeat: no-repeat;\n    background-position: left center;\n}\n\n.system {\n    padding-left: 16px;\n    background-image: url(./../images/icon-system-mini.png);\n    background-repeat: no-repeat;\n    background-position: left center;\n}\n\n.hidden {\n    padding-left: 16px;\n    background-image: url(./../images/icon-hidden-mini.png);\n    background-repeat: no-repeat;\n    background-position: left center;\n}\n\n\n\n/* ---- 1.3.2. Message boxes ------------------------------------------------ */\n\n.messagebox {\n    width: auto;\n    border: solid 1px #eee;\n    background-color: #f6f6f6;\n    padding: 0.5em;\n    margin-bottom: 0.75em;\n    overflow: hidden;\n    display: block;\n    float: none;\n    clear: both;\n}\n\n\n\n.info {\n    border-color: #eee;\n    background-color: #f9f9f9;\n    padding-left: 26px;\n    background: url(./../images/icon-info.png) no-repeat 5px 0.6em #f9f9f9;\n}\n\n.search {\n    border-color: #eee;\n    background-color: #f9f9f9;\n    padding-left: 26px;\n    background: url(./../images/icon-search.png) no-repeat 5px 0.6em #f9f9f9;\n}\n\n.warning {\n    background-color: #ffb;\n    border-color: #eea;\n    color: #000;\n    padding-left: 26px;\n    background: url(./../images/icon-warning.png) no-repeat 5px 0.6em #ffb;\n}\n\n.error {\n    border-color: #eaa;\n    background-color: #fbb;\n    color: #000;\n    padding-left: 26px;\n    background: url(./../images/icon-error.png) no-repeat 5px 0.6em #fbb;\n}\n\n.success {\n    border-color: #aea;\n    background-color: #bfb;\n    color: #000;\n    padding-left: 26px;\n    background: url(./../images/icon-success.png) no-repeat 5px 0.6em #bfb;\n}\n\n.feed {\n    color: #000;\n    padding-left: 26px;\n    background: url(./../images/icon-feed.png) no-repeat 5px 0.6em #f6f6f6;\n}\n\n.content .feed h2 {margin-top: 0;}\n\n/* ------ 1.3.2.1. Status  bar ---------------------------------------------- */\n\n.messagebox .statustool {\n    float: left;\n    margin-left: 2em;\n}\n\n.messagebox .statustool ul {\n    list-style: none;\n    padding: 0;\n    margin: 0;\n    overflow: hidden;\n}\n\n.messagebox .statustool ul li {\n    float: left;\n}\n\n.statusbar {\n    margin-bottom: 0;\n}\n\n.toolbar {\n    float: right;\n    font-size: 0.9em;\n}\n\n\n/* 2. Typography ------------------------------------------------------------ */\n\n/* -- 2.1. Headings --------------------------------------------------------- */\n\n.content h1, .content h2, .content h3, .content h4, .content legend {\n    color: #000;\n    padding-left: 0;\n    margin-left: 0;\n    padding-right: 1em;\n    font-weight: normal;\n}\n\n.content h1 {\n    margin-top: 0.5em;\n    margin-bottom: 0.5em;\n    font-size: 1.5em;\n}\n\n.content h2, .content fieldset legend {\n    margin-top: 0.5em;\n    margin-bottom: 0.5em;\n    font-size: 1.5em;\n}\n\n.content h3, .content fieldset fieldset legend {\n    margin-top: 0.25em;\n    margin-bottom: 0.25em;\n    font-size: 1.25em;\n}\n\n.content h4, .content fieldset fieldset fieldset legend {\n    margin-top: 0.25em;\n    margin-bottom: 0.25em;\n    font-size: 1em;\n    font-weight: bold;\n}\n\n/* -- 2.2. Lists ------------------------------------------------------------ */\n\nul, ol {\n    list-style-position: outside;\n    margin-left: 1em;\n}\n\nul ol, ol ul, ul ul, ol ol {\n    list-style-position: inside;\n    /* margin-left: 1em !important; cannot see any sense for this anymore (mh) */\n}\n\n/**\n * in resource view, prevent table cells with empty values from collapsing\n * otherwise there is no hover space to activate RDFAuthor\n */\n.separated-vertical.Resource ul li {\n    min-height: 1.5em;\n}\n\n/* ---- 2.2.1. Bullets and Numbers ------------------------------------------ */\n\n.bullets-none {\n    list-style-type: none;\n    margin-left: 0;\n}\n\n.bullets-disc {\n    list-style-type: disc;\n}\n\n.bullets-square {\n    list-style-type: square;\n}\n\n.bullets-decimal {\n    list-style-type: decimal;\n}\n\n/* ---- 2.2.2. Horizontal/Inline lists -------------------------------------- */\n\n/**\n * Inline lists (items aligned horizontally inline)\n * @deprecated 0.9.5\n *\n * - Usage: <ul class=\"inline\">[...]</ul>\n */\nul.inline, ol.inline\n{\n    list-style:none;\n    margin-left:0;\n}\n\nul.inline li, ol.inline li\n{\n    display:inline-block;\n    margin-right:1em;\n}\n\n\n/* ---- 2.2.3. Separations -------------------------------------------------- */\n\n/**\n * Vertically separated lists -- old solution\n * @deprecated 0.9.5\n *\n * - please use just <ul class=\"separated\">...</ul>\n */\nul.separated-vertical > li,\nol.separated-vertical > li {\n    padding: 0.1em 0;\n    border-top: dotted 1px #ccc;\n}\nul.separated-vertical > li:first-child,\nol.separated-vertical > li:first-child {\n    border-top: none;\n}\n/* for nested lists we want a upper border */\nul.separated-vertical > li:first-child ol.separated-vertical > li:first-child, \nol.separated-vertical > li:first-child ul.separated-vertical > li:first-child, \nul.separated-vertical > li:first-child ul.separated-vertical > li:first-child, \nol.separated-vertical > li:first-child ol.separated-vertical > li:first-child {\n    border-top: dotted 1px #ccc;\n}\n\n/**\n * Vertically separated lists\n * @since 0.9.5\n *\n * - usage: <ul class=\"separated\">...</ul>\n */\nul.separated > li,\nol.separated > li {\n    padding: 0.1em 0;\n    border-top: dotted 1px #ccc;\n}\nul.separated > li:first-child,\nol.separated > li:first-child {\n    border-top: none;\n}\n/* for nested lists we want a upper border */\nul.separated > li:first-child ol.separated > li:first-child, \nol.separated > li:first-child ul.separated > li:first-child, \nul.separated > li:first-child ul.separated > li:first-child, \nol.separated > li:first-child ol.separated > li:first-child {\n    border-top: dotted 1px #ccc;\n}\n\n/**\n * Horizontally separated lists -- old solution\n * @deprecated 0.9.5\n *\n * - please use just <ul class=\"inline separated\">...</ul> or\n *   <ul class=\"inline\">...</ul> for horizontal/inline lists without separation\n *   between items\n */\nul.separated-horizontal > li,\nol.separated-horizontal > li {\n    display: inline-block;\n    padding-right:0.5em;\n    border-right: dotted 1px #ccc;\n}\n\nul.separated-horizontal > li.last-child,\nol.separated-horizontal > li.last-child\n{\n\tborder-right: none;\n}\n\n\n/**\n * Horizontally separated lists\n * @since 0.9.5\n *\n * - Usage: <ul class=\"inline separated\">...</ul>\n */\nul.inline.separated li, ol.inline.separated li\n{\n    display:inline-block;\n    margin:0;\n    padding:0;\n    border-top:none !important;\n}\nul.inline.separated li:after, ol.inline.separated li:after\n{\n    content:\" • \";\n    color:#ccc;\n}\nul.inline.separated li:last-child:after, ol.inline.separated li:last-child:after,\nul.inline.separated li.last-child:after, ol.inline.separated li.last-child:after\n{\n    content:\"\" !important;\n}\n\n/**\n * Horizontally comma-separated lists\n * @since 0.9.5\n *\n * - Usage: <ul class=\"inline separated comma\">...</ul>\n */\nul.inline.separated.comma li:after, ol.inline.separated.comma li:after\n{\n    content:\", \";\n    color:#333;\n}\n\n/* -- 2.3. Standard margins and paddings ------------------------------------ */\n\n.display-block,\np {\n\n    display: block;\n    width: auto;\n    margin-bottom: 0.5em;\n}   \n\n/* -- 2.4. Images ----------------------------------------------------------- */\n\nimg {\n    border: none;\n    vertical-align: middle;\n}\n\nimg.object {\n    max-width: 10em;\n}\n\ntable img {\n    vertical-align: top;\n}\n\nimg.boxed {border: solid 1px #333;}\n\nimg.clickicon, a.clickicon img {\n    margin: 0;\n    padding: 0;\n    line-height: 1;\n    vertical-align: middle;\n    min-height: 1em;\n    max-height: 1.2em;\n}\n\n/* -- 2.4.1. Icons ---------------------------------------------------------- */\n\n/**\n * Icon\n * should be work with most inline and block elements\n *\n * @since 0.9.5\n *\n * <span class=\"icon icon-####\"></span> Text\n * <a class=\"icon icon-####\" title=\"Actionname\"><span>Actionname</span></a>\n */\n\n.icon\n{\n    display:inline-block;\n    line-height:1;\n    padding:0; margin:0;\n    font-size:16px !important; /* as long we cannot use svg */\n    height:1em;\n    width:1em;\n    vertical-align:middle;\n    background-color:transparent;\n    background-position:center;\n    background-repeat:no-repeat;\n    background-image:url(./../images/icons/icon-not-available.png);\n}\n\n.icon span\n{\n    position:absolute;\n    left:-5000em;\n}\n\n.icon-cancel { background-image:url(./../images/icons/cancel.png); }\n.icon-close  { background-image:url(./../images/icons/close.png); }\n.icon-delete { background-image:url(./../images/icons/delete.png); }\n.icon-edit   { background-image:url(./../images/icons/edit.png); }\n.icon-list   { background-image:url(./../images/icons/list.png); }\n.icon-save   { background-image:url(./../images/icons/save.png); }\n.icon-copy   { background-image:url(./../images/icons/copy.png); }\n.icon-add    { background-image:url(./../images/icons/add.png); }\n.icon-accept { background-image:url(./../images/icon-add-grey.png); }\n.icon-ignore { background-image:url(./../images/icons/close.png); }\n\n.icon-arrow-first    { background-image:url(./../images/icons/arrow-first.png); }\n.icon-arrow-last     { background-image:url(./../images/icons/arrow-last.png); }\n.icon-arrow-next     { background-image:url(./../images/icons/arrow-next.png); }\n.icon-arrow-previous { background-image:url(./../images/icons/arrow-previous.png); }\n.icon-arrow-top      { background-image:url(./../images/icons/arrow-top.png); }\n.icon-arrow-up       { background-image:url(./../images/icons/arrow-up.png); }\n.icon-arrow-down     { background-image:url(./../images/icons/arrow-down.png); }\n.icon-arrow-bottom   { background-image:url(./../images/icons/arrow-bottom.png); }\n\n.icon-toggle-on   { background-image:url(./../images/icons/toggle-on.png); }\n.icon-toggle-off  { background-image:url(./../images/icons/toggle-off.png); }\n\n\n\n/* -- 2.5. Links ------------------------------------------------------------ */\n\na {\n    color: #07c;\n    text-decoration: none;\n    cursor: pointer;\n}\n\na:focus, a:hover {\n    color: #07f;\n    text-decoration: underline;\n}\n\na img.boxed { border-color: #07c; }\n\na:focus img.boxed, a:hover img.boxed { border-color: #07f; }\n\na.clickicon img, a img.clickicon {\n    opacity: 0.6;\n}\n\na.clickicon:focus img, a:focus img.clickicon, a.clickicon:hover img, a:hover img.clickicon {\n    opacity: 1;\n}\n\na.externalLink {\n    background: url(./../images/icon-ext-link.png) no-repeat scroll right center transparent;\n    padding: 10px 10px 0 0;\n}\n\n/* -- 2.6. Tables ----------------------------------------------------------- */\n\ntable {\n    background-color: transparent;\n    width: 99%;\n    margin-bottom: 1em;\n    border-collapse: collapse;\n    border-spacing: 0;\n    empty-cells: show;\n    caption-side: top;\n    table-layout: auto;\n}\n\nth, td {\n    padding: 0.2em 0.6em;\n    text-align: left;\n    border-style: none;\n    border-width: 0;\n    vertical-align: top;\n}\n\nth.selector, td.selector {\n\twidth: 1em;\n\ttext-align: left;\n\tvertical-align: text-top;\n\tpadding-right: 0.5em;\n}\n\nth.enumeration, td.enumeration {\n\twidth: 2em;\n\ttext-align: right;\n\tpadding-right: 0.5em;\n}\n\nth {font-weight: bold;}\n\ntd {font-weight: normal;}\n\ntable.backgrounded thead th, thead.backgrounded th {\n\n    background-color: #666;\n    color: #fff;\n}\n\ntable.backgrounded td {\n    background-color: #eee;\n}\n\ntable.backgrounded tr.odd td {\n    background-color: #f6f6f6;\n}\n\n\ntable caption {\n    margin: 0.25em 0;\n    font-size: 1em;\n    font-weight: bold;\n    color: #333;\n    text-align: left;\n}\n\n/* ---- 2.6.1. Separations -------------------------------------------------- */\n\ntable.separated-vertical tbody {\n    border-style:solid none;\n    border-color:#aaa;\n    border-width:1px;\n}\n\ntable.separated-vertical td {\n    border-top: dotted 1px #ccc;\n}\n\ntable.separated-vertical tr:first-child  td {\n    border-top: none;\n}\n\ntable.separated-vertical tbody tr:first-child th,\ntable.separated-vertical tbody tr:first-child td {\n    border-top: solid 1px #aaa;\n}\n\ntable.separated-vertical tbody:first-child tr:first-child td,\ntable.separated-vertical caption + tbody tr:first-child td,\ntable.separated-vertical thead + tbody tr:first-child td,\ntable.separated-vertical colgroup + tbody tr:first-child td {\n    border-top: none;\n}\n\ntable.separated-vertical th {\n    border-bottom: solid 1px #aaa;\n}\n\ntable.separated-vertical tr.grouptitle th { border-bottom: none; }\n\ntable.separated-horizontal th,\ntable.separated-horizontal td {\n    border-left: dotted 1px #ccc;\n}\n\ntable.separated-horizontal tr th:first-child,\ntable.separated-horizontal tr td:first-child {\n    border-left: none;\n}\n\ntable.spaced-vertical th,\ntable.spaced-vertical td {\n    border-top: solid 2px #fff;\n}\n\ntable.spaced-horizontal th,\ntable.spaced-horizontal td {\n    border-right: solid 2px #fff;\n}\n\n/* -- 2.7. Icon buttons ----------------------------------------------------- */\n\n.icon-button {\n    display: block;\n    float: left;\n    clear: left;\n    height: 1em;\n    width: 16px;\n    vertical-align: bottom;\n    background-repeat: no-repeat;\n    background-position: center;\n    background-color: transparent;\n    overflow: hidden;\n    color: transparent;\n    cursor: pointer;\n    line-height: 0.1;\n    margin-top: 0.25em;\n    margin-right: 0.2em;\n}\n\n.expand {\n    background-image: url(./../images/icon-toggle-plus.png);\n    width: 7px;\n    margin-right: 0.5em;\n}\n\n.collapse {\n    background-image: url(./../images/icon-toggle-minus.png);\n    width: 7px;\n    margin-right: 0.5em;\n}\n\n/* 3. Forms ----------------------------------------------------------------- */\n\nform {\n    font-size: 1em;\n}\n\n/* -- 3.1. Buttons ---------------------------------------------------------- */\n\n/*\n   Created by Kevin Hale [particletree.com]\n   * particletree.com/features/rediscovering-the-button-element\n*/\n\n/* Button standard */\na.formbutton, button, input.formbutton,\ndiv.window .content a.button, div.window .content input.button, /* !!DEPRECATED!! only for back compatibility in 0.8 */\ninput.button,\ninput.submit,\ninput.reset,\nul.minibutton li a,\nli.minibutton a,\na.minibutton,\n.ui-state-default.ui-button\n{\n\n  /*display: block;*/\n  display:inline-block;\n  /*float: left;*/\n  \n  margin: 0 0.35em 0.7em 0;\n  padding: 0.35em 0.7em 0.3em 0.7em;   /* Links */\n  \n  border-style: double;\n  border-width: 3px;\n  border-right-color: #999;\n  border-bottom-color: #999;\n  border-left-color: #ccc;\n  border-top-color: #ccc;\n\n  background: url(./../images/layout-button-menu-gradient.png) repeat-x top center #eee;\n  color: #333;\n\n  font-family: \"Lucida Grande\", Tahoma, Arial, Verdana, sans-serif;\n  font-size: 1em;\n  line-height: 1.3;\n  text-decoration: none;\n  font-weight: normal;\n\n  cursor: pointer;\n}\n\nbutton,\n.ui-state-default.ui-button\n {\n  width: auto;\n  overflow: visible;\n}\n\nbutton,\ninput.formbutton,\ninput.button,\ninput.submit,\ninput.reset,\n.ui-state-default.ui-button\n {\n\n  padding: 0.3em 0.5em 0.3em 0.5em;   /* Firefox */\n  /* line-height: 1.7; */          /* Safari */\n}\n\n\n/* Minibuttons */\nul.minibutton li a,\nli.minibutton a,\na.minibutton {\n\n    border-style: solid;\n    border-width: 1px;\n    margin: 0 0.15em;\n    padding: 0.15em 0.5em;   /* Links */\n    font-size: 0.85em;\n}\n\n/* Button mouse over */\na.formbutton:hover, a.formbutton:focus, button:hover, input.formbutton:hover,\ndiv.window .content a.button:hover, div.window .content a.button:focus, /* !!DEPRECATED!! only for back compatibility in 0.8 */\ninput.button:hover,\ninput.submit:hover,\ninput.reset:hover,\nul.minibutton li a:hover,\nli.minibutton a:hover,\na.minibutton:hover,\n.ui-state-default.ui-button:hover\n {\n\n    border-right-color: #9aa6aa;\n    border-bottom-color: #9aa6aa;\n    border-left-color: #cdd7dd;\n    border-top-color: #cdd7dd;\n    color: #333;\n    background: url(./../images/layout-button-menu-hover-gradient.png) repeat-x bottom center #eff9ff;\n}\n\n/* Button mouse over */\na.formbutton:hover.selected, a.formbutton:focus.selected, button:hover.selected, input.formbutton:hover.selected,\ndiv.window .content a.button:hover.selected, div.window .content a.button:focus.selected, /* !!DEPRECATED!! only for back compatibility in 0.8 */\ninput.button:hover.selected,\ninput.submit:hover.selected,\ninput.reset:hover.selected,\nul.minibutton li a:hover.selected,\nli.minibutton a:hover.selected,\na.minibutton:hover.selected {\n\n    border-right-color: #9aa6aa;\n    border-bottom-color: #9aa6aa;\n    border-left-color: #cdd7dd;\n    border-top-color: #cdd7dd;\n    color: #333;\n    cursor: default;\n    background: url(./../images/layout-button-menu-gradient.png) repeat-x top center #eee;\n}\n\n/* Button focused */\na.active, \na.formbutton:active, button:focus, input.formbutton:focus,\ndiv.window .content a.button:active, /* !!DEPRECATED!! only for back compatibility in 0.8 */\ninput.button:focus,\ninput.submit:focus,\ninput.reset:focus,\nul.minibutton li a:focus,\nli.minibutton a:focus,\na.minibutton:focus,\n.ui-state-default.ui-button:focus\n  {\n\n    border-right-color: #cdd7dd !important;\n    border-bottom-color: #cdd7dd !important;\n    border-left-color: #9aa6aa !important;\n    border-top-color: #9aa6aa !important;\n    color: #333;\n    background: url(./../images/layout-button-menu-hover-gradient.png) repeat-x bottom center #eff9ff;\n}\n\n/* Button disabled */\na.formbutton.disabled, button.disabled, input.formbutton.disabled,\ninput.button.disabled,\ninput.submit.disabled,\ninput.reset.disabled,\nul.minibutton li a.disabled,\nli.minibutton a.disabled,\na.minibutton.disabled,\n \na.formbutton.disabled:active, button.disabled:focus, input.formbutton.disabled:focus,\ninput.button.disabled:hover,\ninput.submit.disabled:hover,\ninput.reset.disabled:hover,\nul.minibutton li a.disabled:hover,\nli.minibutton a.disabled:hover,\na.minibutton.disabled:focus {\n\n\tborder-right-color: #999;\n\tborder-bottom-color: #999;\n\tborder-left-color: #ccc;\n\tborder-top-color: #ccc;\n\tcolor: #333;\n\topacity: 0.5;\n\tcursor: default;\n/*  background: url(./../images/layout-button-menu-gradient.png) repeat-x top center #eee;*/\n}\n\ndiv.window .content a.button img,\nbutton img, a.formbutton img {\n  margin: 0;\n  padding: 0;\n  border: none;\n  min-height: 1em;\n  max-height: 1.2em;\n  line-height: 1;\n  vertical-align: bottom;\n}\n\n.separator {\n\twidth: 0.4em;\n\tborder: none !important;\n\tpadding: 0 !important;\n\tbackground: transparent !important;\n}\n\n/* Positive */\n\n/* Negative */\n\n\n/* -- 3.2. Input fields ----------------------------------------------------- */\n\ninput.text,\ninput.password,\ninput.checkbox,\ninput.radio,\ntextarea {\n\n    display: inline-block;\n    border-left-color: #888;\n    border-top-color: #888;\n    border-right-color: #ddd;\n    border-bottom-color: #ddd;\n    border-style: solid;\n    border-width: 1px;\n    margin: 0;\n    vertical-align: baseline;\n    line-height: 1;\n    padding: 2px;\n    font-family: sans-serif;\n    font-size: 1.1em;\n    font-weight: normal;\n    color: #333;\n    background: url(./../images/layout-button-menu-hover-gradient.png) repeat-x bottom center #f6f6f6;\n}\n\ntable.edittable input.text,\ntable.edittable textarea {\n    font-size: 1em;\n    margin-bottom: 0.5em;\n    vertical-align: text-top;\n    min-width: inherit;\n    min-height: inherit;\n}\n\n.no-min-width input,\n.no-min-width select {\n    min-width: inherit;\n}\n\n.no-max-width input,\n.no-max-width select {\n    max-width: inherit;\n}\n\ninput.text, input.password {\n\n    min-width: 10em;\n}\n\ninput.checkbox, input.radio {\n\n    width: 0.9em !important;\n    height: 0.9em !important;\n    min-width: auto;\n    vertical-align: middle;\n    color: #07c;\n    padding: 0;\n    font-weight: bold;\n    background: transparent;\n    border-style: none;\n}\n\ntextarea {\n    min-width: 30em;\n    min-height: 18.5em;\n    padding: 0;\n    line-height: 1.5;\n    font-size: 1em;\n}\n\ninput:hover, textarea:hover {\n    background-color: #eff9ff;\n    color: #000;\n}\n\ninput:focus, textarea:focus, select:focus, select:hover {\n    background: #fff;\n    color: #000;\n}\n\ntextarea.code-input {\n\tfont-family: monospace;\n\tbackground: none;\n\tmin-height: 15em;\n\tfont-size: 1.1em;\n}\n\n/* -- 3.3. Selects ---------------------------------------------------------- */\n\nselect {\n    min-width: 20em;\n    font-size: 1em;\n    max-width: 20em;\n    background: #f9f9f9;\n    color: #000;\n    display: inline-block;\n    border-left-color: #888;\n    border-top-color: #888;\n    border-right-color: #ddd;\n    border-bottom-color: #ddd;\n    border-style: solid;\n    border-width: 1px;\n    margin-bottom: 0.5em;\n    vertical-align: middle;\n}\n\nselect.multiselect, select[multiple=\"multiple\"], select.multiple {\n    vertical-align: text-top;\n    max-height: 32em;\n}\n\ntable.edittable select {\n    min-width: inherit;\n}\n\nselect optgroup {\n    color: #000;\n    font-weight: bold;\n    font-style: normal;\n    margin: 0;\n}\n\nselect:hover optgroup, select:focus optgroup {\n    color: #07c;\n}\n\nselect option {\n    color: #000;\n    padding: 0;\n    border: none; \n}\n\nselect.bigsize optgroup {\n    margin-bottom: 0.25em;\n}\n\nselect.bigsize option {\n    padding: 0.1em 1em;\n    border: solid 1px transparent; \n}\n\nselect option:hover {\n    border-color: #cdd7dd;\n    background: url(./../images/layout-button-menu-hover-gradient.png) repeat-x bottom center #eff9ff;\n}\n\nselect option:focus, select option[selected]:focus {\n    border-color: #07c;\n    background: url(./../images/layout-button-menu-hover-gradient.png) repeat-x bottom center #07f;\n}\n\n\n/* -- 3.4. Grouping form elements ------------------------------------------- */\n\nlegend {\n    margin-bottom: 0 !important;\n    padding-bottom: 0 !important;\n}\n\nfieldset {\n    border-style: none;\n    border-width: 0;\n    margin-top: 0.5em;\n    margin-bottom: 1em;\n    padding-top: 0.5em;\n    clear: both;\n    float: none;\n}\n\nfieldset fieldset {\n    border-top-style: solid;\n    border-color: #999;\n    border-width: 1px;\n    margin-top: 0.75em;\n    margin-bottom: 0.75em;\n    padding-top: .5em;\n}\n\nfieldset fieldset fieldset {\n    border-style: dotted;\n    margin-top: 0.5em;\n    margin-bottom: 0.5em;\n    padding-top: 0.5em;\n    padding-bottom: 0.75em;\n    padding-left: 0.75em;\n}\n\ndiv.row-input, form.row-input div {\n    padding: 0.25em 0;\n    border-width: 1px 0;\n    border-style: solid;\n    border-color: transparent;\n    background-color: transparent;\n    overflow: hidden;\n}\n\ndiv.simple-input, form.simple-input div {\n    padding: 0.25em 0;\n    overflow: hidden;\n}\n\ndiv.row-input:hover,\nform.row-input div:hover,\ntr.row-input:hover td,\ntable.edittable tr:hover td {\n\n    border-color: #ddd;\n    background-color: #f0f0f0;\n    border-style: solid;\n}\n\ndiv.row-input:focus, div.row-input:active,\nform.row-input div:focus, form.row-input div:active,\ntr.row-input:focus td, tr.row-input:active td,\ntable.edittable tr:focus td, table.edittable tr:active td {\n\n    border-color: #cdd7dd;\n    background-color: #eff9ff;\n}\n\ndiv.input-justify-left,\nform.input-justify-left div {\n    clear: both;\n}\n\ndiv.input-justify-left label, div.input-justify-left textarea, div.input-justify-left select, div.input-justify-left input,\nform.input-justify-left div label, form.input-justify-left div textarea, form.input-justify-left div select, form.input-justify-left div input {\n\n    display: block;\n    float: left;    \n    margin-right: 2%;\n}\n\n.width50 div.input-justify-left label, .width50 div.input-justify-left select,\nform.input-justify-left div.width50 label, form.input-justify-left div.width50 select {\n\n    margin-right: 4%;\n}\n\ndiv.input-justify-left label,\nform.input-justify-left div label {\n    width: 25%;\n    text-align: right;\n    padding-top: 0.3em;\n    overflow: hidden;\n}\n\n.width50 div.input-justify-left label,\nform.input-justify-left div.width50 label {\n    width: 35%;\n}\n\ndiv.input-justify-left label.checkboxradio,\nform.input-justify-left div label.checkboxradio {\n    margin-left: 27%;\n    width: 75%;\n    margin-right: 0;\n    text-align: left;\n}\n\n.width50 div.input-justify-left label.checkboxradio,\nform.input-justify-left div.width50 label.checkboxradio {\n    width: 55%;\n}\n\ndiv.input-justify-left input.checkbox,\nform.input-justify-left div input.checkbox,\ndiv.input-justify-left input.radio,\nform.input-justify-left div input.radio {\n    margin-top: 0.2em;\n    margin-right: 0.5em;\n}\n\n.width50 div.input-justify-left input.checkbox,\nform.input-justify-left div.width50 input.checkbox,\n.width50 div.input-justify-left input.radio,\nform.input-justify-left div.width50 input.radio {\n    margin-left: 39%;\n}\n\ndiv.input-justify-left input,\nform.input-justify-left div input {\n    width: 40%;\n}\n\ndiv.input-justify-left select,\nform.input-justify-left div select {\n    margin-top: 0.2em;\n}\n\n.width50 div.input-justify-left input, .width50 div.input-justify-left select,\nform.input-justify-left div.width50 input, form.input-justify-left div.width50 select {\n    width: 55%;\n}\n\ndiv.input-justify-left textarea,\nform.input-justify-left div textarea {\n    width: 60%;\n}\n\ndiv.input-justify-left .messagebox,\nform.input-justify-left div .messagebox {\n    margin-left: 27%;\n    margin-right: 13%;\n}\n\n.width50 div.input-justify-left .messagebox,\nform.input-justify-left div.width50 .messagebox {\n    margin-left: 39%;\n    margin-right: 1%;\n}\n\ndiv.actionbuttons {\n    padding: 1em 0 1em 27% !important;\n    border: none !important;\n    background-color: transparent !important;\n    overflow: inherit !important;\n}\n\n.width50 div.actionbuttons {\n    padding-left: 39% !important;\n}\n\ndiv.actionbuttons * {\n    float: none !important;\n}\n\n/*.toolbar .button {\n    text-align: center;\n    border-width: 1px !important;\n}\n\n.toolbar .button img {\n    display: block;\n    margin: 0 auto !important;\n}\n\n.toolbar .button span {\n    font-size: 0.9em !important;\n}*/\n\n\n/* 4. Javascript Enhancements ----------------------------------------------- */\n\n/* -- 4.1. Windows ---------------------------------------------------------- */\n\nbody.javascript-on div.is-minimized .title {\n    display: block;\n    margin-bottom: 0 !important;\n    border-bottom: none !important;\n}\n\nbody.javascript-on .has-menu.is-minimized > .title {\n    margin-bottom: 0 !important;\n}\n\nbody.javascript-on div.is-minimized .content,\nbody.javascript-on div.is-minimized .contextmenu,\nbody.javascript-on div.is-minimized span.resizer-vertical,\nbody.javascript-on div.is-minimized .tabs,\nbody.javascript-on div.is-minimized .cmDiv,\nbody.javascript-on div.is-minimized .cmDiv *,\nbody.javascript-on div.is-minimized ul.menu {\n    display: none !important;\n}\n\nbody.javascript-on div.is-disabled {\n    display: none !important;\n}\n\n/* ---- 4.1.1. Context Menu ------------------------------------------------- */\n\nbody.javascript-on div.window .contextmenu {\n    position: absolute;\n    left: -5000em;\n}\n\ndiv.contextmenu-enhanced .contextmenu {\n    border: solid 1px #ddd;\n    position: absolute;\n    font-size: 0.8em;\n    top: 0;\n    left: 0;\n    line-height: 1;\n    min-width: 15em;\n}\n\ndiv.contextmenu-enhanced .contextmenu li a, div.contextmenu-enhanced .contextmenu li span {\n    padding: 0.3em 1em;\n    text-decoration: none;\n    color: #000;\n}\n\ndiv.contextmenu-enhanced .button-windowclose {\n    background-color: #efefef;\n    right: -1em;\n    top: -1px;\n    border-color: #ddd;\n    border-left-color: transparent;\n}\n\ndiv.contextmenu-enhanced .button:hover {\n    background-color: #eff9ff;\n    border-color: #dee8ee;\n    border-left-color: transparent;\n}\n\n/* ---- 4.1.2. Window Menu -------------------------------------------------- */\n\nbody.javascript-on .has-menu > div > div.cmDiv {\n    position: absolute;\n    width: 100%;\n    top: 1.54em; /* 1.5em */\n}\n\nbody.javascript-on .has-menu > .title {\n    margin-bottom: 1.9em !important;\n}\n\nbody.javascript-on .has-menu > div > .tabs {\n    margin-top: 0.5em;\n}\n\n/* ---- 4.1.3 Content Tabs -------------------------------------------------- */\n\nbody.javascript-on div.window .content .tabtitle {\n    position: absolute;\n    left: -5000em;\n}\n\nbody.javascript-on .tabbed > div > .content {\n    position: absolute;\n    left: -5000em;\n}\n\nbody.javascript-on div.window .active-tab-content {\n    position: relative !important;\n    left: auto !important;\n}\n\n/* ---- 4.1.4. Context Menu ------------------------------------------------- */\n\nbody.javascript-on div.window-buttons {\n    display: block;\n    position: static;\n}\n\nbody.javascript-on div.window-buttons div.window-buttons-left {\n    position: absolute;\n    left: 0.25em;\n    top: 0.25em;\n}\n\nbody.javascript-on div.window-buttons div.window-buttons-right {\n    position: absolute;\n    right: 0.25em;\n    top: 0.25em;\n}\n\nbody.javascript-on div.window-buttons div.window-buttons-left .button {\n    float: left;\n}\n\nbody.javascript-on div.window-buttons div.window-buttons-right .button {\n    float: right;\n}\n\n/*  div.windowbuttonscount-left|right-x : \n    x - number of buttons which are left or right in window title\n*/\nbody.javascript-on div.windowbuttonscount-left-1 .title {\n    padding-left: 1.5em !important;\n}\n\nbody.javascript-on  div.windowbuttonscount-left-1 div.window-buttons-left {\n    width: 1em !important;\n}\n\nbody.javascript-on div.windowbuttonscount-left-2 .title {\n    padding-left: 2.5em !important;\n}\n\nbody.javascript-on  div.windowbuttonscount-left-2 div.window-buttons-left {\n    width: 2em !important;\n}\n\nbody.javascript-on div.windowbuttonscount-left-3 .title {\n    padding-left: 3.5em !important;\n}\n\nbody.javascript-on  div.windowbuttonscount-left-3 div.window-buttons-left {\n    width: 3em !important;\n}\n\nbody.javascript-on div.windowbuttonscount-right-1 .title {\n    padding-right: 1.5em !important;\n}\n\nbody.javascript-on  div.windowbuttonscount-right-1 div.window-buttons-right {\n    width: 1em !important;\n}\n\nbody.javascript-on div.windowbuttonscount-right-2 .title {\n    padding-right: 2.5em !important;\n}\n\nbody.javascript-on  div.windowbuttonscount-right-2 div.window-buttons-right {\n    width: 2em !important;\n}\n\nbody.javascript-on div.windowbuttonscount-right-3 .title {\n    padding-right: 3.5em !important;\n}\n\nbody.javascript-on  div.windowbuttonscount-right-3 div.window-buttons-right {\n    width: 3em !important;\n}\n\nbody.javascript-on div.window-buttons .button, div.contextmenu-enhanced .button {\n    font-size: 1em;\n    display: block;\n    position: static;\n    height: 0.9em;\n    width: 0.9em;\n    background-color: transparent;\n    border: solid 1px transparent;\n    padding: 0;\n    margin: 0;\n    cursor: pointer;\n}\n\nbody.javascript-on div.window-buttons .button-contextmenu {\n    background: url(../images/button-contextmenu.png) no-repeat center transparent;\n}\n\nbody.javascript-on div.window-buttons .button-windowrestore {\n    background: url(../images/button-windowrestore.png) no-repeat center transparent;\n}\n\nbody.javascript-on div.window-buttons .button-windowminimize {\n    background: url(../images/button-windowminimize.png) no-repeat center transparent;\n}\n\nbody.javascript-on div.window-buttons .button-windowclose {\n    background: url(../images/button-windowclose.png) no-repeat center transparent;\n}\n\nbody.javascript-on div.window-buttons .button:hover, div.contextmenu-enhanced .button:hover {\n    border-color: #fff;\n}\n\n/* -- 4.2. Context Enabled Elements ----------------------------------------- */\n\n.has-contextmenus-block a {\n    display: block;\n    position: relative;\n    /*border: solid 1px transparent;*/\n}\n\n.has-contextmenus-block a span.button {\n\n    line-height:1;\n    display: block;\n    position: absolute;\n    right: 5000em;\n    top: 0;\n    height: 100%;\n    width: 1.5em;\n    background: url(./../images/icons/context.png) no-repeat center #666;\n    margin: 0;\n    padding: 0;\n    border-style: none;\n    /*border-left: solid 1px #999;*/\n    border-radius:0.25em;\n    -moz-border-radius:0.25em;\n    -webkit-border-radius:0.25em;\n    opacity:0.5;\n}\n\n.has-contextmenus-block a.Resource:hover,\n.has-contextmenus-block a.Resource:focus {\n    /*border-color: #999;*/\n    background-color:#EFF9FF;\n}\n\n.has-contextmenus-block a.Resource:hover span.button,\n.has-contextmenus-block a.Resource:focus span.button,\n.has-contextmenus-block a.Resource:active span.button {\n    right: 0;\n}\n\n.has-contextmenus-block span.button:hover\n{\n    opacity:1;\n}\n\n/* -- 4.2.1 Inline Context Menus ---------------------------------------------- */\n\na.hasMenu {\n    position: relative;\n    /*white-space:nowrap;*/\n}\n\na.hasMenu span.toggle {\n    line-height:1;\n    display: block;\n    position: absolute;\n    height: 0;\n    width: 0;\n    /* border: solid 1px #999; */\n    right: -0.625em;\n    top: 0;\n    /*background: url(./../images/icons/context.png) no-repeat center rgba(85, 85, 85, 0.5);*/\n    background: url(./../images/icons/context.png) no-repeat center #999;\n    background-color:rgba(85, 85, 85, 0.5);\n    opacity:0.75;\n    border-radius:0.2em;\n    -moz-border-radius:0.2em;\n    -webkit-border-radius:0.2em;\n}\n\na.hasMenu span.toggle:hover {\n    opacity:1;\n    background-color:#555;\n}\n\na.hasMenu:hover span.toggle {\n    display: block;\n    height: 100%;\n    width: 1.25em;\n    min-height:16px; min-width:16px; /* as long as we cannot use svg */\n}\n\n/* -- 4.2.2 Area Context Menus ---------------------------------------------- */\n\n/**\n * @since 0.9.5\n *\n * <BLOCKELEMENT class=\"has-contextmenu-area>\n *     <ELEMENT class=\"contextmenu\">\n *         <ELEMENT class=\"item\"><ELEMENT class=\"icon icon-####\" title=\"Text\"><span>Text</span></ELEMENT></ELEMENT>\n *     </ELEMENT>\n * </BLOCKELEMENT>\n *\n */\n\n.has-contextmenu-area\n{\n    position:relative;\n}\n\n.has-contextmenu-area > .contextmenu\n{\n    display:block;\n    position:absolute;\n    left:-5000em; top:-5000em;\n    /* wegen .window .contextmenu */\n    border:none !important;\n    font-size: 16px !important;\n    min-width: auto !important;\n}\n\n.has-contextmenu-area > .contextmenu .item .icon\n{\n    vertical-align:middle;\n}\n\n.has-contextmenu-area:hover > .contextmenu\n{\n    display:block;\n    /* wegen .window .contextmenu */\n    top:-0.25em !important;\n    right:0 !important;\n    bottom:auto !important;\n    left:auto !important;\n}\n\n.has-contextmenu-area > .contextmenu > .item,\n.has-contextmenu-area > .contextmenu > .area .item\n{\n    font-size:16px; /* as long as we cannot use svg */\n    line-height:1;\n    display:inline-block; height:1em;\n    padding:0.25em;\n    background-color:#999;\n    background-color:rgba(85, 85, 85, 0.5); /* #555 */\n    opacity:0.75;\n    border-radius:0.25em;\n    -moz-border-radius:0.25em;\n    -webkit-border-radius:0.25em;\n    margin-left:0.25em;\n    cursor:pointer;\n}\n\n.has-contextmenu-area > .contextmenu > .item:hover,\n.has-contextmenu-area > .contextmenu > .area .item:hover\n{\n    background-color:#555;\n    opacity:1;\n}\n\n/* -- 4.3. Drag and Drop ---------------------------------------------------- */\n\n.dropactive {\n    display: inline-block;\n    padding: 0.1em;\n\tbackground-color: #ffb;\n\tcolor: #333 !important;\n}\n\n.drophover {\n    color: #fff !important;\n    padding: 0.25em 0.5em !important;\n\tbackground-color: #c00 !important;\n\tz-index: 500;\n    font-weight: bold;\n}\n\n/* -- 4.4. Resizer ---------------------------------------------------------- */\n\nbody.javascript-on .section-sidewindows span.resizer-horizontal {\n    display: block;\n    position: absolute;\n    top: 0;\n    right: -0.25em;\n    width: 0.5em;\n    height: 100%;\n    background: transparent;\n    cursor: e-resize;\n}\n\nbody.javascript-on .section-sidewindows span.resizer-horizontal.dragging, \nbody.javascript-on .section-sidewindows span.resizer-horizontal:hover {\n    background: url(./../images/button-resizer-horizontal.png) no-repeat center #bbb;\n/*    background-color: #bbb;*/\n    opacity: 0.5;\n}\n\nbody.javascript-on div.has-resizer span.resizer-vertical {\n    display: block;\n    position: absolute;\n    bottom: 0;\n    width: 100%;\n    height: 0.25em;\n    background-color: transparent;\n    border-bottom: solid 1px #666;\n}\n\nbody.javascript-on div.has-resizer span.resizer-vertical:hover {\n    /*background-color: #dee8ee;*/\n    cursor: s-resize;\n}\n\n/* -- 4.5. Processing ------------------------------------------------------- */\n\n.is-processing * {\n    visibility: hidden !important;\n    cursor: wait !important; \n}\n\n.is-processing > .title,\n.is-processing > .tabs {\n\n    visibility: visible !important;\n}\n\n.is-processing {\n    background-image: url(./../images/spinner.gif) !important;\n    background-position: center !important;\n    background-repeat: no-repeat !important;\n    cursor: wait !important;\n    min-height: 50px;\n}\n\ninput.is-processing {\n    background-image: url(./../images/spinner.gif) !important;\n    background-position: right !important;\n    background-repeat: no-repeat !important;\n    cursor: wait !important;\n    min-height: 0;\n}\n\n/* -- 4.6 Editing ----------------------------------------------------------- */\n.edit {\n    display: none;\n}\n\n/* -- 4.7 Tables ------------------------------------------------------------ */\n\nbody.javascript-on tbody.closed tr { display: none; }\nbody.javascript-on tbody.closed tr.grouptitle { display: table-row; }\n\nbody.javascript-on tr.grouptitle th a.toggle {\n    display: block;\n    float: left;\n    width: 10px; \n    height: 1.5em;\n    margin-right: 0.5em;\n    background-image: url(./../images/tree-toggle.png);\n    background-repeat: no-repeat;\n    background-position: -20px center;\n    background-color: transparent;\n}\n\nbody.javascript-on tr.grouptitle th a.toggle:hover,\nbody.javascript-on tr.grouptitle th a.toggle:focus,\nbody.javascript-on tr.grouptitle th a.toggle:active {\n    background-position: -30px center;\n}\n\nbody.javascript-on tbody.closed tr.grouptitle th a.toggle {\n    background-position: -0px center;\n}\n\nbody.javascript-on tbody.closed tr.grouptitle th a.toggle:hover,\nbody.javascript-on tbody.closed tr.grouptitle th a.toggle:focus,\nbody.javascript-on tbody.closed tr.grouptitle th a.toggle:active {\n    background-position: -10px center;\n}\n\n/* 5. jQuery UI enhancements ------------------------------------------------ */\n\n/* Draggables */\n\na.Resource.ui-draggable-dragging\n{\n    display:block;\n    position: absolute;\n    color:#000;\n    background:#dee8ee;\n    padding:0.25em;\n    border:solid 1px #cdd7dd;\n    -moz-box-shadow:0 0 0.5em #666;\n    -webkit-box-shadow:0 0 0.5em #666;\n    box-shadow:0 0 0.5em #666;\n    cursor: move;\n}\n\na.ui-draggable-dragging.hasMenu span.toggle\n{\n    display:none;\n}\n\n/* Droppables */\n\n/* please use .ui-droppable-accepted-window for droppable div.window elements,\n   and .ui-droppable-accepted-destination for all outher elements in a window */\n\n.ui-droppable-accepted-destination *,\n.window.ui-droppable-accepted-window .content *\n{\n    background-color: transparent !important;\n    border-color:transparent !important;\n    background-image: none;\n}\n\n.ui-droppable-accepted-destination,\n.window.ui-droppable-accepted-window .content\n{\n    background-color: #dee8ee;\n    -moz-box-shadow:inset 0 0 1em #333;\n    -webkit-box-shadow:inset 0 0 1em #333;\n    box-shadow:inset 0 0 1em #333;\n}\n\n.window.ui-droppable-accepted-window h1.title\n{\n    background-color:#adb5ba !important;\n}\n\n.window.ui-droppable-accepted-window .cmDiv,\n.window.ui-droppable-accepted-window .cmDiv *\n{\n    background-color:#c5ced4 !important;\n}\n\n.window .content .ui-droppable-hovered,\n.window.ui-droppable-hovered .content\n{\n    background-color: #eff9ff;\n    -moz-box-shadow:inset 0 0 1.5em #333;\n    -webkit-box-shadow:inset 0 0 1em #333;\n    box-shadow:inset 0 0 1.5em #333;\n}\n\n/* 6. Etcetera -------------------------------------------------------------- */\n\n.hide {display: none !important;}\n\n.onlyAural {position: absolute !important; left: -5000em !important;}\n\n.clearall {\n    float: none;\n    clear: both;\n    border-style: none !important;\n    background: transparent !important;\n    padding: 0 !important;\n    margin: 0 !important;\n    height: 0.1%;\n    line-height: 0.1;\n    overflow: inherit !important;\n}\n\n.clearfloat {\n    float: none;\n    clear: both;\n}\n\n.ui-draggable { position:relative; z-index:998; }\n\n/* 7. Specials -------------------------------------------------------------- */\n\nul.hierarchy li > a, \nol.hierarchy li > a {\n    margin-left: 12px;\n}\n\na.hierarchy-toggle {\n    float: left;\n    width: 8px;\n    height: 1.5em;\n    background-image: url(./../images/tree-toggle.png);\n    background-position: 0px 50%;\n    background-repeat: no-repeat;\n    margin-left: 0 !important;\n}\n\na.hierarchy-toggle:hover {\n    background-position: -10px 50%;\n}\n\na.open {\n    float: left;\n    width: 8px;\n    height: 1.5em;\n    background-image: url(./../images/tree-toggle.png);\n    background-position: -20px 50%;\n    background-repeat: no-repeat;\n    margin-left: 0 !important;\n}\n\na.open:hover {\n    background-position: -30px 50%;\n}\n\n.comment > *:first-child {\n    padding-left: 20px;\n    background-image: url(./../images/icon-comment.png);\n    background-repeat: no-repeat;\n    background-position: 0 0.4em;\n}\n\n.hidden {\n    display: none;\n}\n\n.small {\n    font-size: 0.8em;\n}\n\n/* 8. GUI-Facelift ---------------------------------------------------------- */\n\n/**\n *\n * GUI-Facelift\n *\n * - TODO: merge that style directly into definitions above\n *\n *************************************************************************/\n\nbody\n{\n    background-color: #f9f9f9;\n    background-position: left bottom;\n}\n\n/* -- 1. Windows ----------------------------------------------------------\n\n   - little bit more margin, shadow and adjusted titles, some border-radius\n\n*/\n\ndiv.window\n{\n    margin: 1em;\n    box-shadow: 0px 0px 0.25em rgba(0, 0, 0, 0.25);\n    border-radius: 4px;\n}\n\ndiv.section-mainwindows div.window\n{\n    margin-left: 0.5em;\n}\n\ndiv.section-sidewindows div.window\n{\n    margin-right: 0.5em;\n}\n\ndiv.window .title\n{\n    border-radius: 3px 3px 0 0;\n    padding: 0.5em 0.5em 0.4em 0.5em !important;\n\n    background-color: #888;\n    background-image: none;\n    \n    background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.25));\n    background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.25));\n    background-image: -ms-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.25));\n    background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.25));\n    background-image: linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.25));\n}\n\ndiv.window .content,\ndiv.window .statusbar\n{\n    border-radius: 0 0 3px 3px;\n}\n\nbody.javascript-on .has-menu > div > div.cmDiv\n{\n    top: 1.94em;\n}\n\n/* -- 2. Upper Control Panel ----------------------------------------------\n   \n   - use application window here and tweak its layout\n   \n*/\n\ndiv.section-mainwindows\n{\n    padding-top: 4em;\n}\n\ndiv.section-sidewindows\n{\n    top: 4em;\n}\n\n#application\n{\n    position: fixed;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 4em;\n    margin: 0;\n    z-index: 999;\n    \n    border: none;\n    border-radius: 0;\n    \n    box-shadow: 0px 0px 0.5em rgba(0, 0, 0, 0.5);\n    \n    font-size: 1em;\n\n    background-color: #888;\n    background-image: none;\n    \n    background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.25));\n    background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.25));\n    background-image: -ms-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.25));\n    background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.25));\n    background-image: linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.25));\n}\n\n#application div.window-buttons\n{\n    display: none;\n    float: none;\n    clear: both;\n    height: 1px;\n    width: 100%;\n}\n\n#application div.window-buttons *\n{\n    display: none;\n}\n\n#application.window h1.title\n{\n    border: none;\n    width: 1.625em;\n    height: 2em;\n    line-height: 2;\n    padding: 1em !important;\n    margin: 0 !important;\n    float: left;\n    overflow: hidden;\n    white-space: nowrap;\n    text-indent: 200%;\n    background: url(./../images/logo-ontowiki.png) no-repeat center transparent;\n}\n\n#application .slidehelper\n{\n    margin-left: 3.625em;\n    overflow: visible;\n}\n\n#application .content\n{\n    border: none;\n    background: transparent;\n    padding: 1.15em 1% 0 1%;\n    clear: none;\n    float: right;\n    width: 37%;\n}\n\n#application .content img\n{\n    display: none;\n}\n\n#application div.cmDiv\n{\n    position: static;\n    top: auto;\n    margin-right: 40%;\n    width: auto;\n    border: none;\n    padding: 0;\n    background: transparent;\n}\n\n#application div.cmDiv > ul.clickMenu\n{\n    margin: 0;\n    padding: 0;\n    \n    position: static;\n}\n\n#application ul.clickMenu > li.main\n{\n    padding: 0 0.5em;\n    line-height: 4em;\n    height: 4em;\n    background: none;\n    color: #fff;\n    text-shadow: -1px -1px 1px #000;\n    border: none !important\n}\n\n#application ul.clickMenu > li.main.hover\n{\n    text-shadow: none;\n    \n    color: #333;\n    background-color: #EFF9FF;\n\n    background-image: -webkit-linear-gradient(top , rgba(0, 0, 0, 0.125), rgba(255, 255, 255, 0.125));\n    background-image: -moz-linear-gradient(top , rgba(0, 0, 0, 0.125), rgba(255, 255, 255, 0.125));\n    background-image: -ms-linear-gradient(top , rgba(0, 0, 0, 0.125), rgba(255, 255, 255, 0.125));\n    background-image: -o-linear-gradient(top , rgba(0, 0, 0, 0.125), rgba(255, 255, 255, 0.125));\n    background-image: linear-gradient(top , rgba(0, 0, 0, 0.125), rgba(255, 255, 255, 0.125));\n}\n\n#application ul.clickMenu > li.main li,\n#application ul.clickMenu > li.main a\n{\n    line-height: 1;\n    text-shadow: none;\n}\n\n#application ul.clickMenu li.hover > a\n{\n}\n\n#application ul.clickMenu div.outerbox\n{\n    top: 100%;\n}\n\n#application p\n{\n    padding: 0;\n    margin: 0;\n    width: auto !important;\n}\n\n#application #searchtext-input\n{\n    font-size: 1em;\n    padding: 0.25em 0.5%;\n    margin: 0;\n    width: 99%;\n    background: #eee;\n    color: #999;\n    border-color: #666;\n    border-radius: 4px;\n    margin-top: -1px;\n}\n\n#application #searchtext-input:hover\n{\n    background: #fff;\n    color: #333;\n}\n\n#application #searchtext-input:focus\n{\n    color: #000;\n    background: #fff;\n}\n\n/* -- 3. Dropdown Menus ---------------------------------------------------\n   \n   - restyling boxes and hovers\n   \n*/\n\nul.clickMenu li\n{\n    border: none;\n}\n\nul.clickMenu li.hover\n{\n    background-image: none;\n    /*\n    background-image: -webkit-linear-gradient(top , rgba(0, 0, 0, 0.125), rgba(255, 255, 255, 0.125));\n    background-image: -moz-linear-gradient(top , rgba(0, 0, 0, 0.125), rgba(255, 255, 255, 0.125));\n    background-image: -ms-linear-gradient(top , rgba(0, 0, 0, 0.125), rgba(255, 255, 255, 0.125));\n    background-image: -o-linear-gradient(top , rgba(0, 0, 0, 0.125), rgba(255, 255, 255, 0.125));\n    background-image: linear-gradient(top , rgba(0, 0, 0, 0.125), rgba(255, 255, 255, 0.125));\n    */\n}\n\nul.clickMenu ul.innerBox\n{\n    border-top: none;\n    border-color: #ddd;\n    background-color: #eee;\n    opacity: 0.95;\n}\n\nul.clickMenu ul.innerBox ul.innerBox\n{\n    opacity: 1;\n}\n\n/* -- 4. Input fields -----------------------------------------------------\n*/\n\ninput.text, input.password, textarea\n{\n    box-shadow: 0px 0px 0.35em rgba(0, 0, 0, 0.35) inset;\n    background-image: none;\n}\n\ninput.text:hover, input.password:hover, textarea:hover\n{\n}\n\ninput.text:focus, input.password:focus, textarea:focus\n{\n    background-color: #fff;\n    box-shadow: 0px 0px 0.35em lightblue inset;\n}\n\n/* -- 5. Tabs -------------------------------------------------------------\n*/\n\ndiv.window .tabs li a\n{\n    background-image: none;\n    border-radius: 4px 4px 0 0;\n    background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0) 75%, rgba(0, 0, 0, 0.2));\n    background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0) 75%, rgba(0, 0, 0, 0.2));\n    background-image: -ms-linear-gradient(top, rgba(255, 255, 255, 0) 75%, rgba(0, 0, 0, 0.2));\n    background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0) 75%, rgba(0, 0, 0, 0.2));\n    background-image: linear-gradient(top, rgba(255, 255, 255, 0) 75%, rgba(0, 0, 0, 0.2));\n}\n\ndiv.window .tabs li.active a\n{\n    background-image: none;\n    background-color: #f2f2f2 !important;\n    background-image: -webkit-linear-gradient(top, #ff8f00 0%, #ff8f00 2px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0) 100%);\n    background-image: -moz-linear-gradient(top, #0077CC 0%, #0077CC 2px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0) 100%);\n    background-image: -ms-linear-gradient(top, #ff8f00 0%, #ff8f00 2px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0) 100%);\n    background-image: -o-linear-gradient(top, #ff8f00 0%, #ff8f00 2px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0) 100%);\n    background-image: linear-gradient(top, #ff8f00 0%, #ff8f00 2px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0) 100%);\n    box-shadow: 0px -1px 1px rgba(0, 0, 0, 0.25);\n}\n\n/* -- 6. Buttons ----------------------------------------------------------\n*/\n\na.formbutton,\nbutton, input.formbutton,\ndiv.window .content a.button,\ndiv.window .content input.button,\ninput.button, input.submit, input.reset,\nul.minibutton li a, li.minibutton a, a.minibutton,\n.ui-state-default.ui-button\n{\n    border-radius: 4px;\n    \n    border-style: solid;\n    border-width: 1px;\n    margin: 2px;\n    box-shadow: 0 0 2px rgba(0, 0, 0, 0.25);\n    \n    background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.1));\n    background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.1));\n    background-image: -ms-linear-gradient(top, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.1));\n    background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.1));\n    background-image: linear-gradient(top, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.1));\n}\n\na.formbutton:focus,\nbutton:focus, input.formbutton:focus,\ndiv.window .content a.button:focus,\ninput.button:focus, input.submit:focus, input.reset:focus,\nul.minibutton li a:focus, li.minibutton a:focus, a.minibutton:focus,\n.ui-state-default.ui-button:focus,\na.formbutton:hover,\nbutton:hover, input.formbutton:hover,\ndiv.window .content a.button:hover,\ninput.button:hover, input.submit:hover, input.reset:hover,\nul.minibutton li a:hover, li.minibutton a:hover, a.minibutton:hover,\n.ui-state-default.ui-button:hover\n{\n    box-shadow: 0 0 2px lightblue;\n}\n\na.active,\na.formbutton:active,\nbutton:active, input.formbutton:active,\ndiv.window .content a.button:active,\ninput.button:active, input.submit:active, input.reset:active,\nul.minibutton li a:active, li.minibutton a:active, a.minibutton:active,\n.ui-state-default.ui-button:active\n{\n    box-shadow: 0 0 2px rgba(0, 0, 0, 0.25) inset;\n\n    background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));\n    background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));\n    background-image: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));\n    background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));\n    background-image: linear-gradient(top, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));\n}\n\n/* -- 7. Contextmenu ------------------------------------------------------\n*/\n\ndiv.contextmenu-enhanced .contextmenu\n{\n    opacity: 0.95;\n    box-shadow: 0px 0px 0.25em rgba(0, 0, 0, 0.25);\n    border-radius: 4px;\n}\n\n.contextmenu ul a:hover,\n.contextmenu ol a:hover,\n.contextmenu ul span:hover,\n.contextmenu ol span:hover\n{\n    background-image: none;\n}\n"
  },
  {
    "path": "extensions/themes/silverblue/styles/default.dev.css",
    "content": "/**\n * default.dev.css\n * Ontowiki developer/experimental style sheet, advanced theme\n *\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n *\n * ATTENTION, since this file contains of development styles, it only included in\n * debug mode. See more infos on CSS Development on\n * http://code.google.com/p/ontowiki/wiki/CSSDevelopment\n *\n */\n\n/* form stuff ****************************************************************/\n\n.input-text[readonly=\"readonly\"] {\n\tcolor: #999 !important;\n}\n\ninput.checkbox, input.radio {\n\tvertical-align: text-top !important;\n\tmargin-right: 0.3em !important;\n}\n\n\n/* lists *******************************************************************/\n\n/* Die Spearatoren müssen unbedingt rechts vom Element sein --\n   Spearatoren am Anfang einer Zeile gehen gar nicht.\n   Lieder ist dann :first-child nicht mehr brauchbar und die Klasse\n   .last-child wird nötig. */\n\n\n.highlighted {\n\tbackground-color: #f70;\n\tpadding: 0 0.2em;\n}\n\n/* type **********************************************************************/\n\n.light {\n\tcolor: #999;\n}\n\n.inline-edit {\n\tdisplay: none;\n}\n\n\n/* dev phil: to be sorted or deleted in the future ************************/\n\n/* -> login module - OpenID Tab */\n\n.openid {\n\tbackground-image: url(./../images/openid.gif);\n\tbackground-repeat: no-repeat;\n\tbackground-position: 0 4px;\n}\n\nspan.openid {\n\tpadding-left: 20px;\n\tpadding-top: 1px;\n\tbackground-position: 0 0;\n}\n\n\n/* -> application controller - openidreg action -  */\n\ndiv.openid_logo {\n\twidth: 250px;\n\theight: 100px;\n\tmargin: 0 0 0 10px;\n\tbackground-image: url(./../images/openid-logo-wordmark.png);\n\tbackground-repeat: no-repeat;\n}\n\n.success_icon {\n\tfloat: left;\n\twidth: 18px;\n\theight: 18px;\n\tbackground: url(./../images/icon-success.png) no-repeat;\n\tbackground-position: 0 3px;\n}\n\n\n/* -> hierarchy module  */\n\na.closed {\n    float: left;\n    width: 8px;\n    height: 1.5em;\n    background-image: url(./../images/tree-toggle.png);\n    background-position: 0px 50%;\n    background-repeat: no-repeat;\n    margin-left: 0 !important;\n}\n\na.closed:hover {\n    background-position: -10px 50%;\n}\n\n\n/* -> multimedia plugin */\n\n.object-30em {\n    max-width: 30em;\n    overflow: hidden;\n    margin: 0 auto 10px auto;\n    display: block;\n}\n\n\n/**\n * Horizontal/Inline lists\n *\n * - please use directly ul.inline\n */\nul.horizontal > li,\nol.horizontal > li {\n    display: inline;\n    padding: 0;\n    margin: 0em;\n}\n"
  },
  {
    "path": "extensions/themes/silverblue/styles/deprecated.dev.css",
    "content": "/**\n * deprecated.dev.css\n *\n * - it makes deprecated gui elements visible\n * - should be only included in development environments\n *\n * @see       http://code.google.com/p/ontowiki/wiki/CSSDevelopment\n * @since     0.9.5\n * @author    Michael Haschke\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n *\n */\n  \n\n\n/* -- Buttons --------------------------------------------------------------- */\n\n/**\n * Inherited Minibuttons\n * @deprecated 0.9.5\n *\n * - ul.minibutton and li.minibutton is deprecated 0.9.5 for simplification of the default styles\n * - please use directly span.minibutton or a.minibutton\n */\nul.minibutton li a,\nli.minibutton a\n{\n    outline:solid 1px red !important;\n}\n\n/* -- Form elements --------------------------------------------------------- */\n\n/**\n * Propably unused elements\n * @deprecated 0.9.5\n *\n * - put some of them back to default.dev.css if they are used\n */\n\n/* not used? */\ninput.uri-input {\n\twidth: 30em;\n\tfont-size: 90%;\n\tpadding: 0.15em;\n}\n\n/* not used? */\nlabel.input-label-left {\n\tfloat: left;\n\twidth: 12em;\n}\n\n/* not used? */\nlabel.radio-label {\n\tmargin-left: 1.6em;\n}\n\ninput.uri-input, label.input-label-left, label.radio-label\n{\n    outline:solid 1px red !important;\n}\n\n/* -- Lists ----------------------------------------------------------------- */\n\n/**\n * Horizontal/Inline lists\n *\n * - please use directly ul.inline\n */\nul.horizontal, ol.horizontal > li\n{\n    outline:solid 1px red !important;\n}\n\n/**\n * Vertically separated lists -- old solution\n * @deprecated 0.9.5\n *\n * - please use just <ul class=\"separated\">...</ul>\n */\nul.separated-vertical, ol.separated-vertical\n{\n    outline:solid 1px red !important;\n}\n\n/**\n * Horizontally separated lists -- old solution\n * @deprecated 0.9.5\n *\n * - please use just <ul class=\"inline separated\">...</ul> or\n *   <ul class=\"inline\">...</ul> for horizontal/inline lists without separation\n *   between items\n */\nul.separated-horizontal, ol.separated-horizontal\n{\n    outline:solid 1px red !important;\n}\n\n"
  },
  {
    "path": "extensions/themes/silverblue/styles/jquery-ui.css",
    "content": "/*! jQuery UI - v1.8.22 - 2012-07-24\n* https://github.com/jquery/jquery-ui\n* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.tabs.css, jquery.ui.theme.css\n* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */\n\n/* Layout helpers\n----------------------------------*/\n.ui-helper-hidden { display: none; }\n.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }\n.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }\n.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: \"\"; display: table; }\n.ui-helper-clearfix:after { clear: both; }\n.ui-helper-clearfix { zoom: 1; }\n.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }\n\n\n/* Interaction Cues\n----------------------------------*/\n.ui-state-disabled { cursor: default !important; }\n\n\n/* Icons\n----------------------------------*/\n\n/* states and images */\n.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }\n\n\n/* Misc visuals\n----------------------------------*/\n\n/* Overlays */\n.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }\n\n/* IE/Win - Fix animation bug - #4615 */\n.ui-accordion { width: 100%; }\n.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }\n.ui-accordion .ui-accordion-li-fix { display: inline; }\n.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }\n.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }\n.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }\n.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }\n.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }\n.ui-accordion .ui-accordion-content-active { display: block; }\n\n.ui-autocomplete { position: absolute; cursor: default; }\t\n\n/* workarounds */\n* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */\n\n/*\n * jQuery UI Menu 1.8.22\n *\n * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Menu#theming\n */\n.ui-menu {\n\tlist-style:none;\n\tpadding: 2px;\n\tmargin: 0;\n\tdisplay:block;\n\tfloat: left;\n}\n.ui-menu .ui-menu {\n\tmargin-top: -3px;\n}\n.ui-menu .ui-menu-item {\n\tmargin:0;\n\tpadding: 0;\n\tzoom: 1;\n\tfloat: left;\n\tclear: left;\n\twidth: 100%;\n}\n.ui-menu .ui-menu-item a {\n\ttext-decoration:none;\n\tdisplay:block;\n\tpadding:.2em .4em;\n\tline-height:1.5;\n\tzoom:1;\n}\n.ui-menu .ui-menu-item a.ui-state-hover,\n.ui-menu .ui-menu-item a.ui-state-active {\n\tfont-weight: normal;\n\tmargin: -1px;\n}\n\n.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */\n.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */\nbutton.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */\n.ui-button-icons-only { width: 3.4em; } \nbutton.ui-button-icons-only { width: 3.7em; } \n\n/*button text element */\n.ui-button .ui-button-text { display: block; line-height: 1.4;  }\n.ui-button-text-only .ui-button-text { padding: .4em 1em; }\n.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }\n.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }\n.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }\n.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }\n/* no icon support for input elements, provide padding by default */\ninput.ui-button { padding: .4em 1em; }\n\n/*button icon element(s) */\n.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }\n.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }\n.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }\n.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }\n.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }\n\n/*button sets*/\n.ui-buttonset { margin-right: 7px; }\n.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }\n\n/* workarounds */\nbutton.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */\n\n.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }\n.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }\n.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }\n.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }\n.ui-datepicker .ui-datepicker-prev { left:2px; }\n.ui-datepicker .ui-datepicker-next { right:2px; }\n.ui-datepicker .ui-datepicker-prev-hover { left:1px; }\n.ui-datepicker .ui-datepicker-next-hover { right:1px; }\n.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px;  }\n.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }\n.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }\n.ui-datepicker select.ui-datepicker-month-year {width: 100%;}\n.ui-datepicker select.ui-datepicker-month, \n.ui-datepicker select.ui-datepicker-year { width: 49%;}\n.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }\n.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }\n.ui-datepicker td { border: 0; padding: 1px; }\n.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }\n.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }\n.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }\n.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }\n\n/* with multiple calendars */\n.ui-datepicker.ui-datepicker-multi { width:auto; }\n.ui-datepicker-multi .ui-datepicker-group { float:left; }\n.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }\n.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }\n.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }\n.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }\n.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }\n.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }\n.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }\n.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }\n\n/* RTL support */\n.ui-datepicker-rtl { direction: rtl; }\n.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }\n.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }\n.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }\n.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }\n.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }\n.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }\n.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }\n.ui-datepicker-rtl .ui-datepicker-group { float:right; }\n.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }\n.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }\n\n/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */\n.ui-datepicker-cover {\n    position: absolute; /*must have*/\n    z-index: -1; /*must have*/\n    filter: mask(); /*must have*/\n    top: -4px; /*must have*/\n    left: -4px; /*must have*/\n    width: 200px; /*must have*/\n    height: 200px; /*must have*/\n}\n.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }\n.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative;  }\n.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } \n.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }\n.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }\n.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }\n.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }\n.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }\n.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }\n.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }\n.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }\n.ui-draggable .ui-dialog-titlebar { cursor: move; }\n\n.ui-progressbar { height:2em; text-align: left; overflow: hidden; }\n.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }\n.ui-resizable { position: relative;}\n.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }\n.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }\n.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }\n.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }\n.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }\n.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }\n.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }\n.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }\n.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }\n.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}\n.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }\n\n.ui-slider { position: relative; text-align: left; }\n.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }\n.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }\n\n.ui-slider-horizontal { height: .8em; }\n.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }\n.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }\n.ui-slider-horizontal .ui-slider-range-min { left: 0; }\n.ui-slider-horizontal .ui-slider-range-max { right: 0; }\n\n.ui-slider-vertical { width: .8em; height: 100px; }\n.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }\n.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }\n.ui-slider-vertical .ui-slider-range-min { bottom: 0; }\n.ui-slider-vertical .ui-slider-range-max { top: 0; }\n.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as \"fixed\") */\n.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }\n.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }\n.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }\n.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }\n.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }\n.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */\n.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }\n.ui-tabs .ui-tabs-hide { display: none !important; }\n\n/* Component containers\n----------------------------------*/\n.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; }\n.ui-widget .ui-widget { font-size: 1em; }\n.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; }\n.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }\n.ui-widget-content a { color: #222222/*{fcContent}*/; }\n.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; }\n.ui-widget-header a { color: #222222/*{fcHeader}*/; }\n\n/* Interaction states\n----------------------------------*/\n.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; }\n.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; }\n.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; }\n.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; }\n.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; }\n.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; }\n.ui-widget :active { outline: none; }\n\n/* Interaction Cues\n----------------------------------*/\n.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight  {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; }\n.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }\n.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; }\n.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; }\n.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }\n.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }\n.ui-priority-secondary, .ui-widget-content .ui-priority-secondary,  .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }\n.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }\n\n/* Icons\n----------------------------------*/\n\n/* states and images */\n.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }\n.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }\n.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; }\n.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; }\n.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; }\n.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; }\n.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; }\n.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; }\n\n/* positioning */\n.ui-icon-carat-1-n { background-position: 0 0; }\n.ui-icon-carat-1-ne { background-position: -16px 0; }\n.ui-icon-carat-1-e { background-position: -32px 0; }\n.ui-icon-carat-1-se { background-position: -48px 0; }\n.ui-icon-carat-1-s { background-position: -64px 0; }\n.ui-icon-carat-1-sw { background-position: -80px 0; }\n.ui-icon-carat-1-w { background-position: -96px 0; }\n.ui-icon-carat-1-nw { background-position: -112px 0; }\n.ui-icon-carat-2-n-s { background-position: -128px 0; }\n.ui-icon-carat-2-e-w { background-position: -144px 0; }\n.ui-icon-triangle-1-n { background-position: 0 -16px; }\n.ui-icon-triangle-1-ne { background-position: -16px -16px; }\n.ui-icon-triangle-1-e { background-position: -32px -16px; }\n.ui-icon-triangle-1-se { background-position: -48px -16px; }\n.ui-icon-triangle-1-s { background-position: -64px -16px; }\n.ui-icon-triangle-1-sw { background-position: -80px -16px; }\n.ui-icon-triangle-1-w { background-position: -96px -16px; }\n.ui-icon-triangle-1-nw { background-position: -112px -16px; }\n.ui-icon-triangle-2-n-s { background-position: -128px -16px; }\n.ui-icon-triangle-2-e-w { background-position: -144px -16px; }\n.ui-icon-arrow-1-n { background-position: 0 -32px; }\n.ui-icon-arrow-1-ne { background-position: -16px -32px; }\n.ui-icon-arrow-1-e { background-position: -32px -32px; }\n.ui-icon-arrow-1-se { background-position: -48px -32px; }\n.ui-icon-arrow-1-s { background-position: -64px -32px; }\n.ui-icon-arrow-1-sw { background-position: -80px -32px; }\n.ui-icon-arrow-1-w { background-position: -96px -32px; }\n.ui-icon-arrow-1-nw { background-position: -112px -32px; }\n.ui-icon-arrow-2-n-s { background-position: -128px -32px; }\n.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }\n.ui-icon-arrow-2-e-w { background-position: -160px -32px; }\n.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }\n.ui-icon-arrowstop-1-n { background-position: -192px -32px; }\n.ui-icon-arrowstop-1-e { background-position: -208px -32px; }\n.ui-icon-arrowstop-1-s { background-position: -224px -32px; }\n.ui-icon-arrowstop-1-w { background-position: -240px -32px; }\n.ui-icon-arrowthick-1-n { background-position: 0 -48px; }\n.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }\n.ui-icon-arrowthick-1-e { background-position: -32px -48px; }\n.ui-icon-arrowthick-1-se { background-position: -48px -48px; }\n.ui-icon-arrowthick-1-s { background-position: -64px -48px; }\n.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }\n.ui-icon-arrowthick-1-w { background-position: -96px -48px; }\n.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }\n.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }\n.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }\n.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }\n.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }\n.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }\n.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }\n.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }\n.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }\n.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }\n.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }\n.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }\n.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }\n.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }\n.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }\n.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }\n.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }\n.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }\n.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }\n.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }\n.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }\n.ui-icon-arrow-4 { background-position: 0 -80px; }\n.ui-icon-arrow-4-diag { background-position: -16px -80px; }\n.ui-icon-extlink { background-position: -32px -80px; }\n.ui-icon-newwin { background-position: -48px -80px; }\n.ui-icon-refresh { background-position: -64px -80px; }\n.ui-icon-shuffle { background-position: -80px -80px; }\n.ui-icon-transfer-e-w { background-position: -96px -80px; }\n.ui-icon-transferthick-e-w { background-position: -112px -80px; }\n.ui-icon-folder-collapsed { background-position: 0 -96px; }\n.ui-icon-folder-open { background-position: -16px -96px; }\n.ui-icon-document { background-position: -32px -96px; }\n.ui-icon-document-b { background-position: -48px -96px; }\n.ui-icon-note { background-position: -64px -96px; }\n.ui-icon-mail-closed { background-position: -80px -96px; }\n.ui-icon-mail-open { background-position: -96px -96px; }\n.ui-icon-suitcase { background-position: -112px -96px; }\n.ui-icon-comment { background-position: -128px -96px; }\n.ui-icon-person { background-position: -144px -96px; }\n.ui-icon-print { background-position: -160px -96px; }\n.ui-icon-trash { background-position: -176px -96px; }\n.ui-icon-locked { background-position: -192px -96px; }\n.ui-icon-unlocked { background-position: -208px -96px; }\n.ui-icon-bookmark { background-position: -224px -96px; }\n.ui-icon-tag { background-position: -240px -96px; }\n.ui-icon-home { background-position: 0 -112px; }\n.ui-icon-flag { background-position: -16px -112px; }\n.ui-icon-calendar { background-position: -32px -112px; }\n.ui-icon-cart { background-position: -48px -112px; }\n.ui-icon-pencil { background-position: -64px -112px; }\n.ui-icon-clock { background-position: -80px -112px; }\n.ui-icon-disk { background-position: -96px -112px; }\n.ui-icon-calculator { background-position: -112px -112px; }\n.ui-icon-zoomin { background-position: -128px -112px; }\n.ui-icon-zoomout { background-position: -144px -112px; }\n.ui-icon-search { background-position: -160px -112px; }\n.ui-icon-wrench { background-position: -176px -112px; }\n.ui-icon-gear { background-position: -192px -112px; }\n.ui-icon-heart { background-position: -208px -112px; }\n.ui-icon-star { background-position: -224px -112px; }\n.ui-icon-link { background-position: -240px -112px; }\n.ui-icon-cancel { background-position: 0 -128px; }\n.ui-icon-plus { background-position: -16px -128px; }\n.ui-icon-plusthick { background-position: -32px -128px; }\n.ui-icon-minus { background-position: -48px -128px; }\n.ui-icon-minusthick { background-position: -64px -128px; }\n.ui-icon-close { background-position: -80px -128px; }\n.ui-icon-closethick { background-position: -96px -128px; }\n.ui-icon-key { background-position: -112px -128px; }\n.ui-icon-lightbulb { background-position: -128px -128px; }\n.ui-icon-scissors { background-position: -144px -128px; }\n.ui-icon-clipboard { background-position: -160px -128px; }\n.ui-icon-copy { background-position: -176px -128px; }\n.ui-icon-contact { background-position: -192px -128px; }\n.ui-icon-image { background-position: -208px -128px; }\n.ui-icon-video { background-position: -224px -128px; }\n.ui-icon-script { background-position: -240px -128px; }\n.ui-icon-alert { background-position: 0 -144px; }\n.ui-icon-info { background-position: -16px -144px; }\n.ui-icon-notice { background-position: -32px -144px; }\n.ui-icon-help { background-position: -48px -144px; }\n.ui-icon-check { background-position: -64px -144px; }\n.ui-icon-bullet { background-position: -80px -144px; }\n.ui-icon-radio-off { background-position: -96px -144px; }\n.ui-icon-radio-on { background-position: -112px -144px; }\n.ui-icon-pin-w { background-position: -128px -144px; }\n.ui-icon-pin-s { background-position: -144px -144px; }\n.ui-icon-play { background-position: 0 -160px; }\n.ui-icon-pause { background-position: -16px -160px; }\n.ui-icon-seek-next { background-position: -32px -160px; }\n.ui-icon-seek-prev { background-position: -48px -160px; }\n.ui-icon-seek-end { background-position: -64px -160px; }\n.ui-icon-seek-start { background-position: -80px -160px; }\n/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */\n.ui-icon-seek-first { background-position: -80px -160px; }\n.ui-icon-stop { background-position: -96px -160px; }\n.ui-icon-eject { background-position: -112px -160px; }\n.ui-icon-volume-off { background-position: -128px -160px; }\n.ui-icon-volume-on { background-position: -144px -160px; }\n.ui-icon-power { background-position: 0 -176px; }\n.ui-icon-signal-diag { background-position: -16px -176px; }\n.ui-icon-signal { background-position: -32px -176px; }\n.ui-icon-battery-0 { background-position: -48px -176px; }\n.ui-icon-battery-1 { background-position: -64px -176px; }\n.ui-icon-battery-2 { background-position: -80px -176px; }\n.ui-icon-battery-3 { background-position: -96px -176px; }\n.ui-icon-circle-plus { background-position: 0 -192px; }\n.ui-icon-circle-minus { background-position: -16px -192px; }\n.ui-icon-circle-close { background-position: -32px -192px; }\n.ui-icon-circle-triangle-e { background-position: -48px -192px; }\n.ui-icon-circle-triangle-s { background-position: -64px -192px; }\n.ui-icon-circle-triangle-w { background-position: -80px -192px; }\n.ui-icon-circle-triangle-n { background-position: -96px -192px; }\n.ui-icon-circle-arrow-e { background-position: -112px -192px; }\n.ui-icon-circle-arrow-s { background-position: -128px -192px; }\n.ui-icon-circle-arrow-w { background-position: -144px -192px; }\n.ui-icon-circle-arrow-n { background-position: -160px -192px; }\n.ui-icon-circle-zoomin { background-position: -176px -192px; }\n.ui-icon-circle-zoomout { background-position: -192px -192px; }\n.ui-icon-circle-check { background-position: -208px -192px; }\n.ui-icon-circlesmall-plus { background-position: 0 -208px; }\n.ui-icon-circlesmall-minus { background-position: -16px -208px; }\n.ui-icon-circlesmall-close { background-position: -32px -208px; }\n.ui-icon-squaresmall-plus { background-position: -48px -208px; }\n.ui-icon-squaresmall-minus { background-position: -64px -208px; }\n.ui-icon-squaresmall-close { background-position: -80px -208px; }\n.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }\n.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }\n.ui-icon-grip-solid-vertical { background-position: -32px -224px; }\n.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }\n.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }\n.ui-icon-grip-diagonal-se { background-position: -80px -224px; }\n\n\n/* Misc visuals\n----------------------------------*/\n\n/* Corner radius */\n.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -khtml-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; }\n.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -khtml-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }\n.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; }\n.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }\n\n/* Overlays */\n.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }\n.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -khtml-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; }"
  },
  {
    "path": "extensions/themes/silverblue/styles/old.css",
    "content": "/**\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\ntable * {\n\tvertical-align: top;\n}\n\na {\n\tcursor: pointer;\n}\n\ntable.instanceTable th {\n\ttext-align: left;\n/*\tbackground-color: #eee;*/\n}\n\ntable.instanceTable > tbody > tr > td {\n\tpadding-top: 0.5em;\n}\n\ntable.instanceTable td.property {\n\ttext-align: right;\n\tfont-style: italic;\n\tpadding-right: 5px;\n}\n\ntable.instanceTable ul {\n\tmargin: 0px;\n\tpadding-left: 20px;\n}\n\ntable.instanceTable {\n\twidth: 100%;\n}\n\n.instance .instance {\n\tmargin-left: 13px;\n\tbackground-color: #ddd;\n}\n\n.instance .instance td {\n\tfont-size: 90%;\n}\n\n.instance .instance .instance {\n\tbackground-color: #eee;\n}\n\n.instance .instance .instance .instance {\n\tbackground-color: #fff;\n}\n\n#instanceEdit {\n\tborder-spacing: 0px;\n\twidth: 100%;\n}\n\n#instanceEdit input, #instanceEdit textarea {\n/*\twidth: 250px;*/\n\tbackground-color: #fff;\n\tfont-size: 95%;\n/*\tfont-family: \"Lucida Grande\", Helvetica, Arial, sans-serif;*/\n\tpadding: 0.1em 0;\n}\n\n#instanceEdit > tbody > tr, #instanceEdit > tr {\n\tbackground-color: #eee;\n\tvertical-align: top;\n}\n\n#instanceEdit > tbody > tr > td, #instanceEdit > tr > td {\n\tpadding: 0.6em;\n\tborder-bottom: 2px solid #fdfdfd;\n}\n\n#instanceEdit > tbody > tr.Property:hover, #instanceEdit > tr.Property:hover {\n\tbackground-color: #cde;\n}\n\n#instanceView > tbody > tr, #instanceView > tr {\n\tfont-size: 95%;\n\tbackground-color: #ffffff;\n}\n\n#instanceView > tbody > tr > td, #instanceView > tr > td {\n\tpadding: 0.3em;\n\tborder-bottom: 1px dotted #ddd;\n}\n\ntable.calendar {\n\tmargin-top: 1em;\n\twidth: 100%;\n\theight: 700px;\n\ttable-layout: fixed;\n\tfont-size: 90%;\n}\n\n.calendar .weekday0 {\n\tbackground-color: #eee;\n\tpadding: 0.4em;\n}\n\n.calendar .weekday1 {\n\tbackground-color: #f5f5f5;\n\tpadding: 0.4em;\n}\n\n.calendar .weekend0 {\n\tbackground-color: #ddd;\n\tpadding: 0.4em;\n}\n\n.calendar .weekend1 {\n\tbackground-color: #eaeaea;\n\tpadding: 0.4em;\n}\n\n#map {\n\tmargin-top: 0.5em;\n\twidth: 100%;\n\theight: 750px;\n\tfont-size: 90%;\n}\n\n#map .instance td {\n\tfont-size: 80%;\n\tpadding: 0 3px;\n\tborder-bottom: 5px solid white;\n}\n\ntextarea.query {\n\tfont-family: monospace;\n}\n\n.code_container {\n\tborder: 1px solid #bbb;\n\tmargin: 1em 2em;\n\tpadding: 0.4em;\n\tcursor: pointer;\n/*\tcolor: #02a;*/\n\tmax-height: 9.5em;\n\toverflow: auto;\n}\n\ninput.property {\n\twidth: 14em;\n}\n\n/*\n * Autosuggest box\n */\ndiv.autosuggest {\n/*\tfont-size: 85%;*/\n\tz-index: 1000;\n\tposition: absolute;\n\tbackground-color: #fff;\n/*\tborder: 1px solid #bbb;*/\n}\n\ndiv.autosuggest ul {\n\tlist-style-type: none;\n\tlist-style-position: outside;\n\tpadding-left: 0px;\n\tmargin-left: 0;\n\tborder: 1px solid #bbb;\n}\n\ndiv.autosuggest ul li.selected {\n\tbackground-color: #eff9ff;\n}\n\ndiv.autosuggest ul li {\n\tdisplay: block;\n\tpadding: 0.2em;\n/*\theight: 22px;*/\n\tcursor: pointer;\n}\n\nspan.formal {\n\tdisplay: none;\n}\n\nimg.drop {\n\tmargin: 0.25em 0 0 0.5em;\n\tcursor: pointer;\n}\n\n.window .status-bar p {\n\tdisplay: inline;\n}\n\n"
  },
  {
    "path": "extensions/themes/silverblue/styles/patches/ie6.clickmenu.css",
    "content": "/**\r\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\r\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\r\n */\r\n.clickMenu ul {\r\n\tfloat: left;\r\n\twidth: 100%;\r\n}\r\n\r\n.clickMenu div.inner {\r\n}\r\n\r\n.clickMenu div.inner div.outerbox {\r\n\tleft: 90px;\r\n}\r\n\r\n.clickMenu li.main {\r\n}\r\n\r\n.clickMenu li {\r\n\tpadding: 0.35em 0.5em 0.25em 0.5em;\r\n}\r\n\r\n"
  },
  {
    "path": "extensions/themes/silverblue/styles/patches/ie6.css",
    "content": "/**\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/* Zoom it, baby! (and give layout to elements) */\n\n.window,\nbody.javascript-on .has-contextmenus-block a,\ndiv.window .content,\n.seperated-horizontal li,\n.seperated-vertical li,\ndiv.window .tabs li a,\ndiv.contextmenu-enhanced .contextmenu,\ndiv.contextmenu-enhanced .contextmenu li,\ndiv.contextmenu-enhanced .contextmenu li a,\ndiv.window .contextmenu li a {\n    zoom:1;\n}\n\n.window,\nbody.javascript-on .has-contextmenus-block a,\ndiv.window .content {\n    position:relative;\n}\n\ndiv.window .tabs li a {\n    display:inline-block;\n}\n\n/* fix problems with child selector '>' */\n\ndiv.cmDiv {\n    position:absolute;\n    width:100%;\n    top:1.5em;\n    zoom:1;\n}\n\n.separated-vertical li {\n    padding:0.1em 0;\n    border-top:dotted 1px #ccc;\n}\n\n.separated-vertical li:first-child {\n    border-top:none;\n}\n\n.separated-horizontal li {\n    display:inline;\n    padding-left:0.5em;\n    padding-right:0.4em;\n    border-left:dotted 1px #ccc;\n}\n\n.separated-horizontal li:first-child {\n    padding-left:0;\n    border-left:none;\n}\n\ndiv.window .content {\n    border-top:solid 1px #666;\n}\n\ndiv.window div.innerwindows .content {\n    border-top:solid 1px #999;\n}\n\ndiv.window .title,\ndiv.window div.innerwindows .title {\n    border-bottom-style:none;\n}\n\ndiv.tabbed .title {\n    border-bottom-style:solid;\n}\n\n/* problem with transparent border */\n\ndiv.window .content {\n    border-left-style:none;\n    border-bottom-style:none;\n    border-right-style:none;\n}\n\n.clickMenu li,\ndiv.row-input, form.row-input div {\n    border-style:none;\n}\n\nbody.javascript-on .has-contextmenus-block a {\n    border-color:#fff;\n}\n\n/* fix auto width */\n\ndiv.window {\n    width:98%;\n    margin-left:0.9%;\n    margin-right:0.9%;\n}\n\ndiv.window .content {\n    width:98%;\n    padding-left:0.9%;\n    padding-right:0.9%;\n}\n\ndiv.window .content div.innerwindows {\n    overflow:hidden;\n}\n\n.messagebox {\n    height:1%;\n}\n\n/* window buttons */\n\nbody.javascript-on div.window-buttons .button, div.contextmenu-enhanced .button {\n    font-size:0.1em;\n    height:9em;\n    width:9em;\n    zoom:1;\n    line-height:0.1;\n}\n\nbody.javascript-on div.window-buttons .button {\n    position:relative;\n    top:1px;\n    left:-1px;\n    border:none;\n}\n\nbody.javascript-on div.window-buttons .button:hover {\n    top:0;\n    left:0;\n    border:solid 1px #fff;\n}\n\n/* remove background images with alpha transparency */\n\ndiv.window .title,\ndiv.window .tabs li a,\ndiv.window .tabs li.active a,\ndiv.window .content,\na.formbutton, button,\ndiv.window .content a.button, /* !!DEPRECATED!! only for back compatibility in 0.8 */\na.formbutton:hover, button:hover, input.formbutton:hover,\ndiv.window .content a.button:hover, div.window .content input.button:hover, /* !!DEPRECATED!! only for back compatibility in 0.8 */\n.clickMenu li.hover,\nbody,\ninput,\ntextarea,\ndiv.contextmenu-enhanced .contextmenu li a,\ndiv.window .contextmenu li a,\nul.minibutton li a,\nli.minibutton a,\na.minibutton {\n    background-image:none !important;\n}\n\n/* fix hover for non-links */\n\n\n/* color changes cause of backgrounds */\ndiv.window .tabs li.active a {\n    background-color:#fff;\n}\n\n/* Tabs */\n\n/* Workaround for Bug 1797742 - Begin\n   Tabs are overlayed by Menu\n   \n   Problem: IE6 do not support child selector '>' but without it window.has-menu \n   will affect all window titles including titles in inner windows.\n   \n   This workaround will work as long as inner windows do not have a menu.\n*/\n\nbody.javascript-on .has-menu .title {\n    margin-bottom:1.6em !important;\n}\n\nbody.javascript-on .has-menu .innerwindows .title {\n    margin-bottom:0 !important;\n}\n\nbody.javascript-on .has-menu .tabs {\n    margin-top:2em !important;\n}\n\n/* Workaround for Bug 1797742 - End */\n\n/*\nbody.javascript-on div.window .title-has-menu {\n    margin-bottom:1.9em !important;\n    margin-top:0 !important;\n}\n\nbody.javascript-on div.window ul.tabs-has-menu {\n    margin-bottom:0 !important;\n    margin-top:2.4em !important;\n}\n\n*/\n\ndiv.window .tabs {\n    padding-left:0;\n    height:1%;\n}\n\ndiv.window .tabs li a {\n    margin-top:0.1em;\n}\n\ndiv.window .tabs li.active a {\n    margin-top:0;\n}\n\n/* Contextmenu */\n\ndiv.contextmenu-enhanced .contextmenu {\n    width:15em;\n}\n\n.contextmenu {\n    background-color:#efefef !important;\n}\n\n.contextmenu ul a, .contextmenu ol a, .contextmenu ul span, .contextmenu ol span {\n    border-color:#efefef;\n}\n\n.contextmenu ul, .contextmenu ol {\n    margin-left:0;\n}\n\n.contextmenu ul ul, .contextmenu ol ul, .contextmenu ul ol, .contextmenu ol ol {\n    margin-left:1.5em;\n}\n\n/* context enabled elements, problem with span.button in block elements */\n\nbody.javascript-on .has-contextmenus-block a span.button {\n    right:0;\n    background-color:transparent;\n    border-left-color:#eee;\n}\n\nbody.javascript-on .has-contextmenus-block a.Resource:hover span.button,\nbody.javascript-on .has-contextmenus-block a.Resource:focus span.button,\nbody.javascript-on .has-contextmenus-block a.Resource:active span.button {\n    background-color:#999;\n}\n\n/* -- 3.2. Input fields ----------------------------------------------------- */\n\ninput.text, input.password {\n    width:10em;\n}\n\ninput.text,\ninput.password,\ninput.checkbox,\ninput.radio,\ntextarea {\n    background-color:#fcfcfc;\n}\n\ntextarea {\n    width:30em;\n    height:18.5em;\n}\n\n/* Grouping form elements */\n\nfieldset fieldset fieldset {\n    border-style:solid;\n}\n\n.input-justify-left input.checkbox,\n.input-justify-left input.radio, {\n    display:inline;\n}\n\ndiv.input-justify-left label,\nform.input-justify-left div label {\n    padding-top:0;\n}\n\n.width50 div.input-justify-left label, .width50 div.input-justify-left select,\nform.input-justify-left div.width50 label, form.input-justify-left div.width50 select {\n    margin-right:2%;\n}\n\n.width50 div.input-justify-left input.checkbox,\nform.input-justify-left div.width50 input.checkbox,\n.width50 div.input-justify-left input.radio,\nform.input-justify-left div.width50 input.radio {\n    margin-left:19%;\n}\n\n.width50 div.input-justify-left label.checkboxradio,\nform.input-justify-left div.width50 label.checkboxradio {\n    width:52%;\n}\n\n.width50 div.actionbuttons {\n    padding-left:19.5% !important;\n}\n\n/* Buttons */\n\na.formbutton,\ndiv.window .content a.button, /* !!DEPRECATED!! only for back compatibility in 0.8 */ {\n  padding:0.3em 0.5em 0.3em 0.5em;   /* Links */\n}\n\nbutton,\ninput.formbutton,\ninput.button,\ninput.submit,\ninput.reset {\n  padding:0.2em 0.45em 0.15em 0.45em;   /* IE6 */\n}\n\na.formbutton, div.window .content a.button {\n    padding-left:1.45em;\n    padding-right:1.45em;\n}\n\n/* -- 1.3. Generic layout helper -------------------------------------------- */\n\n.width25 { width:24%; }\n\n.width33 { width:32.3%; }\n\n.width50 { width:49%; }\n\n.width67 { width:65.6%; }\n\n.width75 { width:74%; }\n\n.float-left { padding-right:0.75%; }\n\n.float-right { padding-left:0.75%; }\n\n"
  },
  {
    "path": "extensions/themes/silverblue/styles/patches/ie7.css",
    "content": "/**\n * @copyright Copyright (c) 2014, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/* Tabs */\n\ndiv.window .tabs {\n    height:1%;\n}\n\ndiv.window .tabs li a {\n    margin-top:0.1em;\n    border-top:solid 3px;\n}\n\ndiv.window .tabs li.active a {\n    margin-top:0;\n}\n\n/* Contextmenu */\n\ndiv.contextmenu-enhanced .contextmenu {\n    width:15em;\n}\n\n/* Buttons */\n\na.formbutton,\ndiv.window .content a.button {\n  padding:0.45em 0.7em 0.45em 0.7em;   /* Links */\n}\n\n/* Inputs */\n\ndiv.input-justify-left label,\nform.input-justify-left div label {\n    padding-top:0;\n}\n\nfieldset fieldset fieldset {\n    border-style:solid;\n}\n\n/* Tables */\n\ntable {\n    border-collapse: separate;\n}\n\nbody.javascript-on tbody.closed tr.grouptitle { display:block; }\n\n/* Lists */\n\n/**\n * Horizontally separated lists\n * @fix MSIE 7\n */\nul.inline.separated li, ol.inline.separated li,\nul.inline.separated.comma li, ol.inline.separated.comma li\n{\n    padding-right:0.5em;\n    border-right:dotted 1px #ccc;\n}\nul.inline.separated li.last-child, ol.inline.separated li.last-child,\nul.inline.separated.comma li.last-child, ol.inline.separated.comma li.last-child\n{\n    border-right-style:none;\n}\n\n"
  },
  {
    "path": "extensions/translations/de/core.csv",
    "content": "#\n# OntoWiki German language translation\n# Encoding:  UTF-8\n# Separator: ;\n#\nBack;Zurück\nSubmit;Absenden\nCancel;Abbrechen\nSave Changes;\"Änderungen speichern\"\nReset Form;Formular zurücksetzen\nEdit Instances;Instanzen bearbeiten\nEdit Properties;Eigenschaften bearbeiten\nAdd Property;Eigenschaft hinzufügen\nRendered in %1$d microseconds using %2$d SPARQL queries.;Gerendert in %1$d Mikrosekunden mit %2$d SPARQL-Anfragen.\nmore;mehr\n\nmoments ago;gerade eben\napprox. 1 minute ago;vor einer Minute\napprox. %d minutes ago;vor %d Minuten\napprox. 1 hour ago;vor einer Stunde\napprox. %d hours ago;vor %d Stunden\napprox. %d days ago;vor %d Tagen\n\n# test\npage1;Seite 1\npage2;Seite 2\n\n\n# Module\nSearch all Knowledge Bases;Alle Wissensbasen durchsuchen\nSearch Text;Suchtext\nKnowledge Bases;Wissensbasen\nCreate Knowledge Base;Wissensbasis erstellen\nShow Hidden Knowledge Bases;Versteckte Wissensbasen anzeigen\nHide Hidden Knowledge Bases;Versteckte Wissensbasen verbergen\nLanguages (Tagged Literals);Sprachen (ausgezeichnete Labels)\nnone;keine\nClasses;Klassen\nCreate Class;Klasse erstellen\nShow Empty Classes;Leere Klassen anzeigen\nHide Empty Classes;Leere Klassen ausblenden\nShow System Classes;Systemklassen anzeigen\nHide System Classes;Systemklassen ausblenden\nShow Hidden Classes;Versteckte Klassen anzeigen\nHide Hidden Classes;Versteckte Klassen ausblenden\nMost Popular | Most Active;Populär | Aktiv\nRec. Changes;\"Änderungen\"\nRec. Comments;Kommentare\nLogin;Anmeldung\nNo matches.;Keine Entsprechungen.\nPredicates;Prädikate\nSimilar Instances;\"Ähnliche Instanzen\"\nInstances Linking Here;Verlinkte Ressourcen\nUsage as Property;Auftreten als Prädikat\nNot implemented yet.;Noch nicht implementiert.\nLatest Changes;Aktuelle Änderungen\nLatest Discussions;Aktuelle Diskussionen\nComments, Descriptions and Notes;Kurzbeschreibung\nActions; Aktionen\nThere are no comments, descriptions or notes on this knowledge base.; Es sind keine Kommentare, Beschreibungen oder Anmerkungen in der Wissensbasis enthalten.\nview all resources; Alle Ressourcen anzeigen\nSearch for Resources;Suche nach Ressourcen\nSource;Quellcode\nby;von\nObjects;Objekte\nSubjects;Subjekte\n\n\n# Komponenten\n# TODO: sollten Komponenten ihre Übersetzung selbst verwalten?\nProperties;Eigenschaften\nInstances;Instanzen\nCalendar;Kalender\nHistory;Versionen\nMap;Karte\n\n# application menu\nUser;Benutzer\nRegister New User;Neuen Benutzer registrieren\nPreferences;Einstellungen\nLogout;Abmelden\nView;Ansicht\nEdit;Bearbeiten\nExtras;Extras\nSPARQL Query Editor;SPARQL-Anfrage-Editor\nFile Resource Manager;Dateiressourcen-Manager\nNews;Neuigkeiten\nClear Cache;Cache leeren\nHelp;Hilfe\nDocumentation;Dokumentation\nBug Report; Fehler melden\nVersion Info;Versionsinfo\nAbout;\"Über\"\n\n#Pager\nFirst;Erste\nPrevious;Vorherige\nNext;Nächste\nLast;Letzte\n\nCreate New Knowledge Base;Neue Wissensbasis anlegen\nModel URI;Modell-URI\nCreate an Empty Knowledge Base; Eine leere Wissensbasis anlegen\nBase URI;Basis-URI\nType;Typ\nImport From the Web;Aus dem WWW importieren\nUpload a File;Eine Datei hochladen\nFile Type;Dateityp\nFile (max. %1$sB);Datei (max. %1$sB)\nPaste Source;Quelltext eingeben\nSource Code;Quelltext\nEnter the URL where the model should be downloaded from. If you leave the field empty the model URI will be used.;Geben Sie die URL zur Modelldatei an. Wenn Sie dieses Feld leer lassen, wird stattdessen die Modell-URI benutzt.\nLocation;URL zur Datei\nInstances of %1$s;Instanzen von %1$s\nProperties of %1$s;Eigenschaften von %1$s\n\nRegister User;Benutzer registrieren\nUsername;Benutzername\nEmail Address;E-Mail-Adresse\nPassword;Kennwort\nPassword (repeat);Kennwort (wiederholen)\nUnknown user identifier.;Unbekannte Benutzerkennung.\nForgot your password?;Passwort vergessen?\n\nPredefined namespaces;Vordefinierte Namensräume\nSPARQL Options;SPARQL-Optionen\nPlain;Einfach\nSubmit Query;Anfrage absenden\nresult;Ergebnis\nresults;Ergebnisse\nSearch returned %1$d %2$s.;Die Suche lieferte %1$d %2$s. \nQuery execution took %1$d ms.;Die Bearbeitung der Anfrage dauerte %1$d ms.\n\n# Menüs\nView Resource;Ressource ansehen\nEdit Resource;Ressource bearbeiten\nDelete Resource;Ressource löschen\n\nList Instances;Instanzen auflisten\nCreate Instance;Instantiieren\nCreate Subclass;Unterklasse erstellen\n\nSelect Knowledge Base;Wissensbasis auswählen\nConfigure Knowledge Base;Wissensbasis konfigurieren\nAdd Data to Knowledge Base;Daten zur Wissensbasis hinzufügen\nExport Knowledge Base as RDF/XML;Wissensbasis als RDF/XML exportieren\nExport Knowledge Base as RDF/JSON;Wissensbasis als RDF/JSON exportieren\nExport Knowledge Base as RDF/N3;Wissensbasis als RDF/N3 exportieren\nExport Knowledge Base as RDF/JSON (Talis);Wissensbasis als RDF/JSON (Talis) exportieren\nExport Knowledge Base as Turtle;Wissensbasis als Turtle exportieren\nExport Knowledge Base as Notation 3;Wissensbasis als N3 exportieren\nDelete Knowledge Base;Wissensbasis löschen\n\nToggle show Permalink;Permalink anzeigen/verstecken\nToggle show Resoure Query;Resource Query anzeigen/verstecken\n\n# Wochentage\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday\nSunday\n\nAdd Class;Klasse hinzufügen\nAdd Instance;Instanz hinzufügen\n\nShow Properties;Eigenschaften anzeigen\n\nFilter;Filter\nCombine Filters (Conjunction);Filter kombinieren (Konjunktion)\n\nMerge;Zusammenführen\nVisit resource on the web;Ressource im Netz aufsuchen\n\nCreate instances from property value by regexp\nSimilar Instances\nRating\nAverage Rating\nYour Rating\nInstances Linking Here\nUsage as Property\nInstances\nValues\nSearch | OntoWiki\nSearch Text\nSubmit\nSearch All Knowledge Bases\nSearch\nAdd Property\nSubmit Values\nSPARQL Query Editor\nResult Options\nTable\nSPARQL Query Results XML Format\nRender Ressources as OntoWiki Links\nCreate New Knowledge Base\nFOAFSSL;FOAF+SSL\n\n# explore tags module\nExplore Tags;Schlagwörter / Tag-Wolken\nReset Explore Tags Box;Modul zurücksetzen\nReset selected tags;Tag-Auswahl zurücksetzen\nNumber of showed tags;Anzahl Tags\nSort;Sortierung\nby name; nach Name\nby frequency;nach Anzahl\n\n# navigation module\nNumber of Elements;Anzahl Ressourcen\nToggle Elements;Spezielle Elemente\nReset Navigation;Navigation zurücksetzen\nAdd Resource here;Ressource hier anlegen\nShow Hidden Elements;Versteckte Ressourcen einblenden\nHide Hidden Elements;Versteckte Ressourcen ausblenden\n\n# filter extension\nToggle help; Hilfe (de)aktivieren\nfilter_help1;Wörter die durch Leerzeichen getrennt sind müssen alle im Ergebnis enthalten sein, dabei spielt die eingegebene Reihenfolge keine Rolle.\nfilter_help2;Phrasen können gesucht werden, indem die Wortgruppe in einfache Anführungszeichen gesetzt wird (Strg + #).\nfilter_help3;Werden mindestens vier Buchstaben eingegeben, kann anschließend durch Sternchen '*' eine Trunkierung erfolgen.\nfilter_help4;Sobald die Suche die Wörter AND oder OR enthält, muss die komplette bif:contains-Syntax benutzt werden.\nFurther info;mehr Informationen\n\n"
  },
  {
    "path": "extensions/translations/en/core.csv",
    "content": "#\n# OntoWiki English language translation\n# Encoding:  UTF-8\n# Separator: ;\n#\nOntoWiki – Collaborative Knowledge Engineering;OntoWiki – Collaborative Knowledge Engineering\nBla bla, blub!;Bla bla, blubb!\nI am %1$s years old.;I am %1$s years old.\n\nmoments ago;moments ago\napprox. 1 minute ago;approx. one minute ago\napprox. %d minutes ago;approx. %d minutes ago\napprox. 1 hour ago;approx. one hour ago\napprox. %d hours ago;approx. %d hours ago\napprox. %d days agoapprox. ;%d days ago\n\n# test\npage1;Page 1\npage2;Page 2\n\nKnowledge Bases\nAdd Model\nLanguages (Tagged Literals)\nnone\nClasses\nShow Empty Classes\nHide Empty Classes\nShow System Classes\nHide System Classes\nShow Hidden Classes\nHide Hidden Classes\nMost Popular | Most Active\nRec. Changes\nRec. Comments\nNo matches.\nProperties\nInstances\nMap\nCalendar\nHistory\nDiscussion\nEdit\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday\nSunday\nNr.\nDate\nUser\nModel\nAction\nRollback\nLogin\nIncorrect login data!\nUser\nUsername\nPassword\nRegister\nSubmit\nLogout\nEdit registration\nActions\nExport\nInline\nEditing\nCommenting\nLink to this page\nAdd Class\nAdd Instance\nShow Properties\nFilter\nCombine Filters (Conjunction)\nAdd Instance\nMerge\nVisit resource on the web\nCreate instances from property value by regexp\nSimilar Instances\nRating\nAverage Rating\nYour Rating\nInstances Linking Here\nUsage as Property\nInstances\nValues\nSearch | OntoWiki\nSearch Text\nSubmit\nSearch All Knowledge Bases\nSearch\nAdd Property\nSubmit Values\nSPARQL Query Editor\nResult Options\nTable\nSPARQL Query Results XML Format\nRender Ressources as OntoWiki Links\nCreate New Knowledge Base\nFOAFSSL;FOAF+SSL\nForgot your password?\n\n# Filter explanation\nToggle help\nfilter_help1;Words separated by spaces must all appear, but not necessarily in the given order.\nfilter_help2;Phrases can be searched by enclosing them in single quotes.\nfilter_help3;It is possible to use * as wildcard, but only with a minimum of four preceding letters.\nfilter_help4;As soon the search includes one of the keywords AND or OR, the full bif:contains syntax must be used.\nFurther info\n"
  },
  {
    "path": "extensions/translations/fr/core.csv",
    "content": "#\n# OntoWiki German language translation\n# Encoding:  UTF-8\n# Separator: ;\n#\nBack;Retour\nSubmit;Envoyer\nCancel;Terminer\nSave Changes;\"Sauvegarder les modificitions\"\nReset Form;Reculer formulaire\nEdit Instances;TODO\nEdit Properties;TODO\nAdd Property;\"Ajouter propriété\"\nRendered in %1$d microseconds using %2$d SPARQL queries.;Gerendert in %1$d Mikrosekunden mit %2$d SPARQL-Anfragen.\nmore;mehr\n\nmoments ago;TODO\napprox. 1 minute ago;il y'a une minute\napprox. %d minutes ago;il y'a %d minutes\napprox. 1 hour ago;il y'a une heure\napprox. %d hours ago;il y'a %d heures\napprox. %d days ago;il y'a %d jours\n\n# test\npage1;Page 1\npage2;Page 2\n\n\n# Module\nSearch all Knowledge Bases;Chercher tous les bases de connaissance\nSearch Text;TODO\nKnowledge Bases;Bases de connaissance\nCreate Knowledge Base;\"Créer une base de connaissance\"\nShow Hidden Knowledge Bases;\"Afficher bases de connaissance cachées\"\nHide Hidden Knowledge Bases;\"Cacher bases de connaissance cachées\"\nLanguages (Tagged Literals);Sprachen (ausgezeichnete Labels)\nnone;aucun\nClasses;Classes\nCreate Class;\"Créer une classe\"\nShow Empty Classes;Afficher des classes vides\nHide Empty Classes;Cacher des classes vides\nShow System Classes;Afficher des classes TODO\nHide System Classes;TODO\nShow Hidden Classes;Afficher des classes cachées\nHide Hidden Classes;Cacher des classes cachées\nMost Popular | Most Active;Populär | Aktiv\nRec. Changes;\"Modifications\"\nRec. Comments;Commentaires\nLogin;Connecter\nNo matches.;Keine Entsprechungen.\nPredicates;Prädikate\nSimilar Instances;\"Des instances similaires\"\nInstances Linking Here;Verlinkte Ressourcen\nUsage as Property;Auftreten als Prädikat\nNot implemented yet.;Noch nicht implementiert.\nLatest Changes;Aktuelle Änderungen\nLatest Discussions;Aktuelle Diskussionen\nComments, Descriptions and Notes;Kurzbeschreibung\nActions; Aktionen\nThere are no comments, descriptions or notes on this knowledge base.; Es sind keine Kommentare, Beschreibungen oder Anmerkungen in der Wissensbasis enthalten.\nview all resources; Alle Ressourcen anzeigen\nSearch for Resources;Suche nach Ressourcen\nSource;Code source\nby;von\nObjects;Objekte\nSubjects;Subjekte\n\n\n# Komponenten\n# TODO: sollten Komponenten ihre Übersetzung selbst verwalten?\nProperties;\"Propriétés\"\nInstances;Instances\nCalendar;Calendrier\nHistory;ChangeLog\nMap;Carte\n\n# application menu\nUser;Utilisateur\nRegister New User;Enregistrer nouvel utilisateur\nPreferences;\"Préférences\"\nLogout;Annuler\nView;\"Aperçu\"\nEdit;\"Éditer\"\nExtras;Extras\nSPARQL Query Editor;SPARQL-Anfrage-Editor\nFile Resource Manager;Dateiressourcen-Manager\nNews;Nouvelles\nClear Cache;Vider cache\nHelp;Aide\nDocumentation;Documentation\nBug Report;Fehler melden\nVersion Info;Versionsinfo\nAbout;\"Über\"\n\n#Pager\nFirst;Erste\nPrevious;Vorherige\nNext;Nächste\nLast;Letzte\n\nCreate New Knowledge Base;Neue Wissensbasis anlegen\nModel URI;Modell-URI\nCreate an Empty Knowledge Base; Eine leere Wissensbasis anlegen\nBase URI;Basis-URI\nType;Typ\nImport From the Web;Aus dem WWW importieren\nUpload a File;Eine Datei hochladen\nFile Type;Dateityp\nFile (max. %1$sB);Datei (max. %1$sB)\nPaste Source;Quelltext eingeben\nSource Code;Quelltext\nEnter the URL where the model should be downloaded from. If you leave the field empty the model URI will be used.;Geben Sie die URL zur Modelldatei an. Wenn Sie dieses Feld leer lassen, wird stattdessen die Modell-URI benutzt.\nLocation;URL zur Datei\nInstances of %1$s;Instanzen von %1$s\nProperties of %1$s;Eigenschaften von %1$s\n\nRegister User;Enregister utilisateur\nUsername;Nom d'utilisateur\nEmail Address;Adresse e-mail\nPassword;Mot de passe\nPassword (repeat);\"Mot de passe (répéter)\"\nUnknown user identifier.;Unbekannte Benutzerkennung.\nForgot your password?;Passwort vergessen?\n\nPredefined namespaces;Vordefinierte Namensräume\nSPARQL Options;SPARQL-Optionen\nPlain;Einfach\nSubmit Query;Anfrage absenden\nresult;Ergebnis\nresults;Ergebnisse\nSearch returned %1$d %2$s.;Die Suche lieferte %1$d %2$s. \nQuery execution took %1$d ms.;Die Bearbeitung der Anfrage dauerte %1$d ms.\n\n# Menüs\nView Resource;Regarder ressource\nEdit Resource;\"Éditer ressource\"\nDelete Resource;Effacer ressource\n\nList Instances;Lister les instances\nCreate Instance;\"Créer instance\"\nCreate Subclass;\"Créer sous-classe\"\n\nSelect Knowledge Base;\"Sélectionner base de connaissance\"\nConfigure Knowledge Base;\"Configurer base de connaissance\"\nAdd Data to Knowledge Base;\"Ajouter des données à base de connaissance\"\nExport Knowledge Base as RDF/XML;Exporter base de connaissance comme RDF/XML\nExport Knowledge Base as RDF/JSON;Exporter base de connaissance comme RDF/JSON\nExport Knowledge Base as RDF/N3;Exorter base de connaissance comme RDF/N3\nExport Knowledge Base as RDF/JSON (Talis);Exporter base de connaisssance comme RDF/JSON (Talis)\nExport Knowledge Base as Turtle;Exporter base de connaissance comme Turtle\nExport Knowledge Base as Notation 3;Exporter base de connaissance comme N3\nDelete Knowledge Base;Supprimer base de connaissance\n\nToggle show Permalink;Afficher/cacher Permalien\nToggle show Resoure Query;Afficher/cacher Resource Query\n\n# Wochentage\nMonday;Lundi\nTuesday;Mardi\nWednesday;Mercredi\nThursday;Jeudi\nFriday;Vendredi\nSaturday;Samedi\nSunday;Dimance\n\nAdd Class;Ajouter classe\nAdd Instance;Ajouter instance\n\nShow Properties;\"Afficher propriétés\"\n\nFilter;Filter\nCombine Filters (Conjunction);Filter kombinieren (Konjunktion)\n\nMerge;Fusionner\nVisit resource on the web;Ressource im Netz aufsuchen\n\nCreate instances from property value by regexp\nSimilar Instances\nRating\nAverage Rating\nYour Rating\nInstances Linking Here\nUsage as Property\nInstances\nValues\nSearch | OntoWiki\nSearch Text\nSubmit\nSearch All Knowledge Bases\nSearch\nAdd Property\nSubmit Values\nSPARQL Query Editor\nResult Options\nTable\nSPARQL Query Results XML Format\nRender Ressources as OntoWiki Links\nCreate New Knowledge Base\nFOAFSSL;FOAF+SSL\n\n# explore tags module\nExplore Tags;Schlagwörter / Tag-Wolken\nReset Explore Tags Box;Modul zurücksetzen\nReset selected tags;Tag-Auswahl zurücksetzen\nNumber of showed tags;Anzahl Tags\nSort;Triage\nby name; par nom\nby frequency;\"par quantité\"\n\n# navigation module\nNumber of Elements;Anzahl Ressourcen\nToggle Elements;Spezielle Elemente\nReset Navigation;Navigation zurücksetzen\nAdd Resource here;Ajouter ressource ici\nShow Hidden Elements;Versteckte Ressourcen einblenden\nHide Hidden Elements;Versteckte Ressourcen ausblenden\n\n# filter extension\nToggle help; Hilfe (de)aktivieren\nfilter_help1;Wörter die durch Leerzeichen getrennt sind müssen alle im Ergebnis enthalten sein, dabei spielt die eingegebene Reihenfolge keine Rolle.\nfilter_help2;Phrasen können gesucht werden, indem die Wortgruppe in einfache Anführungszeichen gesetzt wird (Strg + #).\nfilter_help3;Werden mindestens vier Buchstaben eingegeben, kann anschließend durch Sternchen '*' eine Trunkierung erfolgen.\nfilter_help4;Sobald die Suche die Wörter AND oder OR enthält, muss die komplette bif:contains-Syntax benutzt werden.\nFurther info;mehr Informationen\n\n"
  },
  {
    "path": "extensions/translations/ru/core.csv",
    "content": "#\"\n# OntoWiki Russian language translation\"\n# Encoding:  UTF-8\"\n# Separator: ;\"\n# Version:   $Id: core.csv 4282 2009-10-12 11:20:57Z $\"\n#\"\nBack;\"Назад\"\nSubmit;\"Отправить\"\nCancel;\"Отмена\"\nSave Changes;\"Сохранить изменения\"\nReset Form;\"Сбросить\"\nEdit Instances;\"Редактировать экземпляры\"\nEdit Properties;\"Редактировать свойства\"\nAdd Property;\"Добавить свойство\"\nRendered in %1$d microseconds using %2$d SPARQL queries.;\"Страница сгенерирована за %1$d мс с помощью %2$d SPARQL-запросов.\"\nmore;\"еще\"\n\nmoments ago;\"недавно\"\napprox. 1 minute ago;\"примерно минуту назад\"\napprox. %d minutes ago;\"примерно %d минут назад\"\napprox. 1 hour ago;\"примерно час назад\"\napprox. %d hours ago;\"примерно %d часов назад\"\napprox. %d days ago;\"примерно %d дней назад\"\n\n# test\"\npage1;\"Страница 1\"\npage2;\"Страница 2\"\n\n\"\n# Module\"\nSearch all Knowledge Bases;\"Показать все базы знаний\"\nSearch Text;\"Поиск текста\"\nKnowledge Bases;\"Базы знаний\"\nCreate Knowledge Base;\"Создать базу знаний\"\nShow Hidden Knowledge Bases;\"Показать скрытые базы знаний\"\nHide Hidden Knowledge Bases;\"Убрать скрытые базы знаний\"\nLanguages (Tagged Literals);\"Языки\"\nnone;\"ничего\"\nClasses;\"Классы\"\nCreate Class;\"Создать класс\"\nShow Empty Classes;\"Показать пустые классы\"\nHide Empty Classes;\"Скрыть пустые классы\"\nShow System Classes;\"Показать системные классы\"\nHide System Classes;\"Скрыть системные классы\"\nShow Hidden Classes;\"Показать скрытые классы\"\nHide Hidden Classes;\"Скрыть скрытые классы\"\nMost Popular | Most Active;\"Наиболее популярные | Наиболее активные\"\nRec. Changes;\"Недавние именения\"\nRec. Comments;\"Недавние\"\nLogin;\"Вход\"\nNo matches.;\"Нет совпадений.\"\nPredicates;\"Предикаты\"\nSimilar Instances;\"Похожие экземпляры\"\nInstances Linking Here;\"Экземпляры указывающие сюда\"\nUsage as Property;\"Использование как свойства\"\nNot implemented yet.;\"Еще не сделано.\"\nLatest Changes;\"Последние изменения\"\nLatest Discussions;\"Последние обсуждения\"\nComments, Descriptions and Notes;\"Комментарии, описания и заметки\"\nActions;\"Действия\"\nThere are no comments, descriptions or notes on this knowledge base.;\"К этой базе знаний нет комментариев, описаний или заметок.\"\nview all resources;\"Показать все ресурсы\"\nSearch for Resources;\"Поиск по ресурсам\"\nSource;\"Исходный код\"\nby;\"по\"\nObjects;\"Объект\"\nSubjects;\"Субъект\"\n\n\"\n# Komponenten\"\nProperties;\"Свойства\"\nInstances;\"Экземпляры\"\nCalendar;\"Календарь\"\nHistory;\"История\"\nMap;\"Карта\"\n\n# application menu\"\nUser;\"Пользователь\"\nRegister New User;\"Зарегистрировать нового пользователя\"\nPreferences;\"Настройки\"\nLogout;\"Выход\"\nView;\"Вид\"\nEdit;\"Редактировать\"\nExtras;\"Экстра\"\nSPARQL Query Editor;\"Редактор SPARQL-запросов\"\nFile Resource Manager;\"Управление файлами ресурсов\"\nNews;\"Новости\"\nClear Cache;\"Очистить кеш\"\nHelp;\"Помощь\"\nDocumentation;\"Документация\"\nBug Report;\"Сообщить об ошибке\"\nVersion Info;\"Информация о версии\"\nAbout;\"Об OntoWiki\"\n\n#Pager\"\nFirst;\"Первая\"\nPrevious;\"Предыдущая\"\nNext;\"Следующая\"\nLast;\"Последняя\"\n\nCreate New Knowledge Base;\"Создать новую базу знаний\"\nModel URI;\"URI модели\"\nCreate an Empty Knowledge Base;\"Создать пустую базу знаний\"\nBase URI;\"Базовая URI\"\nType;\"Тип\"\nImport From the Web;\"Импортировать из Веб\"\nUpload a File;\"Загрузить файл\"\nFile Type;\"Тип файла\"\nFile (max. %1$sB);\"Файл (макс. %1$sB)\"\nPaste Source;\"Вставить исходный код\"\nSource Code;\"Исходный код\"\nEnter the URL where the model should be downloaded from. If you leave the field empty the model URI will be used.;\"Введите URL для загрузки модели из Веб. Если вы оставите это поле пустым, будет использован URL модели.\"\nLocation;\"Путь\"\nInstances of %1$s;\"Экземпляры %1$s\"\nProperties of %1$s;\"Свойства %1$s\"\n\nRegister User;\"Зарегистрировать пользователя\"\nUsername;\"Имя пользователя\"\nEmail Address;\"E-Mail\"\nPassword;\"Пароль\"\nPassword (repeat);\"Пароль (подтверждение)\"\nUnknown user identifier.;\"Неизвестный идентификатор пользователя.\"\nForgot your password?;\"Забыли пароль?\"\n\nPredefined namespaces;\"Предопределенные пространства имен\"\nSPARQL Options;\"Настройки SPARQL\"\nPlain;\"Простой\"\nSubmit Query;\"Отправить запрос\"\nresult;\"результат\"\nresults;\"результаты\"\nSearch returned %1$d %2$s.;\"Поиск вернул %1$d %2$s. \"\nQuery execution took %1$d ms.;\"Запрос был выполнен за %1$d ms.\"\n\n# Menüs\"\nView Resource;\"Показать ресурс\"\nEdit Resource;\"Редактировать ресурс\"\nDelete Resource;\"Удалить ресурс\"\n\nList Instances;\"Список экземпляров\"\nCreate Instance;\"Создать экземпляр\"\nCreate Subclass;\"Создать подкласс\"\n\nSelect Knowledge Base;\"Выбрать базу знаний\"\nConfigure Knowledge Base;\"Настроить базу знаний\"\nAdd Data to Knowledge Base;\"Добавить данные в базу знаний\"\nExport Knowledge Base as RDF/XML;\"Экспортировать базу знаний в RDF/XML\"\nExport Knowledge Base as RDF/JSON;\"Экспортировать базу знаний в RDF/JSON\"\nExport Knowledge Base as RDF/N3;\"Экспортировать базу знаний в RDF/N3\"\nExport Knowledge Base as RDF/JSON (Talis);\"Экспортировать базу знаний в RDF/JSON (Talis)\"\nExport Knowledge Base as Turtle;\"Экспортировать базу знаний в Turtle\"\nExport Knowledge Base as Notation 3;\"Экспортировать базу знаний в N3\"\nDelete Knowledge Base;\"Удалить базу знаний\"\n\n# Wochentage\"\nMonday;\"Понедельник\"\nTuesday;\"Вторник\"\nWednesday;\"Среда\"\nThursday;\"Четверг\"\nFriday;\"Пятница\"\nSaturday;\"Суббота\"\nSunday;\"Воскресенье\"\n\nAdd Class;\"Добавить класс\"\nAdd Instance;\"Добавить экземпляр\"\n\nShow Properties;\"Показать свойства\"\n\nFilter;\"Фильтры\"\nCombine Filters (Conjunction);\"Группировать фильтры (связывание)\"\n\nMerge;\"Слияние\"\nVisit resource on the web;\"Посетить ресурс в Веб\"\n\nCreate instances from property value by regexp;\"Создать экземпляр из значения свойства с помощью регулярного выражения\"\nSimilar Instances;\"Похожие экземпляры\"\nRating;\"Рейтинг\"\nAverage Rating;\"Средний рейтинг\"\nYour Rating;\"Ваш рейтинг\"\nInstances Linking Here;\"Экземпляры указывающие сюда\"\nUsage as Property;\"Использование как свойства\"\nInstances;\"Экземпляры\"\nValues;\"Значения\"\nSearch | OntoWiki;\"Поиск | OntoWiki\"\nSearch Text;\"Текстовый поиск\"\nSubmit;\"Отправить\"\nSearch All Knowledge Bases;\"Поиск во всех базах знаний\"\nSearch;\"Поиск\"\nAdd Property;\"Добавить свойство\"\nSubmit Values;\"Отправить значения\"\nSPARQL Query Editor;\"Редактор запросов SPARQL\"\nResult Options;\"Настройки результатов\"\nTable;\"Таблица\"\nSPARQL Query Results XML Format;\"Результаты запроса SPARQL в XML\"\nRender Ressources as OntoWiki Links;\"Отобразить ресурсы как ссылки OntoWiki\"\nCreate New Knowledge Base;\"Создать новую базу знаний\"\nFOAFSSL;\"FOAF+SSL\"\n\n# explore tags module\"\nExplore Tags;\"Исследовать теги\"\nReset Explore Tags Box;\"Сбросить исследованные теги\"\nReset selected tags;\"Сбросить выбранные теги\"\nNumber of showed tags;\"Количетсво отображаемых тегов\"\nSort;\"Сортировка\"\nby name;\"по имени\"\nby frequency;\"по частоте\"\n\n"
  },
  {
    "path": "extensions/translations/zh/core.csv",
    "content": "#\n# OntoWiki Chinese language translation\n# Encoding:  UTF-8\n# Separator: ;\n#\nBack;\"返回\"\nSubmit;\"发送\"\nCancel;\"终止\"\nSave Changes;\"保存更改\"\nReset Form;\"重置表单\"\nEdit Instances;\"编辑实例\"\nEdit Properties;\"编辑性质\"\nAdd Property;\"添加性质\"\nRendered in %1$d microseconds using %2$d SPARQL queries.;\"在 %1$d 微秒内发送了 %2$d 条SPARQL语句。\"\nmore;\"更多\"\n\nmoments ago;\"历史记录\"\napprox. 1 minute ago;\"一分钟之前\"\napprox. %d minutes ago;\"%d 分钟之前\"\napprox. 1 hour ago;\"一小时之前\"\napprox. %d hours ago;\"%d 小时之前\"\napprox. %d days ago;\"%d 天之前\"\n\n# test\npage1;\"第1页\"\npage2;\"第2页\"\n\n\n# Module\nSearch all Knowledge Bases;\"在所有知识库中搜索\"\nSearch Text;\"搜索内容\"\nKnowledge Bases;\"知识库\"\nCreate Knowledge Base;\"建立知识库\"\nShow Hidden Knowledge Bases;\"显示隐藏的知识库\"\nLanguages (Tagged Literals);\"语言 (强调的标签)\"\nnone;\"无内容\"\nClasses;\"类\"\nCreate Class;\"构造一个类\"\nShow Empty Classes;\"显示空类\"\nHide Empty Classes;\"不显示空类\"\nShow System Classes;\"显示系统类\"\nHide System Classes;\"不显示系统类\"\nShow Hidden Classes;\"显示隐藏的类\"\nHide Hidden Classes;\"不显示隐藏的类\"\nMost Popular | Most Active;\"最受欢迎 | 最活跃\"\nRec. Changes;\"更改\"\nRec. Comments;\"评论\"\nLogin;\"登陆\"\nNo matches.;\"未找到匹配内容.\"\nPredicates;\"谓词\"\nSimilar Instances;\"类似实例\"\nInstances Linking Here;\"此处为实例联接\"\nUsage as Property;\"作为一个性质使用\"\nNot implemented yet.;\"尚未实现。\"\nObjects;\"宾语\"\nSubjects;\"主语\"\n\n# Komponenten\n# TODO: sollten Komponenten ihre Übersetzung selbst verwalten?\nProperties;\"属性\"\nInstances;\"实例\"\nCalendar;\"日历\"\nHistory;\"历史\"\nMap;\"地图\"\n\n# application menu\nUser;\"用户\"\nRegister New User;\"注册新用户\"\nPreferences;\"设置\"\nLogout;\"注销\"\nView;\"显示\"\nExtras;\"其他\"\nSPARQL Query Editor;\"SPARQL语句编辑器\"\nFile Resource Manager;\"文件管理器\"\nNews;\"新闻\"\nClear Cache;\"清空缓存\"\nHelp;\"帮助\"\nDocumentation;\"帮助文档\"\nBug Report;\"错误报告\"\nVersion Info;\"版本信息\"\nAbout;\"关于\"\n\n#Pager\nFirst;\"首页\"\nPrevious;\"上一页\"\nNext;\"下一页\"\nLast;\"末页\"\n\nCreate New Knowledge Base;\"建立新知识库\"\nModel URI;\"模型-URI\"\nCreate an Empty Knowledge Base;\"建立一个空知识库\"\nBase URI;\"Base URL\"\nType;\"类型\"\nImport From the Web;\"加载自网络\"\nUpload a File;\"上传文件\"\nFile Type;\"文件类型\"\nFile (max. %1$sB);\"文件 (最大. %1$sB)\"\nPaste Source;\"粘贴原代码\"\nSource Code;\"原代码\"\nEnter the URL where the model should be downloaded from. If you leave the field empty the model URI will be used.;\"请输入模型文件的URL。如果未输入任何内容，系统将默认使用模型自己的URL。\"\nLocation;\"文件URL\"\nInstances of %1$s;\"%1$s 的实例\"\nProperties of %1$s;\"%1$s的属性\"\n\nRegister User;\"注册新用户\"\nUsername;\"用户名\"\nEmail Address;\"EMail地址\"\nPassword;\"密码\"\nPassword (repeat);\"密码 (请再次输入密码)\"\n\nPredefined namespaces;\"之前的命名空间\"\nSPARQL Options;\"SPARQL选项\"\nPlain;\"无格式\"\nSubmit Query;\"发送语句\"\nresult;\"查询结果\"\nresults;\"查询结果\"\nSearch returned %1$d %2$s.;\"查询返回 %1$d %2$s。\"\nQuery execution took %1$d ms.;\"处理查询语句使用了 %1$d 微秒。\"\n\n# Menüs\nView Resource;\"显示资源\"\nEdit Resource;\"编辑资源\"\nDelete Resource;\"删除资源\"\n\nList Instances;\"实例列表\"\nCreate Instance;\"建立实例\"\nCreate Subclass;\"构造子类\"\n\nSelect Knowledge Base;\"选择知识库\"\nConfigure Knowledge Base;\"配置知识库\"\nAdd Data to Knowledge Base;\"向知识库内添加数据\"\nExport Knowledge Base as RDF/XML;\"以 RDF/XML 格式导出知识库\"\nExport Knowledge Base as RDF/JSON;\"以 RDF/JSON 格式导出知识库\"\nExport Knowledge Base as RDF/N3;\"以 RDF/N3 格式导出知识库\"\nExport Knowledge Base as RDF/JSON (Talis);\"以 RDF/JSON (Talis) 格式导出知识库\"\nExport Knowledge Base as Turtle;\"以 Turtle 格式导出知识库\"\nDelete Knowledge Base;\"删除知识库\"\n\n# Wochentage\nMonday;\"周一\"\nTuesday;\"周二\"\nWednesday;\"周三\"\nThursday;\"周三\"\nFriday;\"周五\"\nSaturday;\"周六\"\nSunday;\"周日\"\n\nAdd Class;\"添加类\"\nAdd Instance;\"添加实例\"\n\nShow Properties;\"显示属性\"\n\nFilter;\"过滤\"\nCombine Filters (Conjunction);\"联合过滤器 (逻辑与)\"\n\nMerge;\"聚集\"\nVisit resource on the web;\"在网络上搜索资源\"\n\nCreate instances from property value by regexp;\"通过性质的正则表达式建立实例\"\nSimilar Instances;\"类似实例\"\nRating;\"评价\"\nAverage Rating;\"平均评价\"\nYour Rating;\"您的评价\"\nInstances Linking Here;\"此处实例联接\"\nUsage as Property;\"作为一个实例使用\"\nInstances;\"实例\"\nValues;\"评价\"\nSearch | OntoWiki;\"查找 | OntoWiki\"\nSearch Text;\"搜索内容\"\nSubmit;\"发送\"\nSearch All Knowledge Bases;\"搜索所有知识库\"\nSearch;\"搜索\"\nAdd Property;\"添加属性\"\nSubmit Values;\"发送评价\"\nSPARQL Query Editor;\"SPARQL语句编辑器\"\nResult Options;\"搜索结果选项\"\nTable;\"表格\"\nSPARQL Query Results XML Format;\"SPARQL查询结果XML格式\"\nRender Ressources as OntoWiki Links;\"以OntoWiki联接发送资源\"\nCreate New Knowledge Base;\"建立新知识库\"\nFOAFSSL;\"FOAF+SSL\"\n"
  },
  {
    "path": "extensions/weblink/WeblinkPlugin.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2011-2016, {@link http://aksw.org AKSW}\n * @license   http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * @category   OntoWiki\n * @package    Extensions_Weblink\n */\nclass WeblinkPlugin extends OntoWiki_Plugin\n{\n    protected $_config = null;\n\n    public function init()\n    {\n        $this->_config = OntoWiki::getInstance()->config;\n\n        $properties        = array_values($this->_privateConfig->weblink->toArray());\n        $this->_properties = array_combine($properties, $properties);\n    }\n\n    public function onDisplayObjectPropertyValue($event)\n    {\n        if (array_key_exists($event->property, $this->_properties)) {\n            return '<a resource=\"' .\n                $event->value .\n                '\" class=\"hasMenu\" href=\"' .\n                $event->value .\n                '\">' .\n                OntoWiki_Utils::shorten($event->value, 60) .\n                '</a>';\n        }\n    }\n\n    public function onDisplayLiteralPropertyValue($event)\n    {\n        if (array_key_exists($event->property, $this->_properties) && Erfurt_Uri::check($event->value)) {\n            return '<a href=\"' . $event->value . '\">' . OntoWiki_Utils::shorten($event->value, 60) . '</a>';\n        }\n    }\n}\n"
  },
  {
    "path": "extensions/weblink/doap.n3",
    "content": "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n@prefix doap: <http://usefulinc.com/ns/doap#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owconfig: <http://ns.ontowiki.net/SysOnt/ExtensionConfig/> .\n@prefix extension: <http://ns.ontowiki.net/Extensions/> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix event: <http://ns.ontowiki.net/SysOnt/Events/> .\n@prefix : <https://github.com/AKSW/weblink/raw/master/doap.n3#> .\n\n<> foaf:primaryTopic :weblink .\n:weblink a doap:Project ;\n  doap:name \"weblink\" ;\n  owconfig:privateNamespace <https://github.com/AKSW/weblink/raw/master/doap.n3#> ;\n  owconfig:enabled \"true\"^^xsd:boolean ;\n  rdfs:label \"Weblink\" ;\n  doap:description \"A plug-in that renders values of certain properties as HTML links.\" ;\n  owconfig:authorLabel \"Norman Heino\" ;\n  owconfig:pluginEvent event:onDisplayObjectPropertyValue ;\n  owconfig:pluginEvent event:onDisplayLiteralPropertyValue ;\n  :weblink <http://xmlns.com/foaf/0.1/homepage> ;\n  :weblink <http://xmlns.com/foaf/0.1/page> ;\n  :weblink <http://xmlns.com/foaf/0.1/weblog> ;\n  :weblink <http://xmlns.com/foaf/0.1/workInfoHomepage> ;\n  :weblink <http://xmlns.com/foaf/0.1/workplaceHomepage> ;\n  :weblink <http://xmlns.com/foaf/0.1/schoolHomepage> ;\n  :weblink <http://xmlns.com/foaf/0.1/pubkeyAddress> ;\n  :weblink <http://xmlns.com/foaf/0.1/publications> ;\n  :weblink <http://www.w3.org/2000/01/rdf-schema#seeAlso> ;\n  :weblink <http://purl.org/dc/elements/1.1/identifier> ;\n  :weblink <http://purl.org/ontology/mo/myspace> ;\n  :weblink <http://purl.org/ontology/mo/discogs> ;\n  :weblink <http://purl.org/ontology/mo/musicbrainz> ;\n  :weblink <http://3ba.se/conferences/URL> ;\n  :weblink <http://usefulinc.com/ns/doap#wiki> ;\n  :weblink <http://usefulinc.com/ns/doap#homepage> ;\n  :weblink <http://usefulinc.com/ns/doap#download-page> ;\n  :weblink <http://usefulinc.com/ns/doap#bug-database> ;\n  :weblink <http://usefulinc.com/ns/doap#browse> ;\n  :weblink <http://xmlns.com/wot/0.1/assurance> ;\n  :weblink <http://xmlns.com/wot/0.1/src_assurance> ;\n  :weblink <http://www.uni-leipzig.de/history/professors/webLinks> ;\n  :weblink <http://www.w3.org/2002/07/owl#versionInfo> ;\n  :weblink <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> ;\n  :weblink <http://purl.org/vocab/vann/changes> ;\n  :weblink <http://purl.org/vocab/vann/example> ;\n  :weblink <http://rdfs.org/sioc/ns#feed> ;\n  doap:release :v1-0 .\n:v1-0 a doap:Version ;\n  doap:revision \"1.0\" .\n"
  },
  {
    "path": "index.php",
    "content": "<?php\n/**\n * This file is part of the {@link http://ontowiki.net OntoWiki} project.\n *\n * @copyright Copyright (c) 2015, {@link http://aksw.org AKSW}\n * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)\n */\n\n/**\n * OntoWiki bootstrap file.\n *\n * @category OntoWiki\n * @author Norman Heino <norman.heino@gmail.com>\n */\n\n/* Profiling */\ndefine('REQUEST_START', microtime(true));\n\n/*\n * error handling for the very first includes etc.\n * http://stackoverflow.com/questions/1241728/\n */\nfunction errorHandler ($errno, $errstr, $errfile, $errline, array $errcontext)\n{\n    // error was suppressed with the @-operator\n    if (0 === error_reporting()) {\n        return false;\n    }\n    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);\n}\nset_error_handler('errorHandler');\n\n/*\n * method to get evironment variables which are prefixed with \"REDIRECT_\"\n * in some configurations Apache prefixes the environment variables on each rewrite walkthrough\n * e.g. under centos\n */\nfunction getEnvVar ($key)\n{\n    $prefix = \"REDIRECT_\";\n    if (isset($_SERVER[$key])) {\n        return $_SERVER[$key];\n    }\n    foreach ($_SERVER as $k => $v) {\n        if (substr($k, 0, strlen($prefix)) == $prefix) {\n            if (substr($k, -(strlen($key))) == $key) {\n                return $v;\n            }\n        }\n    }\n    return null;\n}\n\n/**\n * Bootstrap constants\n * @since 0.9.5\n */\nif (!defined('__DIR__')) {\n    define('__DIR__', dirname(__FILE__));\n} // fix for PHP < 5.3.0\ndefine('BOOTSTRAP_FILE', basename(__FILE__));\ndefine('ONTOWIKI_ROOT', rtrim(__DIR__, '/\\\\') . DIRECTORY_SEPARATOR);\ndefine('APPLICATION_PATH', ONTOWIKI_ROOT . 'application'.DIRECTORY_SEPARATOR);\ndefine('CACHE_PATH', ONTOWIKI_ROOT . 'cache'.DIRECTORY_SEPARATOR);\n\n/**\n * Old constants for < 0.9.5 backward compatibility\n * @deprecated 0.9.5\n */\ndefine('_OWBOOT', BOOTSTRAP_FILE);\ndefine('_OWROOT', ONTOWIKI_ROOT);\ndefine('OW_SHOW_MAX', 5);\n\n\n// PHP environment settings\nif ((int)ini_get('max_execution_time') < 240) {\n    ini_set('max_execution_time', 240);\n}\n\nif ((int)substr(ini_get('memory_limit'), 0, -1) < 256) {\n    ini_set('memory_limit', '256M');\n}\n\n// append local Erfurt include path\nrequire_once('vendor/autoload.php');\n\n// use default timezone from php.ini or let PHP guess it\ndate_default_timezone_set(@date_default_timezone_get());\n\n// determine wheter rewrite engine works\n// and redirect to a URL that doesn't need rewriting\n// TODO: check for AllowOverride All\n$rewriteEngineOn = false;\n\nif (getEnvVar('ONTOWIKI_APACHE_MOD_REWRITE_ENABLED')) {\n    // used in .htaccess or in debian package config\n    // in some configurations Apache prefixes the env var with 'REDIRECT_'\n    $rewriteEngineOn = true;\n} else if (function_exists('__virt_internal_dsn')) {\n    // compatible with Virtuoso VAD\n    $rewriteEngineOn = true;\n} else if (function_exists('apache_get_modules')) {\n    // usually, we are not here\n    if (in_array('mod_rewrite', apache_get_modules())) {\n        // get .htaccess contents\n        $htaccess = @file_get_contents(ONTOWIKI_ROOT . '.htaccess');\n\n        // check if RewriteEngine is enabled\n        $rewriteEngineOn = preg_match('/.*[^#][\\t ]+RewriteEngine[\\t ]+On/i', $htaccess);\n\n        // explicitly request /index.php for non-rewritten requests\n        if (!$rewriteEngineOn && ! strpos($_SERVER['REQUEST_URI'], BOOTSTRAP_FILE)) {\n            header('Location: ' . rtrim($_SERVER['REQUEST_URI'], '/\\\\') . '/' . BOOTSTRAP_FILE, true, 302);\n            return;\n        }\n    }\n}\n\ndefine('ONTOWIKI_REWRITE', $rewriteEngineOn);\n\n// create application\n$application = new Zend_Application(\n    'default',\n    ONTOWIKI_ROOT . 'application/config/application.ini'\n);\n\n// restore old error handler\nrestore_error_handler();\n\n// bootstrap\ntry {\n    $application->bootstrap();\n} catch (Exception $e) {\n    header('HTTP/1.1 500 Internal Server Error');\n    echo 'Error on bootstrapping application: ';\n    echo $e->getMessage();\n    return;\n}\n\n$event = new Erfurt_Event('onPostBootstrap');\n$event->bootstrap = $application->getBootstrap();\n$event->trigger();\n\n$application->run();\n"
  },
  {
    "path": "phpcs.xml",
    "content": "<?xml version=\"1.0\"?>\n<ruleset name=\"OntoWikiCS\">\n    <description>The combination of codingstandards used for Ontowiki.</description>\n\n    <file>./application/</file>\n    <file>./extensions/</file>\n\n    <arg name=\"extensions\" value=\"php\" />\n\n    <exclude-pattern>./application/tests/integration/OntoWiki/Extension/_files/test1/MoreModule.php</exclude-pattern>\n    <exclude-pattern>./application/tests/integration/OntoWiki/Extension/_files/test2/Test2Plugin.php</exclude-pattern>\n    <exclude-pattern>./application/scripts/</exclude-pattern>\n    <exclude-pattern>./extensions/exconf/pclzip.lib.php</exclude-pattern>\n    <exclude-pattern>./extensions/exconf/Archive.php</exclude-pattern>\n    <exclude-pattern>./extensions/markdown/parser/markdown.php</exclude-pattern>\n    <exclude-pattern>./extensions\\/(?!account\\/|application\\/|auth\\/|autologin\\/|basicimporter\\/|bookmarklet\\/|ckan\\/|community\\/|cors\\/|datagathering\\/|defaultmodel\\/|exconf\\/|filter\\/|googletracking\\/|hideproperties\\/|history\\/|imagelink\\/|imprint\\/|jsonrpc\\/|linkeddataserver\\/|listmodules\\/|literaltypes\\/|mail\\/|mailtolink\\/|manchester\\/|markdown\\/|modellist\\/|navigation\\/|pingback\\/|queries\\/|resourcecreationuri\\/|resourcemodules\\/|savedqueries\\/|selectlanguage\\/|semanticsitemap\\/|sendmail\\/|sindice\\/|sortproperties\\/|source\\/|themes\\/|translations\\/|weblink\\/).*</exclude-pattern>\n\n    <!-- Generic sniffs -->\n    <rule ref=\"Generic.Classes.DuplicateClassName\" />\n    <rule ref=\"Generic.CodeAnalysis.ForLoopWithTestFunctionCall\" />\n    <rule ref=\"Generic.CodeAnalysis.JumbledIncrementer\" />\n    <rule ref=\"Generic.CodeAnalysis.UnconditionalIfStatement\" />\n    <!--<rule ref=\"Generic.CodeAnalysis.UnusedFunctionParameter\" />-->\n    <rule ref=\"Generic.CodeAnalysis.UselessOverridingMethod\" />\n    <!--<rule ref=\"Generic.Commenting.Fixme\" />-->\n    <!--<rule ref=\"Generic.Commenting.Todo\" />-->\n    <rule ref=\"Generic.ControlStructures.InlineControlStructure\" />\n    <rule ref=\"Generic.Files.ByteOrderMark\" />\n    <rule ref=\"Generic.Files.EndFileNewline\" />\n    <rule ref=\"Generic.Files.OneClassPerFile\" />\n    <rule ref=\"Generic.Files.OneInterfacePerFile\" />\n    <rule ref=\"Generic.Files.LineLength\">\n        <properties>\n            <property name=\"lineLimit\" value=\"100\"/>\n            <property name=\"absoluteLineLimit\" value=\"120\"/>\n        </properties>\n    </rule>\n    <rule ref=\"Generic.Files.LineLength.TooLong\">\n        <severity>3</severity>\n    </rule>\n    <rule ref=\"Generic.Files.LineEndings\">\n        <properties>\n            <property name=\"eolChar\" value=\"\\n\"/>\n        </properties>\n    </rule>\n    <rule ref=\"Generic.Files.LineEndings.InvalidEOLChar\">\n        <severity>3</severity>\n    </rule>\n    <rule ref=\"Generic.Formatting.DisallowMultipleStatements\" />\n    <!--<rule ref=\"Generic.Formatting.MultipleStatementAlignment\" />-->\n    <rule ref=\"Generic.Formatting.NoSpaceAfterCast\" />\n    <rule ref=\"Generic.Functions.CallTimePassByReference\" />\n    <rule ref=\"Generic.Functions.FunctionCallArgumentSpacing\" />\n    <!--<rule ref=\"Generic.Metrics.CyclomaticComplexity\" />-->\n    <!--<rule ref=\"Generic.Metrics.NestingLevel\" />-->\n    <rule ref=\"Generic.NamingConventions.ConstructorName\" />\n    <rule ref=\"Generic.NamingConventions.UpperCaseConstantName\" />\n    <rule ref=\"Generic.PHP.CharacterBeforePHPOpeningTag\" />\n    <rule ref=\"Generic.PHP.DeprecatedFunctions\" />\n    <rule ref=\"Generic.PHP.DisallowShortOpenTag\" />\n    <rule ref=\"Generic.PHP.LowerCaseConstant\" />\n    <!--<rule ref=\"Generic.PHP.NoSilencedErrors\" />-->\n    <!--<rule ref=\"Generic.Strings.UnnecessaryStringConcat\" />-->\n    <rule ref=\"Generic.WhiteSpace.DisallowTabIndent\" />\n\n    <!-- PEAR sniffs -->\n    <rule ref=\"PEAR.Classes.ClassDeclaration\" />\n    <rule ref=\"PEAR.Commenting.InlineComment\" />\n    <rule ref=\"PEAR.ControlStructures.ControlSignature\" />\n    <rule ref=\"PEAR.ControlStructures.MultiLineCondition\" />\n    <rule ref=\"PEAR.ControlStructures.MultiLineCondition.StartWithBoolean\">\n        <exclude-pattern>*</exclude-pattern>\n    </rule>\n    <!--<rule ref=\"PEAR.Files.IncludingFile\" />-->\n    <rule ref=\"PEAR.Formatting.MultiLineAssignment\" />\n    <rule ref=\"PEAR.Functions.FunctionCallSignature\" />\n    <rule ref=\"PEAR.Functions.FunctionDeclaration\" />\n    <rule ref=\"PEAR.Functions.ValidDefaultValue\" />\n    <rule ref=\"PEAR.NamingConventions.ValidClassName\" />\n    <rule ref=\"PEAR.WhiteSpace.ObjectOperatorIndent\" />\n    <rule ref=\"PEAR.WhiteSpace.ScopeClosingBrace\" />\n    <!--<rule ref=\"PEAR.WhiteSpace.ScopeIndent\" />-->\n\n    <!-- Squiz -->\n    <rule ref=\"Squiz.Arrays.ArrayBracketSpacing\" />\n    <!--<rule ref=\"Squiz.Arrays.ArrayDeclaration\" />-->\n    <rule ref=\"Squiz.Classes.LowercaseClassKeywords\" />\n    <rule ref=\"Squiz.Classes.SelfMemberReference\" />\n    <rule ref=\"Squiz.Commenting.EmptyCatchComment\" />\n    <rule ref=\"Squiz.Functions.FunctionDuplicateArgument\" />\n    <rule ref=\"Squiz.Functions.GlobalFunction\">\n        <exclude-pattern>index.php</exclude-pattern>\n    </rule>\n    <rule ref=\"Squiz.Operators.IncrementDecrementUsage\" />\n    <rule ref=\"Squiz.Operators.ValidLogicalOperators\" />\n    <!--<rule ref=\"Squiz.PHP.CommentedOutCode\" />-->\n    <!--<rule ref=\"Squiz.PHP.DisallowComparisonAssignment\" />-->\n    <!--<rule ref=\"Squiz.PHP.DisallowMultipleAssignments\" />-->\n    <rule ref=\"Squiz.PHP.DisallowObEndFlush\" />\n    <rule ref=\"Squiz.PHP.DisallowSizeFunctionsInLoops\" />\n    <!--<rule ref=\"Squiz.PHP.DiscouragedFunctions\" />-->\n    <rule ref=\"Squiz.PHP.EmbeddedPhp\" />\n    <rule ref=\"Squiz.PHP.Eval\" />\n    <rule ref=\"Squiz.PHP.ForbiddenFunctions\" />\n    <rule ref=\"Squiz.PHP.GlobalKeyword\" />\n    <rule ref=\"Squiz.PHP.Heredoc\" />\n    <!--<rule ref=\"Squiz.PHP.InnerFunctions\" />-->\n    <rule ref=\"Squiz.PHP.LowercasePHPFunctions\" />\n    <rule ref=\"Squiz.PHP.NonExecutableCode\" />\n    <rule ref=\"Squiz.Scope.MemberVarScope\" />\n    <!--<rule ref=\"Squiz.Scope.MethodScope\" />-->\n    <rule ref=\"Squiz.Scope.StaticThisUsage\" />\n    <!--<rule ref=\"Squiz.Strings.DoubleQuoteUsage\" />-->\n    <rule ref=\"Squiz.Strings.EchoedStrings\" />\n    <!--<rule ref=\"Squiz.WhiteSpace.ControlStructureSpacing\" />-->\n    <rule ref=\"Squiz.WhiteSpace.FunctionOpeningBraceSpace\" />\n    <rule ref=\"Squiz.WhiteSpace.LanguageConstructSpacing\" />\n    <rule ref=\"Squiz.WhiteSpace.LogicalOperatorSpacing\" />\n    <rule ref=\"Squiz.WhiteSpace.OperatorSpacing\" />\n    <rule ref=\"Squiz.WhiteSpace.PropertyLabelSpacing\" />\n    <rule ref=\"Squiz.WhiteSpace.ScopeClosingBrace\" />\n    <rule ref=\"Squiz.WhiteSpace.ScopeKeywordSpacing\" />\n    <rule ref=\"Squiz.WhiteSpace.SemicolonSpacing\" />\n    <rule ref=\"Squiz.WhiteSpace.SuperfluousWhitespace\" />\n\n    <!-- Zend -->\n    <rule ref=\"Zend.Files.ClosingTag.NotAllowed\">\n        <exclude-pattern>*/Sniffs/*</exclude-pattern>\n    </rule>\n    <rule ref=\"Zend.NamingConventions.ValidVariableName\" />\n\n    <!-- OntoWiki cutom rules -->\n    <rule ref=\"./application/tests/CodeSniffer/Standards/Ontowiki/\"/>\n    <rule ref=\"Ontowiki.Functions.ForbiddenFunctions\">\n        <exclude-pattern>application/tests/Bootstrap.php</exclude-pattern>\n    </rule>\n    <rule ref=\"Ontowiki.Commenting.FileComment\">\n        <exclude-pattern>extensions\\/(?!account\\/|application\\/|auth\\/|autologin\\/|basicimporter\\/|bookmarklet\\/|ckan\\/|community\\/|cors\\/|datagathering\\/|defaultmodel\\/|exconf\\/|filter\\/|googletracking\\/|hideproperties\\/|history\\/|imagelink\\/|imprint\\/|jsonrpc\\/|linkeddataserver\\/|listmodules\\/|literaltypes\\/|mail\\/|mailtolink\\/|manchester\\/|markdown\\/|modellist\\/|navigation\\/|pingback\\/|queries\\/|resourcecreationuri\\/|resourcemodules\\/|savedqueries\\/|selectlanguage\\/|semanticsitemap\\/|sendmail\\/|sindice\\/|sortproperties\\/|source\\/|themes\\/|translations\\/|weblink\\/).*</exclude-pattern>\n    </rule>\n\n</ruleset>\n"
  },
  {
    "path": "phpunit.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<phpunit xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n    xsi:noNamespaceSchemaLocation=\"http://schema.phpunit.de/4.1/phpunit.xsd\"\n    bootstrap=\"./application/tests/Bootstrap.php\"\n    colors=\"true\"\n    backupGlobals=\"false\"\n    backupStaticAttributes=\"false\"\n    verbose=\"true\">\n        <testsuite name=\"OntoWiki Unit Tests\">\n            <directory suffix=\"Test.php\">application/tests/unit</directory>\n        </testsuite>\n        <testsuite name=\"OntoWiki Virtuoso Integration Tests\">\n            <directory suffix=\"Test.php\">application/tests/integration</directory>\n        </testsuite>\n        <testsuite name=\"OntoWiki ZendDB Integration Tests\">\n            <directory suffix=\"Test.php\">application/tests/integration</directory>\n        </testsuite>\n        <testsuite name=\"OntoWiki Extensions Tests\">\n            <directory suffix=\"Test.php\">extensions/</directory>\n        </testsuite>\n        <logging>\n            <log type=\"coverage-clover\" target=\"./build/logs/clover.xml\"/>\n            <log type=\"coverage-html\" target=\"./build/coverage\" title=\"OntoWiki\"/>\n            <log type=\"junit\" target=\"./build/logs/junit.xml\"/>\n        </logging>\n\n        <filter>\n            <whitelist processUncoveredFilesFromWhitelist=\"true\">\n                <directory suffix=\".php\">./application</directory>\n\n                <exclude>\n                    <directory>./application/scripts</directory>\n                    <directory>./application/tests</directory>\n                    <directory>./application/shell.worker.client.php</directory>\n                    <directory>./application/shell.worker.php</directory>\n                </exclude>\n            </whitelist>\n        </filter>\n</phpunit>\n"
  },
  {
    "path": "web.config",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<configuration>\r\n    <system.webServer>\r\n\t\t<handlers>\r\n\t\t\t<add name=\"deny ini\" verb=\"*\" path=\"*.ini\" type=\"System.Web.HttpForbiddenHandler\" />\r\n\t\t</handlers>\r\n        <rewrite>\r\n            <rules>\r\n                <rule name=\"Don't rewrite physical files\" stopProcessing=\"true\">\r\n                    <match url=\"((extensions|libraries).*|\\.(js|ico|gif|jpg|png|css|php|swf|json))$\" />\r\n                    <conditions logicalGrouping=\"MatchAny\">\r\n                        <add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" pattern=\"\" ignoreCase=\"false\" />\r\n                        <add input=\"{REQUEST_FILENAME}\" matchType=\"IsDirectory\" pattern=\"\" ignoreCase=\"false\" />\r\n                    </conditions>\r\n                    <action type=\"None\" />\r\n                </rule>\r\n\t\t\t\t<rule name=\"Redirect favicon\" stopProcessing=\"true\">\r\n\t\t\t\t\t<match url=\"^favicon\\.(.*)$\" />\r\n\t\t\t\t\t<action type=\"Redirect\" url=\"application/favicon.{R:1}\" />\r\n\t\t\t\t</rule>\r\n                <rule name=\"Rewrite\" stopProcessing=\"true\">\r\n                    <match url=\"^.*$\" />\r\n\t\t\t\t\t<serverVariables>\r\n\t\t\t\t\t\t<set name=\"ONTOWIKI_APACHE_MOD_REWRITE_ENABLED\" value=\"true\" />\r\n\t\t\t\t\t</serverVariables>\r\n                    <action type=\"Rewrite\" url=\"index.php\" />\r\n                </rule>\r\n            </rules>\r\n        </rewrite>\r\n    </system.webServer>\r\n</configuration>"
  }
]